/* ============================================================
   Sleep Stats — The Observatory
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Night sky */
  --ink-0:   #05060d;
  --ink-1:   #0a0c1c;
  --ink-2:   #11142e;
  --ink-3:   #1a1e44;

  /* Silvers (from app's SilveryTextModifier) */
  --silver-50:  #f4f4f8;
  --silver-100: #e7e7ee;
  --silver-200: #d9d9e6;
  --silver-300: #b8b8ca;
  --silver-400: #9a9aae;
  --silver-500: #7a7b8c;
  --silver-600: #5d5e6e;

  /* App accents (lifted from SwiftUI palette) */
  --moon:        #fffceb;
  --moon-warm:   #fffacc;
  --moon-amber:  #f5d27a;
  --cyan:        #66ccf2;        /* breathe-blue 0.4,0.8,0.95 */
  --mint:        #6fe3c2;
  --green:       #59d68a;
  --yellow:      #f3d65a;
  --amber:       #f5b970;
  --orange:      #f59561;
  --rose:        #f06b6b;
  --indigo:      #5a4ee6;
  --purple:      #a584ff;

  /* Glass surfaces (matches Color.white.opacity(0.08) → Color.black.opacity(0.2)) */
  --glass-top:    rgba(255,255,255,.06);
  --glass-bot:    rgba(0,0,0,.32);
  --glass-line:   rgba(255,255,255,.08);

  /* Typography */
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-ui:      "Sora", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --radius: 18px;
  --radius-lg: 28px;

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset + base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  font-weight: 350;
  background: var(--ink-0);
  color: var(--silver-200);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
em.serif-italic, .serif-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 360;
  font-feature-settings: "ss01" on, "ss02" on;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }

/* Selection */
::selection { background: rgba(165, 132, 255, .35); color: var(--silver-50); }

/* ---------- ATMOSPHERE: starfield, vignette, grain ---------- */
.atmosphere {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1100px 700px at 80% -10%, rgba(90, 78, 230, .18), transparent 70%),
    radial-gradient(900px 700px at 10% 110%, rgba(102, 204, 242, .12), transparent 70%),
    radial-gradient(1400px 900px at 50% 50%, rgba(255, 250, 204, .03), transparent 70%),
    linear-gradient(180deg, var(--ink-0) 0%, #07091a 50%, var(--ink-0) 100%);
}

