/* Know Your ML — consolidated stylesheet.
   Formerly 17 modular files loaded via @import; now merged
   into a single file to eliminate sequential CSS blocking.
   Order: tokens → reset → utilities → components → responsive. */

/* === Self-hosted fonts ===
   Fraunces / Newsreader / Instrument Sans, variable, latin + latin-ext +
   vietnamese subsets (unicode-range loads only what a page uses). Served from
   /fonts with ?v= so .htaccess caches them as immutable. They used to come
   from Google Fonts: a cross-origin, render-blocking stylesheet plus a second
   handshake before the first glyph. Same files, same-origin. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/fraunces-vietnamese.woff2?v=1") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/fraunces-latin-ext.woff2?v=1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/fraunces-latin.woff2?v=1") format("woff2");
  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: "Instrument Sans";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-italic-latin-ext.woff2?v=1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-italic-latin.woff2?v=1") format("woff2");
  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: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-ext.woff2?v=1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin.woff2?v=1") format("woff2");
  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: "Newsreader";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/newsreader-italic-vietnamese.woff2?v=1") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/newsreader-italic-latin-ext.woff2?v=1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/newsreader-italic-latin.woff2?v=1") format("woff2");
  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: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/newsreader-vietnamese.woff2?v=1") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/newsreader-latin-ext.woff2?v=1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/newsreader-latin.woff2?v=1") format("woff2");
  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;
}

/* === Tokens — "Rose Ink" brand system ===
   Direction: the visual language of a marked-up engineering drawing. Cool
   graphite-blue stock (a printed blueprint, not a warm archive), one hot
   rose-ink accent reserved for reference and interaction — the editor's mark
   on a citation — glacier cyan held back for data and live signal, steel for
   structure. Voxel/grid motif unchanged.

   Two earlier directions were rejected and are deliberately excluded:
   indigo/violet + mint (generic AI-startup gradient) and brass/ember on warm
   brown (generic archival-editorial). Nothing here is violet, mint, brown or
   amber: the only warm hue in the system is the rose ink, and it is a rose,
   not an orange. Hue geometry: base 213 deg (near-neutral graphite) with a
   split-complementary pair at 344 deg (rose) and 188 deg (glacier), so the
   page reads as one ink plus one signal rather than a gradient rainbow.

   Contrast (measured, WCAG 2.1 relative luminance):
     --text       16.4:1 on --bg      --muted       7.9:1 on --surface
     --accent      6.1:1 on --surface --muted-dim   6.0:1 on --surface
     --accent-2    9.0:1 on --surface --accent-3    9.4:1 on --surface
     white on --accent-strong 5.8:1   --accent-ink on --accent   7.0:1
   --accent on --surface-hover is 4.8:1, the tightest pair in the system:
   do not darken --accent, lighten --surface-hover, and never set white text
   on --accent / --accent-2 / --accent-3 (use --accent-ink) without
   re-measuring. */
:root {
  color-scheme: dark;

  /* Surfaces — graphite-blue blueprint stock */
  --bg: #0b1016;
  --bg-elev: #101720;
  --surface: #141c26;
  --surface-raised: #1a242f;
  --surface-hover: #21303d;
  --source-bg: #1a242f;

  /* Text — cool paper */
  --text: #e9eef4;
  --text-strong: #fbfdff;
  --muted: #a3b2c0;
  --muted-dim: #8b9aa9;

  /* Signature accents: rose ink is the reference/interaction colour and the
     only warm hue in the system; glacier cyan is the data/informational one;
     steel and deep steel are structural. */
  --accent: #f76b92;
  --accent-hover: #ff8aa9;
  --accent-strong: #c02650;
  --accent-strong-hover: #d63a63;
  --accent-2: #5ecbdb;
  --accent-2-hover: #83dcea;
  --accent-3: #a9c2dc;
  --accent-4: #6d8aa8;
  /* Type and glyphs that sit ON a rose, glacier or vermilion fill. */
  --accent-ink: #1a040a;
  --accent-soft: rgba(247, 107, 146, 0.12);
  --accent-soft-strong: rgba(247, 107, 146, 0.2);

  /* Brand gradient — rose ink pressed into deep crimson. Used for the logo
     tile, the header hairline and the nav underline. Deliberately kept dark:
     the tile carries a single light glyph colour, so every stop holds white
     at >= 5.7:1 (a brighter rose end would fail one end of the ramp). */
  --brand-gradient: linear-gradient(
    135deg,
    #7f1a3a 0%,
    #c02650 45%,
    #8f2a4d 100%
  );
  --brand-gradient-soft: linear-gradient(
    135deg,
    rgba(192, 38, 80, 0.18) 0%,
    rgba(247, 107, 146, 0.1) 50%,
    rgba(94, 203, 219, 0.14) 100%
  );

  /* Semantic */
  --danger: #ff6f5e;

  /* Lines & shadows — warm neutral, never blue-black */
  --border: #253341;
  --border-strong: #35485a;
  --border-accent: rgba(247, 107, 146, 0.35);
  --shadow:
    0 2px 6px rgba(3, 7, 12, 0.45), 0 12px 32px -18px rgba(3, 7, 12, 0.9);
  --shadow-lg:
    0 24px 60px -24px rgba(3, 7, 12, 0.95), 0 4px 12px -4px rgba(3, 7, 12, 0.6);

  /* Geometry */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  /* Rhythm */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --header-h: 68px;
  --measure: 68ch;

  /* Type — three roles, one owner each (links in the page <head>):
       --font-display  Fraunces      headings, wordmark. Variable serif with an
                                     optical-size axis, so one file covers both
                                     56px editorial titles and 20px section
                                     titles; `font-optical-sizing: auto` picks
                                     the cut.
       --font-serif    Newsreader    long-form reading (body, articles). Low
                                     contrast, generous x-height, made for it.
       --font-sans     Instrument    UI chrome: nav, buttons, labels, meta,
                       Sans          captions, data cells.
       --font-mono     system stack  arXiv ids, code, instrument readouts. No
                                     download: the OS ships a good one. */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:
    "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
}

@media (prefers-contrast: more) {
  :root {
    --muted: #cbd6e0;
    --border: #55708a;
  }
}

/* === Reset & base === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-serif);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

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

/* === Utilities === */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  z-index: 100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Section eyebrow label — quiet neutral, not link-blue: labels are not links. */
.section-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Boost specificity to override .content-page p color */
.section-label.section-label {
  color: var(--muted);
}

.section-label--centered {
  text-align: center;
}

.section-label--spaced {
  margin-bottom: 1rem;
}

/* Section divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0 2rem;
}

/* === Header === */
.site-header {
  background-color: var(--bg-elev);
  background-color: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Gradient hairline that anchors the sticky bar to the brand. */
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 1px;
  background: var(--brand-gradient);
  opacity: 0.5;
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
  position: relative;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  gap: 5px;
  touch-action: manipulation;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.logo:hover,
.logo:focus {
  text-decoration: none;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-sm);
  background: var(--brand-gradient);
  color: var(--text-strong);
  flex: 0 0 auto;
  box-shadow: 0 4px 14px -6px rgba(192, 38, 80, 0.9);
}

.logo-mark svg {
  width: 1.55rem;
  height: 1.55rem;
  display: block;
}

/* Text-only fallback for the rare context where the SVG mark is absent. */
.logo-mark--text {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.logo-text {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* The wordmark's "ML" is glacier in both the fallback and the solid-accent
   layer further down; see "Solid accents" below. */
.logo-text em {
  font-style: normal;
}

.primary-nav {
  display: flex;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  position: relative;
  transition: color 0.15s ease;
}

/* Animated gradient underline on hover — subtle, on-brand. */
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.55rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-list a:hover::after,
.nav-list a:focus-visible::after {
  transform: scaleX(1);
}

.nav-list a:hover,
.nav-list a:focus {
  color: var(--text);
  text-decoration: none;
}

/* Current-page marker for the header nav. */
.nav-list a[aria-current="page"] {
  color: var(--text);
}

.nav-list a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* === Hero === */
.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem);
  text-align: center;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
}

/* Aurora wash + voxel grid: the brand's "neural map" backdrop. Pure CSS so it
   renders instantly and stays under the canvas layer. Duotone on purpose —
   deep rose where the copy starts, glacier cyan on the opposite corner — so
   the backdrop already states the palette instead of tinting everything one
   hue. */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 150%;
  z-index: -1;
  background:
    radial-gradient(
      42rem 26rem at 18% 8%,
      rgba(192, 38, 80, 0.24),
      transparent 65%
    ),
    radial-gradient(
      38rem 24rem at 84% 12%,
      rgba(94, 203, 219, 0.18),
      transparent 62%
    ),
    radial-gradient(
      30rem 20rem at 55% 96%,
      rgba(247, 107, 146, 0.16),
      transparent 60%
    );
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(169, 194, 220, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 194, 220, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(
    70% 60% at 50% 40%,
    #000 30%,
    transparent 100%
  );
  pointer-events: none;
}

