:root {
  color-scheme: light dark;

  /* populace.dev consumes the PolicyEngine design system: @policyengine/ui-kit
     tokens.css is loaded via CDN in the page <head> (light theme — PE default,
     no .dark class). The site's original local var names are aliased onto the
     PE semantic tokens here, so the existing component CSS keeps working. */
  --ink: var(--background); /* page background */
  --ink-2: var(--muted); /* raised surface (cards) */
  --paper: var(--foreground); /* primary text */
  --paper-dim: var(--muted-foreground);
  /* --text-tertiary (#64748B) measures 4.47:1 on the translucent .panel-card
     used by /connect/ — just under AA. Darkened one step so faint text clears
     4.5:1 on every surface the site paints. */
  --paper-faint: #5B6878;
  /* Accent. Named --brand* because these are teal, not amber: the old
     --amber/--amber-soft names were left over from a previous palette and
     invited reaching for the wrong colour. --chart-1 (#319795) was 3.51:1 on
     white and failed AA as the site's main link colour, so the emphasis accent
     now resolves to --primary (#2C7A7B, 5.03:1). */
  --brand: var(--primary);
  --brand-strong: var(--primary);
  /* deeper teal for hover/pressed states, so hover still reads as a change now
     that --brand and --brand-strong resolve to the same AA-passing value.
     #285E61 = teal-700, 7.33:1 on white. */
  --brand-deep: #285E61;
  /* Chart series 2. --brand-strong collapsed onto --primary for AA, which
     left .vc-s1 and .vc-s2 the same colour, distinguished only by a dash
     pattern -- while .vc-lab/.vc-lab2 styled the legend as two colours.
     A dark slate keeps the two-series-plus-neutrals restraint and reads
     apart from teal in greyscale. 10.4:1 on white. */
  --chart-s2: #334155;
  /* AA-safe warning text. --text-warning (#c2410c) is only 4.10:1 against the
     16%-tinted chip .tag-local paints behind it; #9A3412 is 5.63:1 there. */
  --brand-warning: #9A3412;
  /* Back-compat aliases: page-level inline <style> blocks still reference
     --amber/--amber-soft. Keep them pointed at the accent tokens. */
  --amber: var(--brand);
  --amber-soft: var(--brand-strong);
  --line: var(--border);
  --line-soft: var(--border-light);
  /* aliases so the content-page component CSS uses design-system colors
     instead of hard-coded light-mode fallbacks (theme-safe). */
  --text: var(--foreground);
  --surface: color-mix(in srgb, var(--background) 72%, transparent);
  /* PE ships its font families in the Tailwind @theme layer (not :root), which a
     no-build static page can't read; the families below mirror ui-kit tokens.css
     and resolve to --font-sans/--font-mono if a build ever exposes them. */
  --display: var(--font-sans, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  --body: var(--font-sans, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  --mono: var(--font-mono, "JetBrains Mono", "Fira Code", Consolas, monospace);
  --max: 1140px;

  /* ---------- type scale (single source of truth for font sizes) ---------- */
  /* Steps are ~1.3x apart so h1 > h2 > h3 > body reads as four distinct
     levels. The old scale topped out at 3.9rem/3.2rem: h1 and h2 were close
     enough to compete, and both were loud enough to fight the body copy. */
  --fs-hero: clamp(2.1rem, 4.4vw, 3.1rem);     /* homepage h1 */
  --fs-hero-sub: clamp(1.9rem, 4vw, 2.7rem);   /* interior-page h1 */
  --fs-h2: clamp(1.5rem, 2.6vw, 1.95rem);      /* band headings */
  --fs-h3: 1.2rem;                             /* card h3 */
  --fs-h3-sm: 1.1rem;                          /* compact card h3 */
  --fs-h4: 16px;                               /* step / minor headings */
  --fs-lede: clamp(1.05rem, 1.8vw, 1.25rem);   /* hero ledes */
  --fs-stat: 2.4rem;                           /* big metric numerals */
  --fs-body: 17px;                             /* prose + card body text */
  --fs-body-sm: 14px;                          /* secondary text, notes, tables */
  --fs-small: 13px;                            /* captions, nav, fine print */
  --fs-mono: 13px;                             /* code blocks */
  --fs-label: 12px;                            /* uppercase mono micro-labels */
  --fs-code-inline: 0.9em;                     /* inline code, relative to its text */
  --ls-label: 0.08em;                          /* letter-spacing for micro-labels */

  /* ---------- spacing scale (single source of truth for rhythm) ----------
     One geometric-ish ramp. Component margins/padding pick a step from here
     instead of inventing a number, so seams between sections are consistent
     and the eye can find them. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  /* band gutter + vertical band rhythm */
  --gutter: clamp(20px, 5vw, 56px);
  --band-y: clamp(56px, 8vw, 104px);

  /* ---------- one border radius, one border colour ----------
     Cards, code blocks, charts and panels used 2px/3px/6px/8px in different
     places for the same job. One value now. */
  --radius: 8px;
  /* Referenced by .section-tabs, the model navs, .contact-email,
     .comparison-table row hover and .verification-tag, but never defined --
     so those backgrounds resolved to nothing and the PUBLISHED ANCHOR chips
     rendered as bare text while STATUTE/CALIBRATED rendered as pills. */
  --brand-wash: color-mix(in srgb, var(--primary) 8%, transparent);
  --radius-card: var(--radius);
  --radius-sm: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--fs-small);
}
.skip-link:focus { left: 12px; top: 12px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.prose tbody th {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- focus (WCAG 2.4.7) ----------
   The vendored ui-kit ships a focus ring inside @layer base, so any unlayered
   rule here would silently outrank it; and its single teal outline disappears
   against the teal-tinted and dark-filled surfaces this site paints (most
   visibly /connect/'s selected tablist button, which is filled with --text).
   This is a two-tone ring — a dark inner outline plus a light outer box-shadow
   — so exactly one of the two always contrasts, on any background the site
   uses. Unlayered, so it wins everywhere. */
:focus-visible {
  outline: 3px solid var(--foreground);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--background);
  border-radius: 3px;
}
/* On a filled/inverted control the roles swap: the light ring sits inside. */
[aria-selected="true"]:focus-visible,
.btn-primary:focus-visible {
  outline-color: var(--background);
  outline-offset: -5px;
  box-shadow: 0 0 0 3px var(--foreground);
}
/* Never let a clipping ancestor eat the ring. */
:focus-visible { position: relative; z-index: 1; }

/* ---------- fragment navigation ----------
   `scroll-behavior: smooth` was here, and it is why `/docs/#papers` did not
   work: the four paper viewer pages link to that fragment, the target sits
   ~4,400px down, and Chrome does not run the smooth animation for the
   initial same-document fragment jump at all (measured: scrollY stayed 0
   with smooth, landed exactly on target with auto). It was also the wrong
   call for its own sake — a multi-second animated flight down a long
   reference page is disorienting, not calm. Instant jumps now.
   scroll-margin-top keeps the landed heading clear of the fixed nav
   instead of tucked underneath it. */
:target,
section[id],
[id]:not(body) { scroll-margin-top: clamp(88px, 12vh, 112px); }
.has-section-tabs :target,
.has-section-tabs section[id],
.has-section-tabs [id]:not(body) { scroll-margin-top: 160px; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: visible;
  position: relative;
}

/* Let content shrink inside grid/flex tracks. Horizontal scrolling belongs
   only to explicit table and code scrollers, never to the whole document. */
main, section, article, header, nav, .hero-inner, .hero-copy, .band-head,
.lede, h1, h2, h3, p, figure, figcaption { min-width: 0; max-inline-size: 100%; }
img, svg, canvas { max-width: 100%; }
h1, h2, h3, p, figcaption, a { overflow-wrap: anywhere; }

/* ---------- background: deliberately nothing ----------
   The page used to stack three ambient layers behind the reading column: two
   fixed teal radial washes, an animated canvas of 120–360 drifting/twinkling
   dots (field.js, now deleted along with its markup), and an SVG noise grain.
   These are reference pages of continuous prose; ambient motion and
   texture directly behind that much body copy is what "the background is confusing" means.
   One flat surface, so the only thing moving on the page is the text.
   .grain is a <div> on all 14 pages (markup owned elsewhere) — retired here.

   What replaces it is not ambient: a static plot grid. The subject of this site
   is models that produce charts, so the page's own surface is ruled like the
   paper those charts are drawn on — a 64px lattice at 3% of the accent, fixed,
   never animated, no second layer. It is a texture you notice once and then
   stop seeing, which is the whole difference from the dot field. The character
   is spent in the hero fan chart below; everything else stays quiet. */
.grain {
  display: block;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to right,
      color-mix(in srgb, var(--brand) 3%, transparent) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(to bottom,
      color-mix(in srgb, var(--brand) 3%, transparent) 0 1px, transparent 1px 64px);
  /* fade the lattice out down the page so long reference pages end on plain
     paper rather than carrying texture under 4,900 words of prose */
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 22vh, transparent 78vh);
  mask-image: linear-gradient(to bottom, #000 0, #000 22vh, transparent 78vh);
}

/* ---------- hero fan chart: the signature element ----------
   The old background depicted a field of synthetic households — a
   microsimulation metaphor on a site about macro models. The artifact this
   subject actually produces is a forecast fan, so the hero *is* one, drawn from
   papers/boe-svar/figures/current_forecast.json by assets/make_hero.py. The
   ornament is the output. Static: no entrance animation, nothing loops. */
.hero-fig {
  margin: 0;
  min-width: 0;          /* lets the grid track shrink; no horizontal overflow */
}
.hero-fan {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.hero-fan text { font-family: var(--mono); fill: var(--paper-faint); }
.hero-fan .hf-tick { font-size: 11px; }
/* the viewBox scales to about half below the two-column breakpoint, which would
   render these at ~6px. Hide them there; the figcaption carries the detail. */
@media (max-width: 999px) {
  .hero-fan .hf-tick { display: none; }
}
.hero-fan .hf-grid { stroke: var(--line-soft); stroke-width: 1; }
.hero-fan .hf-zero { stroke: var(--line); stroke-width: 1.5; }
.hero-fan .hf-b90 { fill: color-mix(in srgb, var(--brand) 13%, transparent); }
.hero-fan .hf-b68 { fill: color-mix(in srgb, var(--brand) 26%, transparent); }
.hero-fan .hf-med {
  fill: none; stroke: var(--brand-strong); stroke-width: 2.5;
  stroke-linejoin: round; stroke-linecap: round;
}
.hero-fan .hf-dot { fill: var(--brand-strong); }

.hero-fig figcaption {
  margin-top: var(--s-3);
  font-size: var(--fs-body-sm);
  line-height: 1.55;
  color: var(--paper-faint);
  max-width: 46ch;
}
.hero-fig figcaption a { color: var(--brand-strong); }

/* single column at phone/tablet: the figure sits under the CTAs, never behind
   a word of text at any width */
.hero-inner { display: grid; grid-template-columns: 1fr; gap: var(--s-7); }
.hero-copy { min-width: 0; }

@media (min-width: 1000px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
    gap: var(--s-5);
    align-items: center;
  }
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--gutter);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  font-family: var(--mono);
  font-size: var(--fs-body);
  letter-spacing: 0.02em;
  color: var(--paper);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--brand);
}
.brand-logo {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: 0.01em;
}
.nav-links a {
  color: var(--paper-dim);
  text-decoration: none;
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--brand-strong); }
.nav-links a[aria-current="page"] { color: var(--brand-strong); }
.nav-gh { color: var(--paper) !important; display: inline-flex; align-items: center; }
.nav-gh svg { width: 18px; height: 18px; display: block; }
.nav-links a:not(.nav-gh) { display: none; }

