/* ---- /assets/core/fonts.css ---- */
/* Self-hosted, latin-subset variable fonts. 2 files total, swap, no layout shift. */
@layer tokens {
  @font-face {
    font-family: "Inter";
    src: url("./fonts/inter-var.woff2") format("woff2-variations"),
         url("./fonts/inter-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }

  @font-face {
    font-family: "Manrope";
    src: url("./fonts/manrope-var.woff2") format("woff2-variations"),
         url("./fonts/manrope-var.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
      U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
      U+2212, U+2215, U+FEFF, U+FFFD;
  }
}

/* ---- /assets/core/tokens.css ---- */
/* ==========================================================================
   MovieState — design tokens · "Obsidian & Signal"
   Single source of truth. Nothing outside this file may hard-code a colour,
   radius, shadow, spacing step or duration. PRD §5.
   ========================================================================== */

/* --- One @layer order for the whole site ---------------------------------- */
@layer tokens, reset, base, layout, components, pages, utilities;

@layer tokens {
  :root {
    /* Type ---------------------------------------------------------------- */
    --font-display: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* Desktop/global type scale (mobile overrides live in base.css) -------- */
    --fs-3xl: 32px;
    --fs-2xl: 26px;
    --fs-xl: 20px;
    --fs-lg: 17px;
    --fs-md: 15px;
    --fs-sm: 13.5px;
    --fs-xs: 12.5px;

    --lh-tight: 1.15;
    --lh-snug: 1.35;
    --lh-copy: 1.8;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 800;

    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.08em;

    /* Spacing -------------------------------------------------------------- */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-7: 48px;
    --sp-8: 64px;

    /* Radii ---------------------------------------------------------------- */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    /* Motion --------------------------------------------------------------- */
    /* A31: tokens that components already referenced but nobody had defined — their absence silently
       dropped whole declarations (no border, no shadow), which is how the action buttons lost their
       surface. Defined once here so a missing token can never erase a style again. */
    --r-xs: 6px;
    --maxw: var(--container);
    --card-radius: var(--r-md);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.35);
    --font-body: var(--font-ui);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --dur-hover: 180ms;
    --dur-panel: 320ms;
    --dur-fade: 180ms;
    --dur-tap: 96ms;

    /* Layout --------------------------------------------------------------- */
    --container: 1754px;
    --gutter: 32px;
    --header-h: 56px;
    /* the sticky pill bar parks directly under the header, safe-area included */
    --hdr: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    --rail-w: 72px;
    --tabbar-h: 56px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
    --safe-t: env(safe-area-inset-top, 0px);

    /* Layers --------------------------------------------------------------- */
    --z-rail: 20;
    --z-header: 40;
    --z-tabbar: 45;
    --z-sheet: 60;
    --z-modal: 70;
    --z-toast: 80;
    --z-boot: 90;

    /* Focus ---------------------------------------------------------------- */
    --ring-w: 2px;
    --ring-offset: 2px;

    /* Motion keyframes shared by the shimmer language --------------------- */
    --shimmer-dur: 1.4s;
  }

  /* ====================== DARK — the default canvas ====================== */
  :root,
  :root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #06070a;
    --bg-2: #0c0e13;
    --surface: #111419;
    --surface-2: #171b22;
    --surface-3: #1e242c;
    --card: #12161c;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);

    --txt: #f2f5f8;
    --txt-2: #a7b0bc;
    --txt-3: #7a8391;   /* 13.7 — was #6b7483: 4.27:1 on #06070a, under WCAG AA. Now 5.26:1 */

    --accent: #ff3b4e;
    --accent-ink: #1a0407;
    --accent-soft: rgba(255, 59, 78, 0.14);
    --accent-ring: rgba(255, 59, 78, 0.45);

    --mint: #2dfc9c;
    --mint-ink: #04231a;
    --mint-soft: rgba(45, 252, 156, 0.14);

    --violet: #7c5cff;
    --violet-soft: rgba(124, 92, 255, 0.16);

    --gold: #f5c151;
    --gold-soft: rgba(245, 193, 81, 0.14);

    --danger: #ff5a5a;
    --ok: var(--mint);
    --warn: var(--gold);

    --scrim: linear-gradient(180deg, rgba(6, 7, 10, 0) 0%, rgba(6, 7, 10, 0.55) 45%, rgba(6, 7, 10, 0.94) 100%);
    --spotlight: radial-gradient(60% 50% at 50% 0%, rgba(255, 59, 78, 0.16) 0%, rgba(124, 92, 255, 0.08) 42%, rgba(6, 7, 10, 0) 72%);
    --glass: rgba(12, 14, 19, 0.72);
    --inner-stroke: inset 0 1px 0 rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45), 0 24px 64px rgba(0, 0, 0, 0.5);

    --grain-opacity: 0.02;
    --img-plate: linear-gradient(135deg, #1a1f27 0%, #12161c 100%);
  }

  /* ====================== LIGHT — warm paper ============================= */
  :root[data-theme="light"] {
    color-scheme: light;

    --bg: #f6f6f9;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f2f7;
    --surface-3: #e7e9f0;
    --card: #ffffff;
    --line: rgba(12, 12, 28, 0.1);
    --line-strong: rgba(12, 12, 28, 0.18);

    --txt: #101019;
    --txt-2: #4a4e5e;
    --txt-3: #686d7b;   /* 13.7 — was #787c8c: 3.85:1 on #f6f6f9, under WCAG AA. Now 4.79:1 */

    --accent: #d4061b;
    --accent-ink: #ffffff;
    --accent-text: #d41200;           /* accent-as-text on paper: 5.4:1 (the fill red is only 4.4:1) */
    --accent-soft: rgba(212, 6, 27, 0.1);
    --accent-ring: rgba(212, 6, 27, 0.4);

    --mint: #0b8f5e;
    --mint-ink: #ffffff;
    --mint-soft: rgba(11, 143, 94, 0.12);

    --violet: #5b32e8;
    --violet-soft: rgba(91, 50, 232, 0.1);

    --gold: #a66a00;
    --gold-soft: rgba(166, 106, 0, 0.12);

    --danger: #c1121f;
    --ok: var(--mint);
    --warn: var(--gold);

    --scrim: linear-gradient(180deg, rgba(246, 246, 249, 0) 0%, rgba(246, 246, 249, 0.6) 45%, rgba(246, 246, 249, 0.96) 100%);
    --spotlight: radial-gradient(60% 50% at 50% 0%, rgba(212, 6, 27, 0.1) 0%, rgba(91, 50, 232, 0.06) 42%, rgba(246, 246, 249, 0) 72%);
    --glass: rgba(255, 255, 255, 0.78);
    --inner-stroke: inset 0 1px 0 rgba(255, 255, 255, 0.9);

    --shadow-sm: 0 1px 2px rgba(16, 16, 25, 0.06), 0 2px 8px rgba(16, 16, 25, 0.06);
    --shadow-lg: 0 8px 24px rgba(16, 16, 25, 0.1), 0 24px 64px rgba(16, 16, 25, 0.12);

    --grain-opacity: 0;
    --img-plate: linear-gradient(135deg, #e7e9f0 0%, #f1f2f7 100%);
  }

  /* --- Gutter rhythm (PRD §5: 16 / 24 / 32) ------------------------------ */
  @media (max-width: 767px) {
    :root { --gutter: 16px; }
  }
  @media (min-width: 768px) and (max-width: 1023px) {
    :root { --gutter: 24px; }
  }
}

/* ==========================================================================
   Identity layer — amendment A9 (owner, 16 Nov 2026)
   Black + red is the common language; the *special* is a cool acid lime that no
   streaming brand owns, used only where it means something (active marker, rating,
   "new" badge). Never as body text on light — on paper it is a fill with ink text.
   ========================================================================== */
@layer tokens {
  :root,
  :root[data-theme="dark"] {
    --accent-2: #c8f751;          /* acid lime — the signature */
    --accent-2-ink: #10160a;      /* text that sits on the lime */
    --accent-2-soft: rgba(200, 247, 81, 0.14);
    --accent-2-line: rgba(200, 247, 81, 0.42);
    --header-glass: rgba(8, 9, 12, 0.72);
    --tabbar-glass: rgba(10, 11, 15, 0.86);
    --drawer-bg: #0b0d12;
    --backdrop: rgba(3, 4, 6, 0.62);
  }
  :root[data-theme="light"] {
    --accent-2: #6f8a00;          /* same hue, pushed to readable contrast on paper */
    --accent-2-ink: #ffffff;
    --accent-2-soft: rgba(111, 138, 0, 0.12);
    --accent-2-line: rgba(111, 138, 0, 0.34);
    --header-glass: rgba(250, 250, 253, 0.82);
    --tabbar-glass: rgba(255, 255, 255, 0.92);
    --drawer-bg: #ffffff;
    --backdrop: rgba(10, 12, 24, 0.38);
  }
}

/* ==========================================================================
   Identity v2 — amendment A10 (owner, 22:24, 16 Nov 2026)
   "Black + red is far too common." So each theme gets its own pairing:
     dark  canvas #06070A  ×  accent #A2FF00 (acid green)
     light canvas #FFFFFF  ×  accent #FF1900 (signal red)
   Both keep a two-colour signal system: --accent leads (buttons, active marker,
   brand), --accent-2 is the counter-signal (LIVE dot, NEW tag) so the palette never
   reads as one flat hue. Ink on accent is always chosen for a real contrast ratio.
   ========================================================================== */
@layer tokens {
  :root,
  :root[data-theme="dark"] {
    /* solid chrome: the top bar, the tab bar and the pill bar are OPAQUE. A translucent
       bar over posters read as "broken/transparent" on a real phone (Devid, 17 Nov). */
    --chrome-bg: #06070a;
    --chrome-line: rgba(255, 255, 255, 0.09);
    --chrome-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.9);
    --line-2: rgba(255, 255, 255, 0.12);
    --accent-glow: rgba(162, 255, 0, 0.3);

    --accent: #a2ff00;                /* the brand hue — indicators, rules, dots */
    --accent-solid: #a2ff00;          /* the fill used behind ink (15.1:1 with #08130A) */
    --accent-ink: #08130a;            /* near-black text on the acid green */
    --accent-text: #a2ff00;           /* accent colour used AS text: 16.1:1 on the canvas */
    --accent-soft: rgba(162, 255, 0, 0.12);
    --accent-ring: rgba(162, 255, 0, 0.5);
    --accent-2: #ff2d46;              /* counter-signal: LIVE, NEW, alerts */
    --accent-2-ink: #ffffff;
    --accent-2-soft: rgba(255, 45, 70, 0.16);
    --accent-2-line: rgba(255, 45, 70, 0.45);
    --spotlight: radial-gradient(60% 50% at 50% 0%, rgba(162, 255, 0, 0.13) 0%, rgba(162, 255, 0, 0.04) 45%, rgba(6, 7, 10, 0) 72%);
  }
  :root[data-theme="light"] {
    --chrome-bg: #ffffff;
    --chrome-line: rgba(12, 12, 28, 0.1);
    --chrome-shadow: 0 10px 30px -18px rgba(16, 16, 25, 0.28);
    --line-2: rgba(12, 12, 28, 0.16);
    --accent-glow: rgba(230, 18, 0, 0.28);

    --accent: #ff1900;                /* the owner's exact signal red — non-text roles */
    --accent-solid: #e61200;          /* same hue, one step deeper: white ink now clears AA (4.65:1) */
    --accent-ink: #ffffff;
    --accent-text: #d41200;           /* accent-as-text on paper: 5.4:1 (the fill red is only 4.4:1) */
    --accent-soft: rgba(255, 25, 0, 0.09);
    --accent-ring: rgba(255, 25, 0, 0.38);
    --accent-2: #5f7a00;              /* readable olive-lime for tags on paper */
    --accent-2-ink: #ffffff;
    --accent-2-soft: rgba(95, 122, 0, 0.12);
    --accent-2-line: rgba(95, 122, 0, 0.34);
    --spotlight: radial-gradient(60% 50% at 50% 0%, rgba(255, 25, 0, 0.07) 0%, rgba(255, 25, 0, 0.02) 45%, rgba(255, 255, 255, 0) 72%);
  }
}

/* ---- /assets/core/base.css ---- */
/* ==========================================================================
   MovieState — reset + base typography + global primitives
   Mobile is the primary canvas (PRD §5.1): every size below is tuned on 390px
   first, then widened. No component styling lives here.
   ========================================================================== */

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

  * { margin: 0; }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
    -webkit-tap-highlight-color: transparent;
  }

  body {
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background: var(--bg);
    color: var(--txt);
    font-family: var(--font-ui);
    font-size: var(--fs-md);
    line-height: var(--lh-snug);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    overscroll-behavior-y: none;
  }

  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  img, video { height: auto; background: var(--img-plate); }
  svg { fill: currentColor; }

  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }

  a { color: inherit; text-decoration: none; }

  ul, ol { list-style: none; padding: 0; }

  table { border-collapse: collapse; width: 100%; }

  :where(h1, h2, h3, h4, h5, h6) {
    font-family: var(--font-display);
    font-weight: var(--fw-black);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
  }

  p { text-wrap: pretty; }

  /* Keyboard focus is always visible, never on mouse click (PRD §5). */
  :focus { outline: none; }
  :focus-visible {
    outline: var(--ring-w) solid var(--accent);
    outline-offset: var(--ring-offset);
    border-radius: var(--r-sm);
  }

  ::selection {
    /* A10 rule: a fill that carries text uses --accent-solid, so white stays at 4.72:1 in light */
    background: var(--accent-solid);
    color: var(--accent-ink);
  }

  /* Scrollbars: dark-aware, unobtrusive, never a layout jump. */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
  }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: var(--r-pill);
    border: 3px solid var(--bg);
  }
  *::-webkit-scrollbar-thumb:hover { background: var(--txt-3); }
}

