/* Rivels website. Tokens first; every colour, size, radius and curve below comes from here.
   Canvas true black, light from the app colour (Rivels violet), glass only on navigation and controls. */
:root {
  color-scheme: dark;
  --bg: #000;
  --surface: #0c0c0e;
  --surface-2: #141416;
  --surface-3: #1c1c1f;
  --ink: #f5f5f7;
  --ink-2: rgba(245, 245, 247, .74);
  --ink-3: rgba(245, 245, 247, .58);
  --hair: rgba(255, 255, 255, .09);
  --hair-strong: rgba(255, 255, 255, .16);

  /* the app's "Rivels" accent palette (App/src/rivels/accent-palettes.ts) */
  --violet: #7b4dff;
  --blue: #3ba8ff;
  --indigo: #4b5bff;
  --violet-ink: #a48aff;

  /* meaning colours, only inside data (App/src/rivels/nutrition-analytics.ts, home-day.tsx) */
  --protein: #ff896c;
  --fat: #efc352;
  --carbs: #57b887;
  --water: #3cc3ff;
  --move: #3edc6e;

  --glass: rgba(30, 30, 36, .52);
  --glass-blur: saturate(1.6) brightness(1.15) blur(26px);
  --frost: rgba(30, 32, 40, .42);
  --frost-blur: saturate(1.45) brightness(1.04) blur(10px);

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(20px, 4.6vw, 64px);
  --wide: 1200px;
  --read: 680px;
  --section: clamp(96px, 12vw, 176px);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --t-press: 120ms;
  --t-state: 240ms;
  --t-enter: 700ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
button { font: inherit; color: inherit; }
::selection { background: rgba(123, 77, 255, .45); color: #fff; }
:focus-visible { outline: 2px solid var(--violet-ink); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 12px 18px; border-radius: 999px; background: #fff; color: #000; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wrap { width: 100%; max-width: calc(var(--wide) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- navigation (glass) ---------- */
.nav {
  position: fixed; inset: 12px 0 auto; z-index: 50;
  padding: 0 max(12px, calc(var(--gutter) - 12px));
  pointer-events: none;
}
.nav-bar {
  pointer-events: auto;
  max-width: calc(var(--wide) + 24px); margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  height: 56px; padding: 0 8px 0 18px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,0) 50%, rgba(190,215,255,.03)), var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 0 .5px rgba(255,255,255,.14), inset 1px 1.5px 0 -.25px rgba(255,255,255,.22);
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; margin-right: auto; min-height: 44px; border-radius: 10px; }
.brand-r { width: 20px; height: auto; }
.brand-word { width: 74px; height: auto; }
.nav-links { display: none; gap: 2px; margin: 0 8px 0 0; padding: 0; list-style: none; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-size: 15px;
  transition: color var(--t-state) var(--ease), background-color var(--t-state) var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(255,255,255,.07); }
.nav-links a[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,.10); }
@media (min-width: 900px) { .nav-links { display: flex; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0;
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform var(--t-press) var(--ease), background-color var(--t-state) var(--ease), opacity var(--t-state) var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: #e8e8ed; }
.btn-lg { min-height: 56px; padding: 0 26px; font-size: 17px; }
.btn-glass {
  background: var(--frost); color: var(--ink);
  -webkit-backdrop-filter: var(--frost-blur); backdrop-filter: var(--frost-blur);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.btn-glass:hover { background: rgba(255,255,255,.14); }
.btn svg { width: 20px; height: 20px; flex: none; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  color: var(--ink); font-size: 17px; font-weight: 500; text-decoration: none;
}
.link-arrow span { transition: transform var(--t-state) var(--ease); }
.link-arrow:hover span { transform: translateX(3px); }

/* ---------- type ---------- */
.eyebrow { display: block; margin: 0 0 14px; color: var(--violet-ink); font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.display {
  font-size: clamp(52px, 8.4vw, 112px); line-height: .96; letter-spacing: -.045em; font-weight: 600;
}
.h2 { font-size: clamp(38px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.h3 { font-size: 21px; line-height: 1.25; letter-spacing: -.015em; }
.lead { font-size: clamp(19px, 1.7vw, 22px); line-height: 1.45; color: var(--ink-2); max-width: 34em; text-wrap: pretty; }
.lead strong { color: var(--ink); font-weight: 600; }
.small { font-size: 14px; line-height: 1.45; color: var(--ink-3); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 112px 0 0; overflow: clip; }
.hero-grid { display: grid; gap: 8px; align-items: center; }
.hero-copy { position: relative; z-index: 2; padding-top: 24px; }
.hero-copy .display .line { display: block; overflow: clip; padding-bottom: .06em; margin-bottom: -.06em; }
.hero-copy .display .line > span { display: inline-block; }
.hero-copy .lead { margin-top: 24px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 36px; }
.hero-stage { position: relative; margin: 0 calc(var(--gutter) * -1); }
.hero-glow {
  position: absolute; inset: 8% 6% 20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(42% 34% at 50% 30%, rgba(123, 77, 255, .34), transparent 70%),
    radial-gradient(36% 30% at 62% 46%, rgba(59, 168, 255, .14), transparent 70%);
}
.media-frame { position: relative; z-index: 1; aspect-ratio: 864 / 1080; }
.media-frame video, .media-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero .media-frame {
  max-width: 640px; margin: 0 auto;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 76%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 76%, transparent);
  mask-composite: intersect;
}
.hero-caption {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 9%;
  display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 64px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--frost); -webkit-backdrop-filter: var(--frost-blur); backdrop-filter: var(--frost-blur);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  font-size: 14px; color: var(--ink-2);
}
.chip b { color: var(--ink); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); flex: none; }
.dot.light { background: #c9b8ff; }
.media-toggle {
  position: absolute; z-index: 4; right: 12px; bottom: 12px;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: var(--frost); -webkit-backdrop-filter: var(--frost-blur); backdrop-filter: var(--frost-blur);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  transition: transform var(--t-press) var(--ease), background-color var(--t-state) var(--ease);
}
.media-toggle:hover { background: rgba(255,255,255,.16); }
.media-toggle:active { transform: scale(.93); }
.media-toggle svg { width: 16px; height: 16px; }
.media-toggle .i-play { display: none; }
.media-toggle[aria-pressed="true"] .i-play { display: block; }
.media-toggle[aria-pressed="true"] .i-pause { display: none; }
.hero .media-toggle { right: max(16px, 12%); bottom: 10%; }
@media (max-width: 959px) {
  .hero .media-toggle { top: 12%; bottom: auto; right: max(20px, 8%); }
  .tab { padding: 0 11px; font-size: 14px; }
}

@media (min-width: 960px) {
  .hero { padding-top: 96px; }
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); min-height: min(100svh, 940px); }
  .hero-copy { padding: 0 0 48px; }
  .hero-stage { margin: 0; }
  .hero .media-frame { max-width: none; }
}

/* ---------- sections ---------- */
main { display: block; overflow-x: clip; }
.section { position: relative; padding: var(--section) 0; }
.section + .section { padding-top: 0; }
.section-head { max-width: 760px; }
.section-head .lead { margin-top: 20px; }
.split { display: grid; gap: 48px; align-items: center; }
.split > *, .muscles-stage > *, .hero-grid > * { min-width: 0; }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; }
  .split.flip > :first-child { order: 2; }
}
.facts { display: grid; gap: 28px; margin: 40px 0 0; padding: 0; list-style: none; }
.facts li { padding-top: 18px; border-top: 1px solid var(--hair); }
.facts h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.facts p { margin-top: 6px; color: var(--ink-2); }
@media (min-width: 640px) { .facts { grid-template-columns: 1fr 1fr; gap: 28px 32px; } }

