/* Track Sleep site. Tokens mirror the app's "Calm night" design system. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallback so the swap to Inter does not shift layout. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

:root {
  color-scheme: dark light;

  --bg: #0B0D1A;
  --surface-1: #12152A;
  --surface-2: #171A33;
  --surface-3: #1E2240;
  --surface-4: #272B4F;
  --outline: #3A3F68;
  --outline-strong: #6B70A0;
  --outline-subtle: #252946;
  --text: #ECEDF7;
  --text-muted: #A3A6C4;
  --primary: #A9B4FF;
  --on-primary: #0E1240;
  --secondary: #8FD5D0;
  --tertiary: #F5C48A;

  --stage-awake: #F5C48A;
  --stage-rem: #C6A8FF;
  --stage-light: #7CCFE0;
  --stage-deep: #6F86FF;

  --score-low: #FF9C9C;
  --score-mid: #F5C48A;
  --score-high: #8EE0B5;

  --glow: rgb(169 180 255 / 0.14);
  --glow-dawn: rgb(245 196 138 / 0.16);
  --phone-edge: #2A2E52;
  --shadow: rgb(0 0 0 / 0.5);

  --r-12: 12px;
  --r-16: 16px;
  --r-24: 24px;
  --r-32: 32px;

  --font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  --max: 1120px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F6F6FB;
    --surface-1: #FFFFFF;
    --surface-2: #EEF0F8;
    --surface-3: #E5E8F3;
    --surface-4: #E5E8F3;
    --outline: #C9CCE0;
    --outline-strong: #7E819F;
    --outline-subtle: #DCDFEC;
    --text: #141629;
    --text-muted: #545771;
    --primary: #4A52C9;
    --on-primary: #FFFFFF;
    --secondary: #1F7C76;
    --tertiary: #A05A12;

    --stage-awake: #B2681A;
    --stage-rem: #7B54D6;
    --stage-light: #1F8299;
    --stage-deep: #3F55D4;

    --score-low: #C2413B;
    --score-mid: #A86512;
    --score-high: #1E8A5A;

    --glow: rgb(74 82 201 / 0.10);
    --glow-dawn: rgb(160 90 18 / 0.10);
    --phone-edge: #D5D8E8;
    --shadow: rgb(20 22 41 / 0.14);
  }
}

@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 1.6rem + 4.2vw, 4.25rem);
  letter-spacing: -0.035em;
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.875rem, 1.4rem + 2.2vw, 2.875rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h3 {
  font-size: 1.1875rem;
  letter-spacing: -0.012em;
  line-height: 1.3;
}

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--primary);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--primary) 45%, transparent);
  transition: text-decoration-color 160ms ease;
}
a:hover { text-decoration-color: currentColor; }

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

::selection { background: color-mix(in srgb, var(--primary) 35%, transparent); color: var(--text); }

html { scrollbar-color: var(--outline) var(--bg); }

svg { display: block; }

.num { font-variant-numeric: tabular-nums; }
.digits { font-feature-settings: "tnum", "cv11", "ss01"; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--r-12);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  text-decoration: none;
  min-height: 44px;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.brand-tile { fill: var(--surface-3); }
.brand-moon { fill: var(--primary); }

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 10px;
  border-radius: var(--r-12);
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}
@media (hover: hover) { .site-nav a:hover { color: var(--text); background: var(--surface-2); } }
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav .nav-wide { display: none; }
@media (min-width: 640px) { .site-nav .nav-wide { display: list-item; } }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--r-16);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: 0 8px 28px -10px color-mix(in srgb, var(--primary) 60%, transparent);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
@media (hover: hover) {
  .button:hover { transform: translateY(-1px); box-shadow: 0 12px 32px -10px color-mix(in srgb, var(--primary) 70%, transparent); }
}
.button:active { transform: translateY(0); }
.button svg { width: 18px; height: 18px; }

.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.soon::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--tertiary);
  box-shadow: 0 0 0 4px var(--glow-dawn);
}

/* Hero */