/* --- Hero figure: the voxel network canvas (js/hero-voxel.js) ---
   Decorative and non-interactive; the copy above it stays selectable. The
   module adds .is-ready after its first painted frame, so the canvas fades in
   rather than popping. The mask keeps the figure from looking cropped where
   it leaves the hero, and re-centres as the layout moves the figure. */
.hero-art {
  --hero-art-opacity: 1;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease;
  mask-image: radial-gradient(85% 78% at 70% 46%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(
    85% 78% at 70% 46%,
    #000 40%,
    transparent 100%
  );
}
.hero-art.is-ready {
  opacity: var(--hero-art-opacity);
}
.hero-art canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 1159px) {
  /* No room beside the copy: the figure steps back and sits centred. */
  .hero-art {
    --hero-art-opacity: 0.72;
    mask-image: radial-gradient(80% 76% at 60% 46%, #000 38%, transparent 100%);
    -webkit-mask-image: radial-gradient(
      80% 76% at 60% 46%,
      #000 38%,
      transparent 100%
    );
  }
}

@media (max-width: 899px) {
  .hero-art {
    --hero-art-opacity: 0.55;
    mask-image: radial-gradient(80% 72% at 50% 46%, #000 34%, transparent 100%);
    -webkit-mask-image: radial-gradient(
      80% 72% at 50% 46%,
      #000 34%,
      transparent 100%
    );
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 60rem;
}

.hero .hero-content {
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.55rem;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(6px);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.hero-eyebrow .dot-live {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent-2);
  flex: 0 0 auto;
}

.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(2.4rem, 7vw, 4.25rem);
  font-weight: 700;
  line-height: 1.02;
  margin: 0 0 1.25rem;
  letter-spacing: -0.035em;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--muted);
  max-width: 44rem;
  margin: 0 auto 2.25rem;
  line-height: 1.55;
}

.hero-small {
  padding: 3.5rem 0 2.5rem;
}

.hero-small h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Proof strip under hero CTAs — real counts rendered by app.js when data loads. */

/* Live stat strip: readable, single-line on desktop, wraps on mobile. */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
  margin: 2.5rem auto 0;
  padding: 1.1rem 1.25rem;
  max-width: 46rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(8px);
  list-style: none;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
}

.hero-stats .stat-value {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.hero-stats .stat-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-dim);
}

/* === Buttons === */
.button,
a,
select,
input,
.nav-toggle,
.source {
  touch-action: manipulation;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.2s ease,
    color 0.15s ease;
}

.button:hover {
  text-decoration: none;
}

.button:active {
  transform: translateY(1px);
}

.button .button-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.button-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button-secondary {
  background-color: color-mix(in srgb, var(--surface-raised) 75%, transparent);
  color: var(--text);
  border-color: var(--border-strong);
}

.button-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background-color: var(--accent-soft);
}

.button-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button-ghost {
  background-color: transparent;
  color: var(--muted);
  border-color: transparent;
}

.button-ghost:hover {
  background-color: var(--accent-soft);
  color: var(--text);
}

.button-ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button-lg {
  min-height: 52px;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.button-sm {
  min-height: 38px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
}

.button-block {
  width: 100%;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.button:disabled:hover {
  background-color: inherit;
}

/* === Sections === */
.section {
  padding: 4rem 0;
}

.section-alt {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.section-lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

/* === About === */
/* (The generic about cards were replaced by the .spec-sheet instrument
   grid — see the theme layer at the end of this file.) */

.content-page {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.content-page h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

.content-page h2:first-child {
  margin-top: 0;
}

.content-page p,
.content-page li {
  color: var(--text);
  line-height: 1.65;
}

.content-page li {
  margin-bottom: 0.5rem;
}

.content-page ul,
.content-page ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.content-page .back-link {
  margin-top: 2.5rem;
}

/* === Filters === */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-search {
  flex: 1 1 220px;
  min-width: 160px;
}

.filter-reset {
  flex: 0 0 auto;
}

.filter-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

select,
input[type="search"],
input[type="email"] {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
}

select:focus,
input[type="search"]:focus,
input[type="email"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-3) 15%, transparent);
}

/* === Skeleton loaders === */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-raised) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
  pointer-events: none;
}

.skeleton-title {
  height: 1.4rem;
  width: 85%;
  margin-bottom: 0.5rem;
}

.skeleton-meta {
  height: 0.8rem;
  width: 60%;
  margin-bottom: 0.75rem;
}

.skeleton-authors {
  height: 0.9rem;
  width: 70%;
  margin-bottom: 1rem;
}

.skeleton-summary {
  height: 0.95rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

.skeleton-summary:nth-child(2) {
  width: 95%;
}
.skeleton-summary:nth-child(3) {
  width: 90%;
}
.skeleton-summary:nth-child(4) {
  width: 85%;
  margin-bottom: 1.25rem;
}

.skeleton-tags {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
}

.skeleton-tag {
  height: 1.2rem;
  width: 4rem;
}

.skeleton-tag:nth-child(2) {
  width: 3rem;
}
.skeleton-tag:nth-child(3) {
  width: 2.5rem;
}

/* === Back to top === */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background-color 0.15s ease;
  z-index: 40;
  padding: 0;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--surface-raised);
  border-color: var(--accent);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === Paper count badge === */
.paper-count {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1rem;
  min-height: 1.2rem;
}

/* === Related reports (report.php) === */
.related-reports {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related-reports h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
}

/* === Search page === */
.search-form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  max-width: 640px;
}

.search-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
}

.search-hint {
  text-align: center;
}

.search-results-count {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.search-group-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 520px) {
  .search-form {
    flex-direction: column;
  }
  .search-form .button {
    width: 100%;
  }
}