.stars {
  position: absolute; inset: -10% -10%;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 70% 18%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 35% 80%, #fff, transparent),
    radial-gradient(1px 1px at 80% 60%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 50% 40%, #fff, transparent),
    radial-gradient(1px 1px at 15% 55%, #fff, transparent),
    radial-gradient(1px 1px at 90% 90%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 60% 10%, #fff, transparent),
    radial-gradient(1px 1px at 25% 25%, #fff, transparent),
    radial-gradient(1px 1px at 5% 75%, #fff, transparent);
  background-size: 700px 700px;
  background-repeat: repeat;
  opacity: .35;
  animation: twinkle 7s ease-in-out infinite;
}
.stars--far  { opacity: .22; filter: blur(.4px); animation-duration: 11s; }
.stars--mid  { opacity: .38; background-size: 520px 520px; animation-duration: 8s; }
.stars--near { opacity: .55; background-size: 380px 380px; animation-duration: 5s; }

@keyframes twinkle {
  0%, 100% { opacity: var(--start, .35); }
  50%      { opacity: calc(var(--start, .35) + .15); }
}

.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
}

.grain {
  position: absolute; inset: 0;
  opacity: .055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- LAYOUT WRAPPERS ---------- */
main { position: relative; z-index: 1; }
section { padding-inline: var(--gutter); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--silver-400);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
}
.eyebrow__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--moon-warm);
  box-shadow: 0 0 12px var(--moon-warm);
}

.display {
  font-family: var(--font-display);
  font-weight: 320;
  font-variation-settings: "SOFT" 50, "opsz" 144;
  font-size: clamp(36px, 5.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -.02em;
  color: var(--silver-50);
  margin: 0 0 24px;
}
.display em { font-weight: 320; }

.section-head {
  max-width: 720px;
  margin: 0 auto 64px 0;
  padding-top: clamp(80px, 12vh, 140px);
}
.section-head--centered { margin-inline: auto; text-align: center; }
.section-head--centered .eyebrow { justify-content: center; }
.section-lede {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--silver-300);
  max-width: 60ch;
  margin: 0;
}

/* Silvery gradient text utility (matches SwiftUI .silveryGradient) */
.silvery {
  background: linear-gradient(135deg,
    #f4f4fa 0%, #d9d9e6 30%, #b3b3bf 60%, #d9d9e6 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(255,255,255,.18));
}

/* ---------- TOP NAV ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 32px;
  padding: 18px var(--gutter);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(180deg, rgba(5,6,13,.78), rgba(5,6,13,.45));
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--silver-50);
}
.brand__mark { width: 28px; height: 28px; }
.brand__word {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -.01em;
}
.topnav__links {
  display: flex; gap: 28px;
  justify-self: center;
  font-size: 13px;
  color: var(--silver-300);
}
.topnav__links a {
  position: relative;
  padding: 6px 0;
  transition: color .25s var(--ease);
}
.topnav__links a:hover { color: var(--silver-50); }
.topnav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--moon-warm), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .35s var(--ease);
}
.topnav__links a:hover::after { transform: scaleX(1); }

.topnav__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01));
  color: var(--silver-50);
  font-size: 13px;
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.topnav__cta svg { width: 14px; height: 14px; }
.topnav__cta:hover {
  border-color: rgba(255, 250, 204, .5);
  background: linear-gradient(180deg, rgba(255, 250, 204, .14), rgba(255, 250, 204, .04));
  transform: translateY(-1px);
}

.topnav__menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.topnav__menu span {
  display: block; width: 22px; height: 1.5px; background: var(--silver-200);
}

.topnav--scrolled {
  background: linear-gradient(180deg, rgba(5,6,13,.92), rgba(5,6,13,.7));
  border-bottom-color: rgba(255,255,255,.08);
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .01em;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn--primary {
  background: linear-gradient(180deg, #f4f4fa, #d3d3df);
  color: #0a0c1c;
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 -10px 30px rgba(255,250,204,.15) inset,
    0 18px 40px rgba(255, 250, 204, .12);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 -10px 30px rgba(255,250,204,.2) inset,
    0 26px 60px rgba(255, 250, 204, .22);
}
.btn--ghost {
  border: 1px solid rgba(255,255,255,.14);
  color: var(--silver-100);
}
.btn--ghost:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.28);
}
.btn--xl {
  padding: 18px 32px;
  font-size: 16px;
}

/* ---------- APP STORE BADGE ---------- */
/* "Download on the App Store" pill, styled to sit in the night-sky palette. */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 9px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1b1d25 0%, #08090f 100%);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,.08) inset,
    0 16px 38px rgba(0,0,0,.5);
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.appstore-badge:hover {
  transform: translateY(-2px);
  border-color: rgba(255,250,204,.5);
  box-shadow:
    0 1px 0 rgba(255,255,255,.1) inset,
    0 24px 52px rgba(0,0,0,.6),
    0 0 0 1px rgba(255,250,204,.14);
}
.appstore-badge__logo {
  width: 27px; height: 27px;
  flex: none;
  margin-top: -2px;            /* optical centering of the apple glyph */
}
.appstore-badge__text {
  display: flex;
  flex-direction: column;
  line-height: 1.04;
  text-align: left;
}
.appstore-badge__text small {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--silver-300);
}
.appstore-badge__text strong {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .01em;
}
/* larger variant for the closing CTA */
.appstore-badge--xl { padding: 12px 26px; border-radius: 16px; gap: 13px; }
.appstore-badge--xl .appstore-badge__logo { width: 32px; height: 32px; }
.appstore-badge--xl .appstore-badge__text small  { font-size: 11px; }
.appstore-badge--xl .appstore-badge__text strong { font-size: 23px; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 90vh;
  padding-top: 28px;
  padding-bottom: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Two columns on desktop: copy stacks (intro over actions) on the left, the
   real devices span the right. Driven by grid AREAS so the mobile order
   (headline → devices → download) is independent of source order. */
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  grid-template-areas:
    "intro   devices"
    "actions devices";
  gap: clamp(18px, 2.5vw, 34px) clamp(28px, 4vw, 72px);
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 24px;
}
.hero__intro   { grid-area: intro;   align-self: end; }
.hero__actions { grid-area: actions; align-self: start; }
.hero__devices { grid-area: devices; align-self: center; justify-self: center; width: 100%; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 320;
  font-variation-settings: "SOFT" 50, "opsz" 144;
  font-size: clamp(48px, 7vw, 104px);
  line-height: .98;
  letter-spacing: -.025em;
  color: var(--silver-50);
  margin: 0 0 28px;
}
.hero__title-line { display: block; }
.hero__title em {
  font-style: italic;
  font-weight: 280;
  background: linear-gradient(135deg, #fffceb 0%, #e0d5a8 35%, #c8a9e8 80%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.hero__lede {
  font-size: clamp(15px, 1.35vw, 18px);
  color: var(--silver-300);
  max-width: 50ch;
  margin: 0;
}
.hero__cta-row {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-bottom: 56px;
}
.hero__signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin: 0;
}
.hero__signals > div { display: flex; flex-direction: column; gap: 4px; }
.hero__signals dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--silver-500);
}
.hero__signals dd {
  margin: 0;
  font-size: 13px;
  color: var(--silver-100);
}

/* ---------- HERO DEVICES: the real iPhone + Apple Watch, front and centre ---------- */
.hero__devices { display: flex; justify-content: center; }
.hero__stage {
  --hs: .94;
  position: relative;
  width: 540px;
  height: 650px;
  zoom: var(--hs);              /* shrinks the LAYOUT box too (not transform) */
  perspective: 1600px;
}
/* warm moon glow seated behind the pair */
.hero__stage::before {
  content: "";
  position: absolute;
  left: 48%; top: 43%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(245,210,122,.18) 0%,
    rgba(102,204,242,.06) 42%,
    transparent 68%);
  filter: blur(6px);
  pointer-events: none;
  z-index: 0;
}
/* Reuse the titanium .phone / .watch frames (defined under DEVICES), re-seated
   for a tight hero pair. Fixed device widths (300 / 240) keep the side-button
   geometry calibrated; the whole stage scales via --hs per breakpoint. */
.hero__stage .phone {
  left: 18px; top: 2px;
  transform: rotateX(3deg) rotateY(13deg) rotateZ(-3deg);
}
.hero__stage .watch {
  left: 282px; top: 352px;
  transform: rotateX(3deg) rotateY(-14deg) rotateZ(4deg);
}

/* Hero instrument (moon) — LEGACY: no longer rendered (hero now shows real
   devices). Rules retained but unused; safe to prune. */
.hero__instrument {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.6vh, 20px);
}
.moon-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid; place-items: center;
}
.astrolabe {
  width: 100%; height: 100%;
}
.astrolabe .ring {
  fill: none;
  stroke: rgba(184,184,210,.18);
  stroke-width: 1;
}
.astrolabe .ring--outer {
  stroke: rgba(184,184,210,.22);
  stroke-dasharray: 3 17;          /* tick marks, so the drift is legible */
}
.astrolabe .ring--mid {
  stroke: rgba(184,184,210,.12);
  stroke-dasharray: 1 6;
}