/* Keep the two primary journeys available on small screens. The previous
   mobile header reduced the entire site navigation to a GitHub icon. */
.nav-links a.nav-mobile { display: inline-flex; }
.nav-links .nav-start {
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--brand);
  border-radius: 4px;
  color: var(--brand-strong);
}
.nav-links .nav-start:hover { background: var(--ink-2); }

@media (min-width: 760px) {
  .nav-links .nav-start { min-height: auto; padding: 0; border: 0; }
  .nav-links .nav-start:hover { background: transparent; }
  .nav-links a:not(.nav-gh) { display: inline; }
}

/* Research library navigation. The global header answers "where am I in the
   product?" while this row keeps the four evidence surfaces visibly related. */
.section-tabs {
  position: fixed;
  z-index: 9;
  top: 59px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 9px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.section-tabs::-webkit-scrollbar { display: none; }
.section-tabs a {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: var(--fs-small);
  text-decoration: none;
  white-space: nowrap;
}
.section-tabs a:hover { color: var(--brand-strong); background: var(--ink-2); border-color: var(--line-soft); }
.section-tabs a[aria-current="page"] {
  color: var(--brand-strong);
  background: var(--brand-wash);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line-soft));
  box-shadow: none;
}
.has-section-tabs .hero { padding-top: clamp(162px, 20vh, 210px); }

