/* PrismWAM — base design system.
   Identity: a dark cinematic front door (the intro film) opening onto a calm, wide, centred page.
   One accent family (lavender) marks PrismWAM; warm = semantic context (RGB), cool = physical state (depth),
   matching the film's orange and cyan beams. Everything else is neutral grey. */

/* ───────── fonts (self-hosted, SIL OFL 1.1 — see static/fonts/OFL-*.txt) ─────────
   Served from this origin so a slow or blocked fonts.googleapis.com can never hold up the first paint.
   Variable fonts; subsets and unicode-ranges follow Google Fonts (latin, latin-ext, Greek/math, arrows). */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url("../fonts/newsreader-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Google Sans Flex"; font-style: normal; font-weight: 300 800; font-stretch: 100%; font-display: swap;
  src: url("../fonts/google-sans-flex-math.woff2") format("woff2");
  unicode-range: U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2070-2071, U+2074-209F, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+219A-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-2217, U+221A-22FF, U+27C0-27FF, U+2900-2AFF; }
@font-face { font-family: "Google Sans Flex"; font-style: normal; font-weight: 300 800; font-stretch: 100%; font-display: swap;
  src: url("../fonts/google-sans-flex-symbols.woff2") format("woff2");
  unicode-range: U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2460-24FF, U+25A0-27BF, U+2B00-2BFF; }
