/* ==========================================================================
   OSReward — project page
   Two themes off one token set. Dark is "gilded cosmos" (deep navy + gold,
   sampled from public/cover.png); light is the same palette on warm paper.
   Structure follows the OS-Sentinel / ScienceBoard / OS-Genesis pages:
   split hero, byline band, then article sections.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens — dark (default)
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Gold — the 鎏金 accent */
  --gold-100: #fbf4d6;
  --gold-200: #f0dca2;
  --gold-300: #e2c377;
  --gold-400: #cfa54b;
  --gold-500: #b8862a;
  --gold-600: #92671c;

  /* Cyan — screens, plots, live data */
  --cyan-200: #a8e8f2;
  --cyan-300: #6fcfe0;
  --cyan-400: #3fb2c9;
  --cyan-500: #1d86a6;

  /* Text */
  --text-hi: #eaf1f9;
  --text: #bfd0e2;
  --text-dim: #8aa1bb;
  --text-faint: #677d99;

  /* Semantic (charts) */
  --ok: #58c7a4;
  --bad: #e0736b;

  /* Surfaces */
  --bg: #050c19;
  --surface-1: rgba(11, 26, 48, 0.58);
  --surface-1b: rgba(6, 16, 33, 0.62);
  --surface-2: rgba(9, 22, 42, 0.9);
  --surface-3: rgba(6, 15, 30, 0.97);
  --ring: #050c19;

  --hairline: rgba(207, 165, 75, 0.18);
  --hairline-strong: rgba(207, 165, 75, 0.36);
  --hairline-cool: rgba(122, 158, 200, 0.16);

  /* Charts */
  --chart-grid: rgba(122, 158, 200, 0.11);
  --chart-grid-minor: rgba(122, 158, 200, 0.055);
  --chart-axis: rgba(122, 158, 200, 0.3);
  --chart-track: rgba(122, 158, 200, 0.08);
  --logo-plate: rgba(238, 245, 252, 0.94);

  /* Type */
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --page: 1560px;        /* content sections */
  --page-wide: 1700px;   /* leaderboard, widest tables */
  --page-hero: 1500px;   /* hero + byline */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;

  --shadow: 0 14px 34px -20px rgba(0, 0, 0, 0.8);
}

/* --------------------------------------------------------------------------
   2. Tokens — light
   -------------------------------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  /* Gold darkens so it stays legible as text on paper */
  --gold-100: #6d4d0e;
  --gold-200: #7d5811;
  --gold-300: #8c6414;
  --gold-400: #a5771c;
  --gold-500: #b98a2a;
  --gold-600: #cba649;

  --cyan-200: #10556b;
  --cyan-300: #14708c;
  --cyan-400: #1a89a6;
  --cyan-500: #2aa0bd;

  --text-hi: #14243c;
  --text: #34475f;
  --text-dim: #5b6d86;
  --text-faint: #7d8ea4;

  --ok: #1f8a68;
  --bad: #bf4a41;

  --bg: #f7f3e9;
  --surface-1: rgba(255, 253, 248, 0.86);
  --surface-1b: rgba(252, 249, 241, 0.9);
  --surface-2: rgba(255, 253, 248, 0.96);
  --surface-3: rgba(255, 253, 248, 0.99);
  --ring: #f7f3e9;

  --hairline: rgba(150, 108, 26, 0.22);
  --hairline-strong: rgba(150, 108, 26, 0.44);
  --hairline-cool: rgba(40, 70, 110, 0.16);

  --chart-grid: rgba(40, 70, 110, 0.12);
  --chart-grid-minor: rgba(40, 70, 110, 0.06);
  --chart-axis: rgba(40, 70, 110, 0.32);
  --chart-track: rgba(40, 70, 110, 0.07);
  --logo-plate: rgba(255, 255, 255, 0);

  --shadow: 0 12px 30px -20px rgba(60, 45, 15, 0.45);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.66;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "kern" 1, "liga" 1;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-hi);
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  line-height: 1.2;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--gold-300); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--gold-200); }

strong { color: var(--text-hi); font-weight: 600; }
em { color: var(--gold-200); font-style: italic; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.87em;
  color: var(--cyan-200);
  background: var(--chart-track);
  border: 1px solid var(--hairline-cool);
  border-radius: 5px;
  padding: 0.08em 0.36em;
}

::selection { background: rgba(207, 165, 75, 0.28); }

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