.model-local-nav,
.validation-model-nav {
  display: flex;
  gap: 8px;
  padding: 0 var(--gutter) var(--s-5);
  max-width: calc(980px + (2 * var(--gutter)));
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.validation-model-nav {
  position: sticky;
  top: 116px;
  z-index: 5;
  width: max-content;
  max-width: calc(100% - (2 * var(--gutter)));
  margin-top: 12px;
  padding: 5px;
  gap: 3px;
  background: color-mix(in srgb, var(--ink) 96%, transparent);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(20, 45, 52, .06);
}
.model-local-nav::-webkit-scrollbar,
.validation-model-nav::-webkit-scrollbar { display: none; }
.model-local-nav a,
.validation-model-nav a {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: var(--fs-label);
  text-decoration: none;
}
.model-local-nav a:hover,
.validation-model-nav a:hover,
.validation-model-nav a[aria-current="location"] {
  color: var(--brand-strong);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line-soft));
  background: var(--brand-wash);
}
.validation-model-nav a[aria-current="location"] { font-weight: 600; }
.model-breadcrumb {
  display: block;
  margin-bottom: var(--s-4);
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: var(--fs-label);
}
.model-breadcrumb a { color: var(--brand-strong); }

@media (max-width: 620px) {
  .section-tabs { justify-content: flex-start; top: 76px; padding-inline: 8px; }
  .section-tabs a { padding-inline: 11px; }
  .has-section-tabs .hero { padding-top: 174px; }
}

/* ---------- hero ---------- */
.hero {
  display: flex;
  align-items: center;
  padding: clamp(120px, 16vh, 168px) var(--gutter) var(--s-9);
}
.hero-inner { max-width: 980px; margin: 0 auto; width: 100%; }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--s-4);
}

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
  margin-bottom: var(--s-5);
}
h1 em {
  font-style: italic;
  color: var(--brand-strong);
  font-weight: 500;
}

.lede {
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--paper);
  max-width: 56ch;
  margin-bottom: var(--s-6);
}
.lede strong { color: var(--brand-strong); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-bottom: 0; }

.btn {
  font-family: var(--mono);
  font-size: var(--fs-body-sm);
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  display: inline-block;
  /* some buttons are labelled with a full repo URL; let the label break
     rather than push the page sideways at 375px */
  max-width: 100%;
  overflow-wrap: anywhere;
}
.btn-primary {
  background: var(--brand);
  color: var(--ink);
  font-weight: 500;
}
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost {
  color: var(--paper);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-strong); }
.mono { font-family: var(--mono); }

/* ---------- bands ---------- */
.band {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--band-y) var(--gutter);
  position: relative;
}
.band + .band { border-top: 1px solid var(--line-soft); }

.band-head { margin-bottom: var(--s-6); max-width: 60ch; }
.kicker {
  display: block;
  font-size: var(--fs-small);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--s-3);
}
h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: 1.2;
  letter-spacing: -0.012em;
  max-width: 26ch;
}

.prose { max-width: 68ch; }
/* Long unbreakable tokens — file paths, package names, URLs printed inline in
   the prose — are wider than a 375px column at this body size and pushed the
   page 2–3px sideways on /validation/. Break them instead of shrinking the
   type. <pre>/.codeblock keep their own horizontal scroll and are untouched. */
.prose p, .prose li, .prose td, .prose figcaption { overflow-wrap: break-word; }
.prose p { margin-bottom: var(--s-5); color: var(--paper); font-size: var(--fs-body); line-height: 1.7; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; color: var(--brand-strong); }
.prose strong { font-weight: 600; color: var(--paper); }

/* ---------- cards ---------- */
.card-id { font-size: var(--fs-small); color: var(--brand); letter-spacing: 0.04em; }
/* ONE chip form. Variants differ only by colour, never by shape or size. */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag-wip { background: var(--ink-2); color: var(--paper-dim); }

/* model access + status badges (accurate to how each model can be used) */
.tag-hosted { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--text-success); }
.tag-local { background: color-mix(in srgb, var(--brand-warning) 16%, transparent); color: var(--brand-warning); }
.tag-experimental { background: var(--muted); color: var(--paper-dim); border-color: var(--line); }
.tag-country { background: transparent; color: var(--paper-dim); border-color: var(--line); }
/* two badges sit side by side in a card header */
.tag-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* paper status badges: draft / preprint / submitted / published */

.stack-note { text-align: center; color: var(--paper-faint); font-size: var(--fs-small); margin-top: 8px; }

/* ---------- metrics ---------- */
.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: var(--s-7) 0 var(--s-6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 720px) { .metrics { grid-template-columns: repeat(3, 1fr); } }

.metric {
  padding: 30px 28px;
  border-bottom: 1px solid var(--line-soft);
}
@media (min-width: 720px) {
  .metric { border-bottom: none; border-right: 1px solid var(--line-soft); }
  .metric:last-child { border-right: none; }
}
.metric-label { display: block; font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--paper-faint); margin-bottom: 14px; }
.metric-val {
  font-family: var(--display);
  font-size: var(--fs-stat);
  font-weight: 500;
  color: var(--brand-strong);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.metric-vs { font-family: var(--mono); font-size: var(--fs-small); color: var(--paper-faint); font-weight: 400; }
.metric-note { display: block; font-family: var(--mono); font-size: var(--fs-label); color: var(--paper-faint); margin-top: 12px; }
.research-link a {
  color: var(--brand-strong);
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent);
  text-underline-offset: 0.18em;
}
.research-link {
  font-size: var(--fs-small);
  margin-top: 18px;
}