@layer base {
  /* ---- Type scale: mobile 28/22/18/16/14/12.5 → desktop 32/26/20/17/15/13.5 */
  h1, .t-3xl {
    font-size: clamp(28px, 1.2vw + 24px, var(--fs-3xl));
  }
  h2, .t-2xl {
    font-size: clamp(22px, 0.9vw + 19px, var(--fs-2xl));
  }
  h3, .t-xl {
    font-size: clamp(18px, 0.5vw + 16px, var(--fs-xl));
  }
  h4, .t-lg {
    font-size: clamp(16px, 0.35vw + 15px, var(--fs-lg));
    font-weight: var(--fw-bold);
    letter-spacing: var(--tracking-normal);
  }
  body, .t-md { font-size: clamp(15px, 0.2vw + 14.5px, var(--fs-md)); }
  .t-sm { font-size: clamp(14px, 0.2vw + 13.5px, var(--fs-sm)); }
  .t-xs { font-size: var(--fs-xs); }

  .t-copy { line-height: var(--lh-copy); }
  .t-muted { color: var(--txt-2); }
  .t-faint { color: var(--txt-3); }
  .t-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .t-eyebrow {
    font-family: var(--font-ui);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--txt-3);
  }
  .t-num { font-variant-numeric: tabular-nums; }

  /* ---- Layout primitives ------------------------------------------------ */
  .container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }
  .container-wide { max-width: none; }

  .stack { display: flex; flex-direction: column; }
  .row { display: flex; align-items: center; }
  .row-between { display: flex; align-items: center; justify-content: space-between; }
  .row-gap-2 { gap: var(--sp-2); }
  .row-gap-3 { gap: var(--sp-3); }
  .row-gap-4 { gap: var(--sp-4); }

  /* ---- Surface primitives (no component may re-invent these) ------------ */
  .surface {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm), var(--inner-stroke);
  }
  .hairline { border-top: 1px solid var(--line); }

  .scrim-bottom { background: var(--scrim); }

  /* Signature: radial spotlight wash behind the hero only (PRD §5).
     `overflow: clip` keeps the bleed from creating horizontal scroll. Rule: a .spotlight
     container never wraps a sticky/fixed bar, so clipping stays invisible. */
  .spotlight { position: relative; isolation: isolate; overflow: clip; }
  .spotlight::before {
    content: "";
    position: absolute;
    inset: -10% -20% auto -20%;
    height: min(680px, 70vw);
    background: var(--spotlight);
    z-index: -1;
    pointer-events: none;
  }

  /* Signature: film grain, dark mode only, 2% (token-driven). */
  .grain { position: relative; }
  .grain::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    z-index: 1;
  }

  /* ---- Shimmer skeleton language (one site-wide, PRD §5) ---------------- */
  .skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: var(--r-md);
    color: transparent;
  }
  .skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: ms-shimmer var(--shimmer-dur) var(--ease) infinite;
  }
  @keyframes ms-shimmer { to { transform: translateX(100%); } }

  /* ---- Touch contract: 44px floor (PRD §5.1.2) -------------------------- */
  .tap {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ---- Utilities -------------------------------------------------------- */
  .sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: var(--z-toast);
    /* A10 rule: a fill that carries text uses --accent-solid, so white stays at 4.72:1 in light */
    background: var(--accent-solid);
    color: var(--accent-ink);
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--r-md);
    font-weight: var(--fw-semibold);
    transition: top var(--dur-hover) var(--ease);
  }
  .skip-link:focus-visible { top: calc(var(--safe-t) + 8px); }

  .no-scroll { overflow: hidden; }

  .fade-in { animation: ms-fade calc(var(--dur-fade) * 2) var(--ease) both; }
  @keyframes ms-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  /* ---- Reduced motion: keep opacity, drop transforms (PRD §5) ---------- */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .skeleton::after { animation: none; opacity: 0.35; }
  }

  /* ---- Print: nothing but the words ----------------------------------- */
  @media print {
    body { background: #fff; color: #000; }
    .skeleton::after, .grain::after, .spotlight::before { display: none; }
  }
}