/* === Papers toolbar (scan + last-updated) === */
.papers-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.papers-updated {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

/* === Status message === */
.status-message {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
  font-family: var(--font-sans);
}

.status-message:empty {
  display: none;
}

.status-message.is-error {
  color: #ff6f5e;
  background: color-mix(in srgb, var(--danger) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.status-message.is-loading::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.5rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: middle;
  animation: status-spin 0.7s linear infinite;
}

@keyframes status-spin {
  to {
    transform: rotate(360deg);
  }
}

/* === Cards === */
.papers-grid,
.briefs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    background-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  background-color: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.card:focus-within {
  border-color: var(--accent);
}

/* Gradient top edge that only resolves on hover — quiet at rest. */
.card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.card-title a {
  color: var(--text);
  /* Enlarge the tap target without shifting the layout. */
  display: inline-block;
  padding: 0.15rem 0.25rem;
  margin: -0.15rem -0.25rem;
}

.card-title a:hover,
.card-title a:focus {
  color: var(--accent);
  text-decoration: none;
}

.card-meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.card-authors {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.card-summary {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0 0 1.25rem;
  /* Neither grow nor shrink: Chrome blockifies a flex item's -webkit-box, which
     silently drops the clamp, so a growing/shrinking box cut text mid-line.
     The tag row below pins itself to the card bottom with margin-top: auto, so
     the summary has no reason to stretch. max-height is the hard 4-line cap
     (line-height 1.6) for engines where the clamp is dropped. */
  flex: 0 0 auto;
  line-height: 1.6;
  max-height: 6.4em;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background-color: var(--accent-soft);
  border: 1px solid transparent;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
}

.tag[href]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tag[href]:hover {
  background-color: var(--accent-soft-strong);
  border-color: var(--border-accent);
  text-decoration: none;
}

.tag[href].tag-primary:hover {
  filter: brightness(1.1);
}

/* === Reports grid === */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.report-card .card-title a {
  color: var(--text);
}

.report-card .card-title a:hover,
.report-card .card-title a:focus {
  color: var(--accent);
}

/* === Report type filter pills === */
.report-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-pill {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter-pill.is-active {
  background-color: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.filter-pill.is-active:hover {
  background-color: var(--accent-strong-hover);
  border-color: var(--accent-strong-hover);
}

/* === Briefs === */
.brief-card .card-summary {
  font-style: italic;
}

.brief-sources {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
  line-height: 1.7;
}

.brief-sources a {
  /* Enlarge tap target to meet WCAG 2.5.8 (min 24px). */
  display: inline-block;
  padding: 0.15rem 0.2rem;
  margin: -0.15rem -0.2rem;
}

.brief-sources strong {
  color: var(--text);
}

/* === Sources === */
.source-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.source {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  background-color: var(--source-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.source:hover,
.source:focus {
  background-color: var(--surface);
  border-color: var(--accent);
  outline: none;
  text-decoration: none;
}

.source img {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  display: block;
}

.source svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  display: block;
  color: var(--muted);
}

.source--no-icon {
  gap: 0.4rem;
}

/* === Pagination === */
.pagination {
  text-align: center;
  margin-top: 2.5rem;
}

.button.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.button.is-loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, var(--accent-3) 30%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: status-spin 0.7s linear infinite;
}

/* === Footer === */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-inner {
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--text);
  font-weight: 500;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--accent);
}

.footer-credit {
  margin: 0 0 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.footer-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* === Install prompt === */
.install-prompt {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(3, 7, 12, 0.08);
  padding: 1rem 1.5rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateY(0);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.install-prompt[hidden] {
  display: none;
}

.install-prompt.is-hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.install-prompt-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.install-prompt-icon img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
}

.install-prompt-body {
  flex: 1;
  min-width: 0;
}

.install-prompt-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.install-prompt-body p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.install-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.install-ios-steps {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background-color: var(--source-bg);
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
}

.install-ios-steps p {
  margin: 0;
}

.ios-share {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--accent);
}

.ios-share::before {
  content: "↑";
  display: inline-block;
  font-size: 1rem;
}

/* === Report content (report.php) === */
.report-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.report-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}

.report-reading-time {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
}

.report-header h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.report-description {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.report-byline {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.report-content {
  font-size: 1.05rem;
  line-height: 1.7;
}

.report-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.report-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
}

.report-content p {
  margin: 0 0 1.1rem;
}

.report-content ul,
.report-content ol {
  padding-left: 1.5rem;
  margin: 0 0 1.25rem;
}

.report-content li {
  margin-bottom: 0.4rem;
}

.report-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-style: italic;
}

.report-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.report-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background-color: var(--source-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.report-content pre {
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

.report-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.report-figure {
  margin: 1.5rem 0 1.75rem;
  padding: 1rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.report-figure svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.report-figure figcaption {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.75rem;
  text-align: center;
}

.report-sources {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.report-sources h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.report-sources ul {
  padding-left: 1.5rem;
  margin: 0;
}

.report-sources li {
  margin-bottom: 0.5rem;
  color: var(--muted);
}

/* === Ebook promotion card ===
   Horizontal card layout with cover image on left, content on right.
   Uses site design tokens. Adapts to vertical layout on mobile. */

.ebook-card {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  align-items: flex-start;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.ebook-card:hover,
.ebook-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(3, 7, 12, 0.08);
  text-decoration: none;
}

.ebook-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Cover image container */
.ebook-card-cover {
  flex-shrink: 0;
  width: 120px;
  height: 170px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  background: var(--surface);
}

.ebook-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback when image fails to load */
.ebook-card-cover-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.ebook-card-cover img[data-failed] {
  display: none;
}

.ebook-card-cover img[data-failed] + .ebook-card-cover-fallback {
  display: flex;
}

/* Content area */
.ebook-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Meta row: badge + stats */
.ebook-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ebook-card-badge {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  display: inline-block;
}

.ebook-card-stats {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--muted);
}

.ebook-card-stats span + span::before {
  content: " · ";
}

/* Title */
.ebook-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.35rem;
  color: var(--text);
}

/* Description */
.ebook-card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

/* Publisher line */
.ebook-card-publisher {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* Price + CTA row */
.ebook-card-action {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.ebook-card-price {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.ebook-card-cta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.ebook-card:hover .ebook-card-cta,
.ebook-card:focus-visible .ebook-card-cta {
  color: var(--accent-hover);
}

.ebook-card-cta::after {
  content: " →";
}

/* ── Placement inside sections ── */
.ebook-card-wrapper {
  max-width: 640px;
  margin: 0 auto;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .ebook-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .ebook-card-cover {
    width: 100px;
    height: 142px;
  }

  .ebook-card-meta {
    justify-content: center;
  }

  .ebook-card-action {
    justify-content: center;
  }
}

/* === "Remain Valuable" ebook promotion ===
   Site-native placements for the Gumroad eBook "How to Remain Valuable
   When Intelligence Becomes Cheap" (224 pages). The cards
   reuse .ebook-card above; these are the quiet additions:
   .ebook-ribbon       — slim dismissible strip under the homepage header.
   .ebook-card--feature — full-width horizontal card above the #author grid.
   .ebook-card--article — in-article spacing for report.php / search.php.
   .ebook-line         — centred one-line text CTA (playground, 404).
   .footer-ebook       — one-line footer mention, site-wide.
   .newsletter-ebook   — quiet line inserted after a successful signup. */

.ebook-ribbon {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
}

.ebook-ribbon[hidden] {
  display: none;
}

.ebook-ribbon-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.ebook-ribbon-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  line-height: 1.45;
}

.ebook-ribbon-text strong {
  color: var(--text);
  font-weight: 600;
}

.ebook-ribbon-text a {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.ebook-ribbon-text a:hover {
  color: var(--accent-hover);
}

.ebook-ribbon-close {
  flex: 0 0 auto;
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

.ebook-ribbon-close:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.ebook-ribbon a:focus-visible,
.ebook-ribbon-close:focus-visible,
.ebook-line a:focus-visible,
.footer-ebook a:focus-visible,
.newsletter-ebook a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Featured card: spans the #author section above the two existing
   product cards, staying horizontal where they stack. */
.ebook-card--feature {
  max-width: 100%;
  margin-bottom: 1.25rem;
  align-items: center;
}

#author .ebook-card.ebook-card--feature {
  flex-direction: row;
  text-align: left;
}

#author .ebook-card.ebook-card--feature .ebook-card-cover {
  flex: 0 0 150px;
  width: 150px;
  height: 212px;
  aspect-ratio: auto;
}

.ebook-card--feature .ebook-card-title {
  font-size: 1.3rem;
}

/* In-article spacing, matching .kit-row--article. */
.ebook-card--article {
  margin: 1.6rem 0;
}

/* Stacked "Also by the creator" cards: the first card has no bottom
   margin of its own, so the gap comes from the follower. */
.ebook-card + .ebook-card,
.ebook-card + .kit-row {
  margin-top: 1.25rem;
}

/* Quiet centred text CTA. */
.ebook-line {
  max-width: 62ch;
  margin: 0 auto;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.ebook-line strong {
  color: var(--text);
  font-weight: 600;
}

.ebook-line a {
  color: var(--accent);
  font-weight: 600;
}

.ebook-line a:hover {
  color: var(--accent-hover);
}

.ebook-line--spaced {
  margin-top: 2rem;
}

/* Footer mention: same size and rhythm as .footer-note. */
.footer-ebook {
  margin: 0.75rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-ebook a {
  color: var(--text);
  font-weight: 500;
}

.footer-ebook a:hover,
.footer-ebook a:focus {
  color: var(--accent);
}

/* Post-signup line under the newsletter status. */
.newsletter-ebook {
  margin: 0.5rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
}

.newsletter-ebook a {
  color: var(--accent);
  font-weight: 600;
}

.newsletter-ebook a:hover {
  color: var(--accent-hover);
}

@media (max-width: 640px) {
  #author .ebook-card.ebook-card--feature {
    flex-direction: column;
    text-align: center;
  }

  #author .ebook-card.ebook-card--feature .ebook-card-cover {
    flex: none;
    width: 110px;
    height: 156px;
  }

  #author .ebook-card.ebook-card--feature .ebook-card-meta,
  #author .ebook-card.ebook-card--feature .ebook-card-action {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .ebook-ribbon {
    font-size: 0.8rem;
  }

  .ebook-ribbon-text a {
    white-space: normal;
  }
}

/* === Toolkit promotion (Machine Learning Decision Toolkit) ===
   Three presentations of the same product, all sharing the site's
   design tokens and the cover's onerror-fallback pattern:
   .toolkit-card — flagship image-led card (index.html); horizontal on
                   desktop, stacked cover-on-top on mobile.
   .kit-row      — compact row card (about.html, reports.html and the
                   in-article promo in report.php).
   .kit-banner   — full-width strip (playground.html, after the tools). */

.toolkit-card-wrapper {
  max-width: 720px;
  margin: 0 auto;
}

.toolkit-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.toolkit-card:hover,
.toolkit-card:focus-visible,
.kit-row:hover,
.kit-row:focus-visible,
.kit-banner:hover,
.kit-banner:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(3, 7, 12, 0.08);
  text-decoration: none;
}

.toolkit-card:focus-visible,
.kit-row:focus-visible,
.kit-banner:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Flagship cover: fills the left column on desktop, full-width strip
   on mobile (aspect-ratio keeps the row from collapsing). */
.toolkit-card-cover {
  flex: 0 0 300px;
  min-height: 230px;
  position: relative;
  background: #141c26; /* matches the cover art while the image loads */
}

.toolkit-card-cover img,
.kit-row-thumb img,
.kit-banner-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.toolkit-card-cover-fallback,
.kit-row-thumb-fallback,
.kit-banner-cover-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.toolkit-card-cover img[data-failed],
.kit-row-thumb img[data-failed],
.kit-banner-cover img[data-failed] {
  display: none;
}

.toolkit-card-cover img[data-failed] + .toolkit-card-cover-fallback,
.kit-row-thumb img[data-failed] + .kit-row-thumb-fallback,
.kit-banner-cover img[data-failed] + .kit-banner-cover-fallback {
  display: flex;
}

.toolkit-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.4rem 1.5rem;
}

.toolkit-card-meta,
.kit-row-meta,
.kit-banner-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolkit-card-badge,
.kit-row-badge,
.kit-banner-badge {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.toolkit-card-stats,
.kit-row-stats,
.kit-banner-stats {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--muted);
}

.toolkit-card-stats span + span::before,
.kit-row-stats span + span::before,
.kit-banner-stats span + span::before {
  content: " · ";
}

.toolkit-card-title,
.kit-banner-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  color: var(--text);
}

.toolkit-card-hook {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text);
  margin: 0;
}

.toolkit-card-desc,
.kit-banner-text {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.toolkit-card-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.4rem;
  margin: 0.15rem 0 0;
  padding: 0;
}

.toolkit-card-chips li {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  white-space: nowrap;
}

.toolkit-card-action,
.kit-row-action,
.kit-banner-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.toolkit-card-action {
  margin-top: auto;
  padding-top: 0.4rem;
}

.toolkit-card-price,
.kit-row-price,
.kit-banner-price {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.toolkit-card-cta,
.kit-row-cta,
.kit-banner-cta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  background-color: var(--accent-strong);
  color: #ffffff;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.toolkit-card:hover .toolkit-card-cta,
.toolkit-card:focus-visible .toolkit-card-cta,
.kit-row:hover .kit-row-cta,
.kit-row:focus-visible .kit-row-cta,
.kit-banner:hover .kit-banner-cta,
.kit-banner:focus-visible .kit-banner-cta {
  background-color: var(--accent-strong-hover);
}

.toolkit-card-cta::after,
.kit-row-cta::after,
.kit-banner-cta::after {
  content: " →";
}

/* Compact row card (about / reports / report.php in-article). */
.kit-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  margin: 0 0 1.25rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.kit-row-thumb {
  flex: 0 0 150px;
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  background: #141c26;
}

.kit-row-body {
  flex: 1;
  min-width: 0;
}

.kit-row-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0.15rem 0 0.25rem;
  color: var(--text);
}

.kit-row-desc {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 0.6rem;
}

.kit-row--article {
  margin: 1.6rem 0;
}

/* Playground banner strip. */
.kit-banner {
  display: flex;
  flex-direction: row-reverse; /* cover on the right */
  align-items: stretch;
  max-width: 720px;
  margin: 0 auto;
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.kit-banner-cover {
  flex: 0 0 260px;
  min-height: 190px;
  position: relative;
  background: #141c26;
}

.kit-banner-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.3rem 1.4rem;
}

.kit-banner-action {
  margin-top: auto;
  padding-top: 0.5rem;
}

/* Toolkit card responsive: stack cover on top on small screens. */
@media (max-width: 640px) {
  .toolkit-card {
    flex-direction: column;
  }

  .toolkit-card-cover {
    flex: none;
    width: 100%;
    min-height: 0;
    aspect-ratio: 3 / 2;
  }

  .toolkit-card-body {
    padding: 1.1rem 1.2rem;
  }

  .kit-banner {
    flex-direction: column;
  }

  .kit-banner-cover {
    flex: none;
    width: 100%;
    min-height: 0;
    aspect-ratio: 3 / 2;
    order: -1;
  }
}

@media (max-width: 520px) {
  .kit-row {
    flex-direction: column;
    align-items: stretch;
  }

  .kit-row-thumb {
    flex: none;
    width: 100%;
  }
}

/* Author section: the two product cards sit side by side, each stacked
   cover-on-top so neither column gets squeezed. */
#author .toolkit-card,
#author .ebook-card {
  flex-direction: column;
  height: 100%;
}