/* Ambient rotation — only the decorative rings & crosshair drift. The moon,
   score arc, time labels and the readout caption all stay still, so nothing
   sweeps across the score the way the old full-dial spin did. */
.astrolabe .spin-cw,
.astrolabe .spin-ccw {
  transform-box: fill-box;
  transform-origin: center;
}
.astrolabe .spin-cw  { animation: dial-cw 150s linear infinite; }
.astrolabe .spin-ccw { animation: dial-ccw 210s linear infinite; }
@keyframes dial-cw  { to { transform: rotate(360deg); } }
@keyframes dial-ccw { to { transform: rotate(-360deg); } }
.astrolabe .cardinals text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--silver-500);
  letter-spacing: .15em;
}
.astrolabe .crosshair line {
  stroke: rgba(184,184,210,.25);
  stroke-width: 1;
}

.score-arc {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}
.score-arc--track { stroke: rgba(255,255,255,.06); }
.score-arc--value {
  stroke-dasharray: 1257;
  stroke-dashoffset: 1257;
  transform: rotate(-90deg);
  transform-origin: 300px 300px;
  animation: score-draw 2.4s var(--ease) .4s forwards;
  filter: drop-shadow(0 0 12px rgba(255, 250, 204, .35));
}
@keyframes score-draw {
  to { stroke-dashoffset: 100; } /* ~94% of 1257 */
}

.moon-body {
  animation: moon-breathe 6s ease-in-out infinite;
  transform-origin: 300px 300px;
  filter: drop-shadow(0 0 60px rgba(255, 250, 204, .35));
}
@keyframes moon-breathe {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 50px rgba(255,250,204,.32)); }
  50%      { transform: scale(1.025); filter: drop-shadow(0 0 75px rgba(255,250,204,.5)); }
}

/* Instrument readout — the score set like a fine astronomical gauge, below the
   dial. The moon itself stays unmarked; the numeral leads, data supports. */
.readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
  color: var(--silver-50);
}
.readout__rule {
  width: clamp(140px, 62%, 210px);
  height: 6px;
  position: relative;
  background: linear-gradient(90deg, transparent, rgba(196,205,232,.30), transparent)
              center / 100% 1px no-repeat;
}
.readout__rule::after {                 /* centre diamond, lit like a star */
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 5px; height: 5px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #ffe6a2;
  box-shadow: 0 0 8px rgba(255, 230, 162, .8);
}
.readout__eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--silver-400);
}
.readout__value {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  line-height: .92;
}
.readout__value b {
  font-weight: 330;
  font-size: clamp(54px, 7vw, 86px);
  letter-spacing: -.015em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(168deg, #ffffff 0%, #f1ebda 28%, #bcbfce 76%, #8c8fa1 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.readout__value i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.4vw, 15px);
  letter-spacing: .03em;
  color: var(--silver-500);
}
.readout__tier {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--silver-200);
  display: inline-flex; align-items: center; gap: 8px;
}
.readout__tier .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
}
.readout__tier em {
  font-style: normal;
  color: var(--mint);
  letter-spacing: .12em;
}

/* Callouts */
.callout {
  position: absolute;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 2px;
  min-width: 90px;
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
  animation: float-y 8s ease-in-out infinite;
}
.callout__k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--silver-400);
}
.callout__v {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--silver-50);
}
.callout__v small {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--silver-400);
  margin-left: 4px;
}
.callout--a { top: 8%;  left: -8%;  animation-delay: 0s;   }
.callout--b { top: 42%; right: -10%; animation-delay: 1.5s; }
.callout--c { bottom: 6%; left: -4%;  animation-delay: 3s; }
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Constellation strip */
.constellation {
  margin-top: 80px;
  max-width: var(--maxw);
  margin-inline: auto;
  position: relative;
}
.constellation svg { width: 100%; height: 60px; }
.constellation circle { animation: starpulse 4s ease-in-out infinite; }
.constellation circle:nth-child(2) { animation-delay: .4s; }
.constellation circle:nth-child(3) { animation-delay: .8s; }
.constellation circle:nth-child(4) { animation-delay: 1.2s; }
.constellation circle:nth-child(5) { animation-delay: 1.6s; }
.constellation circle:nth-child(6) { animation-delay: 2s; }
.constellation circle:nth-child(7) { animation-delay: 2.4s; }
.constellation circle:nth-child(8) { animation-delay: 2.8s; }
@keyframes starpulse {
  0%, 100% { r: 2.2; opacity: .9; }
  50%      { r: 3; opacity: 1; }
}
.constellation__caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--silver-500);
  margin-top: 8px;
}

/* ---------- HORIZON DIVIDER ---------- */
.horizon {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  max-width: var(--maxw);
  margin: 100px auto;
  padding-inline: var(--gutter);
}
.horizon__line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,184,210,.3), transparent);
}
.horizon__star {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--moon-warm);
  box-shadow: 0 0 18px rgba(255, 250, 204, .6);
  position: relative;
}
.horizon__star::before,
.horizon__star::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 250, 204, .55);
}
.horizon__star::before { width: 28px; height: 1px; }
.horizon__star::after  { width: 1px;  height: 28px; }

/* ============================================================
   INSTRUMENTS — SPEC SHEET
   ============================================================ */
