:root {
  --bg: #f7f6f2;
  --surface: #fffcf8;
  --surface-muted: #efece6;
  --primary: #6f8f82;
  --primary-strong: #5c7a6e;
  --secondary: #a8b9af;
  --text: #26312d;
  --text-secondary: #718078;
  --accent: #d8bfa3;
  --line: #e4dfd6;
  --sleep-bg: #101614;
  --sleep-surface: #18201d;
  --sleep-primary: #91b3a5;
  --sleep-text: #eef3f0;
  --sleep-muted: #9aa9a2;
  --radius: 22px;
  --radius-sm: 14px;
  --wrap: min(1200px, calc(100% - 48px));
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Inter", sans-serif;
  --shadow: 0 10px 24px rgba(38, 49, 45, 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html[dir="rtl"] body,
html[lang="ar"] body {
  font-family: var(--font-ar);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font), var(--font-ar);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -48px;
  z-index: 40;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, white);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.logo-mark {
  width: 44px;
  height: 63px;
  flex-shrink: 0;
  border-radius: 10px;
  object-fit: cover;
}

.logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.logo-text strong {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--text-secondary);
  font-size: 12px;
}

.nav-panel {
  position: relative;
}

.nav-toggle {
  list-style: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.nav-toggle::-webkit-details-marker {
  display: none;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

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

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.lang-switch a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-secondary);
}

.lang-switch a.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.nav-panel .site-nav {
  display: none;
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  width: min(280px, 80vw);
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  flex-direction: column;
  align-items: stretch;
}

.nav-panel[open] .site-nav {
  display: flex;
}

.hero,
.section {
  padding-block: 72px;
}

.hero-grid,
.sleep-grid,
.recommend-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.eyebrow,
.card-meta,
.mock-kicker {
  color: var(--primary-strong);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

h1,
h2,
h3 {
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 600;
}

section[id],
h1,
h2 {
  scroll-margin-top: 88px;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
}

h3 {
  font-size: 1.15rem;
}

.lead,
.section-lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 40rem;
}

.hero-actions,
.store-row,
.legal-links,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn,
.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary-strong);
  color: #f7f6f2;
}

.btn-primary:hover {
  background: var(--text);
  color: #f7f6f2;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.store-btn {
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
}

.store-btn:hover {
  color: var(--bg);
}

.store-btn.is-disabled {
  background: var(--surface-muted);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.store-note {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.section-soft {
  background: var(--surface-muted);
}

.loop {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.loop li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.loop-index {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 16%, white);
  color: var(--primary-strong);
  font-weight: 600;
}

.disclaimer {
  margin-top: 28px;
  color: var(--text-secondary);
  font-size: 14px;
}

.sources {
  margin-top: 36px;
}

.sources ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 12px;
}

.sources li span {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
}

.section-sleep {
  background: var(--sleep-bg);
  color: var(--sleep-text);
}

.section-sleep .eyebrow,
.section-sleep .section-lead,
.section-sleep .card p {
  color: var(--sleep-muted);
}

.section-sleep .card {
  background: var(--sleep-surface);
  border-color: #24302b;
  box-shadow: none;
}

.section-sleep h2,
.section-sleep h3 {
  color: var(--sleep-text);
}

.chip {
  display: inline-flex;
  min-height: 40px;
  padding: 0 16px;
  align-items: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 500;
}

.subhead {
  margin: 28px 0 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.factor-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.factor-list li {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.metric-value {
  font-size: 2rem;
  margin: 0 0 8px;
  color: var(--primary-strong);
}

.example-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.week-row span {
  text-align: center;
  padding: 12px 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--line);
}

.premium-panel,
.download-panel {
  max-width: 720px;
}

.section-cta {
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 36%),
    var(--surface-muted);
}

.legal-links a,
.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.legal-links {
  margin-top: 32px;
}

.site-footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.2fr 1fr;
  margin-bottom: 24px;
}

.footer-logo {
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
}

.footer-name {
  font-weight: 600;
  margin: 0 0 4px;
}

.footer-note,
.copyright,
.footer-brand p {
  color: var(--text-secondary);
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.copyright {
  font-size: 14px;
}

.device-frame {
  margin: 0;
  justify-self: center;
}

.device {
  width: min(280px, 100%);
  border-radius: 36px;
  border: 10px solid #26312d;
  background: #f7f6f2;
  box-shadow: var(--shadow);
}

.device-dark {
  border-color: #0b100e;
  background: var(--sleep-bg);
}

.device-screen {
  min-height: 460px;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mock-title {
  font-size: 1.4rem;
  margin: 0;
  font-weight: 600;
}

.mock-question {
  margin: 0;
  color: var(--text-secondary);
}

.device-dark .mock-question,
.device-dark .mock-kicker {
  color: var(--sleep-muted);
}

.need-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.need-grid span,
.mock-cta {
  border-radius: 999px;
  padding: 8px 10px;
  text-align: center;
  font-size: 13px;
  background: color-mix(in srgb, var(--primary) 14%, white);
}

.mock-cta {
  margin-top: auto;
  background: var(--primary);
  color: #f7f6f2;
}

.orb {
  width: 96px;
  height: 96px;
  margin: 16px auto;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #6f8f82 0 28%, rgba(111, 143, 130, 0.18) 29% 62%, transparent 63%);
  box-shadow: 0 0 0 12px rgba(111, 143, 130, 0.08);
  animation: breathe 6s var(--ease) infinite;
}

.orb-sleep {
  background: radial-gradient(circle at 50% 50%, #91b3a5 0 28%, rgba(145, 179, 165, 0.16) 29% 62%, transparent 63%);
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

.legal-page {
  padding-block: 72px 96px;
}

.legal-page h2 {
  margin-top: 32px;
}

.legal-updated {
  color: var(--text-secondary);
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .nav-panel {
    position: static;
  }

  .nav-panel .site-nav,
  .nav-panel[open] .site-nav {
    display: flex;
    position: static;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    flex-direction: row;
    align-items: center;
  }

  .hero-grid,
  .sleep-grid,
  .recommend-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .loop {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .footer-inner,
  .hero-grid,
  .sleep-grid,
  .recommend-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .section,
  .legal-page {
    padding-block: 48px;
  }

  .header-inner {
    min-height: 64px;
  }

  .logo-text span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .orb {
    animation: none;
  }
}