#author .toolkit-card-cover {
  flex: none;
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 7;
}

#author .ebook-card-cover {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 7;
}

#author .ebook-card-cover img {
  position: absolute;
  inset: 0;
}

#author .toolkit-card-body,
#author .ebook-card-body {
  flex: 1;
}

/* === Responsive === */
@media (max-width: 720px) {
  .container {
    padding: 0 1rem;
  }

  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(3, 7, 12, 0.04);
    padding: 0.5rem 1rem 1rem;
  }

  .primary-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .nav-list li {
    border-bottom: 1px solid var(--border);
  }

  .nav-list li:last-child {
    border-bottom: none;
  }

  .nav-list a {
    display: flex;
    width: 100%;
    padding: 0.75rem 0;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .hero-actions .button {
    width: 100%;
  }

  .section {
    padding: 2.25rem 0;
  }

  .section-header {
    margin-bottom: 1.75rem;
  }

  .filters {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.6rem;
  }

  .filter-group,
  .filter-search,
  .filter-reset {
    width: 100%;
  }

  .filter-reset .button {
    width: 100%;
  }

  .filter-share .button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }

  select,
  input[type="search"] {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 0.65rem 0.75rem;
  }

  .papers-grid,
  .briefs-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .card-title {
    font-size: 1.15rem;
  }

  .card-summary {
    font-size: 1rem;
  }

  .source {
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem;
  }

  .install-prompt {
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .install-prompt-content {
    align-items: center;
  }

  .install-prompt-body h3 {
    font-size: 1rem;
  }

  .install-prompt-body p {
    font-size: 0.9rem;
  }

  .install-prompt-actions {
    flex-direction: row;
  }

  .install-prompt-actions .button {
    flex: 1 1 auto;
  }
}

@media (max-width: 360px) {
  .logo-text {
    font-size: 1.1rem;
  }

  .logo-mark {
    width: 2rem;
    height: 2rem;
    font-size: 0.7rem;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 10vw, 2.25rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* === Playground page === */
.playground-header {
  text-align: center;
  padding: 0 0 0.5rem;
}

.playground-header p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* Tool card */
.tool-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.tool-card-header {
  padding: 1.25rem 1.5rem 0;
}

.tool-card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.tool-card-header p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.tool-canvas-wrap {
  position: relative;
  padding: 1rem 1.5rem;
}

.tool-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  touch-action: none;
}

.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0 1.5rem 1.25rem;
  align-items: center;
}

.tool-controls label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-controls input[type="range"] {
  width: 100px;
  accent-color: var(--accent);
}

.tool-controls select {
  min-height: 36px;
  padding: 0.35rem 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text);
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tool-btn {
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background-color: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tool-btn:hover,
.tool-btn:focus {
  /* Tint built from the token, not a copy of it: 12% of --accent-3 keeps
     --accent rose text at >= 4.7:1 on the resulting fill. */
  background-color: color-mix(in srgb, var(--accent-3) 12%, transparent);
}

/* Active state for toggle buttons (activation explorer, perceptron class picker) */
/* A 14% rose wash reads as "this one is chosen" and still holds --accent
   text at 5.0:1; a heavier wash drops under 4.5:1 and fails WCAG AA. */
.tool-btn.is-active {
  background-color: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}

.tool-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tool-controls input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tool-controls select:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-3) 15%, transparent);
}

.tool-value {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 2rem;
  text-align: center;
}

/* Tooltip / info popup */
.tool-info {
  padding: 0.65rem 1.5rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--border);
}