.instruments { max-width: var(--maxw); margin: 0 auto; padding-bottom: 60px; }
.spec-sheet { display: grid; gap: 4px; border-top: 1px solid rgba(255,255,255,.06); }
.spec {
  display: grid;
  grid-template-columns: 80px 1fr minmax(260px, 360px);
  gap: 32px;
  align-items: center;
  padding: 44px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative;
}
.spec::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, rgba(255, 250, 204, .35), transparent 40%);
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.spec:hover::before { opacity: 1; }
.spec__index {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 320;
  font-size: 44px;
  color: var(--silver-500);
}
.spec__copy h3 {
  font-family: var(--font-display);
  font-weight: 360;
  font-size: clamp(24px, 2.4vw, 34px);
  margin: 0 0 10px;
  color: var(--silver-50);
  letter-spacing: -.01em;
}
.spec__copy p {
  margin: 0 0 16px;
  color: var(--silver-300);
  max-width: 56ch;
  font-size: 15px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  color: var(--silver-200);
}
.chip--mint   { color: var(--mint);   border-color: rgba(111,227,194,.3); background: rgba(111,227,194,.08); }
.chip--green  { color: var(--green);  border-color: rgba(89,214,138,.3);  background: rgba(89,214,138,.08); }
.chip--yellow { color: var(--yellow); border-color: rgba(243,214,90,.3);  background: rgba(243,214,90,.08); }
.chip--orange { color: var(--orange); border-color: rgba(245,149,97,.35); background: rgba(245,149,97,.08); }
.chip--rose   { color: var(--rose);   border-color: rgba(240,107,107,.35); background: rgba(240,107,107,.08); }

/* Spec viz */
.spec__viz { display: grid; place-items: center; }

/* Ring viz used by Sleep Score / Recovery / Strain */
.ring-viz { width: 220px; height: 220px; }
.ring-viz__track {
  fill: none; stroke: rgba(255,255,255,.06); stroke-width: 10;
}
.ring-viz__zone {
  fill: none; stroke: rgba(255,255,255,.12);
  stroke-width: 16; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 110px 110px;
}
.ring-viz__arc {
  fill: none; stroke-width: 10; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 110px 110px;
  stroke-dasharray: 578;            /* 2πr = 2π·92 */
  stroke-dashoffset: 578;
  transition: stroke-dashoffset 1.8s var(--ease);
  filter: drop-shadow(0 0 10px currentColor);
}
.ring-viz.in-view .ring-viz__arc {
  /* set in JS via --offset */
  stroke-dashoffset: var(--ring-offset, 578);
}
.ring-viz__num {
  font-family: var(--font-display);
  font-weight: 320;
  font-size: 44px;
  fill: var(--silver-50);
  letter-spacing: -.02em;
}
.ring-viz__tier {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .25em;
  fill: var(--silver-400);
}

/* Battery viz */
.battery-viz { width: 100%; max-width: 360px; height: auto; }
.battery-viz__grid line {
  stroke: rgba(184,184,210,.08); stroke-dasharray: 2 4;
}
.battery-viz__sleep {
  fill: rgba(90, 78, 230, .12);
}
.battery-viz__area {
  fill: url(#battGrad);
  opacity: .14;
}
.battery-viz__line {
  fill: none;
  stroke: url(#battGrad);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(245,185,112,.35));
}
.battery-viz__labels text {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .12em; fill: var(--silver-500);
}
.battery-viz__dot {
  fill: var(--rose);
  filter: drop-shadow(0 0 8px var(--rose));
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { r: 4; opacity: .9; }
  50%      { r: 6; opacity: 1; }
}
.battery-viz__readout {
  margin-top: 8px;
  display: flex; align-items: center; gap: 14px;
  color: var(--silver-300);
  font-size: 12px;
}
.battery-viz__readout .big {
  font-size: 28px;
  color: var(--amber);
  letter-spacing: -.02em;
}
.battery-viz__readout small {
  font-size: 12px; color: var(--silver-500); margin-left: 2px;
}

/* Bedtime mini chip */
.spec__viz--bedtime { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bedtime-mini {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
  color: var(--silver-100);
  font-size: 15px;
}
.bedtime-mini__moon { color: var(--indigo); font-size: 18px; }
.bedtime-mini__sun  { color: var(--amber);  font-size: 18px; }
.bedtime-mini__arrow { color: var(--silver-500); }
.bedtime-mini__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--orange);
  padding: 4px 10px;
  background: rgba(245,149,97,.1);
  border: 1px solid rgba(245,149,97,.3);
  border-radius: 999px;
}

/* Vitals */
.spec__viz--vitals { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }
.vital {
  display: grid;
  grid-template-columns: 50px 1fr 100px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
}
.vital__k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--silver-400);
}
.vital__v {
  font-size: 18px;
  color: var(--silver-50);
  letter-spacing: -.01em;
}
.vital__v small { font-size: 10px; color: var(--silver-500); margin-left: 2px; }
.vital__spark { width: 100%; height: 30px; }

/* ============================================================
   STAGES (HYPNOGRAM)
   ============================================================ */