/* train reel */
.reel {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(72vw, 300px); gap: 16px;
  margin: 56px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.reel::-webkit-scrollbar { display: none; }
.reel figure { margin: 0; scroll-snap-align: start; }
.reel .media-frame { border-radius: var(--r-lg); overflow: hidden; background: #19191b; }
.reel figcaption { padding: 14px 4px 0; }
.reel figcaption b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.reel figcaption span { display: block; margin-top: 2px; font-size: 15px; color: var(--ink-3); }
@media (min-width: 960px) {
  .reel { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 64px 0 0; padding: 0; overflow: visible; }
}

/* muscles story */
.muscles-stage { display: grid; gap: 40px; align-items: center; }
.muscles-copy .h2 { font-size: clamp(34px, 4.2vw, 56px); }
.muscles-copy .lead { margin-top: 20px; }
.muscles-figure { position: relative; aspect-ratio: 864 / 1080; max-width: 560px; width: 100%; margin: 0 auto; }
.muscles-figure img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-xl);
  transition: opacity 480ms var(--ease);
}
.js .muscles-figure img:not(.on) { opacity: 0; }
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: var(--frost); -webkit-backdrop-filter: var(--frost-blur); backdrop-filter: var(--frost-blur);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  color: var(--ink-2); font-size: 15px; font-weight: 500;
  transition: background-color var(--t-state) var(--ease), color var(--t-state) var(--ease), transform var(--t-press) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab:active { transform: scale(.97); }