/* Mobile */
@media (max-width: 720px) {
  .tool-card-header {
    padding: 1rem 1rem 0;
  }
  .tool-canvas-wrap {
    padding: 0.75rem 1rem;
  }
  .tool-controls {
    padding: 0 1rem 1rem;
    gap: 0.5rem;
  }
  .tool-controls input[type="range"] {
    width: 80px;
  }
  .tool-info {
    padding: 0.5rem 1rem 1rem;
  }
}

/* =====================================================================
   Brand component layer — visual language "Rose Ink".
   Everything below is additive and namespaced to brand-* / new component
   classes, so it cannot regress the legacy components above.
   ===================================================================== */

/* --- Global polish ------------------------------------------------- */
::selection {
  background: rgba(247, 107, 146, 0.32);
  color: var(--text-strong);
}

html {
  /* Anchors land below the sticky header instead of under it. */
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  background-image: radial-gradient(
    60rem 40rem at 50% -10rem,
    rgba(94, 203, 219, 0.09),
    transparent 70%
  );
  background-attachment: fixed;
}

/* Thin, brand-tinted scrollbar (progressive enhancement only). */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-strong);
}

/* Respect the OS setting without shipping a JS motion manager. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Section headers ------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.section-head .section-head-text {
  max-width: 46rem;
}

.section-title {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0.35rem 0 0.5rem;
}

.section-lead {
  color: var(--muted);
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
}

.section-link {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.section-link::after {
  content: "\2192";
  transition: transform 0.2s ease;
}

.section-link:hover::after {
  transform: translateX(3px);
}

.section-label--spaced {
  margin-bottom: 0.25rem;
}

.section-label--centered {
  display: block;
  text-align: center;
}

/* --- Layout helpers -------------------------------------------------- */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 1.25rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.stack-2 > * + * {
  margin-top: 0.5rem;
}

/* --- Feature / value cards ------------------------------------------- */
.feature-card {
  position: relative;
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    180deg,
    var(--surface-raised) 0%,
    var(--surface) 100%
  );
  overflow: hidden;
}

.feature-card .feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--brand-gradient-soft);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature-card .feature-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.feature-card h3 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
}

.feature-card p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0;
}

/* Numeric step cards for "how it works". */
.step-card .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

/* --- Stats ----------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stat-grid > * {
  background: var(--surface);
  padding: 1.35rem 1.25rem;
  text-align: center;
}

.stat-grid .stat-value {
  display: block;
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-grid .stat-label {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-dim);
}

/* --- Callouts (used inside articles and landing sections) ------------ */
.callout {
  position: relative;
  margin: 1.75rem 0;
  padding: 1.15rem 1.25rem 1.15rem 1.4rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-raised);
  font-family: var(--font-sans);
}

.callout > :first-child {
  margin-top: 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout .callout-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 0.6rem;
  color: var(--accent);
}

.callout-key {
  border-left-color: var(--accent-3);
  background: linear-gradient(
    135deg,
    rgba(169, 194, 220, 0.09),
    transparent 70%
  );
}

.callout-key .callout-title {
  color: var(--accent-3);
}

.callout-insight {
  border-left-color: var(--accent-2);
  background: linear-gradient(135deg, rgba(94, 203, 219, 0.1), transparent 70%);
}

.callout-insight .callout-title {
  color: var(--accent-2);
}

.callout ul {
  margin: 0;
  padding-left: 1.15rem;
}

.callout li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0.35rem 0;
}

/* --- Article prose refinements --------------------------------------- */
.report-content {
  max-width: var(--measure);
}

.report-content h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2.5rem 0 0.9rem;
  padding-top: 0.25rem;
}

.report-content h2::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 3px;
  margin-bottom: 0.85rem;
  border-radius: 3px;
  background: var(--brand-gradient);
}

.report-content h3 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 1.9rem 0 0.6rem;
}

.report-content p {
  font-size: 1.075rem;
  line-height: 1.75;
}

.report-content a {
  text-decoration: underline;
  text-decoration-color: var(--border-accent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

.report-content a:hover {
  text-decoration-color: var(--accent);
}

.report-content ul,
.report-content ol {
  padding-left: 1.3rem;
}

.report-content li {
  margin: 0.4rem 0;
  line-height: 1.7;
}

.report-content li::marker {
  color: var(--accent);
}

.report-content blockquote {
  margin: 1.6rem 0;
  padding: 0.35rem 0 0.35rem 1.25rem;
  border-left: 3px solid var(--accent-4);
  color: var(--muted);
  font-style: italic;
}

.report-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: var(--radius-xs);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.report-content pre {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  overflow-x: auto;
}

.report-content pre code {
  border: none;
  background: none;
  padding: 0;
}

/* Per-article identity: generated voxel cover art. */
.voxel-cover {
  position: relative;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-raised);
  aspect-ratio: 16 / 6;
  min-height: 9rem;
}

.voxel-cover svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.voxel-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(11, 16, 22, 0.72) 0%,
    rgba(11, 16, 22, 0.25) 55%,
    transparent 100%
  );
  pointer-events: none;
}

.voxel-cover .voxel-cover-label {
  position: absolute;
  left: 1.15rem;
  bottom: 1rem;
  z-index: 1;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

/* --- Table of contents ----------------------------------------------- */
.toc {
  margin: 2rem 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-family: var(--font-sans);
}

.toc h2,
.toc .toc-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-dim);
  margin: 0 0 0.85rem;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  margin: 0;
  padding: 0;
}

.toc li {
  counter-increment: toc;
  margin: 0.2rem 0;
}

.toc a {
  display: flex;
  gap: 0.6rem;
  padding: 0.3rem 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.4;
  text-decoration: none;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--accent);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.15em;
}

.toc a:hover,
.toc a.is-current {
  color: var(--text);
}

/* Reading progress bar (JS-driven width, CSS-driven look). */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  height: 3px;
  width: 0;
  background: var(--brand-gradient);
  transition: width 0.1s linear;
  pointer-events: none;
}

/* --- Share / cite ---------------------------------------------------- */
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
  font-family: var(--font-sans);
}

.share-row .share-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-dim);
  margin-right: 0.25rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease;
}

.share-btn:hover {
  border-color: var(--border-accent);
  color: var(--text);
  background: var(--surface-raised);
  text-decoration: none;
}

.share-btn svg {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
}

.share-btn.is-copied {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.cite-box {
  margin: 1.75rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.cite-box summary {
  cursor: pointer;
  padding: 0.9rem 1.15rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  list-style: none;
}

.cite-box summary::-webkit-details-marker {
  display: none;
}

.cite-box summary::before {
  content: "\00a7";
  margin-right: 0.5rem;
  color: var(--accent);
}

.cite-box[open] summary {
  border-bottom: 1px solid var(--border);
}

.cite-box .cite-body {
  padding: 1rem 1.15rem;
}

.cite-box pre {
  margin: 0 0 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  color: var(--muted);
}

/* --- FAQ ------------------------------------------------------------- */
.faq {
  margin: 2.5rem 0 0;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.faq details[open] {
  border-color: var(--border-accent);
}

.faq summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--accent);
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq .faq-answer {
  padding: 0 1.15rem 1.15rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.faq .faq-answer p {
  margin: 0;
}

/* --- Newsletter ------------------------------------------------------ */
.newsletter {
  position: relative;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  background: var(--brand-gradient-soft), var(--surface);
  overflow: hidden;
}

.newsletter h2,
.newsletter h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem;
}

.newsletter .newsletter-lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 46ch;
}

.newsletter-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  max-width: 32rem;
}

.newsletter-form input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
}

.newsletter-note {
  margin: 0.85rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted-dim);
}

.newsletter-status {
  margin: 0.75rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  min-height: 1.2rem;
}

.newsletter-status.is-error {
  color: var(--danger);
}

.newsletter-status.is-success {
  color: var(--accent-2);
}

/* Honeypot field: hidden from humans, tempting to bots. */
.newsletter-hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Collections / topics / learning paths --------------------------- */
.collection-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s ease,
    box-shadow 0.25s ease;
}

.collection-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.collection-card .collection-count {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.collection-card h3 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
}

.collection-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease;
}

.topic-chip:hover {
  border-color: var(--border-accent);
  background: var(--accent-soft);
  color: var(--text);
  text-decoration: none;
}

.topic-chip .topic-count {
  font-size: 0.72rem;
  color: var(--muted-dim);
  font-variant-numeric: tabular-nums;
}

.path-list {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.path-list li {
  counter-increment: step;
  position: relative;
  padding: 1rem 1.15rem 1rem 3.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.path-list li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-2);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
}

.path-list a {
  font-family: var(--font-sans);
  font-weight: 600;
}