/* ==========================================================================
   P11 — mobile safety net. Every surface already lays itself out with grid and
   clamp(), so this block only covers the three things that break a page on a
   360px phone regardless of layout: media wider than its container, a long
   unbroken word (a title like "Don't Look Now…" or a URL), and a table.
   ========================================================================== */
img, svg, video, iframe, canvas, picture { max-width: 100%; }
iframe { border: 0; }
h1, h2, h3, h4, .card__title, .dt-title { overflow-wrap: anywhere; }
table { max-width: 100%; }

/* a scroll container is the correct answer for a wide table, never a squeezed one */
.ms-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* ── Ad containers ────────────────────────────────────────────────────────────────────────────────
   Devid's rule, and the last word on it: an ad renders exactly as the network's own code says. No scaling, no
   clipping, no forced height, and no scroll box either. The slot is a plain block that gives the banner its
   space and otherwise stays out of the way. */
ms-slot {
  display: block;
  max-width: 100%;
  margin-block: 18px;
  margin-inline: auto;
}
ms-slot:empty { display: none; }
ms-slot iframe { border: 0; }
ms-slot img { display: block; }

/* ---- /assets/core/nav-feedback.css ---- */
/* ==========================================================================
   P11 — Navigation feedback.

   The site is a multi-page app on a static host: a click means a real document
   request, and on a phone that is 300-900 ms of nothing. Before this sheet the
   page changed colour under the cursor and then sat still, so a visitor pressed
   again, or thought the button was broken. Now every navigation answers within
   one frame: a brand-coloured progress bar, the page dims, and the control that
   was pressed shows a busy state. All of it is removed by the new document.
   ========================================================================== */

html[data-nav="1"]::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 2147483000;
  background: linear-gradient(90deg, var(--accent-solid), var(--mint), var(--accent-solid));
  background-size: 220% 100%;
  animation: msNavBar 1.15s linear infinite;
  pointer-events: none;
}

html[data-nav="1"]::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2147482999;
  background: var(--accent-soft);
  pointer-events: none;
}

@keyframes msNavBar {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

/* the page that is being left recedes instead of vanishing: no flash of white, no sudden jump */
html[data-nav="1"] body {
  opacity: .62;
  transition: opacity .16s var(--ease, ease);
  cursor: progress;
}

/* the control the visitor actually pressed */
.is-busy {
  position: relative;
  cursor: progress !important;
  opacity: .72;
}

a.is-busy::after,
button.is-busy::after {
  content: "";
  position: absolute;
  inset: auto 6px 6px auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent-solid);
  border-right-color: transparent;
  animation: msBusySpin .7s linear infinite;
}

@keyframes msBusySpin { to { transform: rotate(360deg); } }

/* Posters fade in once decoded, so a grid never pops into place row by row.
   They are visible by default on purpose: a poster must never depend on JavaScript having run. If the
   script is blocked, slow or broken, the artwork still shows; the class only adds the entrance. */
.card__img { opacity: 1; }

.card__img.is-loaded { animation: msImgIn .3s var(--ease, ease) both; }

@keyframes msImgIn {
  from { opacity: .35; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-nav="1"]::before { animation: none; background: var(--accent-solid); }
  html[data-nav="1"] body { opacity: 1; }
  .card__img { opacity: 1; }
  a.is-busy::after, button.is-busy::after { animation: none; }
}

/* ---------- the feed answers a chip in the same frame ---------- */
@keyframes msCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* a skeleton card occupies the same box as a real card, so the grid never jumps height */
.card--sk { pointer-events: none; }
.card--sk .card__title,
.card--sk .card__meta { display: block; }

/* while a genre is loading, the chips stop accepting taps: one press, one result */
.chip-row[aria-busy="true"] .chip { opacity: .55; pointer-events: none; }
.chip-row[aria-busy="true"] { cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .card { animation: none !important; }
}

/* a freshly swapped grid enters as one movement */
.card--enter { animation: msCardIn .3s ease both; }
@media (prefers-reduced-motion: reduce) { .card--enter { animation: none; } }

/* ---- /assets/pages/boot.css ---- */
/* Phase 0 boot page — proves tokens, type, deployment. Not the product design. */
@layer pages {
  body { display: flex; flex-direction: column; min-height: 100dvh; }

  .boot-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: var(--glass);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line);
  }
  .boot-brand { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; }
  .boot-mark { width: 26px; height: 26px; color: var(--txt); }
  .boot-wordmark {
    font-family: var(--font-display);
    font-weight: var(--fw-black);
    letter-spacing: var(--tracking-tight);
    font-size: 17px;
  }
  .boot-theme {
    color: var(--txt-2);
    border-radius: var(--r-pill);
    font-size: 18px;
  }
  .boot-theme:hover { color: var(--txt); background: var(--surface-2); }

  .boot-main { flex: 1; padding-top: var(--sp-7); padding-bottom: var(--sp-8); }
  .boot-title { margin-top: var(--sp-3); font-size: clamp(30px, 4vw, 44px); }
  .boot-lead { margin-top: var(--sp-3); max-width: 56ch; }

  .boot-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    margin-top: var(--sp-6);
  }
  @media (min-width: 640px) { .boot-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 1024px) { .boot-grid { grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); } }

  .boot-card { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
  .boot-card p { margin: 0; }
  .boot-accent { color: var(--accent); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
  .boot-live { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--mint); font-weight: var(--fw-semibold); }
  .boot-dot {
    width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--mint);
    box-shadow: 0 0 0 0 var(--mint);
    animation: boot-pulse 1.8s var(--ease) infinite;
  }
  @keyframes boot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(45, 252, 156, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(45, 252, 156, 0); }
  }
  .boot-bar { height: 12px; width: 70%; }

  .boot-footer { border-top: 1px solid var(--line); padding-block: var(--sp-4); }
  .boot-footer-inner { gap: var(--sp-3); flex-wrap: wrap; }
  .boot-footer p { margin: 0; }
}

@layer pages {
  .boot-data { padding-bottom: var(--sp-8); }
  .boot-data-head { gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end; }
  .boot-data h2 { margin-top: var(--sp-2); }
  .boot-data-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
  .boot-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 var(--sp-4);
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--txt);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    transition: background var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), transform var(--dur-tap) var(--ease);
  }
  .boot-btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
  .boot-btn:active { transform: scale(0.98); }

  .boot-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-4); }
  .boot-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--fs-xs); font-weight: var(--fw-semibold);
    color: var(--txt-2);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 5px 10px;
    font-variant-numeric: tabular-nums;
  }
  .boot-chip.is-good { color: var(--mint); border-color: color-mix(in oklab, var(--mint) 40%, transparent); }
  .boot-chip.is-bad { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, transparent); }

  #probeNote { margin-top: var(--sp-2); min-height: 1.2em; }

  .boot-posters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
    margin-top: var(--sp-4);
  }
  @media (min-width: 480px) { .boot-posters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  @media (min-width: 768px) { .boot-posters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); } }
  @media (min-width: 1200px) { .boot-posters { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

  .boot-poster { min-width: 0; }
  .boot-poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--img-plate);
    border: 1px solid var(--line);
  }
  .boot-poster-link img { width: 100%; height: 100%; object-fit: cover; }
  .boot-poster-plate { display: block; width: 100%; height: 100%; }
  .boot-poster-rate {
    position: absolute; top: 8px; right: 8px;
    font-size: var(--fs-xs); font-weight: var(--fw-bold);
    color: var(--gold);
    background: rgba(6, 7, 10, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 2px 7px;
    backdrop-filter: blur(6px);
    font-variant-numeric: tabular-nums;
  }
  .boot-poster-title {
    margin-top: var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .boot-poster-meta { margin-top: 2px; color: var(--txt-2); text-transform: capitalize; }
}

/* ---- /assets/pages/route.css ---- */
/* Phase 0 route stub. Replaced by the real per-route page CSS in later phases. */
@layer pages {
  .route-nav { display: none; gap: var(--sp-1); align-items: center; }
  @media (min-width: 720px) { .route-nav { display: flex; } }
  .route-nav-link {
    display: inline-flex; align-items: center; min-height: 44px;
    padding: 0 var(--sp-3);
    border-radius: var(--r-pill);
    color: var(--txt-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
  }
  .route-nav-link:hover { color: var(--txt); background: var(--surface-2); }

  .route-main { padding-top: var(--sp-7); padding-bottom: var(--sp-8); flex: 1; }
  .route-title { margin-top: var(--sp-3); font-size: clamp(28px, 4vw, 40px); }
  .route-main code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
    color: var(--txt);
    background: var(--surface-2);
    border-radius: var(--r-sm);
    padding: 1px 6px;
  }

  .route-facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-2);
    margin-top: var(--sp-6);
  }
  @media (min-width: 640px) { .route-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .route-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

  .route-fact {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-4);
    min-width: 0;
  }
  .route-fact dt {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--txt-2);
  }
  .route-fact dd {
    margin: var(--sp-1) 0 0;
    font-size: var(--fs-sm);
    color: var(--txt);
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
  }
}