.sr-only {
  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; left: 50%; top: -80px; transform: translateX(-50%);
  z-index: 200; background: var(--surface-3); color: var(--gold-300);
  border: 1px solid var(--hairline-strong); border-radius: 0 0 10px 10px;
  padding: 11px 20px; font-size: 15px; transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* --------------------------------------------------------------------------
   4. Backdrop
   -------------------------------------------------------------------------- */
.cosmos {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 14% -6%, rgba(14, 70, 128, 0.34), transparent 64%),
    radial-gradient(900px 600px at 88% 4%,   rgba(150, 106, 26, 0.16), transparent 62%),
    radial-gradient(1200px 900px at 52% 40%, rgba(9, 44, 92, 0.28), transparent 70%),
    radial-gradient(1000px 780px at 8% 74%,  rgba(12, 52, 104, 0.20), transparent 66%),
    radial-gradient(950px 720px at 94% 92%,  rgba(126, 88, 20, 0.12), transparent 64%),
    linear-gradient(168deg, #081428 0%, #05101f 34%, #040c1a 66%, #050c19 100%);
}
:root[data-theme="light"] .cosmos {
  background:
    radial-gradient(1000px 620px at 16% -8%, rgba(198, 216, 238, 0.62), transparent 62%),
    radial-gradient(820px 560px at 86% 2%,  rgba(228, 208, 158, 0.44), transparent 60%),
    radial-gradient(1100px 820px at 50% 48%, rgba(238, 231, 214, 0.7), transparent 70%),
    linear-gradient(180deg, #fbf8f0 0%, #f7f3e9 52%, #f4efe3 100%);
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.3s ease;
}
:root[data-theme="light"] #starfield { display: none; }

/* --------------------------------------------------------------------------
   5. Layout
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 26px; }
.wrap-wide { max-width: var(--page-wide); }

section { position: relative; }

.band { padding: 78px 0; }
.band-tight { padding: 52px 0; }

.section-head { text-align: center; max-width: 950px; margin: 0 auto 44px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 14px;
}
.eyebrow::before, .eyebrow::after {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
  opacity: 0.5;
}

h2.section-title { font-size: clamp(28px, 3.6vw, 38px); margin-bottom: 12px; }
.section-sub { color: var(--text-dim); font-size: 17px; max-width: 860px; margin: 0 auto; }

/* Gold-leaf gradient text */
.gilt {
  background: linear-gradient(176deg, var(--gold-200) 6%, var(--gold-300) 42%, var(--gold-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
:root[data-theme="light"] .gilt {
  background: linear-gradient(176deg, var(--gold-400) 4%, var(--gold-300) 46%, var(--gold-100) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   6. Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.nav.stuck {
  background: var(--surface-3);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--hairline);
}
.nav .wrap { max-width: var(--page-wide); display: flex; align-items: center; gap: 18px; }

.nav-brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600;
  white-space: nowrap;
  color: var(--text-hi);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.nav.stuck .nav-brand { opacity: 1; transform: none; pointer-events: auto; }
.nav-brand img { width: 30px; height: 30px; }
.nav-brand i { font-style: normal; color: var(--gold-400); font-weight: 400; padding: 0 1px; }

.nav-links {
  margin-left: auto;
  display: flex; align-items: center; gap: 2px;
  list-style: none; padding: 0; margin-block: 0;
}
.nav-links a {
  display: block;
  padding: 7px 12px;
  font-size: 14px; font-weight: 500;
  color: var(--text-dim);
  border-radius: 8px;
  transition: color 0.16s ease, background 0.16s ease;
}
.nav-links a:hover { color: var(--gold-300); background: var(--chart-track); }
.nav-links a.active { color: var(--gold-300); }

/* "More research" — the sibling-project menu the reference pages carry */
.nav-more { position: relative; }
.nav-more > button {
  appearance: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 14px; font-weight: 500;
  color: var(--text-dim);
  background: none; border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}
.nav-more > button:hover,
.nav-more[data-open="true"] > button { color: var(--gold-300); background: var(--chart-track); }
.nav-more > button svg { width: 10px; height: 10px; transition: transform 0.18s ease; }
.nav-more[data-open="true"] > button svg { transform: rotate(180deg); }
.nav-more ul {
  position: absolute;
  top: calc(100% + 8px); left: 0;
  min-width: 268px;
  list-style: none;
  margin: 0; padding: 6px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  display: none;
  z-index: 30;
}
.nav-more[data-open="true"] ul { display: block; }
.nav-more ul a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
}
.nav-more ul a:hover { background: var(--chart-track); color: var(--gold-300); }
.nav-more ul a > span { display: flex; flex-direction: column; line-height: 1.3; }
.nav-more ul a small { color: var(--text-faint); font-size: 11px; }
.nav-more ul a img {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 7px;
  object-fit: contain;
}
/* These are detailed illustrations, not flat marks: at 28 px on the dark menu
   they go muddy. A light plate gives each one the same ground to sit on — and
   matches OS-Atlas, whose artwork already carries its own white card. */
:root:not([data-theme="light"]) .nav-more ul a img {
  background: rgba(242, 246, 252, 0.94);
  box-shadow: 0 0 0 1px var(--hairline);
  padding: 2px;
}

.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: 8px; }

.icon-btn {
  appearance: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: var(--chart-track);
  color: var(--gold-300);
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.icon-btn:hover { color: var(--gold-200); border-color: var(--hairline-strong); }
.icon-btn svg { width: 16px; height: 16px; }
/* one icon per theme */
.icon-btn .i-sun { display: none; }
:root[data-theme="light"] .icon-btn .i-sun { display: block; }
:root[data-theme="light"] .icon-btn .i-moon { display: none; }

.nav-toggle { display: none; }

/* --------------------------------------------------------------------------
   7. Hero — split, following the reference pages
   -------------------------------------------------------------------------- */
.hero { position: relative; padding: 100px 0 40px; overflow: hidden; }

/* The cover art is a deep-navy, gold-filigreed square. On flat background it
   reads as a pasted rectangle, so the hero carries its own drifting nebula:
   cool field on the left, a warm gold bloom behind the art on the right, both
   fading to nothing before the byline. */
.hero::before {
  content: "";
  position: absolute;
  inset: -180px -12% -60px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58% 62% at 74% 46%, rgba(18, 74, 150, 0.50), transparent 72%),
    radial-gradient(38% 46% at 84% 30%, rgba(176, 126, 34, 0.30), transparent 74%),
    radial-gradient(64% 70% at 18% 24%, rgba(10, 44, 96, 0.46), transparent 72%),
    radial-gradient(50% 44% at 46% 96%, rgba(8, 28, 62, 0.40), transparent 76%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
}
:root[data-theme="light"] .hero::before {
  background:
    radial-gradient(58% 62% at 74% 46%, rgba(196, 214, 238, 0.55), transparent 72%),
    radial-gradient(38% 46% at 84% 28%, rgba(230, 208, 152, 0.45), transparent 74%),
    radial-gradient(64% 70% at 18% 24%, rgba(214, 224, 238, 0.5), transparent 72%);
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr);
  gap: 54px;
  align-items: center;
  max-width: var(--page-hero);
}

.hero h1 {
  font-size: clamp(40px, 5.2vw, 70px);
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 10px;
}
.hero .tagline {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.35vw, 27px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-hi);
  margin: 0 0 10px;
}
.hero .venue {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-400);
  font-weight: 600;
  margin-bottom: 18px;
}
.hero .lede { font-size: 16.5px; color: var(--text-dim); margin-bottom: 20px; }

/* the four hero bullets the reference pages use */
.bullets { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.bullets li { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; color: var(--text); }
.bullets .b-ico {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 7px;
  color: var(--gold-300);
  background: var(--chart-track);
  border: 1px solid var(--hairline);
  margin-top: 1px;
}
.bullets .b-ico svg { width: 14px; height: 14px; }
.bullets b { color: var(--text-hi); font-weight: 600; }

/* Cover plate. Dark theme: a thin gilt edge, the art continues the background.
   Light theme: the art is deep navy on warm paper, so it is matted like a
   framed print — cream mat, fine gold rule, soft drop shadow — which is what
   makes a dark image sit on a light page instead of punching a hole in it. */
.plate {
  margin: 0;
  position: relative;
  border-radius: var(--r-lg);
  padding: 6px;
  background: linear-gradient(150deg, rgba(207, 165, 75, 0.42), rgba(122, 158, 200, 0.10) 52%, rgba(207, 165, 75, 0.22));
  box-shadow:
    0 26px 80px -34px rgba(16, 60, 124, 0.85),
    0 0 110px -24px rgba(168, 118, 30, 0.30);
}
.plate img { display: block; width: 100%; height: auto; border-radius: 12px; }

:root[data-theme="light"] .plate {
  padding: 20px;
  border-radius: 6px;
  background: linear-gradient(168deg, #fffdf8 0%, #f6f1e4 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(150, 108, 26, 0.28),
    0 22px 44px -26px rgba(60, 45, 15, 0.55);
}
:root[data-theme="light"] .plate::after {
  /* the fine gold rule between mat and image */
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(150, 108, 26, 0.42);
  border-radius: 4px;
  pointer-events: none;
}
:root[data-theme="light"] .plate img {
  border-radius: 2px;
  box-shadow: 0 2px 10px -3px rgba(20, 36, 60, 0.5);
}

/* --------------------------------------------------------------------------
   8. Byline band
   -------------------------------------------------------------------------- */
/* The byline sits on the page, not on a panel. On the dark theme the
   university crests — dark line art on transparent — are rendered as warm
   silhouettes instead: at 28 px the crest detail is invisible anyway, and it
   avoids both the white plate behind each logo and a white slab behind the
   whole block. */
.byline { padding: 4px 0 2px; }
.byline .panel {
  max-width: var(--page-hero);
  margin: 0 auto;
  border-top: 1px solid var(--hairline-cool);
  border-bottom: 1px solid var(--hairline-cool);
  padding: 24px 30px 22px;
  text-align: center;
}

.authors {
  max-width: 940px;
  margin: 0 auto 16px;
  font-size: 16px;
  line-height: 1.95;
  color: var(--text-hi);
  font-weight: 450;
}
/* No underlines in the byline, linked or not — hover colour is the only cue. */
.authors a { color: inherit; text-decoration: none; }
.authors a:hover { color: var(--gold-300); }
.authors .au { white-space: nowrap; }
.authors .au.eq { color: var(--gold-300); font-weight: 600; }
.authors .au.eq a:hover { color: var(--gold-200); }
.authors sup { font-size: 0.64em; color: var(--gold-400); font-weight: 600; margin-left: 1px; }

/* Affiliations: a small mark attached to the left of each name */
.affils {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--text-dim);
}
.affils li { display: inline-flex; align-items: center; gap: 9px; }
.affils sup { color: var(--gold-400); font-weight: 600; font-size: 0.72em; padding-right: 1px; }
.affils .mark {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
}
.affils .mark img { width: 24px; height: 24px; object-fit: contain; display: block; }
/* Two files per crest rather than a CSS filter. A flat silhouette blanks out
   the filled crests (HKU, NUS) into white lozenges; the pre-rendered dark
   variant keeps every crest's internal structure. */
.affils .mark .dk { display: none; }
:root:not([data-theme="light"]) .affils .mark .lt { display: none; }
:root:not([data-theme="light"]) .affils .mark .dk { display: block; }
/* placeholder mark for an institution whose logo we do not have yet */
.legend { margin: 16px 0 0; font-size: 13px; color: var(--text-faint); }
.legend sup { color: var(--gold-400); }
.eq-key { color: var(--gold-300); font-weight: 600; }

/* --------------------------------------------------------------------------
   9. Link row
   -------------------------------------------------------------------------- */
.links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.8px;
  font-weight: 550;
  white-space: nowrap;
  color: var(--text-hi);
  background: var(--surface-1);
  border: 1px solid var(--hairline-cool);
  transition: transform 0.15s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.btn svg, .btn .ic { width: 15px; height: 15px; flex: none; font-size: 14px; line-height: 1; }
.btn:hover {
  color: var(--text-hi);
  transform: translateY(-1px);
  border-color: var(--hairline-strong);
  background: var(--surface-2);
}
.btn:active { transform: none; }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  border-color: var(--hairline-strong);
  color: #201502;
  font-weight: 650;
}
.btn-gold:hover { background: linear-gradient(180deg, var(--gold-200), var(--gold-400)); color: #1a1002; }
:root[data-theme="light"] .btn-gold { color: #fffaf0; }
:root[data-theme="light"] .btn-gold:hover { color: #fff; }

/* Parked links: clearly not-yet-live, but still readable. The dashed border
   carries the "not yet" signal, so the label itself keeps normal contrast. */
.btn.pending {
  color: var(--text-dim);
  border-style: dashed;
  border-color: var(--hairline-strong);
  background: transparent;
  cursor: default;
}
.btn.pending:hover { transform: none; color: var(--text); background: var(--chart-track); }
.btn.btn-gold.pending {
  color: var(--gold-300);
  border-color: var(--gold-400);
  background: var(--chart-track);
  font-weight: 600;
}
.btn.btn-gold.pending:hover { color: var(--gold-200); background: var(--chart-track); }


/* --------------------------------------------------------------------------
   10. Stat strip
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--hairline-cool);
  border: 1px solid var(--hairline-cool);
  border-radius: var(--r);
  overflow: hidden;
}
.stat { background: var(--surface-1b); padding: 17px 10px 15px; text-align: center; }
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(21px, 2.1vw, 27px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   11. Cards & panels
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--hairline-cool);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 21px; margin-bottom: 10px; }

.abstract { max-width: 1120px; margin: 0 auto; padding: 30px 44px 32px; font-size: 16.5px; line-height: 1.72; }

ol.contribs {
  counter-reset: c;
  list-style: none;
  margin: 22px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--hairline-cool);
  display: grid;
  gap: 16px;
}
ol.contribs li {
  counter-increment: c;
  position: relative;
  padding-left: 40px;
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--text-dim);
}
ol.contribs li::before {
  content: counter(c);
  position: absolute;
  left: 0; top: 1px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-300);
  background: var(--chart-track);
  border: 1px solid var(--hairline);
}
ol.contribs a { color: inherit; }
ol.contribs a b {
  color: var(--text-hi);
  border-bottom: 1px solid var(--hairline-strong);
  transition: color 0.16s ease;
}
ol.contribs a:hover b { color: var(--gold-300); }

.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.feature { padding: 24px 24px; }
.feature .ico {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  margin-bottom: 14px;
  background: var(--chart-track);
  border: 1px solid var(--hairline);
  color: var(--gold-300);
}
.feature .ico svg { width: 19px; height: 19px; }
.feature h3 { font-size: 19px; margin-bottom: 7px; }
.feature p { font-size: 15px; color: var(--text-dim); margin: 0; line-height: 1.6; }

a.card.feature { transition: transform 0.16s ease, border-color 0.18s ease; }
a.card.feature:not(.pending-card):hover { transform: translateY(-2px); border-color: var(--hairline-strong); }
.pending-card { cursor: default; }
.pending-card .ico { opacity: 0.65; }
.pending-card .soon {
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-500);
  border: 1px dashed var(--hairline-strong);
  border-radius: 6px;
  padding: 3px 8px;
}

.takeaway {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 22px;
  border-radius: var(--r);
  background: var(--surface-1b);
  border: 1px solid var(--hairline-cool);
  border-left: 3px solid var(--gold-500);
  font-size: 15.5px;
  color: var(--text-hi);
}
.takeaway .k {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-400);
  padding-top: 5px;
  flex: none;
}
.takeaway p { margin: 0; line-height: 1.6; }

.step-n {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 600;
  color: var(--gold-300);
  background: var(--chart-track);
  border: 1px solid var(--hairline);
}

/* --------------------------------------------------------------------------
   12. Flow diagrams
   -------------------------------------------------------------------------- */
.flow { display: flex; align-items: stretch; gap: 0; }
.flow-node {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 16px 13px;
  border-radius: var(--r);
  background: var(--surface-1b);
  border: 1px solid var(--hairline-cool);
  text-align: center;
}
.flow-node.human { border-color: var(--hairline); }
.flow-node.out { border-color: rgba(88, 199, 164, 0.34); }
.flow-node h4 {
  font-family: var(--font-body);
  font-size: 14.5px; font-weight: 600;
  margin: 7px 0 5px;
  color: var(--text-hi);
  text-wrap: balance;
}
.flow-node p { font-size: 12.5px; color: var(--text-faint); margin: 0; line-height: 1.5; }
.flow-arrow {
  align-self: center;
  flex: 0 0 auto;
  color: var(--gold-500);
  padding: 0 8px;
  display: grid; place-items: center; gap: 3px;
}

/* Vertical corpus pipeline */
ol.pipeline { list-style: none; margin: 4px 0 0; padding: 0; position: relative; }
ol.pipeline::before {
  content: "";
  position: absolute;
  left: 96px; top: 14px; bottom: 14px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--hairline-strong) 8%, var(--hairline-strong) 92%, transparent);
}
ol.pipeline > li {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 26px;
  align-items: center;
  padding: 12px 0;
}
ol.pipeline > li:not(.drop)::after {
  content: "";
  position: absolute;
  left: 92px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 0 4px var(--ring);
}
ol.pipeline > li.out::after { background: var(--ok); }
ol.pipeline .n {
  font-family: var(--font-display);
  font-size: 25px; font-weight: 600; line-height: 1;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.022em;
  text-align: right;
}
ol.pipeline li.out .n { color: var(--ok); }
ol.pipeline .s { padding-left: 12px; }
ol.pipeline h4 {
  font-family: var(--font-body);
  font-size: 15px; font-weight: 600;
  color: var(--text-hi);
  margin: 0 0 2px;
}
ol.pipeline p { font-size: 13.5px; color: var(--text-faint); margin: 0; line-height: 1.5; }
ol.pipeline p b { color: var(--gold-300); font-variant-numeric: tabular-nums; }
ol.pipeline > li.drop { padding: 2px 0; font-size: 12.5px; color: var(--text-faint); }
ol.pipeline > li.drop span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--bad);
  text-align: right;
}
ol.pipeline > li.drop::before {
  content: "";
  position: absolute;
  left: 93px;
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1px solid var(--bad);
  background: var(--ring);
  opacity: 0.65;
}
ol.pipeline > li.drop i { padding-left: 12px; font-style: normal; }

/* --------------------------------------------------------------------------
   13. Tables
   -------------------------------------------------------------------------- */
.table-shell {
  border: 1px solid var(--hairline-cool);
  border-radius: var(--r);
  background: var(--surface-2);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  user-select: none;
}
table.data thead tr.group th {
  text-align: center;
  color: var(--gold-400);
  padding-bottom: 6px;
}
table.data thead th.sortable { cursor: pointer; }
table.data thead th.sortable:hover { color: var(--gold-300); }
table.data thead th .arrow { opacity: 0.26; margin-left: 5px; font-size: 9px; }
table.data thead th[aria-sort] .arrow { opacity: 1; color: var(--gold-300); }
table.data th:first-child, table.data td:first-child { text-align: left; padding-left: 16px; }
table.data td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--chart-grid);
  color: var(--text);
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 0.14s ease; }
table.data tbody tr:hover { background: var(--chart-track); }
table.data tbody tr.ours { background: var(--chart-track); box-shadow: inset 3px 0 0 var(--gold-500); }
table.data tbody tr.ours:hover { background: var(--surface-1b); }
table.data td.best { color: var(--gold-300); font-weight: 650; }
table.data .rank {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  width: 32px;
  padding-right: 0;
  text-align: right;
}
.model-cell { display: flex; align-items: center; gap: 9px; }
.model-cell .nm { color: var(--text-hi); font-weight: 500; }