.path-list .path-why {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Breadcrumbs ----------------------------------------------------- */
.breadcrumbs {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--muted-dim);
  margin: 0 0 1.25rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--border-strong);
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text);
}

/* --- Comparison table ------------------------------------------------ */
.compare-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  min-width: 34rem;
}

.compare th,
.compare td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare thead th {
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare tbody tr:last-child td {
  border-bottom: none;
}

.compare td.is-yes {
  color: var(--accent-2);
  font-weight: 600;
}

.compare td.is-no {
  color: var(--muted-dim);
}

/* --- Trust / source strip -------------------------------------------- */
/* (The checkmark trust strip was replaced by the .telemetry readout bar —
   see the theme layer at the end of this file.) */

/* --- Responsive additions for brand v2 ------------------------------- */
@media (max-width: 720px) {
  .section-head {
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .voxel-cover {
    aspect-ratio: 16 / 8;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form .button {
    width: 100%;
  }

  .share-row {
    gap: 0.4rem;
  }

  .share-row .share-label {
    width: 100%;
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 720px) {
  .discovery-field,
  .discovery-field--grow {
    flex: 1 1 100%;
    min-width: 0;
  }

  .report-card-head {
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 420px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Report discovery toolbar (reports.html) -------------------------- */
.report-discovery {
  margin-bottom: 1.25rem;
}

.discovery-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.discovery-field {
  flex: 0 1 auto;
  min-width: 10rem;
}

.discovery-field--grow {
  flex: 1 1 16rem;
}

.discovery-field select,
.discovery-field input[type="search"] {
  width: 100%;
}

.report-discovery .report-filters {
  justify-content: flex-start;
  margin-bottom: 0;
}

.report-count {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.report-empty {
  padding: 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-sans);
  text-align: center;
}

.report-card-head {
  margin-bottom: 1rem;
}

.voxel-thumb {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}

.report-primary-source {
  margin: 0 0 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--muted);
}

.report-collections {
  margin: 2rem 0 0;
}

.report-collections .topic-cloud {
  margin-top: 0.6rem;
}

/* --- Tight section variant (trust strips, inline CTA rows) ------------ */
.section-tight {
  padding: 1.5rem 0;
}

/* ================================================================
   Signal observatory — instrument theme layer.
   De-sloppified visual language: left-aligned editorial, mono
   instrument readouts, numbered sections, solid signal accents,
   and GPU art surfaces (hero engines, shader bands, voxel covers).
   These rules override the generic ones above; later wins.
   ================================================================ */

::selection {
  background: rgba(247, 107, 146, 0.3);
  color: var(--text-strong);
}

/* --- Solid accents: no gradient-clipped text, no gradient buttons --- */
.hero h1 .grad,
.stat-grid .stat-value,
.logo-text em {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--accent-2);
  -webkit-text-fill-color: var(--accent-2);
}

.button {
  border-radius: 10px;
}

/* Rose ink is the action colour: primary buttons and primary tags carry the
   same hue as the links, so the page has one obvious "do this" colour instead
   of competing accents. Glacier stays for data, signal and the wordmark. */
.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: none;
}

.button-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
  filter: none;
  box-shadow:
    0 0 0 1px rgba(247, 107, 146, 0.45),
    0 10px 30px -14px rgba(247, 107, 146, 0.7);
}

.button-secondary {
  border-radius: 10px;
  background-color: rgba(11, 16, 22, 0.55);
}

.tag {
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.tag-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

a.tag-primary {
  color: var(--accent-ink);
}

.tag[href].tag-primary:hover {
  background: var(--accent-hover);
  filter: none;
  border-color: transparent;
}

.filter-pill {
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

/* Solid signal edge on cards instead of the gradient hairline. */
.card::before {
  background: var(--accent-2);
}

.card {
  border-radius: 14px;
}

.card:hover {
  transform: none;
  box-shadow: var(--shadow-lg);
}

.feature-card .feature-icon {
  background: var(--surface-raised);
}

/* --- Hero: left-aligned editorial + readout bar --- */
.hero {
  text-align: left;
}

/* Static backdrop: one faint vignette, no engines. The hero::after grid from
   the base layer stays as the single quiet texture. */
.hero::before {
  inset: 0;
  height: auto;
  background: radial-gradient(
    56rem 28rem at 85% -12%,
    rgba(192, 38, 80, 0.09),
    transparent 60%
  );
}

.hero .hero-content {
  margin: 0;
  max-width: 62rem;
}

.hero-eyebrow {
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-color: var(--border-strong);
  background: rgba(11, 16, 22, 0.6);
  backdrop-filter: none;
  margin: 0 0 1.5rem;
  padding: 0.45rem 0.8rem;
}

.hero h1 {
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero-subtitle {
  margin: 0 0 2rem;
  max-width: 38rem;
}

.hero-actions {
  justify-content: flex-start;
}


/* Stats become an instrument readout: hairline-separated mono cells. */
.hero-stats {
  justify-content: flex-start;
  margin: 2.25rem 0 0;
  padding: 0;
  border: none;
  background: none;
  backdrop-filter: none;
  gap: 0;
  max-width: none;
}

.hero-stats li {
  align-items: flex-start;
  text-align: left;
  min-width: 0;
  padding: 0 1.75rem 0 0;
  margin-right: 1.75rem;
  border-right: 1px solid var(--border);
}

.hero-stats li:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 0;
}

.hero-stats .stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text);
}

/* --- Numbered section headers --- */
.section-header {
  text-align: left;
  max-width: none;
  margin: 0 0 2rem;
}

.section-index {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-index::after {
  content: "";
  height: 1px;
  width: 4rem;
  background: var(--border-strong);
}

.section-head .section-label {
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
}

/* --- Spec sheet (replaces the generic about cards) --- */
.spec-sheet {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 2.5rem;
  margin: 0;
}

.spec-sheet > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.spec-sheet dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  padding-top: 0.25rem;
}

.spec-sheet dd {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-small .hero-content {
  position: relative;
  z-index: 1;
}

/* --- Report covers: full-bleed generative voxel art --- */
.report-card:has(.report-card-head) {
  padding: 0;
  overflow: hidden;
}

.report-card-head {
  margin: 0;
  aspect-ratio: 16 / 6;
  min-height: 96px;
  background:
    radial-gradient(
      24rem 8rem at 50% 120%,
      rgba(169, 194, 220, 0.12),
      transparent 60%
    ),
    var(--surface-raised);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.report-card-head img,
.report-card-head svg.voxel-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.report-card:has(.report-card-head) > :not(.report-card-head) {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.report-card:has(.report-card-head) .card-title {
  margin-top: 1.25rem;
}

.report-card:has(.report-card-head) .card-tags {
  margin-bottom: 1.5rem;
}

/* Article hero cover: 3D render swaps in over the SVG fallback. */
.voxel-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Collection glyphs: small voxel renders, top-right --- */
.collection-card {
  position: relative;
  padding-right: 5.5rem;
}

.collection-glyph {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(
      4rem 3rem at 50% 120%,
      rgba(169, 194, 220, 0.12),
      transparent 60%
    ),
    var(--surface-raised);
}

.collection-glyph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Topic chips: numbered instrument keys --- */
.topic-cloud {
  counter-reset: topic;
}

.topic-chip {
  display: inline-flex;
  align-items: baseline;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.topic-chip::before {
  counter-increment: topic;
  content: counter(topic, decimal-leading-zero);
  color: var(--muted-dim);
  font-size: 0.68rem;
  margin-right: 0.55rem;
}

/* --- Newsletter as a transmission terminal --- */
.newsletter {
  padding: 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--bg-elev);
}

.newsletter-body {
  padding: 2.25rem clamp(1.25rem, 4vw, 2.75rem) 2.5rem;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.term-bar::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  background: var(--accent-2);
}

.newsletter-form input[type="email"] {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* --- Instrument responsive pass --- */
@media (max-width: 720px) {
  .spec-sheet {
    grid-template-columns: 1fr;
  }

  .spec-sheet > div {
    grid-template-columns: 5.5rem 1fr;
  }

  .hero-stats {
    gap: 1rem 0;
  }

  .hero-stats li {
    padding-right: 1.25rem;
    margin-right: 1.25rem;
  }

  .telemetry li {
    padding-right: 1rem;
    margin-right: 1rem;
  }

  .report-card-head {
    aspect-ratio: 16 / 7;
  }
}

/* --- Print: keep articles readable on paper -------------------------- */
@media print {
  .site-header,
  .site-footer,
  .share-row,
  .newsletter,
  .reading-progress,
  .back-to-top,
  .hero-art,
  .kit-row,
  .toolkit-card {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .report-content {
    max-width: none;
  }
}

/* =====================================================================
   Type roles — Fraunces (display) / Newsreader (text) / Instrument Sans (UI).
   Last layer on purpose: it renames the family on headings that earlier
   layers set to the UI sans, and changes nothing about their size, spacing
   or colour. Wrapped in @media screen so the print sheet keeps its own type.
   ===================================================================== */
@media screen {
  .hero h1,
  .section-title,
  .section-header h2,
  .report-header h1,
  .report-content h2,
  .report-sources h2,
  .logo-text {
    font-family: var(--font-display);
    font-optical-sizing: auto;
  }

  /* Fraunces is a high-contrast display serif; two steps lighter than the
     grotesk that used to carry these headings, so it reads as drawn type
     rather than as a heavier sans. */
  .hero h1 {
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.04;
  }

  .section-title,
  .section-header h2 {
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.15;
    text-wrap: balance;
  }

  .report-header h1 {
    font-weight: 600;
    letter-spacing: -0.02em;
  }

  .report-content h2,
  .report-sources h2 {
    font-weight: 600;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  /* Third-level headings are reading structure, not display type: they stay
     in the text serif at 600 so they sit inside the prose instead of on top
     of it. */
  .report-content h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    text-wrap: balance;
  }

  .logo-text {
    font-weight: 600;
    letter-spacing: -0.015em;
  }

  /* No orphan word left alone on a final line. Progressive enhancement:
     ignored by engines without text-wrap support. */
  .report-content p,
  .report-content li,
  .hero-subtitle,
  .section-lead,
  .card-summary,
  .brief-card .card-summary {
    text-wrap: pretty;
  }
}

/* =====================================================================
   Polish layer (2026-10). Last on purpose; every rule here corrects or
   refines something above, and each says why.
   ===================================================================== */
@media screen {
  /* --- Product covers keep their own proportions ---------------------
     The old boxes were fixed (120x170, then a 16:7 banner in #author), so a
     3:4 book cover lost its edges and a 9:16 one became a thin strip. The
     <img> now carries width/height attributes, so the box sizes itself from
     the real cover; the fallback glyph keeps a 3:4 footprint. */
  .ebook-card-cover {
    height: auto;
    align-self: flex-start;
  }

  .ebook-card-cover img {
    position: static;
    height: auto;
    object-fit: contain;
  }

  .ebook-card-cover:has(img[data-failed]) {
    aspect-ratio: 3 / 4;
  }

  .ebook-card-cover-fallback {
    min-height: 100%;
    aspect-ratio: 3 / 4;
  }

  #author .ebook-card-cover,
  #author .ebook-card.ebook-card--feature .ebook-card-cover {
    position: relative;
    height: auto;
    aspect-ratio: auto;
  }

  #author .ebook-card-cover img {
    position: static;
  }

  #author .ebook-card.ebook-card--feature .ebook-card-cover {
    flex: 0 0 150px;
    width: 150px;
  }

  /* "Books & toolkits" is a shelf: every product is one full-width
     horizontal card, cover on the left. Two cards of unequal height in a
     two-column grid left one of them hollow. */
  #author .grid-2 {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  #author .ebook-card:not(.ebook-card--feature) {
    flex-direction: row;
    align-items: center;
    height: auto;
  }

  #author .ebook-card:not(.ebook-card--feature) .ebook-card-cover {
    flex: 0 0 104px;
    width: 104px;
    align-self: center;
  }

  /* The toolkit art is a 3:2 scene with its title at the top edge: show all
     of it instead of cropping it to 16:7. */
  #author .toolkit-card-cover {
    aspect-ratio: 3 / 2;
  }
}

@media screen and (min-width: 641px) {
  #author .toolkit-card {
    flex-direction: row;
    align-items: stretch;
    height: auto;
  }

  #author .toolkit-card-cover {
    flex: 0 0 min(40%, 360px);
    width: auto;
  }

  #author .toolkit-card-body {
    align-self: center;
  }
}

