/* ==========================================================================
   PrismaCoder — project page
   Two themes off one token set. The palette is sampled from the prism in
   public/logo.png: indigo-violet accent, cyan for data. Dark is night indigo,
   light is the same palette on cool white. Structure: split hero, byline band,
   then article sections.
   ========================================================================== */

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

  /* Accent — indigo-violet, the prism body */
  --accent-100: #eceeff;
  --accent-200: #cfd3ff;
  --accent-300: #aeb5ff;
  --accent-400: #9099f5;
  --accent-500: #727ae3;
  --accent-600: #585ec6;

  /* Cyan — the prism's light faces; plots, live data */
  --cyan-200: #b4ecf8;
  --cyan-300: #7fd4ea;
  --cyan-400: #4cb9d5;
  --cyan-500: #2a93b2;

  /* Text */
  --text-hi: #eceefd;
  --text: #c3c8e4;
  --text-dim: #8e95ba;
  --text-faint: #6b7197;

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

  /* Surfaces */
  --bg: #090b1a;
  --surface-1: rgba(22, 25, 52, 0.58);
  --surface-1b: rgba(14, 16, 36, 0.64);
  --surface-2: rgba(17, 19, 42, 0.92);
  --surface-3: rgba(11, 13, 30, 0.97);
  --ring: #090b1a;

  --hairline: rgba(144, 153, 245, 0.2);
  --hairline-strong: rgba(144, 153, 245, 0.4);
  --hairline-cool: rgba(150, 160, 215, 0.15);

  /* Charts */
  --chart-grid: rgba(150, 160, 215, 0.11);
  --chart-grid-minor: rgba(150, 160, 215, 0.055);
  --chart-axis: rgba(150, 160, 215, 0.3);
  --chart-track: rgba(150, 160, 215, 0.08);
  --logo-plate: rgba(240, 242, 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 */
  /* Content sits in the middle ~80% of the screen: 10% margin a side on common
     laptop and desktop widths, capped so a very wide screen does not stretch it. */
  --page: min(80vw, 1360px);       /* content sections */
  --page-wide: min(82vw, 1440px);  /* results tables, hero, byline */
  --page-hero: min(82vw, 1440px);
  --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;

  /* The accent ramp inverts (100 = darkest) so it stays legible as text on white */
  --accent-100: #23267a;
  --accent-200: #2d3197;
  --accent-300: #3a40b5;
  --accent-400: #4b52cb;
  --accent-500: #676de0;
  --accent-600: #9ea3f0;

  --cyan-200: #0f5b76;
  --cyan-300: #147594;
  --cyan-400: #1b8cad;
  --cyan-500: #34a6c3;

  --text-hi: #161a33;
  --text: #363c5c;
  --text-dim: #5d6386;
  --text-faint: #8389a8;

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

  --bg: #f7f8fc;
  --surface-1: rgba(255, 255, 255, 0.84);
  --surface-1b: rgba(250, 251, 255, 0.9);
  --surface-2: rgba(255, 255, 255, 0.96);
  --surface-3: rgba(255, 255, 255, 0.98);
  --ring: #f7f8fc;

  --hairline: rgba(75, 82, 203, 0.2);
  --hairline-strong: rgba(75, 82, 203, 0.4);
  --hairline-cool: rgba(40, 50, 110, 0.14);

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

  --shadow: 0 12px 30px -20px rgba(30, 36, 90, 0.4);
}

/* --------------------------------------------------------------------------
   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(--accent-300); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--accent-200); }

strong { color: var(--text-hi); font-weight: 600; }
em { color: var(--accent-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(114, 122, 227, 0.3); }

:focus-visible { outline: 2px solid var(--accent-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(--accent-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(52, 58, 160, 0.30), transparent 64%),
    radial-gradient(900px 600px at 88% 4%,   rgba(104, 70, 168, 0.16), transparent 62%),
    radial-gradient(1200px 900px at 52% 40%, rgba(26, 30, 88, 0.30), transparent 70%),
    radial-gradient(1000px 780px at 8% 74%,  rgba(24, 58, 108, 0.18), transparent 66%),
    radial-gradient(950px 720px at 94% 92%,  rgba(92, 54, 130, 0.12), transparent 64%),
    linear-gradient(168deg, #0d1026 0%, #0a0c1f 34%, #080a1a 66%, #090b1a 100%);
}
:root[data-theme="light"] .cosmos {
  background:
    radial-gradient(1000px 620px at 16% -8%, rgba(214, 218, 250, 0.62), transparent 62%),
    radial-gradient(820px 560px at 86% 2%,  rgba(228, 216, 248, 0.5), transparent 60%),
    radial-gradient(1100px 820px at 50% 48%, rgba(236, 240, 251, 0.7), transparent 70%),
    linear-gradient(180deg, #fafbfe 0%, #f7f8fc 52%, #f3f5fb 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; }
@media (max-width: 900px) { :root { --page: 100%; --page-wide: 100%; --page-hero: 100%; } }
.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(--accent-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; }

/* Gradient text, indigo into cyan like the prism's faces. The accent and cyan
   ramps invert with the theme, so one rule serves both. */
