/* Continuum site — design tokens + components.
 *
 * Every value below is taken from the app, not invented for the web:
 * colors from lib/core/theme/app_colors.dart (design/CONTINUUM-UI-SPEC.md §3),
 * the typeface is the Inter the app bundles, and the card/rail behaviour follows
 * docs/design/ui-ux-design-patterns.md. The page should read as the same product
 * a visitor is about to install. See ../../DESIGN.md for the token table.
 */

/* ── Typeface: the app's own Inter files, self-hosted (no third-party requests) ── */
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #0a0c10;
  --bg-elevated: #14171f;
  --card: #1b1f2a;
  --card-2: #232836;
  --hairline: #2a3040;

  /* Text (textMuted lifted to #828A99 for WCAG AA, as in the app) */
  --text: #f5f7fa;
  --text-2: #a2a9b6;
  --text-3: #828a99;

  /* Accents: blue means sync; violet is reserved for anime */
  --accent: #4f8cff;
  --accent-pressed: #3a6fd8;
  --anime: #b36cff;
  --success: #35c28e;
  --attention: #e5a53b;
  --on-accent: #0a0c10;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --fs-display: clamp(2.5rem, 1.6rem + 4.4vw, 4.75rem);
  --fs-h2: clamp(1.75rem, 1.3rem + 1.9vw, 2.625rem);
  --fs-h3: 1.125rem;
  --fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-caption: 0.75rem; /* 12px — above the app's 11px floor */

  /* Space (4-based) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 7rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --content: 72rem;

  /* Radius */
  --r-chip: 6px;
  --r-card: 12px;
  --r-frame: 20px;
  --r-pill: 999px;

  /* Motion: the app's card hover — 180ms, easeOutCubic, 1.04x */
  --dur: 180ms;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --lift: 1.04;
  --glow: 0 4px 18px 1px rgb(79 140 255 / 0.25);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -3rem;
  z-index: 10;
  padding: var(--s-2) var(--s-4);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-pill);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: var(--s-3);
}