.stages { max-width: var(--maxw); margin: 0 auto; }
.hypnogram {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  margin: 0;
}
.hypnogram__paper {
  position: relative;
  padding: 28px 28px 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.25)),
    repeating-linear-gradient(0deg, rgba(184,184,210,.05) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(184,184,210,.04) 0 1px, transparent 1px 60px);
  border: 1px solid var(--glass-line);
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.hypnogram__legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--silver-400);
  margin-bottom: 20px;
}
.hypnogram__legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot--awake { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot--rem   { background: var(--purple); box-shadow: 0 0 8px var(--purple); }
.dot--core  { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.dot--deep  { background: var(--indigo); box-shadow: 0 0 8px var(--indigo); }
.dot--mint  { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.dot--cyan  { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.dot--amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.hypnogram__grid {
  position: relative;
  height: 260px;
  margin-left: 56px;
  margin-bottom: 28px;
}
.lane {
  position: absolute;
  left: 0; right: 0;
  height: 50px;
  border-bottom: 1px dashed rgba(184,184,210,.08);
}
.lane[data-lane="awake"] { top: 0; }
.lane[data-lane="rem"]   { top: 60px; }
.lane[data-lane="core"]  { top: 120px; }
.lane[data-lane="deep"]  { top: 180px; }
.lane__label {
  position: absolute;
  left: -56px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .25em;
  color: var(--silver-500);
}
.hypnogram__axis {
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .15em;
  color: var(--silver-500);
}

/* Segments injected by JS */
.seg {
  position: absolute;
  height: 12px;
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s var(--ease);
}
.seg.in { transform: scaleX(1); }
.seg--awake { background: var(--green); box-shadow: 0 0 10px rgba(89,214,138,.5); width: 2px; height: 36px; border-radius: 1px;}
.seg--rem   { background: var(--purple); box-shadow: 0 0 10px rgba(165,132,255,.4); }
.seg--core  { background: var(--cyan);   box-shadow: 0 0 10px rgba(102,204,242,.4); }
.seg--deep  { background: var(--indigo); box-shadow: 0 0 10px rgba(90,78,230,.5); }

.hypnogram__caption {
  text-align: center;
  color: var(--silver-400);
  font-size: 12px;
  letter-spacing: .08em;
}

.hypnogram__notes {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
}
.hypnogram__notes h4 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 360;
  font-size: 20px;
  color: var(--silver-50);
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(184,184,210,.18);
}
.hypnogram__notes ul { display: flex; flex-direction: column; gap: 14px; }
.hypnogram__notes li {
  font-size: 13.5px;
  color: var(--silver-300);
  position: relative;
  padding-left: 16px;
}
.hypnogram__notes li::before {
  content: "·";
  position: absolute; left: 0; top: -2px;
  color: var(--moon-warm);
  font-size: 22px;
  line-height: 1;
}
.hypnogram__notes b { color: var(--silver-50); font-weight: 500; }

/* ============================================================
   BEDTIME
   ============================================================ */
.bedtime { max-width: var(--maxw); margin: 0 auto; }
.bedtime__panel {
  position: relative;
  padding: 56px clamp(24px, 4vw, 72px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 100% at 50% 0%, rgba(90,78,230,.12), transparent 70%),
    linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
  box-shadow: 0 40px 100px rgba(0,0,0,.4);
}
.bedtime__big {
  text-align: center;
  margin-bottom: 56px;
}
.bedtime__target {
  display: inline-flex; align-items: center; gap: 14px;
  margin-bottom: 12px;
}
.bedtime__hours {
  font-family: var(--font-display);
  font-weight: 320;
  font-size: clamp(56px, 8vw, 104px);
  letter-spacing: -.03em;
  background: linear-gradient(180deg, #f4f4fa 0%, #b3b3bf 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  line-height: 1;
}
.bedtime__pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(245,149,97,.1);
  border: 1px solid rgba(245,149,97,.4);
  color: var(--orange);
}
.bedtime__sub {
  color: var(--silver-400);
  font-size: 14px;
}

.orbit {
  position: relative;
  height: 280px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
}
.orbit svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}
.orbit__path {
  stroke-dasharray: 4 6;
  animation: dash-flow 4s linear infinite;
}
@keyframes dash-flow { to { stroke-dashoffset: -100; } }

.orbit__moon, .orbit__sun {
  text-align: center;
  position: relative;
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.orbit__moon-icon {
  font-size: 36px;
  color: var(--moon-warm);
  filter: drop-shadow(0 0 18px rgba(255,250,204,.6));
}
.orbit__sun-icon {
  font-size: 36px;
  color: var(--amber);
  filter: drop-shadow(0 0 18px rgba(245,185,112,.6));
}
.orbit__time { font-size: 16px; color: var(--silver-50); }
.orbit__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--silver-500);
}

.orbit__zenith {
  justify-self: center;
  align-self: start;
  z-index: 2;
  position: relative;
  top: -10px;
}
.zenith-card {
  width: 280px;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(10,12,28,.85), rgba(5,6,13,.85));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
}
.zenith-card__row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--silver-300);
}
.zenith-card__row .mono { color: var(--silver-100); }
.zenith-card__row--total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed rgba(184,184,210,.2);
  color: var(--silver-50);
  font-weight: 500;
}
.zenith-card__row--total .mono {
  color: var(--moon-warm);
  font-weight: 500;
}

/* ============================================================
   DEVICE FRAMES (titanium iPhone + Apple Watch) — reused by the hero
   ============================================================ */
/* iPhone — titanium studio frame, scaled ×0.2964 from the App Store
   screenshot system (sleepstats-brand-kit studio.css, 1012px → 300px) */