.grad-text {
  background: linear-gradient(100deg, var(--accent-200) 0%, var(--accent-400) 50%, var(--cyan-300) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   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(--accent-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(--accent-300); background: var(--chart-track); }
.nav-links a.active { color: var(--accent-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(--accent-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(--accent-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(--accent-300);
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.icon-btn:hover { color: var(--accent-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; }

/* A cool field behind the title, fading before the byline. The cover on the
   right brings its own light (the spectrum fan), so nothing blooms there. */
.hero::before {
  content: "";
  position: absolute;
  inset: -180px -12% -60px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(64% 70% at 18% 24%, rgba(40, 46, 130, 0.42), transparent 72%),
    radial-gradient(50% 44% at 46% 96%, rgba(16, 20, 60, 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(64% 70% at 18% 24%, rgba(220, 224, 250, 0.55), 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 {
  text-wrap: balance;
  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(--accent-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(--accent-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; }

/* Framed art (for a raster cover). Dark theme: a thin accent edge, the art
   continues the background. Light theme: a dark image is matted like a framed
   print (white mat, fine accent rule, soft drop shadow) so it sits on the 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(144, 153, 245, 0.42), rgba(150, 160, 215, 0.10) 52%, rgba(144, 153, 245, 0.22));
  box-shadow:
    0 26px 80px -34px rgba(30, 34, 110, 0.85),
    0 0 110px -24px rgba(110, 90, 200, 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, #ffffff 0%, #f1f3fa 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(75, 82, 203, 0.28),
    0 22px 44px -26px rgba(30, 36, 90, 0.45);
}
:root[data-theme="light"] .plate::after {
  /* the fine accent rule between mat and image */
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(75, 82, 203, 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);
}

/* Hero cover: a layered web version of the paper's task overview. The prism
   disperses light upward and the artifacts of PrismaCoder's tasks float around
   it on three depth layers: back (blurred, not interactive), mid, and front
   (tilted towards the prism, labelled, some paired with the code behind them).
   Markup and geometry come from tools/build_cover.py, which also places the
   scene around this grid cell (inline style): it spreads under the title
   column and past the page edge. */
/* the text stops short of the cover scene, which bleeds under the column's right end */
.hero-content { position: relative; z-index: 1; max-width: 600px; }
.cover {
  position: relative;
  z-index: 0;
  margin: 0;
  aspect-ratio: 600 / 540;
}
.cover-scene {
  position: absolute;
  container: scene / inline-size;
  pointer-events: none;
}
.cover-burst {
  position: absolute;
  aspect-ratio: 1;
  background: var(--fan);
  -webkit-mask-image: radial-gradient(closest-side, #000 0%, #000 22%, rgba(0, 0, 0, 0.6) 48%, rgba(0, 0, 0, 0.22) 74%, transparent 97%);
  mask-image: radial-gradient(closest-side, #000 0%, #000 22%, rgba(0, 0, 0, 0.6) 48%, rgba(0, 0, 0, 0.22) 74%, transparent 97%);
  filter: blur(10px);
  opacity: 0.8;
}
/* on the dark page the fan is added as light rather than painted on */
:root:not([data-theme="light"]) .cover-burst { opacity: 0.58; mix-blend-mode: screen; }
.cover-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* input beams: invisible at the outer end, brightest where they meet the prism */
.cover-beams stop { stop-color: #e6e9ff; }
.cover-beams .far { stop-opacity: 0; }
.cover-beams .near { stop-opacity: 0.42; }
:root[data-theme="light"] .cover-beams stop { stop-color: #6c73b8; }
:root[data-theme="light"] .cover-beams .near { stop-opacity: 0.26; }
.cover-code text { font-family: var(--font-mono); font-size: 8px; fill: var(--glow); opacity: 0.36; }
:root[data-theme="light"] .cover-code text { fill: var(--ink); opacity: 0.28; }

/* depth: each layer drifts against the pointer by its own amount (--mx, --my from main.js) */
.scene-layer { position: absolute; inset: 0; transition: translate 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.layer-back { translate: calc(var(--mx, 0) * 7px) calc(var(--my, 0) * 5px); }
.layer-mid { translate: calc(var(--mx, 0) * -6px) calc(var(--my, 0) * -4px); }
.layer-front { translate: calc(var(--mx, 0) * -15px) calc(var(--my, 0) * -10px); }

.scene-item { position: absolute; }
.scene-item:hover { z-index: 3; }
.layer-mid .scene-item, .layer-front .scene-item { pointer-events: auto; }
.scene-tilt {
  position: relative;
  transform: perspective(1100px) rotateY(var(--ry)) rotateX(var(--rx)) rotate(var(--rz));
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.layer-front .scene-tilt:hover { transform: perspective(1100px) translateY(-6px) scale(1.05); }
.layer-mid .scene-tilt:hover { transform: perspective(1100px) translateY(-4px) scale(1.04); }

.scene-card {
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 20px 38px -20px rgba(22, 26, 70, 0.55),
    0 4px 10px -6px rgba(22, 26, 70, 0.28);
}
.scene-card img { display: block; width: 100%; height: auto; }
.layer-front .scene-card {
  box-shadow:
    0 24px 44px -20px rgba(22, 26, 70, 0.6),
    0 4px 12px -6px rgba(22, 26, 70, 0.3),
    0 0 46px -16px var(--band);
}
/* browser chrome for rendered pages */
.scene-bar {
  display: flex;
  align-items: center;
  gap: 0.34cqw;
  height: 1.5cqw;
  padding: 0 0.62cqw;
  background: #eceef5;
  border-bottom: 1px solid #dde0ea;
}
.scene-bar i { width: 0.52cqw; height: 0.52cqw; border-radius: 50%; background: #f0a79c; }
.scene-bar i:nth-child(2) { background: #f1cf87; }
.scene-bar i:nth-child(3) { background: #9fd3a6; }

/* back layer: out of focus and out of reach */
.layer-back .scene-item { opacity: 0.5; filter: blur(1.6px) saturate(0.85); }
.layer-mid .scene-item { opacity: 0.92; filter: blur(0.35px); transition: filter 0.3s ease, opacity 0.3s ease; }
.layer-mid .scene-item:hover { opacity: 1; filter: none; }
:root:not([data-theme="light"]) .layer-back .scene-item { opacity: 0.3; }
:root:not([data-theme="light"]) .scene-card { border-color: rgba(255, 255, 255, 0.16); filter: brightness(0.94); }
:root:not([data-theme="light"]) .layer-front .scene-card {
  box-shadow:
    0 26px 48px -20px rgba(0, 0, 0, 0.8),
    0 0 52px -14px var(--band);
}

.scene-label {
  position: absolute;
  left: 0.9cqw;
  top: 0;
  translate: 0 -58%;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.32em 0.8em 0.32em 0.45em;
  border-radius: 999px;
  font-size: 11px;
  font-size: clamp(9px, 1.22cqw, 12px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: #1f2340;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--band);
  box-shadow: 0 8px 18px -10px rgba(22, 26, 70, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.scene-label img { height: 1.45em; width: auto; max-width: 1.9em; object-fit: contain; }
:root:not([data-theme="light"]) .scene-label { color: #eef0ff; background: rgba(24, 27, 56, 0.82); }

/* code windows: the source of the render beside them, kept a step quieter than
   the renders (below them where they overlap, no glow, softer ink), and in an
   editor theme that matches the page */
.layer-front .scene-item:not(.is-code) { z-index: 1; }
.layer-front .scene-item:not(.is-code):hover { z-index: 3; }
.scene-code {
  overflow: hidden;
  border-radius: 8px;
  background: rgba(15, 18, 38, 0.9);
  border: 1px solid rgba(160, 170, 255, 0.2);
  box-shadow: 0 18px 36px -22px rgba(10, 12, 40, 0.6);
  opacity: 0.86;
}
.scene-code-tab {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0.85em;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-size: clamp(7px, 1.05cqw, 10.5px);
  color: #aab1d8;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(160, 170, 255, 0.14);
}
.scene-code-tab img { height: 1.3em; width: auto; }
.scene-code pre {
  margin: 0;
  padding: 0.65em 0.95em 0.75em;
  font-family: var(--font-mono);
  font-size: 9px;
  font-size: clamp(6.5px, 1cqw, 10px);
  line-height: 1.55;
  color: #c3c8e6;
  white-space: pre;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
  mask-image: linear-gradient(90deg, #000 82%, transparent);
}
.scene-code .tk { color: #ab9cf0; }
.scene-code .ta, .scene-code .tt { color: #88c4e6; }
.scene-code .ts { color: #93d2b6; }
.scene-code .tn { color: #eab893; }
.scene-code .tc { color: #6f7699; }
:root[data-theme="light"] .scene-code {
  background: rgba(250, 251, 255, 0.92);
  border-color: #e1e4ef;
  box-shadow: 0 16px 32px -22px rgba(22, 26, 70, 0.45);
}
:root[data-theme="light"] .scene-code-tab { color: #6b7194; background: #f1f3f9; border-bottom-color: #e6e9f2; }
:root[data-theme="light"] .scene-code pre { color: #4b5163; }
:root[data-theme="light"] .scene-code .tk { color: #6d4fd6; }
:root[data-theme="light"] .scene-code .ta, :root[data-theme="light"] .scene-code .tt { color: #1d7fa8; }
:root[data-theme="light"] .scene-code .ts { color: #0f8a6a; }
:root[data-theme="light"] .scene-code .tn { color: #c2621d; }
:root[data-theme="light"] .scene-code .tc { color: #9aa0b8; }

.cover-prism {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 18px 40px rgba(84, 96, 226, 0.45));
}
:root[data-theme="light"] .cover-prism { filter: drop-shadow(0 16px 30px rgba(60, 72, 160, 0.28)); }

/* the artifacts leave the prism once, on load */
@media (prefers-reduced-motion: no-preference) {
  .js .scene-item { animation: scene-in 1.15s cubic-bezier(0.16, 0.84, 0.24, 1) both; animation-delay: calc(180ms + var(--i) * 45ms); }
  .js .cover-prism { animation: prism-in 0.8s ease-out both; }
}
@keyframes scene-in {
  from { opacity: 0; transform: translate(calc(var(--fx) * 1cqw), calc(var(--fy) * 1cqw)) scale(0.3); }
}
@keyframes prism-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
}

/* On a narrow scene the labels stop fitting; the renders stay. */
@container scene (max-width: 640px) {
  .scene-label { display: none; }
}

/* --------------------------------------------------------------------------
   8. Byline band
   -------------------------------------------------------------------------- */
/* The byline sits on the page, not on a panel: hairlines above and below, no
   background, so no white slab lands in the dark theme. */
.byline { padding: 4px 0 2px; }
.byline.empty, .news-band.empty { display: none; }
.byline .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(--accent-300); }
.authors .au { white-space: nowrap; }
.authors .au.eq { color: var(--accent-300); font-weight: 600; }
.authors .au.eq a:hover { color: var(--accent-200); }
.authors sup { font-size: 0.64em; color: var(--accent-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(--accent-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; }
.legend { margin: 16px 0 0; font-size: 13px; color: var(--text-faint); }
.legend sup { color: var(--accent-400); }
.eq-key { color: var(--accent-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-primary {
  background: linear-gradient(180deg, #6a71e4, #4c52c4);
  border-color: rgba(144, 153, 245, 0.55);
  color: #ffffff;
  font-weight: 650;
}
.btn-primary:hover { background: linear-gradient(180deg, #767de9, #565cce); color: #ffffff; }

/* 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-primary.pending {
  color: var(--accent-300);
  border-color: var(--accent-400);
  background: var(--chart-track);
  font-weight: 600;
}
.btn.btn-primary.pending:hover { color: var(--accent-200); background: var(--chart-track); }


/* --------------------------------------------------------------------------
   10. 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(--accent-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(--accent-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(--accent-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(--accent-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(--accent-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(--accent-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(--accent-300);
  background: var(--chart-track);
  border: 1px solid var(--hairline);
}

/* News: newest first, month granularity unless a day matters */
.news { padding: 22px 26px; }
.news .eyebrow { margin-bottom: 12px; }
.news ul { list-style: none; padding: 0; margin: 0; font-size: 15.5px; line-height: 1.9; }
.news time {
  color: var(--accent-300);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  margin-right: 0.8em;
}

/* --------------------------------------------------------------------------
   11. 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(--accent-500);
  padding: 0 8px;
  display: grid; place-items: center; gap: 3px;
}

/* --------------------------------------------------------------------------
   11b. Content sections
   The sections below the hero have their own language: a left-aligned head
   with a numbered chip, one italic accent word in the section's hue, a hue
   wash in the corner, and "stages" (dotted workbench surfaces) for the
   interactive pieces. Each section sets --hue (an RGB triplet) inline.
   -------------------------------------------------------------------------- */
.sec { position: relative; padding: 92px 0; --hue: 114, 122, 227; }
.sec::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(900px 460px at 6% 0%, rgba(var(--hue), 0.13), transparent 70%);
}
:root[data-theme="light"] .sec::before { background: radial-gradient(900px 460px at 6% 0%, rgba(var(--hue), 0.16), transparent 70%); }
.sec + .sec { border-top: 1px solid var(--hairline-cool); }
#cite.sec { border-top: 0; }
#cite.sec::before { display: none; }

.sec-head { max-width: 1000px; margin-bottom: 40px; }
.sec-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(var(--hue));
  margin-bottom: 16px;
}
.sec-index::before { content: ""; width: 34px; height: 2px; background: rgb(var(--hue)); border-radius: 2px; }
.sec-title { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 12px; }
.sec-title i { font-style: italic; font-weight: 500; color: rgb(var(--hue)); }
:root[data-theme="light"] .sec-title i { color: rgb(var(--hue)); filter: brightness(0.8); }
.sec-sub { color: var(--text-dim); font-size: 17px; max-width: 720px; margin: 0; }

.panel {
  background: var(--surface-1);
  border-radius: 20px;
  padding: 28px 30px;
  box-shadow: var(--shadow);
}
.stage {
  position: relative;
  border-radius: 22px;
  padding: 26px;
  background-color: var(--surface-1b);
  background-image: radial-gradient(rgba(var(--hue), 0.32) 1px, transparent 1.3px);
  background-size: 22px 22px;
  border: 1px solid rgba(var(--hue), 0.2);
  box-shadow: var(--shadow);
}
:root[data-theme="light"] .stage { background-color: rgba(255, 255, 255, 0.7); }

.split { display: grid; grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.55fr); gap: 40px; align-items: start; }
.split > * { min-width: 0; }
.split .aside { position: sticky; top: 92px; }
.aside p { font-size: 16px; line-height: 1.68; }
.aside p + p { margin-top: 0.9em; }
.aside .lead { color: var(--text-hi); font-size: 17.5px; }

/* three contributions as a trio of columns, one spectrum colour each */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.trio > div { padding-top: 18px; border-top: 3px solid var(--c); }
.trio h3 { font-size: 20px; margin: 0 0 8px; }
.trio h3 a { color: inherit; }
.trio h3 a:hover { color: rgb(var(--hue)); }
.trio p { font-size: 15.5px; color: var(--text-dim); margin: 0; line-height: 1.6; }

@media (max-width: 1080px) {
  .split { grid-template-columns: 1fr; }
  .split .aside { position: static; }
}
@media (max-width: 900px) {
  .sec { padding: 64px 0; }
  .trio { grid-template-columns: 1fr; gap: 20px; }
  .panel { padding: 22px 20px; }
  .stage { padding: 18px 14px; }
}

/* --------------------------------------------------------------------------
   11c. PrismaForge walkthrough (#forge, static/js/forge.js)
   -------------------------------------------------------------------------- */
.forge { padding: 22px 22px 24px; outline: none; }
.forge:focus-visible { outline: 2px solid rgb(var(--hue)); outline-offset: 3px; }
.forge-map { position: relative; display: grid; gap: 16px; padding-top: 6px; }
.forge-map-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; margin: 0 -22px; padding: 0 22px; }
.forge-band {
  position: relative;
  min-width: 560px;
  border-radius: 16px;
  padding: 14px 14px 12px;
  background: rgba(var(--band), 0.08);
  border: 1px solid rgba(var(--band), 0.3);
}
.forge-band-name {
  position: absolute;
  top: -9px; right: 14px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--band));
  background: var(--surface-3);
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--band), 0.35);
}
.forge-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.forge-node {
  grid-column: var(--col) / span var(--span, 1);
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  padding: 10px 8px 9px;
  border-radius: 12px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--hairline-cool);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.forge-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: rgb(var(--band)); background: rgba(var(--band), 0.12); }
.forge-ico svg { width: 22px; height: 22px; }
.forge-node b { font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--text-hi); }
.forge-node small { font-size: 11px; line-height: 1.25; color: var(--text-faint); }
.forge-node.wide { flex-direction: row; justify-content: center; gap: 12px; text-align: left; }
.forge-node.wide b, .forge-node.wide small { display: block; }
.forge-node.is-on {
  border-color: rgb(var(--band));
  box-shadow: 0 0 0 3px rgba(var(--band), 0.25), 0 12px 26px -14px rgba(var(--band), 0.7);
  transform: translateY(-2px);
}
.forge-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; color: var(--text-faint); }
.forge-wire { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0.35; transition: opacity 0.2s ease, stroke-width 0.2s ease; }
.forge-wire.dashed { stroke-dasharray: 5 4; }
.forge-wire.is-on { opacity: 1; stroke-width: 2.2; color: rgb(var(--hue)); }
.forge-wire-label { font-family: var(--font-body); font-size: 11px; fill: var(--text-faint); text-anchor: middle; opacity: 0.85; paint-order: stroke; stroke: var(--surface-3); stroke-width: 4px; stroke-linejoin: round; }
.forge-wire-label.is-on { fill: rgb(var(--hue)); opacity: 1; font-weight: 600; }

.forge-controls { display: flex; align-items: center; gap: 8px; margin: 18px 0 14px; }
.dctl {
  appearance: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--chart-track);
  color: rgb(var(--hue));
  cursor: pointer;
}
.dctl:hover { border-color: rgb(var(--hue)); }
.dctl svg { width: 14px; height: 14px; }
.dctl-play .ic-pause { display: none; }
.dctl-play[aria-pressed="true"] .ic-play { display: none; }
.dctl-play[aria-pressed="true"] .ic-pause { display: block; }
.forge-dots { display: flex; gap: 6px; list-style: none; margin: 0 0 0 6px; padding: 0; }
.forge-dots li { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline-strong); cursor: pointer; transition: transform 0.15s ease; }
.forge-dots li.on { background: rgb(var(--hue)); transform: scale(1.35); }
.forge-count { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

.forge-panel {
  min-height: 220px;
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-cool);
}
.forge-panel h4 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-size: 16px; font-weight: 600;
  color: var(--text-hi);
}
.forge-panel .step-n { color: rgb(var(--hue)); border-color: rgba(var(--hue), 0.5); }
.fp-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
.fp-kicker { margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgb(var(--hue)); }
.fp-instr {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-left: 3px solid rgb(var(--hue));
  border-radius: 0 10px 10px 0;
  background: var(--chart-track);
  font-size: 14.5px; line-height: 1.55;
  color: var(--text-hi);
}
.fp-note { margin: 12px 0 0; font-size: 14px; line-height: 1.6; color: var(--text-dim); }
.fp-shot { margin: 0; }
.fp-shot img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--hairline-cool); background: #fff; }
.fp-shot figcaption { margin-top: 6px; font-size: 12px; color: var(--text-faint); }

.rubric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; margin-top: 14px; }
.rg-head { padding: 6px 10px; border-radius: 8px; text-align: center; font-weight: 600; color: var(--text-hi); }
.rg-head.code { background: rgba(109, 138, 190, 0.2); }
.rg-head.visual { background: rgba(143, 201, 187, 0.24); }
.rg-cell ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.rg-cell li {
  display: flex; align-items: baseline; gap: 7px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--chart-track);
  line-height: 1.35;
}
.rg-cell.code li { border-left: 2px solid rgba(109, 138, 190, 0.8); }
.rg-cell.visual li { border-left: 2px solid rgba(78, 156, 135, 0.8); }
.rg-cell li em { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.rg-cell li i { flex: none; width: 14px; font-style: normal; font-weight: 700; }
.rg-cell li i.ok { color: var(--ok); }
.rg-cell li i.bad { color: var(--bad); }
.rg-cell li span { display: block; }
.rg-cell li small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-faint); }

.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dim { padding: 12px 14px; border-radius: 10px; background: var(--chart-track); font-size: 13px; }
.dim.code { border-top: 2px solid rgba(109, 138, 190, 0.9); }
.dim.visual { border-top: 2px solid rgba(78, 156, 135, 0.9); }
.dim b { display: block; margin-bottom: 6px; color: var(--text-hi); }
.dim-tier { display: block; margin: 6px 0 3px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.dim ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.dim li { padding: 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--hairline-cool); font-size: 12px; color: var(--text); }

.scores { display: grid; gap: 8px; margin-top: 16px; }
.score { display: grid; grid-template-columns: 230px 1fr 48px; align-items: center; gap: 12px; font-size: 13px; color: var(--text-dim); }
.score-track { height: 10px; border-radius: 99px; background: var(--chart-track); overflow: hidden; }
.score-track i { display: block; height: 100%; border-radius: 99px; }
.score-track i.code { background: #6d8abe; }
.score-track i.visual { background: #4e9c87; }
.score-track i.overall { background: rgb(var(--hue)); }
.score b { font-family: var(--font-mono); font-weight: 600; text-align: right; color: var(--text-hi); }

.route { padding: 26px 8px 28px; }
.route-band { position: relative; display: flex; height: 34px; border-radius: 10px; }
.route-band > span { display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #1f2340; }
.route-band > span:first-child { border-radius: 10px 0 0 10px; }
.route-band > span:nth-child(3) { border-radius: 0 10px 10px 0; }
.r-low { background: #e8a0a0; }
.r-mid { background: #f0d08a; }
.r-high { background: #9fd3b6; }
.route-pin { position: absolute; top: -10px; bottom: -10px; width: 2px; background: var(--text-hi); transform: translateX(-1px); }
.route-pin b { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-mono); font-size: 12px; color: var(--text-hi); }
.route-ticks { position: relative; height: 18px; margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.route-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

.rollouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 4px; }
.rollout { padding: 10px; border-radius: 10px; border: 1px dashed var(--hairline-strong); background: var(--chart-track); text-align: center; font-size: 12px; color: var(--text-dim); }
.rollout i { display: block; height: 46px; margin-top: 8px; border-radius: 6px; background: linear-gradient(180deg, rgba(var(--hue), 0.28), rgba(var(--hue), 0.08)); }
.rollouts.scored .rollout i { position: relative; background: var(--chart-track); overflow: hidden; }
.rollouts.scored .rollout i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: rgb(var(--hue)); border-radius: 6px 6px 0 0; }
.rollouts.scored .rollout.good i::after { background: var(--ok); }
.rollouts.scored .rollout.fail { border-color: rgba(224, 115, 107, 0.6); }
.rollouts.scored .rollout b { display: block; margin-top: 7px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--text-hi); }
.rollouts.scored .rollout.fail b { color: var(--bad); }
.adv { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; height: 150px; padding: 0 6px; margin-bottom: 20px; }
.adv-base { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--hairline-strong); }
.adv-base span { position: absolute; right: 0; top: -18px; font-size: 11px; color: var(--text-faint); }
.adv-col { position: relative; }
.adv-col i { position: absolute; left: 22%; right: 22%; border-radius: 4px; }
.adv-col i.up { bottom: 50%; height: calc(var(--h) * 0.5); background: var(--ok); }
.adv-col i.down { top: 50%; height: calc(var(--h) * 0.5); background: var(--bad); opacity: 0.8; }
.adv-col small { position: absolute; left: 0; right: 0; bottom: -18px; text-align: center; font-size: 11px; color: var(--text-faint); }

.forge-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 4px; counter-reset: fs; }
.forge-steps li {
  counter-increment: fs;
  position: relative;
  padding: 6px 10px 6px 34px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.forge-steps li::before {
  content: counter(fs);
  position: absolute; left: 8px; top: 6px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--hue), 0.5);
  font-family: var(--font-mono); font-size: 10.5px;
  color: rgb(var(--hue));
}
.forge-steps li:hover { background: var(--chart-track); }
.forge-steps li.on { background: rgba(var(--hue), 0.14); color: var(--text-hi); }
.forge-steps li.on::before { background: rgb(var(--hue)); color: #fff; }

@media (max-width: 900px) {
  .forge { padding: 16px 14px 18px; }
  .forge-map-scroll { margin: 0 -14px; padding: 0 14px; }
  .forge-panel { padding: 16px 14px; }
  .fp-split { grid-template-columns: 1fr; }
  .score { grid-template-columns: 1fr 48px; }
  .score span { grid-column: 1 / -1; }
  .rubric-grid, .dims { grid-template-columns: 1fr; }
  .rollouts { grid-template-columns: repeat(3, 1fr); }
}

/* --------------------------------------------------------------------------
   11d. Data section: language strip, family wall, seed kinds
   -------------------------------------------------------------------------- */
.langs {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  gap: 10px 14px;
}
.langs li {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 9px;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--hairline-cool);
  font-size: 13.5px; font-weight: 500;
  color: var(--text);
}
.langs img { height: 22px; width: auto; max-width: 30px; object-fit: contain; }

.fam-wall { display: grid; grid-template-columns: 7fr 11fr; gap: 10px 40px; padding: 22px 28px 20px; }
.fam-group { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); margin: 6px 0 8px; display: flex; align-items: baseline; gap: 8px; }
.fam-group::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--g); flex: none; align-self: center; }
.fam-group small { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-faint); }
.fam-col:last-child .fams { grid-template-columns: 1fr 1fr; column-gap: 28px; }
.fams { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 2px 22px; }
.fam { display: grid; grid-template-columns: 40px 1fr 52px; grid-template-rows: auto auto; align-items: center; column-gap: 10px; row-gap: 2px; padding: 5px 0; }
.fam-ico { grid-row: 1 / 3; display: flex; align-items: center; gap: 3px; }
.fam-ico img { height: 22px; width: auto; max-width: 24px; object-fit: contain; }
.fam-name { grid-column: 2; grid-row: 1; font-size: 13.5px; font-weight: 500; color: var(--text-hi); }
.fam-n { grid-column: 3; grid-row: 1 / 3; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); text-align: right; }
.fam-bar { grid-column: 2; grid-row: 2; height: 5px; border-radius: 99px; background: var(--chart-track); overflow: hidden; }
.fam-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgb(var(--hue)), rgba(var(--hue), 0.5)); }

.seeds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 40px; }
.seeds > div { padding: 18px 20px; border-radius: 16px; background: var(--surface-1b); border: 1px solid var(--hairline-cool); }
.seeds h3 { font-size: 16.5px; margin: 0 0 8px; }
.seeds p { font-size: 14px; line-height: 1.6; color: var(--text-dim); margin: 0; }

@media (max-width: 1080px) { .seeds { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .fam-wall { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .fam-col:last-child .fams { grid-template-columns: 1fr; } .seeds { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   11e. Results: range chart and folded tables (static/js/results.js)
   -------------------------------------------------------------------------- */
#results-stage { position: relative; }
.res-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-bottom: 14px; }
.res-legend { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--text-dim); }
.res-legend li { display: inline-flex; align-items: center; gap: 7px; }
.res-legend i { width: 11px; height: 11px; border-radius: 50%; }
.k-open { border: 2px solid var(--text-faint); background: transparent; }
.k-9b { background: rgba(var(--hue), 0.55); }
.k-35b { background: rgb(var(--hue)); }
.k-prop { background: #e0b35a; }
.res-legend .k-open { border-style: dashed; }
.res-prop-label { display: inline-flex; align-items: center; gap: 6px; }
.res-prop {
  appearance: none;
  font: inherit; font-weight: 600;
  color: #e0b35a;
  background: var(--chart-track);
  border: 1px solid var(--hairline-cool);
  border-radius: 7px;
  padding: 2px 22px 2px 8px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 8px) 55%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.res-take { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--text-hi); }
.res-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr); gap: 28px; align-items: center; }
.res-chart { position: relative; }
.radar { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.rd-ring { fill: none; stroke: var(--chart-grid); stroke-width: 1; }
.rd-spoke { stroke: var(--chart-grid); stroke-width: 1; }
.rd-label { font-size: 13.5px; font-weight: 600; fill: var(--text-hi); }
.rd-sub { font-size: 11px; fill: var(--text-faint); }
.rd-val { font-size: 11.5px; font-weight: 600; fill: var(--text-hi); paint-order: stroke; stroke: var(--surface-3); stroke-width: 3px; stroke-linejoin: round; }
.rd-poly { stroke-linejoin: round; }
.rd-poly.rd-open { fill: none; stroke: var(--text-dim); stroke-width: 2; stroke-dasharray: 6 4; }
.rd-poly.rd-prop { fill: none; stroke: #e0b35a; stroke-width: 1.8; }
.rd-poly.rd-9b { fill: rgba(var(--hue), 0.16); stroke: rgba(var(--hue), 0.75); stroke-width: 1.6; }
.rd-poly.rd-35b { fill: rgba(var(--hue), 0.26); stroke: rgb(var(--hue)); stroke-width: 2.2; }
.rd-pt { cursor: pointer; stroke: var(--surface-3); stroke-width: 1.2; }
.rd-pt.rd-open { fill: var(--surface-3); stroke: var(--text-faint); stroke-width: 1.6; }
.rd-pt.rd-prop { fill: #e0b35a; }
.rd-pt.rd-9b { fill: rgba(var(--hue), 0.75); }
.rd-pt.rd-35b { fill: rgb(var(--hue)); }
.range-chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.rc-grid { stroke: var(--chart-grid); stroke-width: 1; }
.rc-tick { font-size: 10.5px; fill: var(--text-faint); }
.rc-label { font-size: 12.5px; font-weight: 600; fill: var(--text-hi); }
.rc-sub { font-size: 10.5px; fill: var(--text-faint); }
.rc-track { stroke: var(--chart-track); stroke-width: 4; stroke-linecap: round; }
.rc-span { stroke: rgba(var(--hue), 0.35); stroke-width: 4; stroke-linecap: round; }
.rc-pt { cursor: pointer; }
.rc-open { fill: var(--surface-3); stroke: var(--text-faint); stroke-width: 2; }
.rc-prop { fill: #e0b35a; stroke: var(--surface-3); stroke-width: 1.5; }
.rc-9b { fill: rgba(var(--hue), 0.6); stroke: var(--surface-3); stroke-width: 1.5; }
.rc-35b { fill: rgb(var(--hue)); stroke: var(--surface-3); stroke-width: 1.5; }
.rc-val { font-size: 10.5px; fill: var(--text-hi); font-weight: 600; }
.rc-val.dim { fill: var(--text-dim); font-weight: 500; }
.res-tip {
  position: absolute; z-index: 5; pointer-events: none; display: none;
  transform: translate(-50%, -100%);
  padding: 7px 10px; border-radius: 8px;
  background: var(--surface-3); border: 1px solid var(--hairline-strong);
  font-size: 12.5px; color: var(--text-hi); white-space: nowrap;
  box-shadow: var(--shadow);
}
.res-tip.on { display: block; }
.res-tip b { display: block; font-weight: 600; }
.res-tip small { display: block; color: var(--text-faint); font-size: 11px; }
.res-tip span { font-family: var(--font-mono); color: rgb(var(--hue)); }

.fold { margin-top: 18px; border-top: 1px solid var(--hairline-cool); padding-top: 12px; }
.fold summary { cursor: pointer; font-size: 14px; font-weight: 600; color: rgb(var(--hue)); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s ease; }
.fold[open] summary::before { transform: rotate(45deg); }
.fold .table-shell { margin-top: 12px; }
.fold-note { font-size: 12.5px; color: var(--text-faint); margin: 10px 0 0; }
table.data tr.section td { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); padding-top: 12px; border-bottom: 1px solid var(--hairline-cool); }
table.data td.best { color: rgb(var(--hue)); font-weight: 650; }
table.data td.second { text-decoration: underline; text-decoration-color: rgba(var(--hue), 0.6); text-underline-offset: 3px; }
table.data tbody tr.ours { background: rgba(var(--hue), 0.1); box-shadow: inset 3px 0 0 rgb(var(--hue)); }
.res-settings { margin: 26px auto 0; max-width: 900px; font-size: 13.5px; line-height: 1.65; color: var(--text-faint); }

@media (max-width: 1080px) { .res-body { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .res-legend { margin-left: 0; } }

/* --------------------------------------------------------------------------
   11f. Analysis charts (static/js/analysis.js)
   -------------------------------------------------------------------------- */
.an-block { display: grid; grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.6fr); gap: 34px; align-items: center; padding: 30px 0; }
.an-block + .an-block { border-top: 1px solid var(--hairline-cool); }
.an-text h3 { font-size: 21px; margin: 0 0 10px; }
.an-text p { font-size: 15.5px; line-height: 1.65; color: var(--text-dim); margin: 0; }
.an-fig { padding: 18px 18px 10px; border-radius: 16px; background: var(--surface-1b); border: 1px solid var(--hairline-cool); }
.an-chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.an-grid { stroke: var(--chart-grid); stroke-width: 1; }
.an-grid.zero { stroke: var(--chart-axis); }
.an-tick, .an-sub { font-size: 11px; fill: var(--text-faint); }
.an-cat { font-size: 12.5px; font-weight: 600; fill: var(--text-hi); }
.an-delta, .an-val { font-size: 11px; font-family: var(--font-mono); fill: var(--text-hi); }
.an-brace { stroke: var(--hairline-strong); stroke-width: 1; }
.an-link { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 2 2; }
.an-bar.direct { fill: var(--text-faint); opacity: 0.55; }
.an-bar.rubric.vision { fill: #da8a9c; }
.an-bar.rubric.text { fill: #8fa8c8; }
.an-bar.sft { fill: rgba(var(--hue), 0.5); }
.an-bar.rl { fill: rgb(var(--hue)); }
.an-slope { stroke-width: 2.2; }
.an-slope.j0, .an-dot.j0 { stroke: #d78c6e; fill: #d78c6e; }
.an-slope.j1, .an-dot.j1 { stroke: #6d8abe; fill: #6d8abe; }
.an-slope.j2, .an-dot.j2 { stroke: #4e9c87; fill: #4e9c87; }
.an-legend { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--text-dim); }
.an-legend li { display: inline-flex; align-items: center; gap: 7px; }
.an-legend i { width: 12px; height: 12px; border-radius: 3px; }
.k-direct { background: var(--text-faint); opacity: 0.55; }
.k-rubric { background: linear-gradient(90deg, #da8a9c 50%, #8fa8c8 50%); }
.k-sft { background: rgba(var(--hue), 0.5); }
.k-rl { background: rgb(var(--hue)); }
.an-seg { margin-top: 14px; }
.an-seg button[aria-pressed="true"] { background: linear-gradient(180deg, rgb(var(--hue)), rgba(var(--hue), 0.8)); color: #1f2340; }
@media (max-width: 1080px) { .an-block { grid-template-columns: 1fr; gap: 18px; } }

/* --------------------------------------------------------------------------
   11g. Case viewer (static/js/cases.js)
   A selector column on the left, the case on the right. Every render sits in
   a frame of one fixed aspect ratio, so rows are regular whatever the images'
   own proportions.
   -------------------------------------------------------------------------- */
.case-stage { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 26px; outline: none; }
.case-stage:focus-visible { outline: 2px solid rgb(var(--hue)); outline-offset: 3px; }
.case-side { position: sticky; top: 92px; align-self: start; }
.case-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.case-list button {
  appearance: none;
  width: 100%;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 7px 10px;
  border: 0; border-radius: 9px;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.case-list button:hover { background: var(--chart-track); }
.case-list button[aria-pressed="true"] { background: rgba(var(--hue), 0.16); box-shadow: inset 3px 0 0 rgb(var(--hue)); }
.case-list b { font-size: 13px; font-weight: 600; color: var(--text-hi); }
.case-list small { font-size: 11px; color: var(--text-faint); }
.case-nav { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline-cool); }
.case-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); min-width: 44px; text-align: center; }

.case-head { margin-bottom: 12px; }
.case-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgb(var(--hue)); }
.case-instr { margin: 6px 0 0; font-size: 14.5px; color: var(--text-hi); font-style: italic; }
.case-row { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 12px; align-items: start; margin-bottom: 8px; }
.case-panel { margin: 0; min-width: 0; }
.case-img {
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  padding: 6px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--hairline-cool);
}
.case-img img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.case-panel figcaption { margin-top: 6px; font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 7px; }
.case-panel figcaption::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.case-panel.is-gold figcaption::before { background: #e0b35a; }
.case-panel.is-ours figcaption { color: var(--text-hi); font-weight: 600; }
.case-panel.is-ours figcaption::before { background: rgb(var(--hue)); }
.case-panel.is-ours .case-img { border-color: rgba(var(--hue), 0.7); box-shadow: 0 0 0 2px rgba(var(--hue), 0.25); }
.case-caption { margin: 6px 0 18px; font-size: 13.5px; line-height: 1.6; color: var(--text-dim); }
.case-caption:last-child { margin-bottom: 0; }
@media (max-width: 1080px) {
  .case-stage { grid-template-columns: 1fr; }
  .case-side { position: static; }
  .case-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .case-list { grid-template-columns: 1fr; }
  .case-row { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   12. 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(--accent-400);
  padding-bottom: 6px;
}
table.data thead th.sortable { cursor: pointer; }
table.data thead th.sortable:hover { color: var(--accent-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(--accent-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:hover { background: var(--surface-1b); }
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,
.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(--accent-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;
}

/* --------------------------------------------------------------------------
   13. 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(--accent-300); }
.seg button[aria-pressed="true"] {
  color: #ffffff;
  background: linear-gradient(180deg, #6a71e4, #4c52c4);
}

.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 accent field instead of an "(ours)" suffix */
.chip-ours {
  background: linear-gradient(180deg, rgba(144, 153, 245, 0.22), rgba(144, 153, 245, 0.10));
  border-color: var(--hairline-strong);
  color: var(--accent-200);
  font-weight: 600;
}
.chip-ours:hover { color: var(--accent-100); border-color: var(--accent-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); }

/* --------------------------------------------------------------------------
   14. Charts & figures
   -------------------------------------------------------------------------- */
.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-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; }

.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; }

/* --------------------------------------------------------------------------
   15. 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; }

/* --------------------------------------------------------------------------
   16. 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(--accent-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(--accent-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);
}

/* --------------------------------------------------------------------------
   17. 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(--accent-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(--accent-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); }

/* --------------------------------------------------------------------------
   18. 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; } }

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

@media (max-width: 900px) {
  body { font-size: 16px; }
  .band { padding: 60px 0; }
  .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; }
  /* in the stacked phone menu the project list expands in place */
  .nav-more ul { position: static; min-width: 0; margin-top: 2px; box-shadow: none; backdrop-filter: none; }
  .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) {
  .authors { font-size: 15px; line-height: 1.9; }
  .btn { height: 38px; padding: 0 15px; font-size: 13.5px; }
}

/* 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, .grad-text { color: #111 !important; -webkit-text-fill-color: #111 !important; }
}