/* ---------- releases ---------- */

/* ---------- commons ---------- */

/* ---------- footer ---------- */
.foot {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 48px var(--gutter) 64px;
  border-top: 1px solid var(--line-soft);
}
.foot-pe { display: inline-flex; align-items: center; }
.foot-pe img { height: 20px; width: auto; display: block; opacity: 0.82; transition: opacity 0.2s; }
.foot-pe:hover img { opacity: 1; }

/* ---------- reveal: retired ----------
   Every band-head, prose block, card grid and metric row started at
   opacity:0 and slid up on scroll. On documentation pages that meant the
   reader could not skim: content arrived under them as they moved, and a
   staggered `--d` delay meant it arrived out of order. Reveal-on-scroll is
   for a landing page with four things on it, not a 4,900-word reference.
   Everything is now painted immediately. reveal.js still adds `.in-view`
   (its <script> tag lives in markup owned elsewhere) — harmless, and these
   rules keep it a no-op. */
.reveal, .in-view,
.band-head, .prose, .metrics, .stack-note,
.hero-cta {
  opacity: 1;
  transform: none;
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- strategy grid (papers aggregator, homepage overview) ---------- */
.strategy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 640px) { .strategy-grid { grid-template-columns: repeat(2, 1fr); } }
/* four model cards: keep a balanced 2x2 at desktop */

/* Cards: ONE treatment, shared by .strategy-card and .doc-index a (below).
   Previously two padding values, two radii, two border colours and two hover
   transforms did the same job. */
.strategy-card,
.doc-index a {
  display: block;
  border: 1px solid var(--line-soft);
  background: var(--card);
  padding: var(--s-5);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.strategy-card:hover,
.doc-index a:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--primary) 4%, var(--card));
}
.strategy-card header { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.strategy-card .card-id { font-size: var(--fs-small); color: var(--brand); letter-spacing: 0.04em; }
/* The restructured cards lead with a bolded question inside the body copy,
   which was out-weighting the card title. The title takes 600 so the
   heading level still wins. */
.strategy-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-h3-sm);
  color: var(--paper);
  margin-bottom: 10px;
}
.strategy-card p { font-size: var(--fs-body); line-height: 1.55; color: var(--paper-dim); margin-bottom: 0; }
.strategy-card .strategy-paper-link {
  display: block;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: var(--fs-small);
  color: var(--brand-strong);
}

/* ---------- strategy landing pages: depth-gradient sections ---------- */
.page-title { font-size: var(--fs-hero-sub); }

/* ---------- diagrams (strategy-page SVGs) ---------- */

/* box = a stage/node in a pipeline or hierarchy diagram */

/* text roles inside a diagram */

/* edges: flows between stages */

/* reference / floor lines on bar charts */

/* bar-chart bars: primary result vs. comparison arms */

/* ---------- quick-start block (06 releases) ---------- */

/* =====================================================================
   Content pages (olg, connect) — one shared measure and rhythm.
   `body.doc` widens the reading column so text uses the full line, and
   lets code, tables, charts, and card grids span the whole band.
   ===================================================================== */
.doc .band { max-width: var(--max); }
/* The hero's inner column was 980px while bands are 1140px, so a page's h1
   started 26px to the right of every heading under it — a visible kink down
   the left edge. One column edge for the whole page. */
.doc .hero-inner { max-width: var(--max); }
/* Content-page titles share one left edge with the sections below. The
   homepage keeps its split text/chart composition; only model-style heroes
   collapse to a single, left-aligned reading column. */
.doc .model-hero .hero-inner { display: block; }
.doc .model-hero .lede { margin-left: 0; margin-right: 0; }

/* text fills the line; rich blocks go edge-to-edge inside the band */
.doc .prose { max-width: none; }
.doc .prose > p,
.doc .prose > ul,
.doc .prose > ol,
.doc .prose > .research-link,
.doc .prose > .soon-hint,
.doc .prose > .chart-note,
.doc .prose > .opt-note { max-width: 74ch; }

/* consistent body copy across every content page */
.doc .prose p { font-size: var(--fs-body); line-height: 1.7; }
.doc .prose ul { padding-left: 22px; }
.doc .prose li { margin: var(--s-2) 0; line-height: 1.7; font-size: var(--fs-body); max-width: 74ch; }
.doc .prose p code,
.doc .prose li code,
.doc .prose td code { font-family: var(--mono); font-size: var(--fs-code-inline); color: var(--brand-strong); }
.doc .prose p code,
.doc .prose li code,
.connect-panel p code { overflow-wrap: anywhere; }

/* AI-client identity cues: names stay visible, while the marks make the
   hosted path quicker to scan without turning third-party brands into CTAs. */
.ai-client-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.ai-client {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: color-mix(in srgb, var(--background, #fff) 92%, transparent);
  color: var(--text);
  font-weight: 600;
}
.ai-client img { display: block; flex: 0 0 auto; }
.seg button[data-client] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
}
.seg button[data-client] img { display: block; flex: 0 0 auto; }
.seg button[data-client="chatgpt"] img { color: currentColor; }
.seg button[data-client="chatgpt"][aria-selected="true"] img { filter: invert(1); }

/* section headings on content pages read a touch tighter than the band default */
.doc .band-head { margin-bottom: var(--s-6); }
.doc h2 { max-width: 30ch; }

/* --- code blocks: one look everywhere (was duplicated inline) --- */
.codeblock {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--ink-2);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-5) 0 var(--s-2);
  overflow-x: auto;
}
.codeblock pre { margin: 0; }
.codeblock code,
.code-window code { font-family: var(--mono); font-size: var(--fs-mono); line-height: 1.7; white-space: pre; }
.codeblock .cb-copy {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: var(--fs-label); color: var(--paper-faint);
}
.codeblock .cb-copy:hover { color: var(--text); }
.cm { color: var(--paper-faint); }
.kw { color: var(--brand); }

/* --- reference tables --- */
/* wide tables (e.g. the docs comparison) scroll inside their own container
   instead of pushing the page sideways on narrow screens */