.hero {
  position: relative;
  overflow-x: clip;
  padding-block: 32px 72px;
}
.hero .wrap {
  display: grid;
  gap: 56px;
  align-items: center;
}
.hero-copy { max-width: 40rem; container-type: inline-size; }
.hero-copy h1 { font-size: clamp(2.5rem, 11.2cqi, 4.25rem); }
h1 .line { display: inline-block; }
.hero-lead {
  margin-top: 24px;
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 33rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 36px;
}
.hero-figure {
  position: relative;
  justify-self: center;
}
.hero-figure::before {
  content: "";
  position: absolute;
  inset: -12% -30%;
  background:
    radial-gradient(closest-side, var(--glow), transparent 70%),
    radial-gradient(40% 30% at 62% 78%, var(--glow-dawn), transparent 75%);
  pointer-events: none;
  z-index: -1;
}

@media (min-width: 900px) {
  .hero { padding-block: 56px 112px; }
  .hero .wrap { grid-template-columns: 1.15fr 1fr; gap: 64px; }
  .hero-figure { justify-self: end; margin-right: 24px; }
}

/* Sections */

.section { padding-block: 88px; overflow-x: clip; }
@media (min-width: 900px) { .section { padding-block: 128px; } }

.section-head { max-width: 40rem; }
.section-head p {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 1.125rem;
}

.rule { border: 0; border-top: 1px solid var(--outline-subtle); margin: 0; }

/* Night chart */

.night { position: relative; }

.night-chart {
  margin: 56px 0 0;
  padding: 24px 20px 16px;
  border-radius: var(--r-24);
  background: var(--surface-1);
  border: 1px solid var(--outline-subtle);
}
@media (min-width: 640px) { .night-chart { padding: 32px 32px 20px; } }

.night-chart-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
}
.stage-names {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}
.stage-names li { display: flex; align-items: center; }
.night-plot { position: relative; height: 148px; }
@media (min-width: 640px) { .night-plot { height: 168px; } }
.night-plot svg { width: 100%; height: 100%; overflow: visible; }

.st-awake { fill: var(--stage-awake); }
.st-rem { fill: var(--stage-rem); }
.st-light { fill: var(--stage-light); }
.st-deep { fill: var(--stage-deep); }
.st-conn { stroke: var(--outline); stroke-width: 1; fill: none; }
.st-window { fill: var(--glow-dawn); }
.st-alarm { stroke: var(--tertiary); stroke-width: 1.5; stroke-dasharray: 3 3; fill: none; }
.st-gridline { stroke: var(--outline-subtle); stroke-width: 1; }

.night-ticks {
  position: relative;
  height: 20px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.night-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.night-ticks .t0 { left: 0; transform: none; }
.night-ticks .t1 { left: 12.903%; }
.night-ticks .t2 { left: 25.806%; }
.night-ticks .t3 { left: 38.71%; }
.night-ticks .t4 { left: 51.613%; }
.night-ticks .t5 { left: 64.516%; }
.night-ticks .t6 { left: 77.419%; }
.night-ticks .t7 { left: 90.323%; }
.night-ticks .minor { display: none; }
@media (min-width: 640px) { .night-ticks .minor { display: inline; } }

.night-callouts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.callout {
  position: absolute;
  top: -6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.callout-wake { right: 0; margin: 0; color: var(--tertiary); transform: translateY(-100%); }
.callout .wide { display: none; }
@media (min-width: 640px) { .callout .wide { display: inline; } }

.night-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--outline-subtle);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.night-steps {
  display: grid;
  gap: 40px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .night-steps { grid-template-columns: 1fr 1fr; column-gap: 40px; } }
@media (min-width: 1024px) { .night-steps { grid-template-columns: repeat(4, 1fr); column-gap: 32px; } }

.night-steps li { display: grid; gap: 10px; align-content: start; }
.step-time {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
}
.step-time::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--outline), transparent);
}
.night-steps li:nth-child(3) .step-time,
.night-steps li:nth-child(4) .step-time { color: var(--tertiary); }
.night-steps p { color: var(--text-muted); font-size: 1rem; }

/* The one authored moment: the night draws in as it scrolls into view. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .night-plot svg {
      animation: night-draw linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 45%;
    }
    @keyframes night-draw {
      from { clip-path: inset(0 100% 0 0); }
      to { clip-path: inset(0 0 0 0); }
    }
  }
}

/* Feature splits */

.split {
  display: grid;
  gap: 56px;
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: 80px; }
  .split-reverse .split-figure { order: 2; }
}
.split-figure { justify-self: center; position: relative; }
.split-figure::before {
  content: "";
  position: absolute;
  inset: -10% -25%;
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  z-index: -1;
  pointer-events: none;
}