@font-face { font-family: "Google Sans Flex"; font-style: normal; font-weight: 300 800; font-stretch: 100%; font-display: swap;
  src: url("../fonts/google-sans-flex-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Google Sans Flex"; font-style: normal; font-weight: 300 800; font-stretch: 100%; font-display: swap;
  src: url("../fonts/google-sans-flex-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Google Sans Code"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/google-sans-code-math.woff2") format("woff2");
  unicode-range: U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2070-2071, U+2074-209F, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+219A-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-2217, U+221A-22FF, U+27C0-27FF, U+2900-2AFF; }
@font-face { font-family: "Google Sans Code"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/google-sans-code-symbols.woff2") format("woff2");
  unicode-range: U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2460-24FF, U+25A0-27BF, U+2B00-2BFF; }
@font-face { font-family: "Google Sans Code"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/google-sans-code-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Google Sans Code"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/google-sans-code-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #1d1d1f;
  --ink-2: #5f5f68;
  --ink-3: #74747e;
  --paper: #ffffff;
  --mist: #f6f5fa;
  --mist-2: #efedf6;
  --line: #e7e5ef;
  --line-2: #d7d4e2;

  --night: #090b12;
  --night-2: #12141d;
  --night-3: #1b1e2a;
  --night-ink: #f2f1f7;
  --night-ink-2: #a9a8b8;
  --night-line: rgba(255, 255, 255, .1);

  --accent: #ac9fe3;
  --accent-light: #cbc1f1;
  --accent-soft: #f3f0fc;
  --accent-ink: #6a5cc0;
  --accent-night: #cdc4f5;
  --focus: #8577d4;          /* focus ring: ≥ 3.7:1 on paper, mist and night alike */

  --warm: #ff9500;
  --warm-ink: #f58200;
  --warm-soft: #fff1de;
  --cool: #35a7ff;
  --cool-ink: #0062c4;
  --cool-soft: #e7f3ff;

  --base: #e6e6eb;
  --base-hover: #a3a8b3;
  --base-pre: repeating-linear-gradient(135deg, #e6e6eb 0 4px, #d0d0d8 4px 5.5px);
  /* retired: the page no longer uses rainbow gradients; kept as a flat accent so any stray use stays calm */
  --spectrum: linear-gradient(90deg, var(--accent), var(--accent));

  --font: "Google Sans Flex", "Google Sans", "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* serif accent, as on ASPIRE: section kickers and highlighted phrases */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --brand: "Montserrat", "Google Sans Flex", system-ui, sans-serif;   /* the PrismWAM wordmark only */
  --mono: "Google Sans Code", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1200px;
  --prose: 720px;
  --gutter: 24px;
  --nav-h: 56px;
  --nav-top: 14px;
  --sec-pad: clamp(72px, 9vw, 112px);
  /* small, Apple-like corner radii (no pills on rectangles) */
  --r-xl: 14px;
  --r-lg: 12px;
  --r-md: 10px;
  --r-sm: 8px;
  --r-xs: 6px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --shadow-1: 0 1px 2px rgba(20, 16, 40, .05), 0 6px 20px rgba(20, 16, 40, .06);
  --shadow-2: 0 2px 6px rgba(20, 16, 40, .08), 0 18px 48px rgba(20, 16, 40, .14);
}

/* ───────── reset ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + var(--nav-top) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; font-family: var(--font); font-optical-sizing: auto;
  font-size: 17px; line-height: 1.6; letter-spacing: -0.003em;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4, p, figure, ul, ol, pre, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[tabindex]:focus:not(:focus-visible) { outline: none; }
::selection { background: rgba(154, 134, 236, .28); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ───────── layout ───────── */
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--prose); margin-left: auto; margin-right: auto; }
.sec { position: relative; padding: var(--sec-pad) 0; }
/* anchor jumps (nav tabs, skip link, hero cue) land the section header just under the nav rather than the
   section box: scroll-padding-top clears the nav, this cancels all but 6px of the section's top padding */
.sec[id] { scroll-margin-top: calc(6px - var(--sec-pad)); }
.sec + .sec:not(.sec-dark):not(.sec-tint) { border-top: 1px solid var(--line); }
.sec-tint { background: var(--mist); }
.sec-dark { background: var(--night); color: var(--night-ink); }

/* centred section header: title + lead */
.sec-head { max-width: 1040px; margin: 0; text-align: left; }
.sec-kicker { display: block; font-family: var(--serif); font-optical-sizing: auto; font-style: italic; font-size: clamp(21px, 1.8vw, 25px); line-height: 1.25; font-weight: 500; letter-spacing: -0.005em; color: var(--ink-2); margin-bottom: 8px; }
.serif { font-family: var(--serif); font-optical-sizing: auto; }
#overview .ov-abs em { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.08em; color: var(--accent-ink); background: var(--accent-soft); padding: 0 .2em; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sec-dark .sec-kicker { color: var(--night-ink-2); }
.h-sec { font-size: clamp(28px, 3.1vw, 42px); line-height: 1.14; font-weight: 650; letter-spacing: -0.024em; text-wrap: balance; }
.lead { margin: 14px 0 0; max-width: 1040px; font-size: clamp(16.5px, 1.25vw, 18.5px); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.sec-dark .lead { color: var(--night-ink-2); }
.claim-num { color: var(--accent-ink); display: inline-block; font-variant-numeric: tabular-nums; }
.sec-dark .claim-num { color: var(--accent-night); }
.sec-body { margin-top: clamp(36px, 4.4vw, 56px); }
.note { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.sec-dark .note { color: var(--night-ink-2); }

/* ───────── buttons, chips, segmented, badges ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid transparent;
  font-size: 15px; font-weight: 550; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn small { font-size: 11.5px; font-weight: 500; opacity: .7; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-line { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-light { background: #fff; color: var(--ink); }
.btn-glass { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 13px;
  border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  background: var(--mist); color: var(--ink-2); border: 1px solid var(--line);
}
.chip b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.sec-dark .chip, .chip-glass { background: rgba(255, 255, 255, .07); color: var(--night-ink-2); border-color: rgba(255, 255, 255, .12); }
.sec-dark .chip b, .chip-glass b { color: #fff; }

/* segmented control (pill) — same width in every state, no weight change */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--mist-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
/* the strip clips its overflow, so the focus ring goes inside the button (outside, only a sliver showed between buttons) */
.seg button:focus-visible { outline-offset: -2px; border-radius: 7px; }
/* auto-advancing controls (P.autoSeg): a lavender ring traces the selected segment, then the next one is chosen */
.seg-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: 0; transition: opacity .25s; }
.seg-ring rect { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.seg.is-auto button.is-run .seg-ring { opacity: 1; }
.seg.is-auto button.is-run .seg-ring rect { animation: seg-ring var(--seg-ms, 10s) linear forwards; }
.seg.is-auto.is-paused button.is-run .seg-ring rect { animation-play-state: paused; }   /* must outrank the shorthand above */
@keyframes seg-ring { to { stroke-dashoffset: 0; } }
.seg button {
  position: relative; border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  height: 34px; padding: 0 14px; border-radius: 7px; font-size: 14px; font-weight: 550; color: var(--ink-2);
  transition: background-color .25s, color .25s, box-shadow .25s;
}
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 16, 40, .14); }
.sec-dark .seg { background: rgba(255, 255, 255, .08); }
.sec-dark .seg button { color: var(--night-ink-2); }
.sec-dark .seg button[aria-selected="true"], .sec-dark .seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .92); color: var(--ink); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-xs);
  font: 600 11px/1 var(--font); letter-spacing: .01em; white-space: nowrap;
  background: rgba(10, 10, 20, .58); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-warm i { background: var(--warm); }