/* Several vendor marks are solid black on transparent and vanish on the dark
   page; a light disc makes every logo legible in both themes. */
.model-cell img,
.tip .t-name img,
.chip img,
.model-card .top img {
  background: var(--logo-plate);
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 0 0 1px var(--hairline);
}
.model-cell img { width: 20px; height: 20px; object-fit: contain; flex: none; }

.tag {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid transparent;
}
.tag.closed { color: var(--text-faint); border-color: var(--hairline-cool); }
.tag.open { color: var(--cyan-400); border-color: var(--hairline-cool); }
.tag.ours { color: var(--gold-400); border-color: var(--hairline-strong); }

.cellbar { position: relative; display: inline-block; min-width: 44px; text-align: right; }
.cellbar i {
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--cyan-400);
  opacity: 0.7;
  border-radius: 2px;
  transform-origin: left;
}

/* --------------------------------------------------------------------------
   14. Controls
   -------------------------------------------------------------------------- */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.controls .spacer { flex: 1; }
.ctl-label {
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}

.seg {
  display: inline-flex;
  padding: 3px; gap: 2px;
  border-radius: 999px;
  background: var(--chart-track);
  border: 1px solid var(--hairline-cool);
}
.seg button {
  appearance: none; border: 0; background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px; font-weight: 550;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
  white-space: nowrap;
}
.seg button:hover { color: var(--gold-300); }
.seg button[aria-pressed="true"] {
  color: #201502;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
}
:root[data-theme="light"] .seg button[aria-pressed="true"] { color: #fffaf0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none;
  font-family: inherit;
  font-size: 12px; font-weight: 550;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--hairline-cool);
  transition: all 0.16s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { color: var(--text-hi); border-color: var(--hairline-strong); }