.facts {
  display: grid;
  gap: 28px;
  margin: 40px 0 0;
  padding: 0;
}
.facts div { display: grid; gap: 6px; }
.facts dt { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }
.facts dd { margin: 0; color: var(--text-muted); }

.stat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.stat-list li {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--outline-subtle);
  background: var(--surface-1);
  font-size: 0.875rem;
  color: var(--text);
}

/* Privacy */

.privacy {
  background: var(--surface-1);
  border-block: 1px solid var(--outline-subtle);
}
.privacy-grid {
  display: grid;
  gap: 56px;
  margin-top: 56px;
}
@media (min-width: 900px) { .privacy-grid { grid-template-columns: 1.1fr 1fr; gap: 72px; align-items: start; } }

.promises {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--outline-subtle);
}
.promises li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 16px;
  padding-block: 20px;
  border-bottom: 1px solid var(--outline-subtle);
}
.promises svg { width: 22px; height: 22px; margin-top: 2px; color: var(--secondary); }
.promises strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.promises span { color: var(--text-muted); }

.ledger {
  border-radius: var(--r-24);
  background: var(--surface-2);
  border: 1px solid var(--outline-subtle);
  padding: 24px;
}
@media (min-width: 640px) { .ledger { padding: 32px; } }
.ledger h3 { font-size: 1.375rem; letter-spacing: -0.02em; }
.ledger > p { margin-top: 12px; color: var(--text-muted); }
.ledger-label {
  margin-top: 28px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.events {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  border-radius: var(--r-16);
  background: var(--surface-1);
  border: 1px solid var(--outline-subtle);
}
.events li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 0.9375rem;
}
.events li + li { border-top: 1px solid var(--outline-subtle); }
.events .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--secondary); }
.events .when { color: var(--text-muted); font-size: 0.875rem; }
.never {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: var(--r-16);
  border: 1px dashed var(--outline);
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.never svg { width: 28px; height: 20px; color: var(--text-muted); }
.never strong { color: var(--text); font-weight: 600; }

.privacy-more { margin-top: 40px; }

/* FAQ */

.faq-list { margin-top: 48px; border-top: 1px solid var(--outline-subtle); max-width: 48rem; }
.faq-list details { border-bottom: 1px solid var(--outline-subtle); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-block: 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  margin-right: 6px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 200ms var(--ease-out);
}
.faq-list details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq-list summary:hover { color: var(--primary); }
.faq-list summary:focus-visible { outline-offset: 2px; }
.faq-answer { padding-bottom: 24px; color: var(--text-muted); max-width: 42rem; }
.faq-answer p + p { margin-top: 12px; }

/* Closing */

.closing { text-align: center; }
.closing .wrap { display: grid; justify-items: center; gap: 20px; }
.closing-mark { width: 56px; height: 56px; margin-bottom: 8px; }
.closing p { color: var(--text-muted); max-width: 32rem; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--outline-subtle);
  padding-block: 40px 48px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.site-footer .wrap {
  display: grid;
  gap: 24px;
}
@media (min-width: 720px) {
  .site-footer .wrap { grid-template-columns: 1fr auto; align-items: center; }
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-meta { display: grid; gap: 6px; }
.footer-meta .brand { min-height: 0; }

/* Phone mockups. Each screen scales with the phone through container units. */

.phone {
  margin: 0;
  width: min(300px, 80vw);
  padding: 9px;
  border-radius: 46px;
  background: var(--phone-edge);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--outline) 60%, transparent),
    0 40px 80px -40px var(--shadow);
}
.phone-screen,
.phone-shot {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  border-radius: 37px;
}
.phone-screen {
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}
.screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 5cqi 6.5cqi 6cqi;
  font-size: 4.4cqi;
  line-height: 1.35;
}
.screen-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 8cqi;
  padding-inline: 3cqi;
  font-size: 0.85em;
  font-weight: 600;
}
.screen-island {
  width: 28cqi;
  height: 7.5cqi;
  border-radius: 99px;
  background: #000;
}
.screen-bars { display: flex; gap: 1cqi; align-items: flex-end; height: 2.6cqi; }
.screen-bars i { display: block; width: 1cqi; background: currentColor; border-radius: 1px; }
.screen-bars i:nth-child(1) { height: 40%; }
.screen-bars i:nth-child(2) { height: 65%; }
.screen-bars i:nth-child(3) { height: 85%; }
.screen-bars i:nth-child(4) { height: 100%; }