.tab[aria-selected="true"] { background: #fff; color: #000; }
.legend { margin-top: 28px; }
.js .legend-panel:not(.on) { display: none; }
.legend-panel + .legend-panel { margin-top: 32px; }
.js .legend-panel + .legend-panel { margin-top: 0; }
.legend-panel h3 { font-size: 28px; letter-spacing: -.02em; }
.legend-list { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.legend-list li { display: flex; align-items: center; gap: 14px; min-height: 52px; border-bottom: 1px solid var(--hair); font-size: 17px; }
.legend-list li .role { margin-left: auto; color: var(--ink-3); font-size: 15px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.swatch.main { background: var(--violet); }
.swatch.help { background: #c9b8ff; }
@media (min-width: 960px) {
  .muscles-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; }
  .muscles-pin { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 88px 0 24px; }
  .muscles-figure { width: min(100%, calc((100svh - 128px) * .8)); }
}

/* product cards (built in code from the app's own screens) */
.panel {
  position: relative; border-radius: var(--r-xl); padding: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  box-shadow: inset 0 0 0 1px var(--hair), inset 0 1px 0 rgba(255,255,255,.06);
}
.panel + .panel { margin-top: 16px; }
.panel-stack { position: relative; max-width: 480px; width: 100%; margin: 0 auto; }
.panel-stack::before {
  content: ""; position: absolute; inset: -12% -10%; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 45% at 50% 40%, rgba(123, 77, 255, .16), transparent 72%);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-title { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.panel-sub { font-size: 14px; color: var(--ink-3); }
.rows { margin: 16px 0 0; padding: 0; list-style: none; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--hair); }
.row:first-child { border-top: 0; }
.row-name { font-size: 16px; font-weight: 500; }
.row-meta { font-size: 14px; color: var(--ink-3); }
.row-val { font-size: 16px; text-align: right; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: rgba(255,255,255,.85); transform-origin: left center; }
.bar.ready i { background: var(--move); }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); }
.state.ready::before { background: var(--move); }
.note { margin-top: 16px; font-size: 13px; line-height: 1.45; color: var(--ink-3); }

.day { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 16px; }
.ring { width: 112px; height: 112px; }
.ring-label { text-anchor: middle; fill: var(--ink); }
.macros { display: grid; gap: 12px; }
.macro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; font-size: 14px; }
.macro .bar { height: 5px; }
.macro.p .bar i { background: var(--protein); }
.macro.c .bar i { background: var(--carbs); }
.macro.f .bar i { background: var(--fat); }
.macro span:first-child { color: var(--ink-2); }
.water .bar i { background: var(--water); }