@media screen {

  /* --- Card tags: one quiet category label, one clear action ----------
     A solid rose pill for the category and a solid rose "Read report" chip
     in the same row read as two competing buttons. The category is now a
     soft label; the action is a text link pushed to the row's end. */
  /* Rose means "you can act on this" everywhere else in the system, so a
     non-clickable tag must not wear it: static tags are quiet steel, the
     category is glacier (the system's data colour), and only links stay rose. */
  span.tag {
    background: var(--surface-raised);
    color: var(--muted);
    border-color: var(--border);
  }

  span.tag.tag-primary {
    background: color-mix(in srgb, var(--accent-2) 12%, transparent);
    color: var(--accent-2);
    border-color: color-mix(in srgb, var(--accent-2) 38%, transparent);
  }

  a.tag.tag-primary {
    margin-left: auto;
    padding: 0.3rem 0.15rem;
    background: transparent;
    border-color: transparent;
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 0.86rem;
    letter-spacing: 0;
    text-transform: none;
    border-radius: var(--radius-xs);
  }

  a.tag.tag-primary::after {
    content: "\00a0\2192";
  }

  .tag[href].tag-primary:hover,
  a.tag.tag-primary:hover {
    background: transparent;
    color: var(--accent-hover);
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  /* --- Announcement ribbon: cover thumbnail + one tidy line ------------ */
  .ebook-ribbon-inner {
    gap: 0.85rem;
  }

  .ebook-ribbon-cover {
    flex: 0 0 auto;
    width: 30px;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  }

  .ebook-ribbon-text strong {
    margin-right: 0.15rem;
  }
}

@media screen and (max-width: 640px) {
  #author .ebook-card:not(.ebook-card--feature) {
    flex-direction: row;
    text-align: left;
  }

  #author .ebook-card:not(.ebook-card--feature) .ebook-card-cover {
    flex-basis: 88px;
    width: 88px;
  }

  #author .ebook-card.ebook-card--feature .ebook-card-cover {
    flex: none;
    width: 120px;
    height: auto;
  }

  .ebook-ribbon-cover {
    width: 26px;
  }
}

@media screen {
  /* Dismiss is a compact square: the label is on aria-label, so the visible
     "Dismiss" word was only costing width on phones. */
  .ebook-ribbon-close {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
  }
}

@media screen and (max-width: 640px) {
  /* One tight line of the announcement on phones; the full sentence lives on
     the product card further down the page. */
  .ebook-ribbon-more {
    display: none;
  }

  .ebook-ribbon-text {
    font-size: 0.85rem;
  }
}

@media screen and (max-width: 520px) {
  /* Three equal columns on phones instead of a wrapping row with a ragged,
     orphaned divider. */
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

  .hero-stats li {
    margin-right: 0;
    padding: 0 0.75rem 0 0;
  }

  .hero-stats li + li {
    padding-left: 0.75rem;
  }

  .hero-stats .stat-label {
    font-size: 0.68rem;
  }
}

@media screen {
  /* --- Math (KaTeX, js/math.js) ---------------------------------------
     Un-rendered TeX (no JS) reads as quiet monospace; rendered math inherits
     the article colour and is nudged up to match the serif body size. Display
     equations scroll sideways instead of widening the page on phones. */
  .math:not(.math-ready) {
    font-family: var(--font-mono);
    font-size: 0.88em;
    color: var(--muted);
  }

  .math.math-ready .katex {
    font-size: 1.06em;
  }

  .math-display {
    margin: 1.4rem 0;
    padding: 0.25rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: center;
  }
}

/* =====================================================================
   Video (2026-10). Player stage, chapter timeline, chapter list,
   transcript and the cards that point at them. Colour jobs are fixed:
   glacier (--accent-2) means "where playback is now" — playhead fill,
   current chapter, current caption line — and rose stays reserved for
   links and focus, as everywhere else on the site.
   ===================================================================== */
.vp {
  margin: 0;
}

.vp-stage {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #04070a;
  box-shadow: var(--shadow-lg);
}

.vp-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #04070a;
}

.vp-fallback {
  margin: 0;
  padding: 1.25rem;
  color: var(--muted);
}

/* Chapter timeline: one segment per chapter, width proportional to its
   length, so the bar reads as a map of the argument. */
.vp-timeline {
  margin-top: 0.9rem;
}

.vp-readout {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-height: 1.6rem;
  margin: 0 0 0.2rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text);
}