.wrap {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgb(10 12 16 / 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  border-bottom-color: var(--hairline);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.brand__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.nav__link {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav__link:hover {
  color: var(--text);
  background: var(--card);
}
.nav__link[aria-current="page"] {
  color: var(--text);
  background: rgb(79 140 255 / 0.16);
  box-shadow: inset 0 0 0 1px rgb(79 140 255 / 0.6);
}
@media (max-width: 640px) {
  .nav__link--optional {
    display: none;
  }
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 3rem;
  padding: 0 1.25rem;
  border-radius: var(--r-pill);
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--primary:hover {
  background: #6a9dff;
  box-shadow: var(--glow);
}
.btn--primary:active {
  background: var(--accent-pressed);
}
.btn--ghost {
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.btn--ghost:hover {
  background: var(--card);
}
/* Not a control: a store that isn't live yet is stated, never linked to a 404 */
.btn--soon {
  min-height: 2.75rem;
  color: var(--text-2);
  font-size: var(--fs-small);
  box-shadow: inset 0 0 0 1px var(--hairline);
  cursor: default;
}
/* Store buttons carry the store's own mark, so the eye finds them before the
   words do. Fixed box: the logos differ in visual weight. */
.btn--store {
  gap: var(--s-3);
}
.btn__logo {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn--soon .btn__logo {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}
.text-link {
  display: inline-block;
  margin-top: var(--s-1);
  white-space: nowrap;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn__icon {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding-block: var(--s-8) var(--s-8);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--s-6) var(--s-7);
}
/* The headline spans the page: two lines, one for each screen */
.hero__head {
  grid-column: 1 / -1;
}
.eyebrow {
  margin: 0 0 var(--s-4);
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.hero__title {
  margin: 0;
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.hero__title-line {
  display: block;
}
.hero__title-line--next {
  color: var(--text-2);
}
.hero__lead {
  max-width: 34rem;
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-lead);
  line-height: 1.55;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.hero__platforms {
  margin: var(--s-5) 0 0;
  color: var(--text-3);
  font-size: var(--fs-small);
}

@media (max-width: 900px) {
  .hero {
    padding-block: var(--s-6) var(--s-7);
  }
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5) var(--s-6);
  }
}

/* ── Signature: the handoff (hero illustration) ─────────────────────────── */
.handoff {
  position: relative;
  margin: 0;
}
.handoff__svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.handoff__caption {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-3);
  color: var(--text-3);
  font-size: var(--fs-caption);
}
.handoff__caption b {
  color: var(--text-2);
  font-weight: 600;
}

/* SVG paint — tokens, so the illustration and the page cannot disagree */
.hs-frame { fill: var(--bg-elevated); stroke: var(--hairline); stroke-width: 1.5; }
.hs-screen { fill: #07080b; }
.hs-stand { fill: var(--card-2); }
.hs-track { fill: rgb(245 247 250 / 0.18); }
.hs-fill { fill: var(--text); }
.hs-fill--accent { fill: var(--accent); }
.hs-head { fill: var(--text); }
.hs-arc { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; opacity: 0.55; }
.hs-traveller { fill: var(--accent); }
.hs-traveller-halo { fill: var(--accent); opacity: 0.22; }
.hs-title { fill: var(--text); font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.01em; }
.hs-meta { fill: var(--text-2); font-family: var(--font-sans); font-weight: 400; }
.hs-time { fill: var(--text-2); font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.hs-pill { fill: var(--accent); }
.hs-pill-text { fill: var(--on-accent); font-family: var(--font-sans); font-weight: 600; font-variant-numeric: tabular-nums; }
.hs-icon { fill: var(--text); }
.hs-label { fill: var(--text-3); font-family: var(--font-sans); font-weight: 600; letter-spacing: 0.06em; }

/* ── Sections ───────────────────────────────────────────────────────────── */
.section {
  padding-block: var(--s-9);
  border-top: 1px solid var(--hairline);
}
.section__head {
  max-width: 44rem;
  margin-bottom: var(--s-7);
}
.section__title {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.section__intro {
  margin: var(--s-4) 0 0;
  color: var(--text-2);
  font-size: var(--fs-lead);
}
@media (max-width: 640px) {
  .section {
    padding-block: var(--s-8);
  }
  .section__head {
    margin-bottom: var(--s-6);
  }
}

/* ── Poster rail (Continue Watching preview) ────────────────────────────── */
.rail {
  display: flex;
  gap: var(--s-4);
  margin-inline: calc(var(--gutter) * -1);
  /* Pattern §2: vertical headroom so a scaled card is never clipped */
  padding: 10px var(--gutter) var(--s-4);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
  list-style: none;
}
.poster {
  flex: none;
  /* Pattern §3: 126 mobile / 148 tablet / 170 desktop */
  width: 126px;
  scroll-snap-align: start;
}
@media (min-width: 600px) {
  .poster { width: 148px; }
}
@media (min-width: 1024px) {
  .poster { width: 170px; }
}
.poster__art {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--card);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@media (hover: hover) {
  .poster:hover .poster__art {
    transform: scale(var(--lift));
    box-shadow: var(--glow); /* shadow only — never a colored border */
  }
}
/* Pattern §1: bottom scrim keeps chips and bars legible over any artwork */
.poster__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgb(10 12 16 / 0.6) 100%);
}
.poster__badge {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100% - 16px);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster__badge--device {
  background: rgb(10 12 16 / 0.72);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgb(79 140 255 / 0.55);
}
.poster__badge--local {
  background: rgb(10 12 16 / 0.72);
  color: var(--success);
}
.poster__dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--success);
}
.poster__progress {
  position: absolute;
  z-index: 1;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 3px;
  border-radius: var(--r-pill);
  background: rgb(245 247 250 / 0.25);
  overflow: hidden;
}
.poster__progress-fill {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  border-radius: inherit;
  background: var(--text); /* neutral resume marker… */
}
.poster--anime .poster__progress-fill {
  background: var(--anime); /* …violet is for anime only */
}
.poster__title {
  margin: var(--s-3) 0 0;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster__meta {
  margin: 2px 0 0;
  color: var(--text-3);
  font-size: var(--fs-caption);
}
[data-progress="18"] { --p: 18%; }
[data-progress="37"] { --p: 37%; }
[data-progress="62"] { --p: 62%; }
[data-progress="74"] { --p: 74%; }
[data-progress="86"] { --p: 86%; }
[data-progress="91"] { --p: 91%; }

/* Poster artwork: abstract, generated — illustrative titles, no studio art */
.art-1 { background: radial-gradient(120% 70% at 30% 20%, #3a5bd9 0%, transparent 60%), radial-gradient(90% 60% at 80% 90%, #1d2b5e 0%, transparent 70%), #0d1224; }
.art-2 { background: radial-gradient(80% 50% at 70% 30%, #e5a53b 0%, transparent 55%), linear-gradient(170deg, #3b2412 0%, #120b07 70%); }
.art-3 { background: radial-gradient(70% 45% at 50% 35%, #b36cff 0%, transparent 60%), radial-gradient(100% 60% at 20% 100%, #2b1a52 0%, transparent 70%), #110a20; }
.art-4 { background: radial-gradient(110% 60% at 20% 80%, #35c28e 0%, transparent 55%), linear-gradient(200deg, #0e2a25 0%, #07110f 80%); }
.art-5 { background: radial-gradient(90% 55% at 75% 25%, #ff5c66 0%, transparent 55%), linear-gradient(160deg, #2a0f18 0%, #0c0508 80%); }
.art-6 { background: radial-gradient(100% 60% at 40% 30%, #8fb3ff 0%, transparent 50%), linear-gradient(180deg, #1b2438 0%, #0a0d15 80%); }

/* ── Two columns: what travels, what stays ──────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
.panel {
  padding: var(--s-6);
  border-radius: var(--r-frame);
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.panel__size {
  margin: 0;
  font-size: clamp(2.25rem, 1.8rem + 2vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}
.panel__size--travels { color: var(--accent); }
.panel__size--stays { color: var(--text); }
.panel__title {
  margin: var(--s-3) 0 0;
  font-size: var(--fs-h3);
  font-weight: 600;
}
.panel__list {
  margin: var(--s-4) 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
}
.panel__list li {
  position: relative;
  padding: var(--s-2) 0 var(--s-2) var(--s-5);
  border-top: 1px solid var(--hairline);
}
.panel__list li:first-child { border-top: 0; }
.panel__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.05em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px currentColor;
}
.panel--travels .panel__list li::before { color: var(--accent); }
.panel--stays .panel__list li::before { color: var(--text-3); }

.routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
  margin: var(--s-6) 0 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 860px) {
  .routes { grid-template-columns: minmax(0, 1fr); }
}
.route {
  padding: var(--s-5);
  border-radius: var(--r-card);
  background: var(--card);
}
.route__label {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.route__text {
  margin: var(--s-2) 0 0;
  color: var(--text-2);
  font-size: var(--fs-small);
}
.route__text strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Steps (a real sequence, so it is numbered) ─────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
@media (max-width: 860px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
}
.step {
  counter-increment: step;
  padding-top: var(--s-5);
  border-top: 2px solid var(--hairline);
}
.step:last-child {
  border-top-color: var(--accent);
}
.step::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-bottom: var(--s-4);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-2);
  font-size: var(--fs-small);
  font-weight: 600;
}
.step:last-child::before {
  background: var(--accent);
  color: var(--on-accent);
}
.step__title {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.step__text {
  margin: var(--s-2) 0 0;
  color: var(--text-2);
}

/* ── Feature cards ──────────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .features { grid-template-columns: minmax(0, 1fr); }
}
.feature {
  padding: var(--s-5);
  border-radius: var(--r-card);
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.feature__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: rgb(79 140 255 / 0.14);
  color: var(--accent);
}
.feature__icon--anime {
  background: rgb(179 108 255 / 0.14);
  color: var(--anime);
}
.feature__icon svg {
  width: 20px;
  height: 20px;
}
.feature__title {
  margin: var(--s-4) 0 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.feature__text {
  margin: var(--s-2) 0 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}

/* ── Platforms ──────────────────────────────────────────────────────────── */
.platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 860px) {
  .platforms { grid-template-columns: minmax(0, 1fr); }
}
.platform {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  padding: var(--s-5);
  border-radius: var(--r-card);
  background: var(--card);
}
.platform__icon {
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--text-2);
}
.platform__name {
  margin: 0;
  font-weight: 600;
}
.platform__role {
  margin: var(--s-1) 0 0;
  color: var(--text-2);
  font-size: var(--fs-small);
}
.platform__store {
  display: inline-block;
  margin: var(--s-3) 0 0;
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
}
a.platform__store:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.platform__store--soon {
  color: var(--text-3);
}

/* ── Support ────────────────────────────────────────────────────────────── */
.support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-5);
}
.support__note {
  flex: 1 1 18rem;
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-small);
}

/* ── Privacy callout (home) ─────────────────────────────────────────────── */
.callout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  align-items: center;
  gap: var(--s-6);
  padding: var(--s-7);
  border-radius: var(--r-frame);
  background:
    radial-gradient(60% 120% at 100% 0%, rgb(79 140 255 / 0.18) 0%, transparent 60%),
    var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
@media (max-width: 760px) {
  .callout {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--s-6) var(--s-5);
  }
}
.callout__title {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.callout__text {
  margin: var(--s-3) 0 0;
  color: var(--text-2);
  max-width: 40rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  padding-block: var(--s-7);
  border-top: 1px solid var(--hairline);
  color: var(--text-3);
  font-size: var(--fs-small);
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer__links a {
  color: var(--text-2);
  text-decoration: none;
}
.site-footer__links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer__attribution {
  margin: var(--s-5) 0 0;
  font-size: var(--fs-caption);
}

/* ── Legal document (privacy) ───────────────────────────────────────────── */
.doc-hero {
  padding-block: var(--s-8) var(--s-6);
}
.doc-hero__title {
  margin: 0;
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.doc-hero__meta {
  margin: var(--s-4) 0 0;
  color: var(--text-3);
  font-size: var(--fs-small);
}

.doc {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: var(--s-8);
  align-items: start;
  padding-bottom: var(--s-9);
}
@media (max-width: 960px) {
  .doc {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
  }
}
.toc {
  position: sticky;
  top: 5.5rem;
}
@media (max-width: 960px) {
  .toc {
    position: static;
    padding: var(--s-5);
    border-radius: var(--r-card);
    background: var(--bg-elevated);
  }
}
.toc__label {
  margin: 0 0 var(--s-3);
  color: var(--text-3);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--hairline);
}
.toc__list a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px var(--s-4);
  border-left: 2px solid transparent;
  color: var(--text-2);
  font-size: var(--fs-small);
  line-height: 1.4;
  text-decoration: none;
}
.toc__list a:hover {
  color: var(--text);
}
.toc__list a[aria-current="true"] {
  color: var(--text);
  border-left-color: var(--accent);
}

.prose {
  max-width: 44rem;
  color: var(--text-2);
}
.prose h2 {
  margin: var(--s-8) 0 0;
  padding-top: var(--s-2);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  scroll-margin-top: 5.5rem;
}
.prose h3 {
  margin: var(--s-6) 0 0;
  color: var(--text);
  font-size: var(--fs-h3);
  font-weight: 600;
}
.prose p,
.prose ul {
  margin: var(--s-3) 0 0;
}
.prose ul {
  padding-left: 1.25rem;
}
.prose li + li {
  margin-top: var(--s-2);
}
.prose li::marker {
  color: var(--text-3);
}
.prose strong {
  color: var(--text);
  font-weight: 600;
}
.prose a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.prose a:hover {
  color: #8fb3ff;
}
.prose code {
  padding: 1px 6px;
  border-radius: var(--r-chip);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8125em;
}

.summary {
  padding: var(--s-6);
  border-radius: var(--r-frame);
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
/* Scoped under .prose: the summary sits inside the article, and the generic
   .prose h2 / ul / li rules would otherwise out-rank these. */
.prose .summary__title {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: 0;
}
.prose .summary__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4) var(--s-6);
  margin: var(--s-5) 0 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 640px) {
  .prose .summary__list { grid-template-columns: minmax(0, 1fr); }
}
.prose .summary__list li {
  position: relative;
  margin: 0;
  padding-left: var(--s-6);
  font-size: 0.9375rem;
}
.summary__list svg {
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  color: var(--success);
}

.table-scroll {
  margin: var(--s-4) 0 0;
  overflow-x: auto;
  border-radius: var(--r-card);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: var(--fs-small);
}
.table caption {
  padding: var(--s-3) var(--s-4);
  color: var(--text-3);
  font-size: var(--fs-caption);
  text-align: left;
}
.table th,
.table td {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}
.table thead th {
  background: var(--bg-elevated);
  color: var(--text-3);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.table tbody th {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.note {
  margin: var(--s-4) 0 0;
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--text-2);
}

/* ── 404 ────────────────────────────────────────────────────────────────── */
.lost {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 4rem);
  min-height: calc(100dvh - 4rem);
  padding-block: var(--s-8);
  text-align: center;
}
.lost__time {
  margin: 0;
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.lost__title {
  margin: var(--s-3) 0 0;
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.lost__text {
  max-width: 28rem;
  margin: var(--s-3) auto 0;
  color: var(--text-2);
}
.lost__bar {
  position: relative;
  width: min(22rem, 100%);
  height: 4px;
  margin: var(--s-6) auto 0;
  border-radius: var(--r-pill);
  background: var(--hairline);
}
.lost__bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40.4%;
  border-radius: inherit;
  background: var(--text);
}
.lost__bar::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 40.4%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
}
.lost__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .poster:hover .poster__art { transform: none; }
}