.check { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.28); }
.check.done { background: #fff; box-shadow: none; }
.check.done svg { width: 14px; height: 14px; color: #000; }
.stack-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--hair); }
.stack-row:first-child { border-top: 0; }
.stack-row .row-val { margin-left: auto; color: var(--ink-3); font-size: 14px; }

.post-head { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 15px; font-weight: 600; color: #fff; background: #2a2a2e; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding: 16px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.stats b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.stats span { font-size: 13px; color: var(--ink-3); }
.post-foot { display: flex; gap: 18px; margin-top: 14px; font-size: 14px; color: var(--ink-3); }
.bubbles { display: grid; gap: 8px; margin-top: 4px; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 20px; font-size: 15px; line-height: 1.35; background: #26262a; }
.bubble.me { justify-self: end; background: #fff; color: #000; }
.bubble.card { padding: 12px 14px; background: #1c1c1f; box-shadow: inset 0 0 0 1px var(--hair); }
.bubble.card b { display: block; font-size: 15px; }
.bubble.card span { font-size: 13px; color: var(--ink-3); }
.audience { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.audience span { padding: 6px 12px; border-radius: 999px; font-size: 13px; box-shadow: inset 0 0 0 1px var(--hair-strong); color: var(--ink-2); }
.audience span.on { background: #fff; color: #000; box-shadow: none; font-weight: 600; }

/* two-up feature (supplements next to nutrition) */
.duo { display: grid; gap: 16px; margin-top: 56px; }
@media (min-width: 960px) { .duo { grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 72px; } }
.duo > .panel { margin: 0; padding: 28px; }
.duo .panel > .h3 { margin-bottom: 4px; }
.duo .panel > p.copy { margin: 6px 0 4px; color: var(--ink-2); max-width: 30em; }

/* privacy band */
.band {
  border-radius: var(--r-xl); padding: clamp(28px, 5vw, 64px);
  background: radial-gradient(80% 120% at 0% 0%, rgba(123, 77, 255, .16), transparent 60%), var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hair);
  display: grid; gap: 28px;
}
@media (min-width: 960px) { .band { grid-template-columns: 1.1fr .9fr; align-items: end; gap: 56px; } }
.band ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.band li { display: flex; gap: 12px; color: var(--ink-2); }
.band li svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--violet-ink); }

/* faq */
.faq { max-width: 820px; margin-top: 40px; }
.faq details { border-top: 1px solid var(--hair); }
.faq details:last-child { border-bottom: 1px solid var(--hair); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 16px 0; font-size: 19px; font-weight: 500; letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px; margin-right: 6px;
  border-right: 1.75px solid var(--ink-2); border-bottom: 1.75px solid var(--ink-2);
  transform: translateY(-3px) rotate(45deg); transition: transform var(--t-state) var(--ease);
}
.faq details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.faq details > div { padding: 0 0 24px; color: var(--ink-2); max-width: 40em; }
.faq details > div p + p { margin-top: 10px; }

/* final call */
.final { text-align: center; padding-bottom: clamp(96px, 10vw, 140px); }
.final-mark { width: 64px; margin: 0 auto 28px; }
.final .h2 { max-width: 14em; margin: 0 auto; }
.final .lead { margin: 18px auto 0; }
.final .btn { margin-top: 36px; }
.final .small { margin-top: 14px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--hair); padding: 56px 0 40px; font-size: 14px; color: var(--ink-3); }
.footer-grid { display: grid; gap: 36px; }
.footer-brand img { width: 96px; height: auto; }
.footer-brand p { margin-top: 14px; max-width: 22em; }
.footer h2 { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 12px; }
.footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.footer ul a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-3); text-decoration: none; }
.footer ul a:hover { color: var(--ink); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--hair); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }

/* ---------- reading pages (legal, support) ---------- */
.doc { padding: 136px 0 var(--section); }
.doc-grid { display: grid; gap: 40px; }
@media (min-width: 1080px) { .doc-grid { grid-template-columns: 220px minmax(0, var(--read)); gap: 80px; justify-content: center; } }
.toc { display: none; }
@media (min-width: 1080px) {
  .toc { display: block; position: sticky; top: 112px; align-self: start; font-size: 14px; }
  .toc p { color: var(--ink); font-weight: 600; margin-bottom: 10px; }
  .toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--hair); }
  .toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; color: var(--ink-3); text-decoration: none; border-left: 1px solid transparent; }
  .toc a:hover { color: var(--ink); }
  .toc a.on { color: var(--ink); border-left-color: var(--violet-ink); }
}
.doc-body { max-width: var(--read); }
.doc-body h1 { font-size: clamp(40px, 6vw, 56px); line-height: 1.05; letter-spacing: -.035em; }
.doc-body .updated { margin-top: 14px; font-size: 15px; color: var(--ink-3); }
.doc-body .lede { margin-top: 24px; font-size: 21px; line-height: 1.5; color: var(--ink-2); }
.doc-body h2 { margin: 56px 0 14px; font-size: 26px; line-height: 1.2; letter-spacing: -.02em; scroll-margin-top: 104px; }
.doc-body h3 { margin: 28px 0 8px; font-size: 18px; letter-spacing: -.01em; }
.doc-body p, .doc-body li { color: var(--ink-2); }
.doc-body p + p { margin-top: 14px; }
.doc-body ul, .doc-body ol { margin: 12px 0 0; padding-left: 22px; }
.doc-body li + li { margin-top: 8px; }
.doc-body li::marker { color: var(--ink-3); }
.doc-body strong { color: var(--ink); font-weight: 600; }
.doc-body a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(164, 138, 255, .7); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc-body a:hover { text-decoration-color: var(--violet-ink); }
.doc-body .card { margin-top: 24px; padding: 22px 24px; border-radius: var(--r-lg); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }
.doc-body .card p + p { margin-top: 12px; }
.doc-body .muted { color: var(--ink-3); font-size: 15px; }
.doc-links { margin: 32px 0 0; padding: 0; list-style: none; }
.doc-links li + li { margin-top: 0; }
.doc-links a {
  display: grid; gap: 2px; padding: 18px 0; border-top: 1px solid var(--hair); text-decoration: none;
}
.doc-links li:last-child a { border-bottom: 1px solid var(--hair); }
.doc-links strong { font-size: 19px; }
.doc-links span { color: var(--ink-3); font-size: 15px; }
.doc-links a:hover strong { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--violet-ink); }
.ph {
  padding: 1px 6px; border-radius: 5px; white-space: normal;
  background: rgba(239, 195, 82, .14); color: #f3d27a; box-shadow: inset 0 0 0 1px rgba(239, 195, 82, .35);
  font-size: .94em;
}

/* app-link fallback and 404 */
.center-page { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 120px var(--gutter) 64px; }
.center-page img.mark { width: 56px; margin: 0 auto 28px; }
.center-page .lead { margin: 16px auto 0; }
.center-page .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

/* ---------- motion (JS adds .js; reduced motion keeps everything static) ---------- */
/* .motion is set in <head> only when motion is allowed, and removed by site.js once GSAP owns the states */
.motion .reveal,
.motion .hero [data-intro],
.motion .hero .media-frame,
.motion .hero-glow,
.motion .hero-caption,
.motion .hero .media-toggle,
.motion .hero .display .line > span { opacity: 0; }
@media (prefers-reduced-transparency: reduce) {
  .nav-bar, .chip, .tabs, .btn-glass, .media-toggle { -webkit-backdrop-filter: none; backdrop-filter: none; background: #1c1c1f; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .btn, .tab, .media-toggle { border: 1px solid ButtonText; }
}