.phone {
  position: absolute;
  left: 156px; top: 4px;
  z-index: 1;
  transform: rotateX(3deg) rotateY(14deg) rotateZ(-3deg);
  width: 300px;
  aspect-ratio: 1012 / 2156;
  border-radius: 39px;
  padding: 5px;
  background: linear-gradient(135deg, #9396a0 0%, #52555f 16%, #26282f 40%, #2c2e35 58%, #646771 82%, #9a9da7 100%);
  box-shadow:
    0 28px 52px rgba(0,0,0,.62),
    0 12px 24px rgba(0,0,0,.5),
    0 3px 8px rgba(0,0,0,.55),
    inset 0 1px 1px rgba(255,255,255,.45),
    inset 0 -1px 2px rgba(0,0,0,.55),
    inset 1px 0 1px rgba(255,255,255,.18),
    inset -1px 0 1px rgba(0,0,0,.4);
}
/* bright titanium edge catching light */
.phone::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 40px;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.65), rgba(255,255,255,0) 26%, rgba(255,255,255,0) 74%, rgba(255,255,255,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.phone__bezel {
  width: 100%; height: 100%;
  border-radius: 34px;
  background: #020203;
  padding: 2px;
  box-shadow: inset 0 0 4px 1px rgba(0,0,0,.9);
}
.phone__screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: #05060d;
}
.phone__screen img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* glass sheen */
.phone__screen::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 32px;
  background: linear-gradient(122deg, rgba(255,255,255,.11) 0%, rgba(255,255,255,0) 20%, rgba(255,255,255,0) 80%, rgba(255,255,255,.05) 100%);
}
/* side buttons (titanium nubs) */
.phone__btn {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #777a84, #34363d 55%, #202229);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), -1px 0 2px rgba(0,0,0,.45);
}
.phone__btn--action { left: -3px; top: 127px; height: 20px; }
.phone__btn--volup  { left: -3px; top: 166px; height: 35px; }
.phone__btn--voldn  { left: -3px; top: 209px; height: 35px; }
.phone__btn--power  {
  right: -3px; top: 165px; height: 56px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), 1px 0 2px rgba(0,0,0,.45);
}

/* Watch — Apple Watch Ultra frame, taken 1:1 from the App Store
   screenshot system (sleepstats-brand-kit watch.css, 240×294) */
.watch {
  position: absolute;
  left: 600px; top: 206px;
  z-index: 2;
  transform: rotateX(3deg) rotateY(-16deg) rotateZ(3.5deg);
  width: 240px;
  height: 294px;
  border-radius: 67px;
  padding: 5px;
  background: linear-gradient(135deg, #9396a0 0%, #52555f 16%, #26282f 40%, #2c2e35 58%, #646771 82%, #9a9da7 100%);
  box-shadow:
    0 34px 64px rgba(0,0,0,.6),
    0 14px 26px rgba(0,0,0,.5),
    0 4px 9px rgba(0,0,0,.55),
    inset 0 1px 2px rgba(255,255,255,.45),
    inset 0 -2px 3px rgba(0,0,0,.55);
}
/* bright titanium edge */
.watch::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 69px;
  padding: 1.5px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.65), rgba(255,255,255,0) 26%, rgba(255,255,255,0) 74%, rgba(255,255,255,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.watch__bezel {
  width: 100%; height: 100%;
  border-radius: 63px;
  background: #010102;
  padding: 8px;
  box-shadow: inset 0 0 6px 2px rgba(0,0,0,.92);
}
.watch__screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 53px;
  overflow: hidden;
  background: #05060d;
}
/* top-anchored at width-scale; the shot's ink ground melts into the bezel */
.watch__screen img {
  width: 100%; height: auto;
  display: block;
}
/* glass sheen */
.watch__screen::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 53px;
  background: linear-gradient(125deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,0) 22%, rgba(255,255,255,0) 80%, rgba(255,255,255,.05) 100%);
}
/* right side — Digital Crown (ridged) + side button */
.watch__crown {
  position: absolute;
  right: -6px; top: 85px;
  width: 8px; height: 38px;
  border-radius: 4px;
  background: linear-gradient(180deg, #8d909a, #3c3e45 55%, #212329);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45), 2px 0 5px rgba(0,0,0,.45);
}
.watch__crown::after {
  content: "";
  position: absolute;
  left: 1.5px; right: 1.5px; top: 2px; bottom: 2px;
  border-radius: 3px;
  background: repeating-linear-gradient(180deg, #62646c 0 1px, #2b2d33 1px 2.1px);
  opacity: .55;
}
.watch__sidebtn {
  position: absolute;
  right: -4px; top: 139px;
  width: 6px; height: 47px;
  border-radius: 4px;
  background: linear-gradient(180deg, #7b7e88, #36383f 55%, #202229);
  box-shadow: 2px 0 5px rgba(0,0,0,.45);
}
/* left side — Ultra Action Button (orange) */
.watch__action {
  position: absolute;
  left: -5px; top: 111px;
  width: 6px; height: 43px;
  border-radius: 4px;
  background: linear-gradient(180deg, #ff8a4c, #e9551c);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.3), -2px 0 5px rgba(0,0,0,.4);
}

/* ============================================================
   PRIVACY
   ============================================================ */
.privacy {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 60px;
}
.privacy__inner {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 60px;
  align-items: center;
  padding: 64px clamp(24px, 4vw, 56px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 100% at 0% 0%, rgba(102,204,242,.06), transparent 70%),
    linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
}
.privacy__seal svg {
  width: 220px; height: 220px;
  animation: spin-slow 90s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.privacy__copy h2 { margin-bottom: 16px; }
.privacy__copy p {
  color: var(--silver-300);
  max-width: 60ch;
  margin: 0 0 20px;
}
.privacy__list {
  display: flex; flex-direction: column; gap: 10px;
  font-size: 14px; color: var(--silver-200);
}
.privacy__list li { display: flex; align-items: center; gap: 12px; }
.check {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: rgba(111,227,194,.12);
  border: 1px solid rgba(111,227,194,.4);
  color: var(--mint);
  font-size: 11px;
}
.privacy__more { margin: 26px 0 0; }
.privacy__more a {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px;
  color: var(--moon-warm);
  border-bottom: 1px solid rgba(255,250,204,.3);
  padding-bottom: 2px;
  transition: gap .25s var(--ease), border-color .25s var(--ease);
}
.privacy__more a svg { width: 14px; height: 14px; }
.privacy__more a:hover { gap: 12px; border-color: var(--moon-warm); }

/* ============================================================
   FINALE
   ============================================================ */
.finale {
  position: relative;
  text-align: center;
  padding-top: clamp(120px, 16vh, 200px);
  padding-bottom: clamp(80px, 14vh, 180px);
  max-width: var(--maxw);
  margin: 0 auto;
}
.finale__inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.finale__moon {
  width: 200px; height: 200px;
  margin-bottom: 24px;
  animation: moon-breathe 6s ease-in-out infinite;
}
.finale__title {
  font-size: clamp(60px, 9vw, 128px);
  letter-spacing: -.03em;
}
.finale__sub {
  font-size: 14px;
  color: var(--silver-400);
  margin: 0 0 36px;
  font-family: var(--font-mono);
  letter-spacing: .08em;
}
.finale__poem {
  margin-top: 32px;
  font-size: 16px;
  color: var(--silver-400);
  font-family: var(--font-display);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  padding: 60px var(--gutter) 36px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.6));
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer__col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--silver-500);
  margin: 0 0 14px;
  text-transform: uppercase;
}
.footer__col a, .footer__col p {
  display: block;
  font-size: 13.5px;
  color: var(--silver-300);
  margin: 6px 0;
  transition: color .25s var(--ease);
}
.footer__col a:hover { color: var(--silver-50); }
.footer__col--brand p {
  margin-top: 14px;
  font-size: 13px;
  color: var(--silver-400);
}
.footer__rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,184,210,.2), transparent);
  margin: 40px auto 24px;
  max-width: var(--maxw);
}
.footer__bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--silver-500);
  flex-wrap: wrap;
  gap: 12px;
}