.chip[aria-pressed="false"] { opacity: 0.4; }
/* our own models: a soft gold field instead of an "(ours)" suffix */
.chip-ours {
  background: linear-gradient(180deg, rgba(207, 165, 75, 0.20), rgba(207, 165, 75, 0.09));
  border-color: var(--hairline-strong);
  color: var(--gold-200);
  font-weight: 600;
}
.chip-ours:hover { color: var(--gold-100); border-color: var(--gold-400); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.search {
  flex: 1;
  min-width: 170px;
  max-width: 250px;
  height: 32px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-hi);
  background: var(--chart-track);
  border: 1px solid var(--hairline-cool);
  border-radius: 999px;
}
.search::placeholder { color: var(--text-faint); }
.search:focus { outline: none; border-color: var(--hairline-strong); }

/* --------------------------------------------------------------------------
   15. Charts
   -------------------------------------------------------------------------- */
.chart-card { padding: 26px 34px 22px; }
.chart-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-head h3 { font-size: 20px; margin: 0; }
.chart-head .fignum {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-500);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 2px 6px;
}
.chart-note { font-size: 14px; color: var(--text-dim); margin: 0 0 16px; max-width: 980px; line-height: 1.6; }
.chart-body { position: relative; width: 100%; }
.chart-body svg { display: block; width: 100%; height: auto; overflow: visible; }

