/* Created by Artur Ilyasov */

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-muted: #f0f1f6;
  --text: #172033;
  --muted: #5c6475;
  --line: #dfe2ea;
  --accent: #6e61e8;
  --accent-strong: #5448ca;
  --green: #2a9d75;
  --green-soft: #dff4ec;
  --pink: #e05b8c;
  --pink-soft: #fde5ef;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
  --card-shadow: 0 10px 26px rgba(23, 32, 51, 0.05);
  --control-shadow: 0 8px 18px rgba(23, 32, 51, 0.04);
  --active-border: rgba(110, 97, 232, 0.38);
  --free-border: rgba(42, 157, 117, 0.45);
  --green-fade: #edf8f3;
  --ink-block: #293044;
  --primary-action-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #10131b;
    --surface: #181d29;
    --surface-muted: #242b3a;
    --text: #f3f5fb;
    --muted: #aab1c2;
    --line: #303848;
    --accent: #8f84ff;
    --accent-strong: #b8b1ff;
    --green: #5fd1a5;
    --green-soft: #17372e;
    --pink: #ff7daa;
    --pink-soft: #442233;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
    --card-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    --control-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    --active-border: rgba(143, 132, 255, 0.48);
    --free-border: rgba(95, 209, 165, 0.42);
    --green-fade: #102920;
    --ink-block: #6f7791;
    --primary-action-text: #ffffff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10131b;
  --surface: #181d29;
  --surface-muted: #242b3a;
  --text: #f3f5fb;
  --muted: #aab1c2;
  --line: #303848;
  --accent: #8f84ff;
  --accent-strong: #b8b1ff;
  --green: #5fd1a5;
  --green-soft: #17372e;
  --pink: #ff7daa;
  --pink-soft: #442233;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
  --card-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  --control-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  --active-border: rgba(143, 132, 255, 0.48);
  --free-border: rgba(95, 209, 165, 0.42);
  --green-fade: #102920;
  --ink-block: #6f7791;
  --primary-action-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.site-header,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.utility-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, var(--accent), #9b8dff 55%, var(--green));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--surface-muted);
  color: var(--text);
}

.theme-toggle {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--control-shadow);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--active-border);
}

.theme-icon {
  font-size: 16px;
  line-height: 1;
}

.theme-icon-dark {
  display: none;
}

:root[data-resolved-theme="dark"] .theme-icon-light {
  display: none;
}

:root[data-resolved-theme="dark"] .theme-icon-dark {
  display: inline;
}

.language-menu {
  position: relative;
  flex: 0 0 auto;
  z-index: 5;
}

.language-menu summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  list-style: none;
  cursor: pointer;
  box-shadow: var(--control-shadow);
}

.language-menu summary::-webkit-details-marker {
  display: none;
}

.language-menu summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
}

.language-menu[open] summary {
  border-color: var(--active-border);
  box-shadow: var(--shadow);
}

.language-menu[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.language-current,
.language-options a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.language-flag {
  width: 20px;
  display: inline-flex;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.language-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.language-options a {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.language-options a:hover,
.language-options a[aria-current="page"] {
  background: var(--surface-muted);
  color: var(--text);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: 44px;
  padding: 28px 0 54px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow,
.card-label {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: 48px;
  line-height: 1.08;
  font-weight: 800;
}

h2 {
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.hero p,
.page-heading p {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
}

.availability-preview {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
}

.preview-header strong {
  color: var(--green);
}

.timeline {
  height: 76px;
  display: grid;
  grid-template-columns: auto 0.9fr 1.2fr 0.72fr 1.7fr 0.82fr auto;
  align-items: center;
  gap: 8px;
}

.time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.busy,
.free {
  min-width: 28px;
  height: 46px;
  border-radius: 7px;
}

.busy.work {
  background: var(--accent);
}

.busy.meal {
  background: var(--pink);
}

.busy.close {
  background: var(--ink-block);
}

.free {
  background: var(--green-soft);
  border: 1px dashed var(--free-border);
}

.free.wide {
  background: linear-gradient(90deg, var(--green-soft), var(--green-fade));
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 52px;
}

.page-card {
  display: block;
  min-height: 172px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--card-shadow);
}

.page-card:hover {
  border-color: var(--active-border);
  box-shadow: var(--shadow);
}

.page-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.25;
}

.page-card span:last-child {
  color: var(--muted);
}

.content-page {
  max-width: 820px;
  padding-bottom: 52px;
}

.page-heading {
  padding: 34px 0 24px;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--primary-action-text);
  font-weight: 750;
  text-decoration: none;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.support-contact {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.support-contact span {
  color: var(--text);
  font-weight: 700;
}

.info-section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.info-section p,
.info-section li {
  color: var(--muted);
}

.info-section ul {
  margin: 0;
  padding-left: 22px;
}

.info-section li + li {
  margin-top: 8px;
}

.faq-item {
  padding: 18px 0;
}

.faq-item + .faq-item {
  border-top: 1px solid var(--line);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  .site-header,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px 0 20px;
  }

  .header-actions {
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .nav {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .language-menu summary {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .theme-toggle {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  .language-options {
    width: 196px;
    max-width: calc(100vw - 24px);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    width: min(100% - 24px, 1120px);
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 10px 0 34px;
  }

  h1 {
    font-size: 32px;
  }

  .hero p,
  .page-heading p {
    font-size: 16px;
  }

  .page-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-bottom: 38px;
  }

  .page-card {
    min-height: auto;
    padding: 20px;
  }

  .page-card strong {
    font-size: 20px;
  }

  .content-page {
    padding-bottom: 38px;
  }

  .page-heading {
    padding: 18px 0 22px;
  }

  .availability-preview {
    padding: 16px;
  }

  .timeline {
    grid-template-columns: auto 0.85fr 1fr 0.65fr 1.15fr 0.75fr auto;
    gap: 5px;
  }
}

@media (max-width: 430px) {
  .header-actions {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .utility-actions {
    align-self: flex-end;
  }

  .nav {
    width: 100%;
  }

  h1 {
    font-size: 29px;
  }

  h2 {
    font-size: 22px;
  }

  .primary-action {
    width: 100%;
  }

  .support-contact {
    overflow-wrap: anywhere;
  }

  .busy,
  .free {
    min-width: 14px;
    height: 40px;
  }
}