/* .model-seg is declared in /connect/'s inline <style> (owned elsewhere). It
   sets overflow-x:auto but is a flex item, whose default min-width:auto makes
   it grow to content width rather than clip — which panned the whole page
   679px sideways at 375px. Fixed from here with a two-class selector so it
   outranks the inline single-class rule without editing that file. */
.seg.model-seg { min-width: 0; max-width: 100%; }
/* same failure mode for any other flex/grid child that scrolls internally */
.panel-bars > *, .model-pane, .prose > * { min-width: 0; }

.table-scroll { overflow-x: auto; margin: 24px 0; }
/* code blocks get the same treatment: long lines scroll inside the block
   instead of being clipped unreachably (or panning the whole page) on mobile */
.prose pre,
.codeblock pre,
.code-window pre { overflow-x: auto; max-width: 100%; }
.table-scroll table { margin: 0; min-width: 720px; }
.prose table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: var(--fs-body-sm); }
.prose th {
  text-align: left; font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--paper-faint);
}
.prose th, .prose td {
  padding: 11px 16px 11px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
.opt-note { font-size: var(--fs-body-sm); line-height: 1.55; color: var(--paper-faint); }
.callout {
  border-left: 2px solid var(--brand);
  padding: var(--s-1) 0 var(--s-1) var(--s-5); margin: var(--s-6) 0;
  font-size: var(--fs-body-sm); line-height: 1.6; color: var(--paper-dim); max-width: 80ch;
}

/* ---------- section divider after hero + grid footer ---------- */
.hero + .band { border-top: 1px solid var(--line-soft); }
.foot-head { display: block; font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--paper-faint); margin-bottom: 12px; }
.next-invite { margin-top: 30px; text-align: center; font-size: var(--fs-small); color: var(--paper-faint); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.next-invite a { color: var(--text, #111); text-decoration: none; border-bottom: 1px solid var(--line-soft); padding-bottom: 1px; }
.next-invite a:hover { color: var(--brand-strong); border-bottom-color: var(--brand-strong); }

/* Homepage decision path. This is intentionally a list rather than another
   card grid: readers scan from their question to the model in one line. */
.question-list {
  border-top: 1px solid var(--line);
  margin-top: var(--s-6);
}
.question-list a {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.7fr) 18px;
  gap: var(--s-5);
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--paper);
  text-decoration: none;
}
.question-list a::after { content: "→"; color: var(--brand); }
.question-list a:hover strong,
.question-list a:hover::after { color: var(--brand-deep); }
.question-list span { font-size: var(--fs-body); line-height: 1.45; }
.question-list strong {
  color: var(--brand-strong);
  font-family: var(--mono);
  font-size: var(--fs-small);
  font-weight: 500;
}
.chooser-note { margin-top: var(--s-5); color: var(--paper-dim); font-size: var(--fs-body-sm); }
.chooser-note a { color: var(--brand-strong); }

@media (max-width: 620px) {
  .nav {
    min-height: 112px;
    align-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 10px;
  }
  .brand { width: 100%; font-size: 12px; }
  .nav-links { width: 100%; justify-content: space-between; gap: 6px; }
  .nav-links a.nav-mobile:first-child { display: inline-flex; }
  .nav-links .nav-start { min-height: 44px; padding-inline: 12px; }
  .nav-gh { min-width: 44px; min-height: 44px; justify-content: center; }
  .section-tabs { top: 112px; }
  .has-section-tabs .hero { padding-top: 210px; }
  .question-list a { grid-template-columns: 1fr 18px; gap: 8px 14px; }
  .question-list strong { grid-column: 1; grid-row: 2; }
  .question-list a::after { grid-column: 2; grid-row: 1 / span 2; }
}

/* slim footer bar */
.foot-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 26px; padding-bottom: 30px; }
/* wraps like .foot-bar above it — without this the nav pushed every page
   68px sideways at a 375px viewport. */
.foot-nav { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; }
.foot-nav a { font-family: var(--mono); font-size: var(--fs-small); color: var(--paper-dim); text-decoration: none; }
.foot-nav a:hover { color: var(--brand-strong); }
.foot-nav .foot-pe img { height: 18px; }
.footer-brand,
.footer-links,
.footer-links a { display: inline-flex; align-items: center; }
.footer-brand {
  gap: 10px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--fs-body-sm);
  text-decoration: none;
}
.footer-brand img { width: 20px; height: 20px; }
.footer-legal {
  margin: 0;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: var(--fs-small);
  line-height: 1.5;
}
.footer-links { flex-wrap: wrap; gap: 10px; }
.footer-links a {
  justify-content: center;
  width: 30px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: var(--fs-small);
  text-decoration: none;
}
.footer-links a:hover { color: var(--brand-strong); background: transparent; transform: translateY(-1px); }
.footer-links img,
.footer-links svg { width: 17px; height: 17px; flex: 0 0 auto; }
.footer-links svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.footer-links .footer-icon-fill { fill: currentColor; stroke: none; }

/* ==========================================================================
   Validation page — comparison charts and provenance styling
   Used by /validation/. Charts are hand-authored inline SVG (no third-party JS)
   and inherit the site's light/dark tokens through currentColor and var().
   ========================================================================== */

.model-hero { min-height: auto; padding-top: clamp(120px, 18vh, 180px); padding-bottom: 10px; }
.papers-index-hero { padding-bottom: clamp(64px, 8vw, 100px); }
.papers-index-hero .paper-library { margin-top: clamp(38px, 5vw, 60px); }
.contact-hero { padding-bottom: clamp(64px, 8vw, 100px); }
.contact-options { margin-top: clamp(42px, 6vw, 72px); }
.contact-action { display: flex; align-items: center; gap: 14px; margin-top: var(--s-5); flex-wrap: wrap; }
.contact-email-label { color: var(--paper-faint); font-family: var(--mono); font-size: var(--fs-small); }
.contact-email {
  display: inline-flex;
  padding: 11px 16px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-wash);
  color: var(--brand-strong);
  text-decoration: none;
  font-family: var(--mono);
  font-size: var(--fs-small);
  transition: border-color .2s, background .2s, transform .2s;
}
.contact-email:hover { border-color: var(--brand-strong); background: var(--surface); transform: translateY(-1px); }
.models-page .model-hero + .band { border-top: 0; }
.validation-page .model-hero { padding-bottom: var(--s-5); }
.validation-page .validation-model-nav { margin-top: 0; }
.validation-page .validation-model-nav + .band { padding-top: clamp(64px, 8vw, 92px); }