.badge-cool i { background: var(--cool); }
.badge-accent i { background: var(--accent-light); }

@media (hover: hover) and (pointer: fine) {
  .btn-ink:hover { background: #34343a; }
  .btn-line:hover { border-color: var(--ink); }
  .btn-light:hover { background: #ecebf3; }
  .btn-glass:hover { background: rgba(255, 255, 255, .18); }
  .seg button:hover { color: var(--ink); }
  .sec-dark .seg button:hover { color: #fff; }
}

/* ───────── cards & figures ───────── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(18px, 2.2vw, 28px); min-width: 0; }
.card-dark { background: var(--night-2); border-color: var(--night-line); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 18px; }
.card-title { font-size: 17px; font-weight: 650; letter-spacing: -0.012em; }
.card-hint { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.sec-dark .card-hint { color: var(--night-ink-2); }
.fig-cap { margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); text-align: left; text-wrap: pretty; }

/* ───────── legend keys ───────── */
.key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-2); }
.key li { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.key .dot { width: 8px; height: 8px; border-radius: 50%; }
.key .sq { width: 13px; height: 9px; border-radius: 3px; }
.k-ours { background: var(--accent); }
.k-ours-light { background: var(--accent-light); }
.k-base { background: var(--base); }
.k-pre { background: var(--base-pre); }
.k-warm { background: var(--warm); }
.k-cool { background: var(--cool); }

/* ───────── floating model card (shared tooltip) ───────── */
.tip {
  position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none;
  width: 288px; padding: 14px 16px 12px; border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line); box-shadow: var(--shadow-2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transform: translate3d(0, 6px, 0); transition: opacity .14s ease-out, transform .14s ease-out;
  font-size: 13px; color: var(--ink);
}
.tip.is-on { opacity: 1; }

/* ───────── reveal (headers and figures only, once) ───────── */
/* hidden only when JS runs (template.html adds .js to <html>); if core.js never wires the observer (blocked,
   404, or threw) an inline failsafe adds .reveal-off and everything shows */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
  .js .reveal.is-in, .js.reveal-off .reveal { opacity: 1; transform: none; }
}

/* ───────── citation + footer (owned by base) ───────── */
/* wide enough for the longest BibTeX line on desktop; narrower boxes wrap each field with a hanging indent
   under its value (no sideways scrolling, and the Copy button sits beside the short first line) */
.bib { position: relative; max-width: 860px; margin: 28px auto 0; background: var(--mist); border: 1px solid var(--line); border-radius: var(--r-lg); text-align: left; }
.bib pre { font-family: var(--mono); font-kerning: none; font-feature-settings: "kern" 0; font-size: 13px; line-height: 1.7; padding: 22px 24px; color: #34343c; white-space: pre-wrap; overflow-wrap: anywhere; }
.bib-l { display: block; }
/* phones: keep each BibTeX field on one line and let the block scroll sideways, as code blocks do */
@media (max-width: 599.98px) { .bib pre { white-space: pre; overflow-wrap: normal; overflow-x: auto; font-size: 12px; padding: 18px 16px; } }
.bib-f { padding-left: 15ch; text-indent: -15ch; }
.bib-k { display: inline-block; width: 13.6ch; text-indent: 0; white-space: pre; }   /* field names: '=' lines up whatever the glyph rounding */
.bib-copy { position: absolute; top: 12px; right: 12px; height: 32px; min-width: 76px; padding: 0 13px; font-size: 13px; }
@media (max-width: 720px) { .bib-copy { top: 10px; right: 10px; height: 28px; padding: 0 12px; } }  /* clear of the wrapped 2nd line */
.bib-copy.is-done { background: var(--ink); color: #fff; border-color: var(--ink); }
.foot { border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 24px; padding-bottom: 28px; font-size: 13.5px; color: var(--ink-2); }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--brand); font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.foot-brand img { width: 22px; height: 22px; border-radius: 5px; }
.foot-links { display: flex; gap: 20px; }
.foot-links a { color: var(--ink-2); }

/* ───────── lightbox (shared) ───────── */
.lightbox { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 4vw; background: rgba(6, 6, 12, .88); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 14px; background: #fff; }
.lightbox-close { position: absolute; top: 18px; right: 20px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; cursor: pointer; }

@media (max-width: 899.98px) {
  html { scroll-padding-top: calc(var(--nav-h) + 14px); }
}
@media (max-width: 720px) {
  :root { --gutter: 18px; }
  body { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