/* Phase 0 admin auth card (replaced by the real panel in Phase 9). */
@layer pages {
  .admin-grid { display: grid; gap: var(--sp-4); margin-top: var(--sp-6); max-width: 520px; }
  .admin-card { padding: var(--sp-5); display: grid; gap: var(--sp-3); }
  .admin-h2 { font-size: var(--fs-lg); }
  .admin-h3 { font-size: var(--fs-sm); color: var(--txt-2); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
  .admin-label { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: var(--fw-Medium, 500); color: var(--txt-2); }
  .admin-input {
    min-height: 44px; padding: 0 var(--sp-3);
    background: var(--surface-2); color: var(--txt);
    border: 1px solid var(--line); border-radius: var(--r-sm);
    font: inherit; font-size: var(--fs-sm);
  }
  .admin-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .admin-submit { justify-self: start; }
  .admin-sub { display: grid; gap: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
  .admin-msg { font-size: var(--fs-sm); color: var(--ok, #34D399); min-height: 1.2em; }
  .admin-msg[data-bad="1"] { color: var(--signal, #FF3B4E); }
}

/* Step 13.7 — the A–Z directory had no styling of its own: inline links 18px tall failed WCAG 2.2 target size (24px)
   and read as a wall of text. It is now a real two/four-column index with a 32px hit area and a hover plate. */
.brw-list { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }
.brw-list li { min-width: 0; }
.brw-list a { display: flex; align-items: center; min-height: 32px; padding: 4px 8px; border-radius: 8px; color: var(--txt-2); font-size: 14px; line-height: 1.3; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background .16s, color .16s; }
.brw-list a:hover, .brw-list a:focus-visible { background: var(--accent-soft); color: var(--accent-text); }
@media (min-width: 900px) { .brw-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 20px; } }

/* Step 13.7 — the A–Z year jump bar was plain 19px-tall inline links, under the 24px target size WCAG 2.2 asks for */
.brw-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 26px; }
.brw-year { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--txt-2); font-size: 13px; font-weight: 600; text-decoration: none; transition: border-color .16s, color .16s, background .16s; }
.brw-year:hover, .brw-year:focus-visible { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

/* ---- /assets/pages/shell.css ---- */
/* ==========================================================================
   Site chrome — top bar, mobile tab bar, menu drawer (amendment A9)
   Public chrome carries NO account affordances. Admin lives at /admin/ only.
   Mobile-first: the tab bar and drawer are the primary navigation under 1024px.
   ========================================================================== */
@layer layout {
  .site-header {
    position: sticky; top: 0; z-index: var(--z-header);
    /* A42: the page's own edge wears the brand hue, so the strip directly under the browser
       bar reads as one continuous surface with it (the browser strip itself is browser-owned). */

    /* Solid, not glass. On Android Chrome the translucent header let posters run under the
       brand and made the icons look washed out; the theme's canvas is the right answer. */
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--chrome-line);
    box-shadow: var(--chrome-shadow);
    padding-top: var(--safe-t);
  }
  .site-header::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: var(--accent); pointer-events: none;
  }
  .site-header__inner {
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: var(--header-h); max-width: var(--container);
    margin: 0 auto; padding: 0 var(--gutter);
  }
  .site-brand {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 44px; min-width: 44px; text-decoration: none; color: var(--txt);
    font-family: var(--font-display); font-weight: var(--fw-black);
    font-size: 16px; letter-spacing: var(--tracking-tight);
    transition: color 260ms var(--ease), opacity 200ms var(--ease);
  }
  /* The mark is a glass tile, not a bare icon: a hairline accent ring, an inner light line and a soft
     accent glow under it. Every one of those is painted from tokens, so switching dark → bright animates
     the hue instead of snapping it. */
  .site-brand__tile {
    position: relative; display: grid; place-items: center; flex: none;
    width: 34px; height: 34px; border-radius: 11px; overflow: hidden;
    background-color: color-mix(in oklab, var(--accent) 10%, var(--surface-2));
    box-shadow:
      inset 0 0 0 1px color-mix(in oklab, var(--accent) 32%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.10),
      0 6px 18px color-mix(in oklab, var(--accent) 16%, transparent);
    transition: background-color 280ms var(--ease), box-shadow 280ms var(--ease), transform 200ms var(--ease);
  }
  .site-brand__mark { width: 26px; height: 26px; color: var(--txt); transition: color 280ms var(--ease); }
  .site-brand__shine {
    position: absolute; inset: -45%; pointer-events: none; opacity: 0;
    background: linear-gradient(115deg, transparent 38%, color-mix(in oklab, var(--accent) 60%, white) 50%, transparent 62%);
    transform: translateX(-70%) rotate(10deg);
    transition: opacity 200ms var(--ease), transform 640ms var(--ease);
  }
  .site-brand:hover .site-brand__tile {
    transform: translateY(-1px);
    box-shadow:
      inset 0 0 0 1px color-mix(in oklab, var(--accent) 58%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 10px 26px color-mix(in oklab, var(--accent) 30%, transparent);
  }
  .site-brand:hover .site-brand__shine { opacity: 0.85; transform: translateX(70%) rotate(10deg); }
  .site-brand__dot {
    width: 5px; height: 5px; border-radius: 50%; flex: none;
    background-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent);
    transition: background-color 280ms var(--ease), box-shadow 280ms var(--ease);
  }
  .site-brand__word { display: none; }
  .site-brand__word b { color: var(--accent); transition: color 280ms var(--ease); }
  .site-brand:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); border-radius: var(--r-sm); }
  @media (min-width: 400px) { .site-brand__word { display: inline; } }
  @media (prefers-reduced-motion: reduce) {
    .site-brand__shine { display: none; }
    .site-brand__tile, .site-brand__mark, .site-brand__dot, .site-brand__word b { transition: none; }
  }

  /* desktop tabs */
  .site-tabs { display: none; align-items: center; gap: 2px; margin-left: var(--sp-4); }
  .site-tab {
    position: relative; display: inline-flex; align-items: center; gap: 7px;
    min-height: 44px; padding: 0 13px; border-radius: var(--r-sm);
    color: var(--txt-2); font-size: var(--fs-sm); font-weight: var(--fw-medium);
    text-decoration: none; transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
  }
  .site-tab:hover { color: var(--txt); background: var(--surface-2); }
  .site-tab[aria-current="page"] { color: var(--txt); background: var(--accent-soft); }
  .site-tab[aria-current="page"]::after {
    content: ''; position: absolute; left: 13px; right: 13px; bottom: 6px; height: 2px;
    border-radius: 2px; background: var(--accent);
  }
  .site-tab__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
  @media (min-width: 1024px) { .site-tabs { display: flex; } }

  .site-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
  .icon-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    border: 1px solid transparent; border-radius: var(--r-sm);
    background: transparent; color: var(--txt); cursor: pointer;
    transition: background var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  }
  .icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
  .icon-btn:active { transform: scale(0.96); }
  .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  .icon-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-2-line); color: var(--txt); }
  .site-search {
    display: none; align-items: center; gap: var(--sp-2);
    height: 44px; padding: 0 14px; min-width: 0; width: min(320px, 34vw);
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface); color: var(--txt-2); font-size: var(--fs-sm);
  }
  .site-search:hover { border-color: var(--line-strong); color: var(--txt); }
  @media (min-width: 900px) { .site-search { display: inline-flex; } }

  /* mobile tab bar */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabbar);
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding-bottom: var(--safe-b);
    background: var(--chrome-bg);
    border-top: 1px solid var(--chrome-line);
    box-shadow: 0 -10px 30px -20px rgba(0, 0, 0, 0.9);
  }
  .tabbar__item {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 3px;
    min-height: calc(var(--tabbar-h) + var(--safe-b)); padding: 6px 2px 8px;
    color: var(--txt-2); text-decoration: none; background: none; border: 0;
    font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
    cursor: pointer; transition: color var(--dur-hover) var(--ease);
  }
  .tabbar__item svg { width: 22px; height: 22px; }
  .tabbar__item:hover { color: var(--txt-2); }
  .tabbar__item[aria-current="page"], .tabbar__item[aria-expanded="true"] { color: var(--txt); font-weight: 700; }
  .tabbar__item[aria-current="page"]::before,
  .tabbar__item[aria-expanded="true"]::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 22px; height: 2px; border-radius: 2px; background: var(--accent);
  }
  .tabbar__item[aria-current="page"] svg { color: var(--accent); }
  .tabbar__item:focus-visible { outline: none; box-shadow: inset 0 0 0 var(--ring-w) var(--accent-ring); }
  /* Step 6.5 — the Live TV slot: same 44px target and identical rhythm as its neighbours, but the
     glyph carries the accent and a 5px live dot pulses once every 3s (stopped for reduced motion). */
  .tabbar__ico { position: relative; display: inline-grid; place-items: center; }
  .tabbar__item--live svg { color: var(--accent); }
  .tabbar__item--live[aria-current="page"] svg { filter: drop-shadow(0 0 6px var(--accent-glow, rgba(162,255,0,.35))); }
  .tabbar__live-dot {
    position: absolute; top: -1px; right: -3px; width: 5px; height: 5px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 2px var(--tabbar-bg, #06070A);
    animation: tabLivePulse 3s ease-in-out infinite;
  }
  .tabbar__item--live span:last-child { white-space: nowrap; }
  @keyframes tabLivePulse { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
  @media (prefers-reduced-motion: reduce) { .tabbar__live-dot { animation: none; opacity: 1; } }
  .tabbar__badge {
    position: absolute; top: 5px; right: calc(50% - 20px);
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2);
  }
  @media (min-width: 1024px) { .tabbar { display: none; } }

  /* drawer */
  .drawer-backdrop {
    position: fixed; inset: 0; z-index: var(--z-sheet);
    background: var(--backdrop); opacity: 0; pointer-events: none;
    transition: opacity var(--dur-panel) var(--ease);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  }
  .drawer-backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }
  .drawer {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: calc(var(--z-sheet) + 1);
    width: min(88vw, 342px); display: flex; flex-direction: column;
    /* A real panel clips its own content. Without this the sitemap painted straight over the
       page behind the drawer once it outgrew the viewport (defect found in step 1.1 review). */
    overflow: hidden;
    background: var(--drawer-bg); border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(-101%);
    transition: transform var(--dur-panel) var(--ease);
    visibility: hidden;
    padding-top: var(--safe-t); padding-bottom: var(--safe-b);
  }
  .drawer[data-open="true"] { transform: none; visibility: visible; }
  .drawer__head {
    flex: none;
    display: flex; align-items: center; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line);
  }
  .drawer__title { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-md); }
  .drawer__close { margin-left: auto; }
  /* flex:1 + min-height:0 is what turns this into a real scroll region; without min-height:0 a
     flex child refuses to shrink below its content and the column overflows instead. */
  .drawer__body {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: var(--sp-3) 0 var(--sp-4);
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  }
  .drawer__body::-webkit-scrollbar { width: 6px; }
  .drawer__body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
  .drawer__group + .drawer__group { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line); }
  .drawer__label {
    padding: var(--sp-2) var(--sp-4); font-size: 11px; font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--txt-3);
  }
  .drawer__link {
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: 46px; padding: 0 var(--sp-4);
    color: var(--txt-2); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-medium);
    border-left: 2px solid transparent;
    transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  }
  .drawer__link:hover, .drawer__link:focus-visible { background: var(--surface-2); color: var(--txt); outline: none; }
  .drawer__link[aria-current="page"] { color: var(--txt); background: var(--accent-soft); border-left-color: var(--accent); }
  .drawer__link svg { width: 19px; height: 19px; flex: none; color: var(--txt-3); }
  .drawer__link[aria-current="page"] svg { color: var(--accent); }
  .drawer__link .tag {
    margin-left: auto; padding: 2px 7px; border-radius: var(--r-pill);
    background: var(--accent-2-soft); color: var(--accent-2);
    font-size: 10px; font-weight: var(--fw-bold); letter-spacing: 0.04em;
  }
  :root[data-theme="light"] .drawer__link .tag { color: var(--accent-2); }
  .drawer__theme {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    margin: 0; padding: 0 var(--sp-1) 0 0; min-height: 44px;
  }
  .drawer__theme span { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--txt-2); }
  .drawer__foot { flex: none; display: grid; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4) calc(var(--sp-3) + var(--safe-b)); border-top: 1px solid var(--line); }
  .drawer__foot p { font-size: 11px; line-height: 1.5; color: var(--txt-3); }

  /* keep content clear of the tab bar */
  @media (max-width: 1023px) {
    /* --tabbar-h is the inner height; the hairline border and a breathing gap sit on top of it,
       otherwise the last content row clips under the bar by exactly 1px. */
    body { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 1px + var(--sp-3)); }
  }
  @media (min-width: 1024px) {
    body { padding-bottom: 0; }
  }
  body[data-drawer="open"] { overflow: hidden; }

  /* shared contract for any future panel that scrolls internally (bottom sheet, filters) */
  .scroll-region { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

  @media (prefers-reduced-motion: reduce) {
    .drawer, .drawer-backdrop { transition: none; }
  }
}