/* comparison matrix: strong column headers, anchored row labels, easier scanning */
.comparison-prose {
  width: 100%;
  max-width: none;
}
.comparison-table-wrap {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--ink);
  box-shadow: 0 14px 36px color-mix(in srgb, #000 16%, transparent);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: var(--brand) var(--ink-2);
  scrollbar-width: thin;
}
.comparison-table {
  width: 100%;
  min-width: 1120px !important;
  table-layout: fixed;
}
.comparison-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.comparison-table thead { background: var(--ink-2); }
.comparison-table thead tr { border-bottom: 1px solid var(--line); }
.comparison-table thead td:first-child,
.comparison-table tbody th:first-child { width: 154px; }
.comparison-table thead th { padding: 20px 16px; }
.comparison-table tbody th,
.comparison-table tbody td {
  padding: 15px 16px;
  line-height: 1.55;
}
.comparison-table thead th a { color: var(--paper); text-decoration: none; line-height: 1.45; }
.comparison-table thead th a span { color: var(--brand-strong); font-size: 10px; letter-spacing: .06em; }
.comparison-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--ink-2) 58%, transparent); }
.comparison-table tbody tr:hover { background: var(--brand-wash); }
.comparison-table th,
.comparison-table td { border-right: 1px solid var(--line-soft); }
.comparison-table tr > :last-child { border-right: 0; }
.comparison-table tbody tr:last-child > * { border-bottom: 0; }
.comparison-table th:first-child,
.comparison-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  padding-left: 16px;
  background: var(--ink);
  box-shadow: 1px 0 0 var(--line);
}
.comparison-table thead td:first-child { z-index: 2; background: var(--ink-2); }
.comparison-table tbody tr:nth-child(even) th:first-child { background: var(--ink-2); }

.vfig { margin: 32px 0 30px; }
.vfig figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--paper-faint);
}
.vfig figcaption code { font-size: var(--fs-code-inline); }

.vchart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 10px 6px;
  background: var(--surface);
}
.vchart text { font-family: var(--mono); fill: var(--paper-dim); }
.vchart .vc-tick { font-size: 11px; }
.vchart .vc-lab { font-size: 12px; fill: var(--brand); }
.vchart .vc-lab2 { fill: var(--chart-s2); }
.vchart .vc-rowlab { font-size: 11.5px; fill: var(--paper-dim); }
.vchart .vc-val { font-size: 12px; fill: var(--paper); font-weight: 600; }
.vchart .vc-note { font-size: 10.5px; fill: var(--paper-faint); }
.vchart .vc-grid { stroke: var(--line-soft); stroke-width: 1; }
.vchart .vc-axis { stroke: var(--line); stroke-width: 1.5; }

/* series 1 = ours, series 2 = the official/published counterpart */
.vchart .vc-s1 { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; }
.vchart .vc-s1-dot { fill: var(--brand); }
.vchart .vc-s2 { fill: none; stroke: var(--chart-s2); stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
.vchart .vc-s2-dot { fill: var(--chart-s2); }
.vchart .vc-b1 { fill: var(--brand); }
/* 34%/18% measured ~2.3:1 and ~1.3:1 on the chart surface, under the 3:1
   WCAG 1.4.11 floor -- and these are the official/comparison bars our numbers
   are judged against. */
.vchart .vc-b2 { fill: color-mix(in srgb, var(--paper) 55%, transparent); }
.vchart .vc-b3 { fill: color-mix(in srgb, var(--paper) 35%, transparent); }
.vchart .vc-band90 { fill: color-mix(in srgb, var(--brand) 13%, transparent); }
.vchart .vc-band68 { fill: color-mix(in srgb, var(--brand) 26%, transparent); }
.current-outlook { margin: 28px 0 8px; }

/* Paper index result emphasis. */
.paper-result strong { color: var(--brand); font-weight: 600; }
.paper-result:has(> strong:first-child) { border-top-color: var(--line); }

/* ---------------------------------------------------------------------
   Section seams. Bands are separated by a hairline and generous, EQUAL
   space above and below it, so the eye can find where one section ends.
   --------------------------------------------------------------------- */
.band + .band,
.hero + .band { border-top: 1px solid var(--line-soft); }

/* heading rhythm inside prose: space belongs above a heading, not below */
.prose h3, .doc .prose h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: var(--s-7) 0 var(--s-3);
  color: var(--paper);
}
.prose > :first-child { margin-top: 0; }
.prose table, .prose .table-scroll, .prose figure, .prose .codeblock { margin-block: var(--s-6); }
.prose caption {
  text-align: left;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--paper-faint);
  padding-bottom: var(--s-3);
}