/* Reveal-on-scroll was removed: every page now shows its content immediately
   (glanceable + readable without JS). Only ambient/decorative motion remains. */

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .topnav { display: flex; align-items: center; gap: 14px; }
  .brand { margin-right: auto; }
  .topnav__links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 12px var(--gutter) 20px;
    background: linear-gradient(180deg, rgba(5,6,13,.96), rgba(5,6,13,.92));
    border-bottom: 1px solid rgba(255,255,255,.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .topnav__links.is-open { display: flex; }
  .topnav__links a {
    padding: 12px 0;
    border-bottom: 1px dashed rgba(184,184,210,.08);
  }
  .topnav__menu { display: inline-flex; }
  .topnav__cta { display: inline-flex; padding: 8px 14px; font-size: 12px; }
  .topnav__cta svg { width: 15px; height: 15px; }

  /* Stack: headline → devices → download, so the phone + watch are the
     first thing on a phone, right under the title. */
  .hero__inner {
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "devices" "actions";
    text-align: center;
    padding-top: 8px;
  }
  .hero__intro, .hero__actions { align-self: auto; }
  .hero__lede { margin-inline: auto; }
  .hero__cta-row { justify-content: center; margin-bottom: 0; }
  .hero__signals { margin-top: 26px; justify-items: center; text-align: center; }
  .hero__stage { --hs: .84; }

  .spec { grid-template-columns: 56px 1fr; }
  .spec__viz { grid-column: 1 / -1; justify-self: start; padding-top: 8px; }

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

  .privacy__inner { grid-template-columns: 1fr; text-align: center; gap: 32px; }
  .privacy__seal { justify-self: center; }
  .privacy__list li { justify-content: center; }

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

@media (max-width: 640px) {
  .hero__signals { grid-template-columns: 1fr; gap: 14px; }
  .hero__title { font-size: clamp(40px, 12vw, 64px); }
  .display     { font-size: clamp(32px, 9vw, 52px); }
  .hero__stage { --hs: .6; }
  .brand__word { font-size: 19px; }

  .callout--a { left: 0; }
  .callout--b { right: 0; }
  .callout--c { left: 0; }

  .orbit { grid-template-columns: 1fr; gap: 30px; }
  .orbit__zenith { top: 0; }
  .orbit svg { display: none; }

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

@media (max-width: 390px) {
  .hero__stage { --hs: .5; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .score-arc--value { stroke-dashoffset: 100; }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--moon-warm);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   CONTENT PAGES — legal / faq / contact
   ============================================================ */
.page { position: relative; z-index: 1; }

/* Page header */
.page-hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 11vh, 132px) var(--gutter) clamp(28px, 4vh, 44px);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 320;
  font-variation-settings: "SOFT" 50, "opsz" 144;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 1.02;
  letter-spacing: -.025em;
  color: var(--silver-50);
  margin: 0 0 18px;
}
.page-hero h1 em { font-style: italic; font-weight: 280; }
.page-hero__sub {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--silver-300);
  max-width: 60ch;
  margin: 0 0 18px;
}
.page-hero__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--silver-500);
  display: flex; flex-wrap: wrap; gap: 8px 18px;
}
.page-hero__meta a { color: var(--silver-400); border-bottom: 1px solid rgba(184,184,210,.25); }
.page-hero__meta a:hover { color: var(--moon-warm); border-color: var(--moon-warm); }

/* Divider used at top of content */
.page-rule {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,184,210,.22), transparent);
}