.ax-line { stroke: var(--chart-axis); stroke-width: 1; }
.ax-grid { stroke: var(--chart-grid); stroke-width: 1; }
.ax-grid.minor { stroke: var(--chart-grid-minor); }
.ax-tick { fill: var(--text-faint); font-size: 11px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.ax-title { fill: var(--text-dim); font-size: 11.5px; font-weight: 600; font-family: var(--font-body); }
.ref-line { stroke: var(--gold-500); stroke-opacity: 0.5; stroke-width: 1; stroke-dasharray: 5 5; }
.ref-label { fill: var(--gold-500); font-size: 10.5px; font-family: var(--font-body); }
.pt-label { fill: var(--text-dim); font-size: 10.5px; font-family: var(--font-body); pointer-events: none; }
.pt-label.hi { fill: var(--gold-300); font-weight: 600; }
.pt { cursor: pointer; transition: r 0.14s ease; }
.pt-halo { pointer-events: none; }

.tip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  display: none;
  transform: translate(-50%, -100%) translateY(-12px);
  background: var(--surface-3);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  padding: 9px 12px;
  min-width: 144px;
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}
.tip.on { display: block; }
.tip .t-name {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 6px;
  white-space: nowrap;
}
.tip .t-name img { width: 15px; height: 15px; object-fit: contain; }
.tip dl {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 14px;
  margin: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.tip dt { color: var(--text-faint); }
.tip dd { margin: 0; text-align: right; color: var(--cyan-300); font-weight: 550; }
.tip .t-foot {
  margin-top: 6px; padding-top: 5px;
  border-top: 1px solid var(--hairline);
  font-size: 11.5px; color: var(--gold-400);
}

.legend-row {
  display: flex; flex-wrap: wrap;
  gap: 7px 17px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.legend-row .li { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-row .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend-row .sw.round { border-radius: 50%; }

figcaption { font-size: 13px; color: var(--text-faint); margin-top: 11px; line-height: 1.55; }

/* Success / fail composition bars */
.comp-bar {
  display: flex;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hairline-cool);
}
.comp-bar > div {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.comp-bar .seg-ok  { background: rgba(88, 199, 164, 0.30); color: #cdf3e5; }
.comp-bar .seg-bad { background: rgba(224, 115, 107, 0.28); color: #f8d6d2; }
:root[data-theme="light"] .comp-bar .seg-ok  { background: rgba(31, 138, 104, 0.24); color: #10583f; }
:root[data-theme="light"] .comp-bar .seg-bad { background: rgba(191, 74, 65, 0.22); color: #7d2b24; }

/* --------------------------------------------------------------------------
   15b. DataViewer
   -------------------------------------------------------------------------- */
.viewer-warn {
  margin: 0 0 20px;
  padding: 11px 15px;
  border: 1px solid var(--gold-500);
  border-left-width: 3px;
  border-radius: 9px;
  background: rgba(217, 165, 58, 0.1);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
}
.viewer-warn b { color: var(--gold-200); }
:root[data-theme="light"] .viewer-warn b { color: var(--gold-600); }

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--hairline-cool);
}
.viewer-meta { display: flex; align-items: baseline; gap: 10px; }
.viewer-plat {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--gold-300);
  border: 1px solid var(--gold-600);
  border-radius: 999px;
  padding: 4px 11px;
}
.viewer-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.viewer-pager { display: flex; align-items: center; gap: 8px; }
.viewer-nav {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--hairline-cool);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.viewer-nav:hover:not(:disabled) { color: var(--gold-200); border-color: var(--hairline-strong); }
.viewer-nav:disabled { opacity: 0.35; cursor: default; }
.viewer-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  min-width: 48px;
  text-align: center;
}

.viewer-k {
  display: block;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 7px;
}
.viewer-task {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text-hi);
  margin: 0 0 22px;
}

/* The strip scrolls sideways rather than compressing the step cards; a
   trajectory can run to a dozen steps and squeezing them is unreadable. */
.viewer-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 14px;
  margin-bottom: 20px;
}
.viewer-step {
  flex: 0 0 236px;
  border: 1px solid var(--hairline-cool);
  border-radius: 12px;
  padding: 12px 13px 14px;
  background: var(--surface-2);
}
.viewer-step-n {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 9px;
}
.viewer-shot {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  object-position: top center;
}
.viewer-shot-empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--hairline-strong);
  background: var(--chart-track);
}
.viewer-shot-empty span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.viewer-act {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-hi);
  margin: 11px 0 7px;
  overflow-wrap: break-word;
}
.viewer-thought { font-size: 12.5px; line-height: 1.55; color: var(--text-dim); margin: 0; }