/* compact verification scorecard on the homepage */
.verification-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-block: var(--s-6);
}
.verification-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: 18px 20px;
}
.verification-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.verification-card .mono { color: var(--brand-strong); font-size: var(--fs-small); }
.verification-card p { margin: 0; color: var(--paper-dim); font-size: var(--fs-body-sm); line-height: 1.5; }
.verification-tag {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--brand-wash);
  color: var(--brand-strong);
  font: 500 10px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.verification-tag-statute { background: #edf4f2; }
.verification-tag-calibrated { background: #f7eee8; color: #945c42; }
.verification-card:last-child { grid-column: 1 / -1; }

@media (max-width: 700px) {
  .verification-grid { grid-template-columns: 1fr; }
  .verification-card:last-child { grid-column: auto; }
}

/* one callout treatment (was: left-rule callout + tinted note + bordered box) */
.callout, .opt-note, .chart-note, .soon-hint, .caveat {
  max-width: 74ch;
}

.vlinks { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 26px; font-size: var(--fs-small); }

@media (max-width: 620px) {
  .vchart { padding: 10px 4px 4px; }
  .vchart .vc-tick { font-size: 13px; }
  .vchart .vc-lab, .vchart .vc-val { font-size: 14px; }
  .vchart .vc-rowlab { font-size: 12.5px; }
  .vchart .vc-note { font-size: 12px; }
}

/* ============================================================
   doc index cards (shared: /docs/ and /papers/)
   ============================================================ */
.doc-index { display: grid; grid-template-columns: 1fr; gap: var(--s-4); margin: var(--s-6) 0; }
@media (min-width: 760px) { .doc-index { grid-template-columns: 1fr 1fr; } }
 /* .doc-index a shares the card rule defined with .strategy-card above. */
.doc-index .di-id { font-family: var(--mono); font-size: var(--fs-label); color: var(--brand); }
.doc-index h3 { font-family: var(--display); font-weight: 500; font-size: var(--fs-h3-sm); margin: 8px 0 8px; color: var(--paper); }
.doc-index p { font-size: var(--fs-body-sm); line-height: 1.55; color: var(--paper-dim); margin: 0; }
.doc-index .di-go { display: block; margin-top: 12px; font-family: var(--mono); font-size: var(--fs-label); color: var(--brand-strong); }

.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.library-card {
  min-width: 0;
  padding: var(--s-5);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.library-card .di-id { color: var(--brand); font-family: var(--mono); font-size: var(--fs-label); }
.library-card h3 { margin: 10px 0 8px; font-family: var(--display); font-size: var(--fs-h3-sm); font-weight: 500; }
.library-card p { color: var(--paper-dim); font-size: var(--fs-body-sm); line-height: 1.55; }
.library-actions { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: var(--s-4); }
.library-actions a { color: var(--brand-strong); font-family: var(--mono); font-size: var(--fs-label); }
.paper-meta { margin-top: var(--s-4); color: var(--paper-faint) !important; font-family: var(--mono); font-size: var(--fs-label) !important; }
@media (max-width: 680px) { .library-grid { grid-template-columns: 1fr; } }

/* The wide comparison matrix is useful on desktop. On phones a deliberate
   two-model view replaces the clipped horizontal slice. */
.mobile-compare { display: none; }
.mobile-compare h3 { margin: 0 0 var(--s-4); font-family: var(--display); font-size: var(--fs-h3); font-weight: 500; }
.mobile-compare-controls { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-bottom: var(--s-5); }
.mobile-compare-controls label { display: grid; gap: 7px; color: var(--paper-dim); font-family: var(--mono); font-size: var(--fs-label); }
.mobile-compare-controls select { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--paper); background: var(--surface); font: inherit; }
.mobile-compare-row { padding: var(--s-5) 0; border-top: 1px solid var(--line-soft); }
.mobile-compare-row h4 { margin: 0 0 var(--s-4); color: var(--brand); font-family: var(--mono); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: var(--ls-label); }
.mobile-compare-row > div { padding: var(--s-3); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--surface); }
.mobile-compare-row > div + div { margin-top: 8px; }
.mobile-compare-row strong { color: var(--paper); font-size: var(--fs-body-sm); }
.mobile-compare-row p { margin: 6px 0 0; color: var(--paper-dim); font-size: var(--fs-body-sm); line-height: 1.55; }

@media (max-width: 760px) {
  .desktop-comparison { display: none; }
  .mobile-compare { display: block; }
  .mobile-compare-controls { grid-template-columns: 1fr; }
  .validation-model-nav {
    top: 172px;
    width: calc(100% - 20px);
    max-width: none;
    border-radius: var(--radius);
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .validation-model-nav a { flex: 1 1 auto; min-height: 40px; text-align: center; }
}

/* ============================================================
   working papers — index cards + in-page PDF viewer
   ============================================================ */

/* --- papers index: extends .doc-index with a metadata/result row --- */
.paper-result {
  display: block; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: var(--fs-label);
  line-height: 1.55; color: var(--paper-dim);
}
.paper-result strong { color: var(--brand); font-weight: 500; }

/* --- viewer page --- */
.paper-viewer { padding-top: clamp(96px, 14vh, 140px); }
.has-section-tabs .paper-viewer {
  padding-top: clamp(152px, 19vh, 184px);
}
@media (max-width: 620px) {
  .has-section-tabs .paper-viewer { padding-top: 214px; }
}
.paper-viewer-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 18px;
}
.paper-viewer-head > * { min-width: 0; max-width: 100%; }
.paper-viewer-head h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.25;
  margin: 6px 0 0; max-width: 30ch; color: var(--paper);
}
@media (max-width: 620px) {
  .paper-viewer-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .paper-viewer-head h1 { width: 100%; max-width: 100%; }
}
.paper-viewer-actions { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.paper-viewer .paper-result,
.paper-viewer > p { overflow-wrap: anywhere; }

/* the embed frame */
.pdf-frame {
  position: relative;
  width: 100%;
  height: min(78vh, 1000px);
  min-height: 460px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-2);
}
.pdf-frame object,
.pdf-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* fallback shown by the browser when inline PDF rendering is unavailable
   (it is the <object> element's child content, so it only paints when the
   PDF handler fails) */
.pdf-fallback {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; height: 100%;
  padding: 36px 24px; text-align: center;
}
.pdf-fallback p {
  margin: 0; max-width: 46ch;
  font-size: var(--fs-body-sm); line-height: 1.6; color: var(--paper-dim);
}

.pdf-note {
  margin-top: 14px; font-family: var(--mono); font-size: var(--fs-label);
  color: var(--paper-faint);
}

/* --- mobile / touch: inline PDF embedding is unreliable (iOS Safari and most
   Android browsers render a blank box or a single page), so drop the embed
   entirely and promote a download/open card instead. --- */
.pdf-mobile { display: none; }
@media (max-width: 820px), (pointer: coarse) {
  .pdf-frame { display: none; }
  .pdf-mobile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
    border: 1px solid var(--line-soft); border-radius: var(--radius);
    padding: 24px 22px; background: var(--ink-2);
  }
  .pdf-mobile p {
    margin: 0; font-size: var(--fs-body-sm); line-height: 1.6;
    color: var(--paper-dim);
  }
}