/* ==========================================================================
   Theme transition — amendment A10 (premium, smooth, respects reduced motion)
   Modern browsers get a circular reveal from the toggle itself (View Transitions);
   everyone else gets a colour crossfade + a soft bloom, so the swap never snaps.
   ========================================================================== */
@layer utilities {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  ::view-transition-new(root) {
    animation: ms-theme-reveal 560ms var(--ease) both;
  }
  @keyframes ms-theme-reveal {
    from { clip-path: circle(0% at var(--vt-x, 50%) var(--vt-y, 0%)); }
    to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 0%)); }
  }

  /* fallback path (Safari < 18, Firefox, reduced-motion off but no VT support) */
  html.theme-anim,
  html.theme-anim *,
  html.theme-anim *::before,
  html.theme-anim *::after {
    transition:
      background-color 420ms var(--ease),
      color 420ms var(--ease),
      border-color 420ms var(--ease),
      fill 420ms var(--ease),
      stroke 420ms var(--ease),
      box-shadow 420ms var(--ease) !important;
  }

  .theme-bloom {
    position: fixed; z-index: var(--z-toast); pointer-events: none;
    width: 46vmax; height: 46vmax; margin: -23vmax 0 0 -23vmax;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
    animation: ms-bloom 620ms var(--ease) forwards;
  }
  @keyframes ms-bloom {
    0% { transform: scale(0.2); opacity: 0.85; }
    100% { transform: scale(1.9); opacity: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    ::view-transition-new(root) { animation: none; }
    .theme-bloom { display: none; }
  }

  /* ============================================================ A13: shell ===
     YouTube's shape, our skin: full-width slim header, pills under it, a persistent
     desktop rail, and the tab bar as the only mobile menu (no double menu anymore). */

  :root { --hdr: 56px; }

  /* header: hamburger only where a rail exists */

  /* mobile brand lockup: mark + name, tight and confident */
  .site-brand { gap: 9px; }
  .site-brand__tile { width: 32px; height: 32px; border-radius: 10px; }
  .site-brand__mark { width: 24px; height: 24px; }
  .site-brand__word {
    font-family: var(--font-display); font-weight: 700; font-size: 17px;
    letter-spacing: -0.022em; font-feature-settings: 'ss01' on;
  }
  .site-brand__word b { font-weight: 800; color: var(--accent); }
  @media (max-width: 399px) { .site-brand__dot { display: none; } }

  /* ============================================ A20: the rail is a real column again
     Devid's call: the hidden-rail experiment failed on two counts — with one small pill on the edge you
     could not tell a sidebar existed, and an overlay never adjusts the page, so the content stayed
     underneath it. So the rail is back IN the grid: 76px of section icons at rest (every group's glyph
     visible, the active one marked), and it grows to 316px on hover / focus / pin. The page shifts with
     it because it is the same grid — nothing is ever covered, nothing shows through, nothing jumps. */
  .shell { display: grid; grid-template-columns: minmax(0, 1fr); }
  .shell__content { min-width: 0; }

  .railzone { display: none; }
  .siderail { display: none; }
  .railpin { display: none; }

  @media (min-width: 1024px) {
    .shell {
      grid-template-columns: 72px minmax(0, 1fr);
      transition: grid-template-columns 260ms cubic-bezier(0.22, 0.9, 0.25, 1);
    }
    body[data-rail="open"] .shell { grid-template-columns: 264px minmax(0, 1fr); }

    .railzone {
      display: block; position: sticky; top: var(--hdr); align-self: start;
      height: calc(100dvh - var(--hdr)); z-index: 60;
    }

    .siderail {
      display: flex; flex-direction: column; gap: 2px;
      height: 100%; width: 100%;
      overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
      padding: 10px 8px 14px;
      /* opaque in both themes — the page must never read through the rail */
      background: var(--surface);
      border-right: 1px solid var(--line-2);
      scrollbar-width: thin;
    }

    /* ---- resting state: an icon rail, not a mystery pill ---- */
    .railzone[data-open="false"] .siderail__label,
    .railzone[data-open="false"] .navgrp__btn > span:not(.navrow__ico),
    .railzone[data-open="false"] .navgrp__chev,
    .railzone[data-open="false"] .nav-brand__word,
    .railzone[data-open="false"] .nav-brand__tag,
    .railzone[data-open="false"] .railpin__word,
    .railzone[data-open="false"] .siderail__pages { display: none; }
    .railzone[data-open="false"] .navgrp { margin: 0; }
    .railzone[data-open="false"] .navgrp__panel { display: none; }
    /* the icon rail has to look like a deliberate column of controls, not five grey smudges:
       48px tiles, 22px glyphs, a real hover surface and the active section tinted */
    .railzone[data-open="false"] .navgrp { margin: 0; }
    .railzone[data-open="false"] .navgrp__btn {
      width: 48px; height: 48px; margin: 3px auto; padding: 0;
      justify-content: center; border-radius: 13px;
      color: color-mix(in oklab, var(--txt) 74%, transparent);
      transition: color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
    }
    .railzone[data-open="false"] .navgrp__btn:hover { color: var(--txt); background: var(--surface-2); }
    .railzone[data-open="false"] .navgrp__btn[aria-expanded="true"] { color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); }
    .railzone[data-open="false"] .navgrp__btn svg { width: 22px; height: 22px; }
    .railzone[data-open="false"] .navgrp__btn[aria-expanded="true"] { background: var(--surface-2); }
    .railzone[data-open="false"] .nav-brand { padding: 2px 0 8px; }
    /* the brand is a real control in the icon rail too: 44×44, not a 33×30 sliver */
    .railzone[data-open="false"] .nav-brand__link {
      width: 44px; height: 44px; min-height: 44px; margin: 0 auto;
      justify-content: center; gap: 0; padding: 0;
    }
    .railzone[data-open="false"] .nav-brand__mark { width: 26px; height: 26px; }
    .railzone[data-open="false"] .railpin { width: 44px; margin: 4px auto 0; padding: 0; justify-content: center; }

    /* the width has travelled before the words arrive, so nothing squashes mid-move */
    .siderail__label,
    .navgrp__btn > span,
    .nav-brand__word,
    .nav-brand__tag,
    .railpin__word { transition: opacity 160ms var(--ease) 90ms; }
    .railzone[data-open="true"] .siderail { padding-right: var(--sp-2); }

    .siderail__group + .siderail__group { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
    .siderail__label {
      font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
      color: var(--txt-3); padding: 0 var(--sp-3) var(--sp-2);
    }
    .siderail__link {
      display: flex; align-items: center; gap: var(--sp-3);
      min-height: 44px; padding: 0 var(--sp-3); border-radius: 10px;
      color: var(--txt-2); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-medium);
      position: relative; transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
    }
    .siderail__link svg { flex: none; opacity: 0.85; }
    .siderail__link:hover { background: var(--surface-2); color: var(--txt); }
    .siderail__link:hover svg { opacity: 1; }
    .siderail__link.is-active { background: var(--surface-2); color: var(--txt); font-weight: 600; }
    .siderail__link.is-active::before {
      content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
      width: 3px; height: 20px; border-radius: 2px; background: var(--accent);
    }
    .siderail__link.is-active svg { color: var(--accent); opacity: 1; }
    .siderail__link .tag { margin-left: auto; }

    /* the pin lives at the foot of the rail, in the thumb-free zone on a desktop but always visible */
    .railpin {
      display: flex; align-items: center; gap: 10px;
      margin-top: auto; min-height: 44px; padding: 0 12px;
      border: 1px solid var(--line-2); border-radius: 10px; background: transparent;
      color: var(--txt-2); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
      transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
    }
    .railpin:hover { color: var(--txt); border-color: color-mix(in oklab, var(--accent) 50%, var(--line-2)); background: var(--surface-2); }
    .railpin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .railpin__glyph { display: grid; place-items: center; flex: none; }
    .railpin__glyph--close { display: none; }
    body[data-rail="open"] .railzone[data-pinned="true"] .railpin__glyph--open { display: none; }
    body[data-rail="open"] .railzone[data-pinned="true"] .railpin__glyph--close { display: grid; }
    /* a pinned rail says so, quietly */
    .railzone[data-pinned="true"] .railpin { color: var(--txt); border-color: color-mix(in oklab, var(--accent) 45%, var(--line-2)); }
  }

  /* ==================================================== A13: drawer, premium ===
     Same groups as the rail, but a full-height sheet with real hierarchy: brand head,
     rounded rows with an accent active bar, an appearance card that sits in the thumb zone. */
  .drawer { width: min(332px, 86vw); }
  .drawer__head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-4) var(--sp-3);
    border-bottom: 1px solid var(--line);
  }
  .drawer__title {
    font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  }
  .drawer__body { padding: var(--sp-3) var(--sp-2); }
  .drawer__group + .drawer__group { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
  .drawer__label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--txt-3); padding: 0 var(--sp-3) var(--sp-2);
  }
  .drawer__link {
    display: flex; align-items: center; gap: var(--sp-3);
    min-height: 46px; padding: 0 var(--sp-3); border-radius: 10px;
    color: var(--txt-2); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-medium);
    position: relative;
    transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
  }
  .drawer__link svg { flex: none; opacity: 0.85; }
  .drawer__link:active, .drawer__link:hover { background: var(--surface-2); color: var(--txt); }
  .drawer__link[aria-current="page"] { background: var(--surface-2); color: var(--txt); font-weight: 600; }
  .drawer__link[aria-current="page"]::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 2px; background: var(--accent);
  }
  .drawer__link[aria-current="page"] svg { color: var(--accent); opacity: 1; }
  .drawer__link .tag { margin-left: auto; }

  .drawer__theme {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    min-height: 52px; padding: 0 var(--sp-3);
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  }
  .drawer__theme span { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--txt-2); }
  .drawer__foot { display: grid; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3) calc(var(--sp-3) + var(--safe-b)); border-top: 1px solid var(--line); }
  .drawer__foot p { font-size: 11px; line-height: 1.5; color: var(--txt-3); padding: 0 var(--sp-1); }

  /* ================================================= A14: header controls + search ===
     Every control in the header must look like it belongs to this design: hairline border,
     surface hover, 40px, and an obvious purpose. The old ones were naked icons. */
  .site-actions { gap: var(--sp-2); }
  .icon-btn {
    height: 44px; min-width: 44px; border-radius: 10px;
    border: 1px solid transparent; color: var(--txt-2);
    transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
  }
  .icon-btn:hover { background: var(--surface-2); color: var(--txt); border-color: var(--line); }
  .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-w) var(--accent-ring); }
  /* A14: the sidebar toggle is the last control on the right, matching the rest of the header icons.
     The glyph nudges toward the rail it controls, and the tinted state says which way it will go. */
  .site-search__kbd {
    margin-left: auto; font: 600 11px/1 var(--font-ui); color: var(--txt-3);
    border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px;
  }
  /* the mobile-only search button; the desktop pill takes over from 900px */
  .site-search-btn { display: inline-flex; }
  @media (min-width: 900px) { .site-search-btn { display: none; } }

  /* mobile brand lockup must actually show the name */
  @media (max-width: 899px) {
    .site-brand__word { display: inline-block; font-size: 16.5px; }
  }

  /* ---- search overlay ---- */
  .search-panel {
    position: fixed; inset: 0; z-index: var(--z-sheet);
    display: none; grid-template-rows: auto 1fr;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
  }
  .search-panel[data-open="true"] { display: grid; animation: fadeInDown 220ms var(--ease) both; }
  .search-panel__bar { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
  .search-panel__field {
    display: flex; align-items: center; gap: var(--sp-3);
    height: 52px; padding: 0 var(--sp-2) 0 var(--sp-4);
    border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  .search-panel__field svg { flex: none; color: var(--txt-3); }
  .search-panel__field input {
    flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: none; color: var(--txt);
    font: 500 16px/1 var(--font-ui); outline: none;
  }
  .search-panel__field input::placeholder { color: var(--txt-3); }
  .search-panel__body { padding: var(--sp-4); display: grid; gap: var(--sp-3); align-content: start; }
  .search-panel__label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--txt-3); }
  .search-panel__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .search-panel__hint { font-size: var(--fs-sm); color: var(--txt-3); max-width: 52ch; }
  body[data-overlay="search"] { overflow: hidden; }

  /* ---- footer mesh ---- */
  /* ================================================ A39: the footer, both canvases ================
     Desktop: a brand band on the left, three sitemap columns on the right behind one hairline.
     Phone: the same brand band, then three 52px folding rows so the foot of the page stays a block.
     Nothing hides behind the fixed tab bar — the foot carries its own clearance. */
  .site-footer {
    position: relative; margin-top: var(--sp-7);
    border-top: 1px solid var(--line-2);
    background:
      radial-gradient(120% 90% at 8% -30%, color-mix(in oklab, var(--accent) 9%, transparent) 0%, transparent 62%),
      linear-gradient(180deg, color-mix(in oklab, var(--surface) 94%, var(--accent) 6%) 0%, var(--surface) 58%);
    padding: var(--sp-7) 0 calc(var(--sp-6) + 66px + env(safe-area-inset-bottom, 0px));
  }
  @media (min-width: 1024px) { .site-footer { padding-bottom: var(--sp-6); } }

  .site-footer__band { display: grid; gap: var(--sp-5); }
  @media (min-width: 900px) {
    .site-footer__band { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.5fr); gap: var(--sp-7); align-items: start; }
    .site-footer__cols { border-left: 1px solid var(--line); padding-left: var(--sp-6); }
  }

  .site-footer__brand { display: grid; gap: 14px; align-content: start; }
  .site-footer .site-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; width: fit-content; }
  .site-footer .site-brand__tile {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
    background: color-mix(in oklab, var(--accent) 12%, var(--surface-2));
    border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--line));
    box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent) 6%, transparent);
  }
  .site-footer .site-brand__mark { width: 26px; height: 26px; color: var(--txt); }
  .site-footer .site-brand__word { font-family: var(--font-display); font-size: 1.32rem; font-weight: 800; letter-spacing: -0.02em; color: var(--txt); }
  .site-footer .site-brand__word b { color: var(--accent-text); }
  .site-footer__note { font-size: var(--fs-sm); line-height: 1.65; color: var(--txt-2); max-width: 46ch; }
  .site-footer__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .site-footer__chips li {
    font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; color: var(--txt-2);
    padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  }

  .site-footer__cols { display: grid; }
  @media (min-width: 900px) { .site-footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); } }
  .site-footer__col { border-bottom: 1px solid var(--line); }
  .site-footer__col:first-of-type { border-top: 1px solid var(--line); }
  @media (min-width: 900px) { .site-footer__col, .site-footer__col:first-of-type { border: 0; } }

  .site-footer__label {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin: 0; min-height: 52px; cursor: pointer; list-style: none;
    font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-2);
  }
  .site-footer__label::-webkit-details-marker { display: none; }
  .site-footer__chev { display: grid; place-items: center; width: 22px; height: 22px; color: var(--txt-3); transition: transform 240ms var(--ease), color 200ms var(--ease); }
  .site-footer__col[open] .site-footer__chev { transform: rotate(180deg); color: var(--accent-text); }
  @media (min-width: 900px) {
    .site-footer__label { min-height: 34px; cursor: default; padding-bottom: 4px; }
    .site-footer__chev { display: none; }
  }

  .site-footer__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; padding-bottom: 8px; }
  @media (min-width: 900px) { .site-footer__links { grid-template-columns: 1fr; padding-bottom: 0; } }
  .site-footer__col a {
    display: flex; align-items: center; min-height: 44px;
    font-size: 13.5px; font-weight: 600; color: var(--txt-2); text-decoration: none;
    transition: color 180ms var(--ease), transform 180ms var(--ease);
  }
  .site-footer__col a:hover, .site-footer__col a:focus-visible { color: var(--accent-text); transform: translateX(2px); }
  @media (min-width: 900px) { .site-footer__col a { min-height: 34px; } }

  .site-footer__base {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 10px var(--sp-4); margin-top: var(--sp-6); padding-top: var(--sp-4);
    border-top: 1px solid var(--line);
  }
  .site-footer__base p { font-size: 12px; line-height: 1.6; color: var(--txt-3); max-width: 52ch; }
  @media (max-width: 899px) {
    /* the sitemap pill needs its 44px, so the base row itself gets tighter */
    .site-footer__base { margin-top: var(--sp-4); padding-top: 10px; gap: 6px; }
    .site-footer__base a { min-height: 44px; padding: 0 16px; }
  }
  .site-footer__base a {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--line-2); color: var(--txt-2);
    font-weight: 650; text-decoration: none; transition: color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
  }
  .site-footer__base a:hover { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
  .site-footer__base a:hover { color: var(--accent-text); border-color: currentColor; }
  .site-footer__top {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; margin-left: auto;
    border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--txt-2);
    font: inherit; font-size: 12.5px; font-weight: 750; cursor: pointer;
    transition: background 220ms var(--ease), color 220ms var(--ease), border-color 220ms var(--ease), transform 180ms var(--ease);
  }
  .site-footer__top:hover { background: var(--accent); color: var(--accent-ink); border-color: transparent; transform: translateY(-1px); }
  .site-footer__top:focus-visible { outline: var(--ring-w, 2px) solid var(--accent-ring, var(--accent)); outline-offset: 2px; }
  @media (max-width: 599px) { .site-footer__top { margin-left: 0; width: 100%; justify-content: center; } }
}
/* ============================================================================
   A15 — premium accordion navigation (rail + drawer share every rule below)
   One group open at a time; height/opacity motion on a 220ms ease-out curve.
   ========================================================================== */