/* Reveal control: the answer is deliberately withheld until clicked. */
.viewer-reveal {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--gold-200);
  background: rgba(217, 165, 58, 0.09);
  border: 1px dashed var(--gold-500);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
}
.viewer-reveal:hover { background: rgba(217, 165, 58, 0.16); border-style: solid; }
:root[data-theme="light"] .viewer-reveal { color: var(--gold-600); }
.viewer-answer[hidden] { display: none; }
.viewer-answer { animation: viewer-fade 0.22s ease-out both; }
@keyframes viewer-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.viewer-verdict { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.viewer-tag {
  flex: none;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 5px 12px;
}
.viewer-tag-success { color: var(--ok); border: 1px solid var(--ok); background: rgba(63, 195, 162, 0.1); }
.viewer-tag-failure { color: var(--bad); border: 1px solid var(--bad); background: rgba(224, 115, 107, 0.1); }
.viewer-why { margin: 3px 0 0; font-size: 14.5px; line-height: 1.65; color: var(--text-dim); }

.viewer-judges { display: flex; flex-wrap: wrap; gap: 8px; }
.viewer-judge {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--hairline-cool);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  color: var(--text-dim);
}
.viewer-judge .jn { color: var(--text-hi); }
.viewer-judge .jv { font-family: var(--font-mono); font-size: 11.5px; }
.viewer-judge .jm { color: var(--ok); font-size: 12px; }
.viewer-judge.wrong { border-color: rgba(224, 115, 107, 0.5); }
.viewer-judge.wrong .jm { color: var(--bad); }