/* =====================================================================
   Dark theme.

   The vendored ui-kit ships a complete dark token set, but only behind a
   `.dark` class that nothing on this site ever sets — so it was unreachable
   dead weight. It is wired to the system preference here rather than in
   vendor/ui-kit-tokens.css, because that file is a generated upstream
   artifact ("DO NOT EDIT; refresh by re-fetching the pinned version") and a
   refresh would silently drop the wiring. Site theming policy belongs here.

   Verified before shipping: the dark set defines every token this site
   actually consumes. The only tokens it omits are --radius (a length, which
   correctly inherits from :root) and the --diverging-* / --warm-neutral
   scales, which are referenced nowhere in this repo. An automated WCAG 2.x
   sweep of every text node on all 14 pages reports zero AA failures in dark,
   given the three site-level overrides at the end of this block.

   Values below mirror the `:root.dark` block of vendor/ui-kit-tokens.css.
   Keep them in sync when refreshing that vendored file.
   ===================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    /* Page */
    --background: #0B0E14;
    --foreground: #F5F5F5;

    /* Primary (lifted up the teal scale so it pops on dark) */
    --primary: #38B2AC;
    --primary-foreground: #0B0E14;

    /* Secondary */
    --secondary: #1E293B;
    --secondary-foreground: #F5F5F5;

    /* Muted */
    --muted: #1A2030;
    --muted-foreground: #9CA3AF;

    /* Accent */
    --accent: #1E293B;
    --accent-foreground: #F5F5F5;

    /* Destructive */
    --destructive: #F87171;
    --destructive-foreground: #0B0E14;

    /* Chrome. --border bumped from #1E293B (1.32:1 on background, 1.22:1 on card — visually invisible) to #334155 (1.87:1 on bg, 1.57:1 on card). */
    --border: #334155;
    --input: #334155;
    --ring: #38B2AC;

    /* Card. Bumped from #131820 (1.08:1 on background — invisible) to #1A2030 (1.19:1 on bg). Together with the bumped --border, the card surface is now clearly distinguishable. */
    --card: #1A2030;
    --card-foreground: #F5F5F5;

    /* Popover */
    --popover: #1A2030;
    --popover-foreground: #F5F5F5;

    /* Charts (lifted up the brand scale for dark backgrounds) */
    --chart-1: #4FD1C5;
    --chart-2: #38BDF8;
    --chart-3: #81E6D9;
    --chart-4: #7DD3FC;
    --chart-5: #94A3B8;

    /* Background variants */
    --background-secondary: #0B0E14;
    --background-tertiary: #0F1320;

    /* Border scale */
    --border-light: #1E293B;
    --border-medium: #334155;
    --border-dark: #475569;

    /* Text semantic aliases */
    --text-primary: #F5F5F5;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    --text-inverse: #000000;

    /* Accessible-on-dark text variants — picked at AA on #0B0E14 */
    --text-warning: #FFB066;
    --text-error: #F87171;
    --text-success: #4FD1C5;

    /* Primary alpha variants (re-tuned for dark primary) */
    --primary-alpha-40: rgba(56, 178, 172, 0.4);
    --primary-alpha-50: rgba(56, 178, 172, 0.5);
    --primary-alpha-60: rgba(56, 178, 172, 0.6);

    /* Site-level tokens that are literal values rather than vendor aliases,
       so they need an explicit dark counterpart.
       Contrast measured against --background #0B0E14 / --card #1A2030:
         --paper-faint    #A9B4C4   9.21:1 on bg, 7.74:1 on card
         --brand-deep     #81E6D9  13.11:1 on bg (hover/pressed, lifted
                                    above --primary's 7.48:1)
         --brand-warning  #FFB066  10.72:1 on bg */
    --paper-faint: #A9B4C4;
    --brand-deep: #81E6D9;
    --brand-warning: #FFB066;
  }
}

/* Ambient field — restored, deliberately quieter than the original.
   Density and alpha roughly halved from the original, and the three things that
   actually pulled the eye off the text are gone: the twinkle (oscillating
   opacity), the mouse parallax, and the glow halo on heavy points. What remains
   is slow uniform drift.

   The canvas is position:fixed, so the mask is VIEWPORT-relative, not
   document-relative: the field is densest in the upper part of whatever you are
   looking at and clears by 88vh, leaving the bottom of every screen clean. It
   does still pass behind body copy while scrolling — that is intended, and is
   readable because text no longer fades in (the reveal animation that used to
   hold copy at opacity:0 is retired). Motion stops under prefers-reduced-motion,
   handled in field.js. */

/* The verdict band — "how far to trust it" on every model page, and the
   validation summary. This is the suite's distinguishing claim (each model
   publishes how far it can be checked), so it gets a surface of its own rather
   than reading as one more section. Kept quiet: a tint and a top rule, no box.
   .band-result was referenced on all five model pages with no rule behind it. */
.band.band-result, .band + .band.band-result {
  background: color-mix(in srgb, var(--brand) 4%, transparent);
  /* Specificity note: `.band + .band` (0,2,0) sets the generic hairline, so a
     bare `.band-result` (0,1,0) loses and the accent rule silently vanishes. */
  border-top: 2px solid color-mix(in srgb, var(--brand) 55%, transparent);
}
.band-result > .band-head .kicker { color: var(--brand); }
@media (prefers-color-scheme: dark) {
  .band-result { background: color-mix(in srgb, var(--brand) 9%, transparent); }
}

/* Model card grid: give the cards room and a consistent stacking rhythm.
   .band-stack was referenced on the homepage models section with no rule. */
.band-stack { padding-top: var(--s-7); }

/* Hero fan: the two quarter labels bracketing the x-axis. They carry the
   date range, so unlike the value ticks they survive at narrow widths where
   .hf-tick is hidden. */
.hf-q { fill: var(--paper-faint); }
@media (max-width: 1000px) { .hf-tick.hf-q { display: initial; } }

/* honest-warning cells in validation tables (over-band, imposed, targeted) */
/* Was --brand-strong: the same teal as links, series 1 and .metric-val, so
   "Weak" read in the site's affirmative accent. --brand-warning is AA-tested. */
.vchart .vc-warn, td.vc-warn, th.vc-warn { color: var(--brand-warning); font-weight: 600; }