.vp-readout-time,
.vp-readout-total {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.vp-readout-time {
  color: var(--accent-2);
}

.vp-readout-total {
  margin-left: auto;
  color: var(--muted-dim);
}

.vp-readout-title {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vp-track {
  display: flex;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vp-track > li {
  /* A short chapter never shrinks to a sliver: 13 chapters still fit in a
     320px phone (13 × 16px + 12 gaps). The chapter list is the roomy control. */
  min-width: 1rem;
}

.vp-seg {
  position: relative;
  display: block;
  width: 100%;
  height: 1.8rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.vp-seg::before,
.vp-seg-fill {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 6px;
  margin-top: -3px;
  border-radius: 3px;
  transition:
    height 0.15s ease,
    margin-top 0.15s ease,
    background-color 0.15s ease;
}

.vp-seg::before {
  content: "";
  background: var(--border-strong);
}

.vp-seg-fill {
  background: var(--accent-2);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  pointer-events: none;
}

.vp-seg:hover::before,
.vp-seg:focus-visible::before,
.vp-seg:hover .vp-seg-fill,
.vp-seg:focus-visible .vp-seg-fill,
.vp-seg.is-active::before,
.vp-seg.is-active .vp-seg-fill {
  height: 10px;
  margin-top: -5px;
}

.vp-seg:hover::before {
  background: var(--accent-4);
}

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

.vp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
  margin-top: 1rem;
}

.vp-status {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
}

.vp-link {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
}

/* Page layout: reading column + facts column. */
.video-stage {
  padding-top: 0;
}

.video-body {
  padding-top: 1rem;
}

.video-layout {
  display: grid;
  gap: 3rem;
  grid-template-columns: minmax(0, 1fr);
}

.video-main > section + section {
  margin-top: 3.25rem;
}

.video-h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-wrap: balance;
}

.video-prose p {
  max-width: 68ch;
  margin: 0 0 1.1rem;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.72;
  text-wrap: pretty;
}

.video-points {
  max-width: 68ch;
  margin: 0;
  padding: 0;
  list-style: none;
}

.video-points li {
  position: relative;
  margin: 0 0 0.9rem;
  padding-left: 1.4rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.65;
}

.video-points li strong {
  font-family: var(--font-sans);
  font-size: 0.97em;
  font-weight: 600;
  color: var(--text-strong);
}

.video-points li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 1.5px;
  background: var(--accent-4);
}

/* Chapter list */
.chapters {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.chapters li + li {
  border-top: 1px solid var(--border);
}

.chapter {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr) auto;
  gap: 0 1rem;
  align-items: baseline;
  width: 100%;
  padding: 0.95rem 1.15rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.chapter:hover {
  background: var(--surface-hover);
}

.chapter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.chapter[aria-current="true"] {
  background: var(--surface-raised);
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.chapter-time,
.chapter-len {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.chapter-time {
  color: var(--accent-2);
}

.chapter-len {
  color: var(--muted-dim);
}

.chapter-body {
  display: block;
  min-width: 0;
}

.chapter-title {
  display: block;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
}

.chapter-summary {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Facts column */
.video-facts {
  margin: 0;
  border-top: 1px solid var(--border);
}

.video-facts > div {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.video-facts dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.video-facts dd {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text);
}

.video-downloads {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.video-aside-block + .video-aside-block {
  margin-top: 2rem;
}

.video-aside .section-label {
  display: block;
  margin-bottom: 0.6rem;
}

/* Sources table */
.video-sources-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.video-sources {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.93rem;
}

.video-sources th,
.video-sources td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.video-sources tr:last-child td {
  border-bottom: 0;
}

.video-sources thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dim);
  background: var(--surface-raised);
}

.video-sources td:first-child {
  color: var(--text);
}

.video-sources td:last-child {
  color: var(--muted);
}

/* "Numbers from the film": one captioned table per topic, a timestamp column
   that jumps the player, and tabular figures so the values line up. */
.video-figure {
  margin-top: 1.25rem;
}

.video-figure td {
  font-variant-numeric: tabular-nums;
}

.video-sources caption {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
  text-align: left;
}

.video-figure-time {
  width: 1%;
  white-space: nowrap;
}

.video-figure-time .vt-time {
  min-width: 2.5rem;
  padding: 0.3rem 0;
  text-align: left;
}

/* Quick answers: the transcript's disclosure pattern, one per question. */
.video-faq-item + .video-faq-item {
  margin-top: 0.6rem;
}

.video-faq-body {
  padding: 1rem 1.2rem 1.15rem;
  border-top: 1px solid var(--border);
}

.video-faq-body p {
  max-width: 68ch;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.7;
}

.video-faq-body .video-faq-watch {
  margin-top: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--muted);
}

.video-note {
  max-width: 68ch;
  margin: 0.9rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

/* A correction or caveat the reader should not skim past: neutral, not an error state. */
.video-note--alert {
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--muted);
  border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
  background: var(--surface);
  color: var(--text);
}

.video-note--alert strong {
  color: var(--text-strong);
}

/* Transcript */
.vt {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.vt > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.vt > summary::-webkit-details-marker {
  display: none;
}

.vt > summary::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.vt[open] > summary::after {
  transform: rotate(-135deg);
}

.vt > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-lg);
}

.vt-meta {
  margin-left: 0.6rem;
  font-weight: 400;
  color: var(--muted);
}

.vt-body {
  padding: 0.4rem 1.4rem 1.8rem;
  border-top: 1px solid var(--border);
}

.vt-body h3 {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 1.8rem 0 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
}

.vt-time {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.vt-time:hover {
  text-decoration: underline;
}

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

.vt-body p {
  max-width: 68ch;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.75;
}

.vt-cue {
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.vt-cue:hover {
  background: var(--accent-soft);
}

.vt-cue.is-current {
  background: rgba(94, 203, 219, 0.16);
}

/* Cards: hub, home, about, reports, topic hubs, report pages */
.video-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.video-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition:
    border-color 0.2s ease,
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s ease;
}

.video-card:hover,
.video-card:focus-within {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.video-card-media {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  background: #04070a;
}

.video-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card-play {
  position: absolute;
  bottom: 0.9rem;
  left: 0.9rem;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: rgba(11, 16, 22, 0.84);
  color: var(--text-strong);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.video-card-play svg {
  width: 1.05rem;
  height: 1.05rem;
  margin-left: 0.12rem;
  fill: currentColor;
}

.video-card:hover .video-card-play,
.video-card:focus-within .video-card-play {
  background: var(--accent);
  color: var(--accent-ink);
}

.video-card-duration {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: rgba(11, 16, 22, 0.88);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.video-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.15rem 1.3rem 1.4rem;
}

.video-card-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.video-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.video-card-title a {
  color: var(--text-strong);
  text-decoration: none;
}

/* One link per card: the title's hit area covers the whole card. */
.video-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.video-card-title a:focus-visible {
  outline: none;
}

.video-card:has(.video-card-title a:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.video-card-desc {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

/* In-article placement on report pages */
.report-video {
  margin: 2.5rem 0 0;
}

.report-video .section-label {
  display: block;
  margin-bottom: 0.75rem;
}

/* Two or more related films stack with a gap, not a shared border. */
.report-video .video-card + .video-card,
.video-aside .video-card + .video-card {
  margin-top: 0.75rem;
}

/* Compact: poster beside the text, for sidebars and in-article placements */
.video-card--compact .video-card-desc {
  display: none;
}

@media (min-width: 40rem) {
  .video-card--compact {
    flex-direction: row;
  }

  .video-card--compact .video-card-media {
    flex: 0 0 40%;
    aspect-ratio: auto;
    min-height: 8rem;
  }

  .video-card--compact .video-card-media img {
    position: absolute;
    inset: 0;
  }

  .video-card--compact .video-card-body {
    justify-content: center;
  }

  .video-card--compact .video-card-title {
    font-size: 1.15rem;
  }
}

@media (min-width: 62rem) {
  .video-layout {
    grid-template-columns: minmax(0, 1fr) 18.5rem;
    gap: 4rem;
  }

  .video-aside {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    align-self: start;
  }
}

@media (max-width: 520px) {
  .chapter {
    grid-template-columns: 3rem minmax(0, 1fr);
  }

  .chapter-len {
    display: none;
  }

  .vt-body {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .video-sources th,
  .video-sources td,
  .video-sources caption {
    padding-right: 0.65rem;
    padding-left: 0.65rem;
  }

  .video-faq-body {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vp-seg::before,
  .vp-seg-fill,
  .chapter,
  .vt-cue,
  .vt > summary::after,
  .video-card,
  .video-card-play {
    transition: none;
  }

  .video-card:hover,
  .video-card:focus-within {
    transform: none;
  }
}