/* Readable document column */
.doc {
  max-width: 768px;
  margin: 0 auto;
  padding: clamp(32px, 5vh, 56px) var(--gutter) clamp(80px, 12vh, 160px);
  color: var(--silver-300);
  font-size: 16px;
  line-height: 1.72;
}
.doc > section { scroll-margin-top: 96px; }
.doc h2 {
  font-family: var(--font-display);
  font-weight: 360;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -.01em;
  color: var(--silver-50);
  margin: 2.4em 0 .6em;
  padding-top: 1.4em;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: baseline; gap: 14px;
}
.doc > section:first-of-type h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.doc h2 .doc__no {
  font-style: italic;
  font-size: .7em;
  color: var(--silver-500);
  font-variant-numeric: tabular-nums;
}
.doc h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .01em;
  color: var(--silver-100);
  margin: 1.8em 0 .5em;
}
.doc p { margin: 0 0 1.1em; }
.doc a {
  color: var(--cyan);
  border-bottom: 1px solid rgba(102,204,242,.35);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.doc a:hover { color: var(--moon-warm); border-color: var(--moon-warm); }
.doc strong { color: var(--silver-50); font-weight: 600; }
.doc em { font-style: italic; }
.doc ul, .doc ol {
  list-style: revert;
  padding-left: 1.4em;
  margin: 0 0 1.2em;
}
.doc ul { list-style: disc; }
.doc li { margin: .4em 0; }
.doc li::marker { color: var(--silver-500); }
.doc hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184,184,210,.2), transparent);
  margin: 2.2em 0;
}

/* Table of contents */
.doc-toc {
  padding: 20px 22px;
  margin: 0 0 2.4em;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
}
.doc-toc__h {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--silver-500);
  margin: 0 0 12px;
}
.doc-toc ol {
  list-style: none;
  padding: 0; margin: 0;
  columns: 2;
  column-gap: 28px;
}
.doc-toc li { margin: 0 0 8px; break-inside: avoid; }
.doc-toc a {
  display: inline-flex; gap: 10px;
  font-size: 13.5px;
  color: var(--silver-300);
  border: 0;
}
.doc-toc a .doc__no { color: var(--silver-500); font-variant-numeric: tabular-nums; }
.doc-toc a:hover { color: var(--silver-50); }

/* Note / disclaimer callout */
.doc-note {
  padding: 18px 22px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 0 0, rgba(245,185,112,.08), transparent 60%),
    linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid rgba(245,185,112,.28);
  border-left: 2px solid var(--amber);
  color: var(--silver-200);
  font-size: 14px;
  line-height: 1.65;
}
.doc-note strong { color: var(--amber); }
.doc-note--top { margin-bottom: 2.4em; }

/* Inline "back home" return crumb */
.crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--silver-400);
  margin-bottom: 22px;
}
.crumb svg { width: 14px; height: 14px; }
.crumb:hover { color: var(--moon-warm); }

/* ---------- FAQ accordion ---------- */
.faq {
  max-width: 768px;
  margin: 0 auto;
  padding: clamp(32px, 5vh, 56px) var(--gutter) clamp(80px, 12vh, 160px);
}
.faq__group + .faq__group { margin-top: 40px; }
.faq__grouphead {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--silver-500);
  margin: 0 0 8px;
}
.faq details {
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.faq details:first-of-type { border-top: 1px solid rgba(255,255,255,.07); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 22px 4px;
  font-family: var(--font-display);
  font-weight: 360;
  font-size: clamp(17px, 1.8vw, 21px);
  color: var(--silver-50);
  transition: color .2s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: #fff; }
.faq__icon {
  flex: none;
  width: 22px; height: 22px;
  position: relative;
}
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 12px; height: 1.5px;
  background: var(--silver-300);
  transform: translate(-50%, -50%);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.faq__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq details[open] .faq__icon::after { opacity: 0; transform: translate(-50%, -50%) rotate(0); }
.faq details[open] .faq__icon::before { background: var(--moon-warm); }
.faq__a {
  padding: 0 4px 24px;
  color: var(--silver-300);
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 64ch;
}
.faq__a p { margin: 0 0 .9em; }
.faq__a p:last-child { margin-bottom: 0; }
.faq__a a {
  color: var(--cyan);
  border-bottom: 1px solid rgba(102,204,242,.35);
}
.faq__a a:hover { color: var(--moon-warm); border-color: var(--moon-warm); }

/* ---------- Contact ---------- */
.contact {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(32px, 5vh, 56px) var(--gutter) clamp(80px, 12vh, 160px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: start;
}
.contact-card {
  padding: 36px clamp(24px, 3vw, 40px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 100% at 0 0, rgba(102,204,242,.08), transparent 60%),
    linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.contact-card__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--silver-500);
  margin: 0 0 10px;
}
.contact-card h2 {
  font-family: var(--font-display);
  font-weight: 360;
  font-size: clamp(22px, 2.4vw, 28px);
  color: var(--silver-50);
  margin: 0 0 8px;
}
.contact-card p { color: var(--silver-300); font-size: 15px; margin: 0 0 22px; }
.contact-email {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01));
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.6vw, 18px);
  letter-spacing: .01em;
  color: var(--silver-50);
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.contact-email svg { width: 18px; height: 18px; color: var(--moon-warm); }
.contact-email:hover {
  border-color: rgba(255,250,204,.5);
  background: linear-gradient(180deg, rgba(255,250,204,.12), rgba(255,250,204,.03));
  transform: translateY(-1px);
}
.contact-side { display: flex; flex-direction: column; gap: 16px; }
.contact-tile {
  padding: 20px 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bot));
  border: 1px solid var(--glass-line);
}
.contact-tile h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  color: var(--silver-50);
  margin: 0 0 6px;
}
.contact-tile p { color: var(--silver-300); font-size: 13.5px; margin: 0; line-height: 1.6; }
.contact-tile a { color: var(--cyan); border-bottom: 1px solid rgba(102,204,242,.3); }
.contact-tile a:hover { color: var(--moon-warm); border-color: var(--moon-warm); }

@media (max-width: 720px) {
  .contact { grid-template-columns: 1fr; }
  .doc-toc ol { columns: 1; }
}