@media (max-width: 620px) {
  .viewer-bar { align-items: flex-start; }
  .viewer-step { flex-basis: 200px; }
}

/* --------------------------------------------------------------------------
   16. Model cards
   -------------------------------------------------------------------------- */
.model-card { padding: 24px 26px; }
.model-card .top { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.model-card .top img { width: 32px; height: 32px; object-fit: contain; }
.model-card .top h3 { margin: 0; font-size: 20px; }
.model-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  margin: 14px 0 0;
  font-size: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline-cool);
}
.model-card dt { color: var(--text-faint); }
.model-card dd { margin: 0; text-align: right; color: var(--text-hi); font-variant-numeric: tabular-nums; font-weight: 550; }
.model-card dd .up { color: var(--ok); font-size: 12px; margin-left: 5px; }

/* --------------------------------------------------------------------------
   17. BibTeX
   -------------------------------------------------------------------------- */
.bibtex {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--hairline-cool);
  border-radius: var(--r);
  overflow: hidden;
}
.bibtex-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--hairline-cool);
  background: var(--chart-track);
}
.bibtex-bar .dots { display: flex; gap: 6px; }
.bibtex-bar .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline-cool); }
.bibtex-bar .fn { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.copy-btn {
  margin-left: auto;
  appearance: none;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  color: var(--gold-300);
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.16s ease;
}
.copy-btn:hover { background: var(--chart-track); color: var(--gold-200); }
.copy-btn.done { color: var(--ok); border-color: var(--ok); }
.bibtex pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.68;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   18. Footer
   -------------------------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--hairline-cool);
  padding: 46px 0 38px;
  margin-top: 30px;
}
footer.site .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 36px; margin-bottom: 28px; }
/* The footer sits outside <main>, so its column labels are top-level headings,
   not subsections of the last section. h2 keeps the outline free of a level
   skip; this rule carries the small-caps look the h4 used to give them. */