.navgrp { border-radius: var(--r-md); }
.navgrp__btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 0 10px; margin: 0;
  background: none; border: 0; border-radius: var(--r-md);
  color: var(--txt-2); font: inherit; font-size: var(--fs-sm); font-weight: 650;
  letter-spacing: 0.01em; text-align: left; cursor: pointer;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.navgrp__btn > svg:first-child { flex: none; opacity: 0.9; }
.navgrp__btn > span { flex: 1 1 auto; }
.navgrp__chev { flex: none; opacity: 0.6; transition: transform 220ms cubic-bezier(0.2, 0.9, 0.24, 1); }
.navgrp__btn:hover { background: var(--surface-2); color: var(--txt); }
.navgrp__btn:focus-visible { outline: none; box-shadow: inset 0 0 0 var(--ring-w) var(--accent-ring); }
.navgrp[data-open="true"] > .navgrp__btn { background: var(--surface-2); color: var(--txt); }
.navgrp[data-open="true"] > .navgrp__btn .navgrp__chev { transform: rotate(180deg); opacity: 1; }
.navgrp[data-open="true"] > .navgrp__btn > svg:first-child { color: var(--accent); opacity: 1; }

.navgrp__panel {
  height: 0; overflow: hidden;
  transition: height 220ms cubic-bezier(0.2, 0.9, 0.24, 1);
}
.navgrp__inner { display: grid; gap: 2px; padding: 4px 0 8px 8px; }
.navgrp__inner .siderail__link { min-height: 44px; font-size: var(--fs-sm); }
.drawer .navgrp__inner .siderail__link, .drawer .siderail__page { min-height: 46px; }