.screen-title {
  margin-top: 5cqi;
  font-size: 1.75em;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.screen-sub { color: var(--text-muted); font-size: 0.9em; margin-top: 1cqi; }
.screen-card {
  border-radius: var(--r-16);
  background: var(--surface-1);
  border: 1px solid var(--outline-subtle);
  padding: 4cqi;
}

.dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: auto -2cqi 0;
  padding: 2cqi 1.5cqi;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--outline-subtle);
  font-size: 0.62em;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
}
.dock span { display: grid; justify-items: center; gap: 0.8cqi; padding: 1.2cqi 0; border-radius: 99px; }
.dock svg { width: 5.4cqi; height: 5.4cqi; }
.dock .on { color: var(--primary); background: var(--surface-4); }
.screen-cta + .dock { margin-top: 4cqi; }

/* Alarm screen */
.dial { position: relative; margin: 7cqi auto 2cqi; width: 86cqi; }
.dial svg { width: 100%; height: auto; }
.dial-track { fill: none; stroke: var(--surface-3); stroke-width: 12; }
.dial-sleep { fill: none; stroke: var(--primary); stroke-width: 12; stroke-linecap: round; }
.dial-window { fill: none; stroke: var(--tertiary); stroke-width: 12; stroke-linecap: round; }
.dial-ticks { stroke: var(--outline); stroke-width: 1.4; stroke-linecap: round; }
.dial-hours { fill: var(--text-muted); font: 600 8px var(--font); }
.dial-knob-bed { fill: var(--bg); stroke: var(--primary); stroke-width: 2.5; }
.dial-knob-alarm { fill: var(--bg); stroke: var(--tertiary); stroke-width: 2.5; }
.dial-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.6cqi;
}
.dial-center .k { font-size: 0.8em; color: var(--text-muted); }
.dial-center .big { font-size: 2.9em; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.dial-center .win { font-size: 0.8em; font-weight: 600; color: var(--tertiary); }

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1cqi;
  margin-top: 5cqi;
  padding: 1cqi;
  border-radius: 99px;
  background: var(--surface-2);
  font-size: 0.85em;
  font-weight: 600;
  text-align: center;
}
.seg span { padding: 1.8cqi 0; border-radius: 99px; color: var(--text-muted); }
.seg .on { background: var(--surface-4); color: var(--text); }

.rows { margin-top: 3.5cqi; padding: 0 4cqi; }
.rows div { display: flex; justify-content: space-between; padding: 2.6cqi 0; font-size: 0.9em; }
.rows div + div { border-top: 1px solid var(--outline-subtle); }
.rows span:last-child { color: var(--text-muted); }

.screen-cta {
  margin-top: auto;
  margin-inline: 2cqi;
  padding: 3.6cqi;
  border-radius: var(--r-16);
  background: var(--primary);
  color: var(--on-primary);
  text-align: center;
  font-weight: 650;
}