footer.site h2 {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 12px;
}
footer.site ul { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 1.95; }
footer.site ul a { color: var(--text-dim); }
footer.site ul a:hover { color: var(--gold-300); }
footer.site .brand-line {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-hi);
  margin-bottom: 9px;
}
footer.site .brand-line img { width: 34px; height: 34px; }
footer.site .fine {
  font-size: 12.5px;
  color: var(--text-faint);
  padding-top: 20px;
  border-top: 1px solid var(--hairline-cool);
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
}
footer.site .fine a { color: var(--text-dim); }

/* --------------------------------------------------------------------------
   19. Reveal-on-scroll (scoped to .js so the page reads without scripts)
   -------------------------------------------------------------------------- */
.js .rise {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(0.22, 0.68, 0.35, 1), transform 0.5s cubic-bezier(0.22, 0.68, 0.35, 1);
}
.js .rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .rise { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  footer.site .cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  body { font-size: 16px; }
  .band { padding: 60px 0; }
  .br-lg { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 88px 0 34px; }
  .hero-split { grid-template-columns: 1fr; gap: 30px; }
  .hero-art { max-width: 420px; margin: 0 auto; width: 100%; }
  .nav-links {
    position: absolute;
    top: 60px; left: 12px; right: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border-radius: 14px;
    background: var(--surface-3);
    border: 1px solid var(--hairline);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: grid; }
  .nav-tools { margin-left: auto; }
  .nav-brand { opacity: 1; transform: none; pointer-events: auto; font-size: 16px; }
  /* the full wordmark pushes the nav buttons off a phone screen */
  .brand-suffix { display: none; }
  .nav-brand img { width: 26px; height: 26px; }
  .abstract { padding: 24px 22px; }
  .card { padding: 22px 18px; }
  .chart-card { padding: 20px 14px 16px; }
  .flow { flex-direction: column; gap: 10px; }
  .flow-arrow { transform: rotate(90deg); padding: 2px 0; }
  footer.site .cols { grid-template-columns: 1fr; gap: 24px; }
  .affils { justify-content: flex-start; text-align: left; }
  .byline { text-align: left; }
  .authors { text-align: left; }
}

@media (max-width: 620px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .authors { font-size: 15px; line-height: 1.9; }
  .btn { height: 38px; padding: 0 15px; font-size: 13.5px; }
  ol.pipeline::before { left: 62px; }
  ol.pipeline > li { grid-template-columns: 54px 1fr; gap: 16px; }
  ol.pipeline > li:not(.drop)::after { left: 58px; }
  ol.pipeline > li.drop::before { left: 59px; }
  ol.pipeline .n { font-size: 19px; }
}

/* Print */
@media print {
  .cosmos, #starfield, .nav { display: none !important; }
  body { background: #fff; color: #111; }
  .card, .chart-card { border-color: #ccc; background: #fff; box-shadow: none; }
  h1, h2, h3, .gilt { color: #111 !important; -webkit-text-fill-color: #111 !important; }
}