/* the branding block sits mid-rail: below the groups, above the site pages */
.nav-brand {
  margin: var(--sp-4) 0 var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 90% at 12% 0%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 62%),
    var(--surface-2);
  transition: border-color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}
.nav-brand:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.nav-brand__link { display: grid; gap: 6px; text-decoration: none; color: var(--txt); }
.nav-brand__mark { width: 30px; height: 30px; color: var(--txt); }
.nav-brand__word { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.nav-brand__tag { font-size: var(--fs-xs); color: var(--txt-3); line-height: 1.45; }

.siderail__pages { display: grid; gap: 1px; margin-top: var(--sp-2); }
.siderail__page {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px;
  border-radius: var(--r-sm); color: var(--txt-3); text-decoration: none; font-size: var(--fs-sm);
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.siderail__page svg { flex: none; opacity: 0.7; }
.siderail__page:hover { background: var(--surface-2); color: var(--txt); }
.siderail__page:hover svg { opacity: 1; }
.siderail__page[aria-current="page"] { color: var(--txt); font-weight: 650; }

/* drawer canvas: same accordion, roomier rows */
.drawer .navgrp--drawer > .navgrp__btn { min-height: 46px; font-size: var(--fs-md); font-weight: 700; }
.drawer .navgrp--drawer .navgrp__inner { padding-left: 6px; }
.drawer .navgrp--drawer + .navgrp--drawer { border-top: 1px solid var(--line); border-radius: 0; }
.drawer .nav-brand { margin: var(--sp-4) 0; }

/* ---------------------------------------------------------- A22: resting rail --- */
/* The closed desktop rail is ONE clean column of six tiles and nothing else:
   the five section glyphs in sidebar order, then the MovieState tile. Site pages,
   the pin and every open panel exist only in the expanded rail, so no clipped
   half-words ("Ab", "Co", "Ed po") can leak out of a 72px strip. */
@media (min-width: 1024px) {
  #railZone[data-open="false"] #siteRail { padding: 10px 12px; gap: 6px; overflow: hidden; }

  #railZone[data-open="false"] #siteRail .siderail__pages,
  #railZone[data-open="false"] #siteRail .railpin,
  #railZone[data-open="false"] #siteRail .navgrp__panel,
  #railZone[data-open="false"] #siteRail .siderail__label,
  #railZone[data-open="false"] #siteRail .navgrp__btn > span:not(.navrow__ico),
  #railZone[data-open="false"] #siteRail .navgrp__chev,
  #railZone[data-open="false"] #siteRail .nav-brand__word,
  #railZone[data-open="false"] #siteRail .nav-brand__tag { display: none !important; }

  #railZone[data-open="false"] #siteRail > .navgrp { width: 48px; margin: 0 auto; flex: 0 0 auto; }
  #railZone[data-open="false"] #siteRail .navgrp__btn {
    width: 48px; height: 48px; margin: 0; padding: 0; border: 0;
    display: grid; place-items: center; border-radius: 13px; background: transparent;
    color: color-mix(in oklab, var(--txt) 72%, transparent);
    transition: color 180ms var(--ease), background 180ms var(--ease);
  }
  #railZone[data-open="false"] #siteRail .navgrp__btn svg { width: 22px; height: 22px; }
  #railZone[data-open="false"] #siteRail .navgrp__btn:hover { color: var(--txt); background: var(--surface-2); }
  #railZone[data-open="false"] #siteRail .navgrp__btn[aria-expanded="true"] {
    color: var(--accent); background: color-mix(in oklab, var(--accent) 14%, transparent);
  }

  #railZone[data-open="false"] #siteRail .nav-brand {
    width: 48px; height: 48px; margin: 6px auto 0; padding: 0; border: 0;
    display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px;
    background: color-mix(in oklab, var(--accent) 12%, transparent);
  }
  #railZone[data-open="false"] #siteRail .nav-brand__link {
    width: 48px; height: 48px; margin: 0; padding: 0; display: grid; place-items: center;
  }
  #railZone[data-open="false"] #siteRail .nav-brand__mark { width: 24px; height: 24px; }

  /* the expanded rail lifts off the page instead of butting against it */
  #railZone[data-open="true"] #siteRail { box-shadow: 14px 0 44px rgba(0, 0, 0, 0.28); }
}


  /* ============================================ A38: the rail opens without a single flicker ===
     Measured defect: on hover the glyph jumped from x=25 to x=18 in one frame before the column
     had travelled, so the rail visibly twitched. The cure is geometric, not cosmetic: every rail
     row carries one fixed 40px icon slot centred on the same optical line in BOTH states, so the
     glyph's x never changes; only the column width and the labels move. */
  @media (min-width: 1024px) {
    .railzone { contain: layout paint; }
    .railzone .navrow__ico {
      display: grid; place-items: center; flex: none;
      width: 40px; height: 40px;
    }
    .railzone .navrow__ico svg { width: 22px; height: 22px; display: block; }
    .railzone .navrow__ico--sm { width: 40px; height: 32px; }
    .railzone .navrow__ico--sm svg { width: 20px; height: 20px; }

    /* open state: same 8px rail inset + same slot => glyph centre stays at x=36 */
    .railzone[data-open="true"] .siderail__link,
    .railzone[data-open="true"] .siderail__page,
    .railzone[data-open="true"] .navgrp__btn { padding-left: 8px; gap: 10px; }
    .railzone[data-open="true"] .nav-brand__link { padding-left: 6px; gap: 10px; }
    .railzone[data-open="true"] .railpin { padding-left: 6px; gap: 10px; }
    .railzone[data-open="true"] .navgrp__chev { margin-left: auto; }

    /* closed tile: the 48px tile now wraps the same 40px slot, so the glyph does not shift */
    .railzone[data-open="false"] .navgrp__btn { padding: 0; }
    .railzone[data-open="false"] .navgrp__btn .navrow__ico { width: 40px; height: 40px; }
    .railzone[data-open="false"] .nav-brand__link { padding: 0; }
    .railzone[data-open="false"] .railpin { padding: 0; }

    /* the surfaces morph instead of snapping: tile -> row is a background fade, not a flash */
    .railzone .navgrp__btn,
    .railzone .siderail__link,
    .railzone .railpin,
    .railzone .nav-brand__link {
      transition: background-color 220ms var(--ease), color 200ms var(--ease),
                  border-color 200ms var(--ease), border-radius 240ms var(--ease);
    }

    /* words arrive after the column has travelled, and they leave first on close */
    .railzone .siderail__label,
    .railzone .navgrp__btn > span:not(.navrow__ico),
    .railzone .nav-brand__word,
    .railzone .nav-brand__tag,
    .railzone .railpin__word,
    .railzone .siderail__page,
    .railzone .siderail__link,
    .railzone .navgrp__chev {
      transition: opacity 170ms var(--ease) 130ms;
    }
    .railzone[data-open="false"] .siderail__label,
    .railzone[data-open="false"] .navgrp__btn > span:not(.navrow__ico),
    .railzone[data-open="false"] .nav-brand__word,
    .railzone[data-open="false"] .nav-brand__tag,
    .railzone[data-open="false"] .railpin__word,
    .railzone[data-open="false"] .siderail__page { transition: opacity 90ms var(--ease) 0ms; }
  }