/* Morning screen */
.score { position: relative; width: 56cqi; margin: 6cqi auto 0; }
.score svg { width: 100%; height: auto; transform: rotate(-90deg); }
.score-track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.score-arc { fill: none; stroke: var(--score-high); stroke-width: 9; stroke-linecap: round; }
.score-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-center .big { font-size: 3.2em; font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.score-center .k { font-size: 0.75em; color: var(--text-muted); margin-top: 1cqi; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqi; margin-top: 5cqi; text-align: center; }
.trio b { display: block; font-size: 1.05em; font-weight: 600; letter-spacing: -0.02em; }
.trio span { font-size: 0.75em; color: var(--text-muted); }

.mini-hyp { margin-top: 6cqi; }
.mini-hyp svg { width: 100%; height: 15cqi; }
.mini-hyp .st-conn { stroke: var(--outline); }
.mini-legend { display: flex; justify-content: space-between; margin-top: 2.4cqi; font-size: 0.72em; color: var(--text-muted); }
.mini-legend span { display: inline-flex; align-items: center; gap: 1.2cqi; }
.mini-legend i { width: 2cqi; height: 2cqi; border-radius: 50%; display: block; }
.i-awake { background: var(--stage-awake); }
.i-rem { background: var(--stage-rem); }
.i-light { background: var(--stage-light); }
.i-deep { background: var(--stage-deep); }

.rows-card {
  margin-top: 5cqi;
  padding: 0 4cqi;
  border-radius: var(--r-16);
  background: var(--surface-1);
  border: 1px solid var(--outline-subtle);
}
.rows .mood-val { color: var(--secondary); font-weight: 600; }
.rows .tags { display: flex; gap: 1.2cqi; }
.rows .tags span { padding: 0.4cqi 2cqi; border-radius: 99px; background: var(--surface-3); color: var(--text); font-size: 0.85em; }

/* Statistics screen */
.trend { margin-top: 4cqi; }
.trend-head { display: flex; justify-content: space-between; align-items: baseline; }
.trend-head b { font-size: 1.9em; font-weight: 600; letter-spacing: -0.04em; }
.trend-head span { font-size: 0.8em; color: var(--text-muted); }
.trend svg { width: 100%; height: auto; margin-top: 3cqi; overflow: visible; }
.trend-raw { fill: none; stroke: var(--outline-strong); stroke-width: 1.2; stroke-linejoin: round; opacity: 0.7; }
.trend-avg { fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.trend-grid { stroke: var(--outline-subtle); stroke-width: 1; }
.trend-dot { fill: var(--primary); }
.trend-axis { display: flex; justify-content: space-between; margin-top: 1.5cqi; font-size: 0.7em; color: var(--text-muted); }

.mix { margin-top: 4cqi; }
.mix-bar { display: flex; height: 3cqi; border-radius: 99px; overflow: hidden; gap: 0.6cqi; margin-top: 2cqi; }
.mix-bar i { display: block; height: 100%; }
.mix-bar .i-awake { flex: 7; }
.mix-bar .i-rem { flex: 24; }
.mix-bar .i-light { flex: 47; }
.mix-bar .i-deep { flex: 22; }
.mix-k { display: flex; justify-content: space-between; font-size: 0.8em; }
.mix-k span:last-child { color: var(--text-muted); }

.synthetic {
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* Prose pages (privacy, support, 404) */

.page-head { padding-block: 48px 40px; }
@media (min-width: 900px) { .page-head { padding-block: 72px 56px; } }
.page-head p { margin-top: 16px; color: var(--text-muted); font-size: 1.125rem; max-width: 40rem; }

.prose-layout {
  display: grid;
  gap: 40px;
  padding-bottom: 96px;
}
@media (min-width: 1000px) {
  .prose-layout { grid-template-columns: 15rem minmax(0, 44rem); gap: 72px; align-items: start; }
  .toc { position: sticky; top: 24px; }
}
.toc {
  font-size: 0.9375rem;
}
.toc h2 { font-size: 0.875rem; font-weight: 600; letter-spacing: 0; color: var(--text-muted); }
.toc ol { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; border-left: 1px solid var(--outline-subtle); }
.toc a {
  display: block;
  padding: 6px 0 6px 16px;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
}
.toc a:hover { color: var(--text); }

.prose { max-width: 44rem; }
.prose section + section { margin-top: 56px; }
.prose h2 { font-size: 1.625rem; letter-spacing: -0.022em; }
.prose h3 { margin-top: 28px; font-size: 1.125rem; }
.prose p, .prose ul, .prose ol { margin-top: 16px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--text-muted); }
.prose strong { font-weight: 600; }
.prose .note {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--r-16);
  background: var(--surface-1);
  border: 1px solid var(--outline-subtle);
}
.prose .path { font-weight: 600; }

.summary-box {
  padding: 24px;
  border-radius: var(--r-24);
  background: var(--surface-1);
  border: 1px solid var(--outline-subtle);
}
.summary-box ul { margin: 12px 0 0; padding-left: 1.25em; }
.summary-box h2 { font-size: 1.25rem; }

/* 404 */
.lost {
  min-height: 62vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 20px;
  padding-block: 64px 96px;
}
.lost svg { width: 64px; height: 64px; }
.lost p { color: var(--text-muted); max-width: 30rem; font-size: 1.125rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