/* ==========================================================================
   Step 6.4b — navigation feel
   A tap must always be acknowledged in the next frame, and the arriving document
   must never snap into place. No prefetch: a tap costs nothing until it happens.
   ========================================================================== */
.navbar-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  z-index: 4000;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(.22,.61,.36,1), opacity 160ms linear;
  box-shadow: 0 0 10px var(--accent);
}
.navbar-progress.is-on { opacity: 1; }
body { animation: ms-doc-in 180ms ease-out both; }
@keyframes ms-doc-in { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .navbar-progress { transition: none; }
  body { animation: none; }
}

/* 10.2a — the owner's tagline sits under the footer wordmark, quiet but readable in both themes */
.site-footer__tag { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--txt-2); max-width: 34ch; }

/* 10.2b — the owner's channels in the footer brand band, only when a link is set */
/* 10.2b — the chips and the owner's channels share one row, so the phone footer stays compact */
.site-footer__meta { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.site-footer__social { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.site-footer__socialLink {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--txt-2);
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}
.site-footer__socialLink:hover, .site-footer__socialLink:focus-visible {
  color: var(--accent-text); border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2)); transform: translateY(-1px);
}
@media (max-width: 560px) { .site-footer__socialLink { width: 44px; height: 44px; } }

@media (max-width: 560px) {
  .site-footer__band { padding-bottom: 10px; }
  .site-footer__meta { gap: 6px 10px; }
  .site-footer__note { line-height: 1.45; }
  .site-footer__base > p:first-child { font-size: 12px; line-height: 1.4; }
  .site-footer__col > summary { min-height: 48px; }
  /* the base row becomes two lines instead of three: copyright + back-to-top, then the note */
  .site-footer__base { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; }
  .site-footer__base > p:first-child { grid-column: 1; grid-row: 1; margin: 0; }
  .site-footer__base > .site-footer__top { grid-column: 2; grid-row: 1; margin: 0; }
  .site-footer__baseTail { grid-column: 1 / -1; grid-row: 2; margin: 0; }
}

/* Step 13.5 — live suggestions in the search sheet: the answer appears while typing (390 and 1440) */
.sb { border-bottom: 1px solid var(--line); background: var(--surface); max-height: min(58vh, 520px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sb__head { padding: 10px 16px 6px; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-3); font-weight: 700; }
.sb__row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; text-decoration: none; color: var(--txt); border-left: 3px solid transparent; transition: background .16s, border-color .16s, transform .16s; }
.sb__row:hover, .sb__row:focus-visible, .sb__row.is-on { background: var(--surface-2); border-left-color: var(--accent); transform: translateX(2px); }
.sb__row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sb__img { width: 40px; height: 60px; border-radius: 7px; object-fit: cover; flex: none; background: var(--surface-2); box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.sb__img--plate { display: grid; place-items: center; font-size: 17px; font-weight: 800; color: var(--accent-text); background: radial-gradient(120% 90% at 30% 10%, var(--accent-soft), transparent 70%), var(--surface-2); }
.sb__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sb__title { font-size: 14px; font-weight: 650; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb__meta { font-size: 11.5px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.sb__go { margin-left: auto; color: var(--txt-3); font-size: 18px; }
.sb__all { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px 14px; font-size: 13px; font-weight: 700; color: var(--accent-text); text-decoration: none; border-top: 1px solid var(--line); }
.sb__all:hover, .sb__all:focus-visible { background: var(--surface-2); }
@media (max-width: 559px) { .sb__row { padding: 8px 14px; gap: 10px; } .sb__img { width: 36px; height: 54px; } .sb__title { font-size: 13.5px; } }

/* ---- server network: the sibling movie-server sites, shown only where a page asks for them ---- */
.ms-net[hidden]{display:none!important}
.ms-net{margin:18px 0}
.ms-net__title{font-size:1.05rem;font-weight:700;margin:0 0 6px}
.ms-net__lead{margin:0 0 10px;color:var(--muted,#9aa0a6);font-size:.92rem}
.ms-net__list{list-style:none;display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:0;padding:0}
.ms-net__card{margin:0}
.ms-net__link{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border:1px solid var(--line,rgba(255,255,255,.14));border-radius:12px;text-decoration:none;color:inherit;transition:border-color .2s ease,transform .2s ease}
.ms-net__link:hover,.ms-net__link:focus-visible{border-color:var(--accent,#8bd450);transform:translateY(-1px)}
.ms-net__name{font-weight:700;font-size:.95rem}
.ms-net__note{font-size:.82rem;color:var(--muted,#9aa0a6)}
.ms-net__theme{align-self:flex-start;margin-top:6px;font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;padding:2px 8px;border-radius:999px;border:1px solid var(--line,rgba(255,255,255,.18))}
.ms-net__line{margin:0;font-size:.82rem;color:var(--muted,#9aa0a6)}
.ms-net__kicker{margin-right:6px;font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;opacity:.75}
.ms-net--maintenance{margin-top:22px}
@media (max-width:520px){.ms-net__list{grid-template-columns:1fr 1fr}}
