@font-face { font-family: "Inter"; src: url("fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --card: #fdfcf8;
  --ink: #121210;
  --ink-hover: #2a2a26;
  --grey: #6b6960;
  --faint: #8a877c;
  --line: #e7e2d6;
  --dot: #d9d3c4;
  --track: #ece7db;
  --accent: #ec7a2f;
  --glass: rgba(253, 252, 248, 0.7);
  --nav-bg: rgba(245, 242, 235, 0.82);
  --hover: rgba(18, 18, 16, 0.05);
  --row-hover: rgba(18, 18, 16, 0.025);
  --shadow: 0 1px 0 rgba(18, 18, 16, 0.04), 0 12px 32px -20px rgba(18, 18, 16, 0.18);
  --dark-panel: #0c0b09;
  --dark-edge: transparent;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1120px;
  --gut: 32px;
}

/* Dark theme: follows the system unless the page is forced light, and can be forced dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #131210;
    --card: #1c1b18;
    --ink: #f2efe8;
    --ink-hover: #d9d5cb;
    --grey: #aaa69b;
    --faint: #8f8b80;
    --line: #2e2c27;
    --dot: #3c3a34;
    --track: #2b2924;
    --glass: rgba(28, 27, 24, 0.72);
    --nav-bg: rgba(19, 18, 16, 0.82);
    --hover: rgba(242, 239, 232, 0.07);
    --row-hover: rgba(242, 239, 232, 0.035);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    --dark-panel: #0a0908;
    --dark-edge: #2e2c27;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #131210;
  --card: #1c1b18;
  --ink: #f2efe8;
  --ink-hover: #d9d5cb;
  --grey: #aaa69b;
  --faint: #8f8b80;
  --line: #2e2c27;
  --dot: #3c3a34;
  --track: #2b2924;
  --glass: rgba(28, 27, 24, 0.72);
  --nav-bg: rgba(19, 18, 16, 0.82);
  --hover: rgba(242, 239, 232, 0.07);
  --row-hover: rgba(242, 239, 232, 0.035);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  --dark-panel: #0a0908;
  --dark-edge: #2e2c27;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, p, dl, dd, figure, pre, ul { margin: 0; }
a { color: inherit; }
em { font-style: normal; }
code { font: 0.92em var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--grey); }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.label { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--grey); font-weight: 500; }

/* Pills: one solid and one outline per view at most. */
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px; border-radius: 999px; font: 500 14px/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.pill-solid { background: var(--ink); color: var(--paper); }
.pill-outline { border-color: var(--line); background: var(--glass); color: var(--ink); }
@media (hover: hover) {
  .pill-solid:hover { background: var(--ink-hover); }
  .pill-outline:hover { border-color: var(--ink); }
  .links a:hover { background: var(--hover); }
}

/* Nav: logo left, glass pill of links center. */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) max(var(--gut), env(safe-area-inset-right)) 14px max(var(--gut), env(safe-area-inset-left));
  transition: background .25s, box-shadow .25s;
}
.nav.scrolled { background: var(--nav-bg); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 1px 0 var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; text-decoration: none; letter-spacing: -0.01em; }
.wordmark .mark { display: block; width: 22px; height: 22px; }
.links { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.links a { padding: 7px 14px; border-radius: 999px; font-size: 14px; text-decoration: none; transition: background .2s; }
.links a[aria-current="true"] { background: var(--ink); color: var(--paper); }
main { display: flex; flex-direction: column; }
main > section { width: 100%; }

/* Hero */
.hero { max-width: 860px; margin: 0 auto; padding: 104px var(--gut) 0; text-align: center; }
h1 { margin-top: 20px; font-size: 64px; line-height: 1.02; letter-spacing: -0.04em; font-weight: 500; }
.lede { margin: 22px auto 0; max-width: 560px; color: var(--grey); font-size: 16px; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.facts { margin: 72px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 760px; border-top: 1px solid var(--line); }
.facts div { padding-top: 18px; }
.facts dt { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--grey); }
.facts dd { font-size: 36px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.2; margin-top: 4px; }

/* Sections */
.section { max-width: calc(var(--maxw) + 2 * var(--gut)); margin: 0 auto; padding: 128px var(--gut) 0; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 48px; margin-bottom: 32px; }
h2 { margin-top: 12px; font-size: 42px; line-height: 1.04; letter-spacing: -0.035em; font-weight: 500; }
.aside { max-width: 420px; color: var(--grey); font-size: 14px; line-height: 1.6; }
.card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); }
.note { margin-top: 14px; font-size: 12.5px; color: var(--grey); max-width: 780px; }

/* Chart card */
.chart-card { padding: 22px 24px 20px; }
.card-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 500; }
.chart { margin-top: 12px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--dot); stroke-dasharray: 1 5; }
.chart .axis text { font: 11px var(--mono); fill: var(--faint); }
.chart .axis-title { font: 500 10px var(--sans); letter-spacing: 0.08em; fill: var(--faint); text-transform: uppercase; }
.chart .ci { stroke: var(--ink); stroke-opacity: 0.25; stroke-width: 3; stroke-linecap: round; }
.chart .pt { fill: var(--ink); stroke: var(--card); stroke-width: 3; }
.chart .lbl { font: 500 12.5px var(--sans); fill: var(--ink); }
.chart .lbl-sub { font: 400 12.5px var(--sans); fill: var(--faint); }
.chart .val { font: 11px var(--mono); fill: var(--grey); }
.chart .row { transition: opacity .2s; }
.chart .row.dim { opacity: 0.25; }
.card-foot { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--grey); }

/* Configuration table */
.table-card { margin-top: 12px; padding: 8px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; }
.board { width: 100%; border-collapse: collapse; font-size: 14px; }
.board th { text-align: left; font: 500 11px/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.board td { padding: 15px 16px; border-bottom: 1px solid var(--line); }
.board tbody tr:last-child td { border-bottom: 0; }
.board tbody tr { transition: background .15s; }
@media (hover: hover) { .board tbody tr:hover { background: var(--row-hover); } }
.board .r { text-align: right; white-space: nowrap; }
.board .mode { display: block; color: var(--faint); font-size: 12.5px; }
.board .route-inline { display: none; }
@media (max-width: 760px) { .board .route-inline { display: inline; } }
.c-score { width: 36%; }
.scorecell { display: flex; align-items: center; gap: 16px; }
.scorecell .bar { flex: 1; height: 6px; border-radius: 6px; background: var(--track); position: relative; overflow: hidden; }
.scorecell .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--ink); }
.scorecell .val { min-width: 104px; text-align: right; font-size: 14px; white-space: nowrap; }
.scorecell .val small { color: var(--faint); font-size: 12px; margin-left: 6px; }

/* The one dark moment, next to a plain light panel. */
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; }
.glowpanel { position: relative; overflow: hidden; isolation: isolate; border-radius: 28px; background: var(--dark-panel); border: 1px solid var(--dark-edge); color: #f5f2eb; padding: 48px; min-height: 460px; display: flex; flex-direction: column; justify-content: flex-end; }
.arc { position: absolute; z-index: -1; width: 130%; aspect-ratio: 1; right: -78%; top: -100%; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 196, 140, 0.9), 0 0 60px 18px rgba(236, 122, 47, 0.75), inset 0 0 140px 40px rgba(236, 122, 47, 0.45); }
.grain { position: absolute; inset: 0; z-index: -1; background: url("grain.png"); opacity: 0.22; mix-blend-mode: overlay; pointer-events: none; }
.on-dark { color: rgba(245, 242, 235, 0.65); }
.on-dark-muted { color: rgba(245, 242, 235, 0.7); max-width: 460px; margin-top: 14px; font-size: 14px; }
.huge { font-size: 88px; font-weight: 200; letter-spacing: -0.045em; line-height: 1; margin: 14px 0 24px; }
.huge .of { font-size: 22px; font-weight: 300; letter-spacing: 0; opacity: 0.6; margin-left: 4px; }
.glowpanel h2 { font-size: 32px; margin-top: 0; }
.plainpanel { background: var(--card); border-radius: 28px; padding: 48px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.plainpanel .huge .of { color: var(--grey); opacity: 1; }
.ruled { list-style: none; padding: 0; margin-top: auto; padding-top: 32px; }
.ruled li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ruled li span:first-child { color: var(--grey); }
.ruled li span:last-child { text-align: right; }
.correction { margin-top: 12px; padding: 22px 26px; font-size: 13.5px; color: var(--grey); }
.correction strong { color: var(--ink); font-weight: 500; }

/* Faults: editorial cards */
.faults { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.fault { padding: 20px 20px 24px; min-height: 240px; display: flex; flex-direction: column; }
.fault .meta { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.fault h3 { margin-top: auto; padding-top: 48px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.fault p.muted { margin-top: 8px; font-size: 13.5px; line-height: 1.55; }
.scope { margin-top: 14px; font-size: 12.5px; color: var(--grey); max-width: 780px; }

/* Closing */
.closing { text-align: center; display: flex; flex-direction: column; align-items: center; }
.closing h2 { max-width: 640px; }
.bib { margin: 32px 0 24px; text-align: left; font: 13px/1.65 var(--mono); background: var(--card); border-radius: 18px; padding: 24px 28px; overflow-x: auto; max-width: 100%; box-shadow: var(--shadow); }
.copied { margin-top: 10px; min-height: 20px; font-size: 12px; color: var(--grey); }

.footer { max-width: calc(var(--maxw) + 2 * var(--gut)); margin: 120px auto 0; padding: 24px var(--gut) calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }

/* Tablet */
@media (max-width: 1024px) {
  h1 { font-size: 54px; }
  .head { flex-direction: column; align-items: start; gap: 14px; }
  .faults { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}

/* Phone */
@media (max-width: 760px) {
  :root { --gut: 16px; }
  .nav { grid-template-columns: auto 1fr; gap: 12px; }
  .links { display: none; }
  .hero { padding-top: 56px; }
  h1 { font-size: 40px; }
  .lede { font-size: 15px; }
  .facts { grid-template-columns: 1fr 1fr; margin-top: 48px; }
  .facts div:nth-child(n+3) { margin-top: 12px; }
  .facts dd { font-size: 30px; }
  .section { padding-top: 88px; }
  h2 { font-size: 32px; }
  .chart-card { padding: 18px 14px 16px; }
  .chart .lbl, .chart .lbl-sub { font-size: 11.5px; }
  .board { font-size: 13px; }
  .board th, .board td { padding: 12px 8px; }
  .board th { white-space: normal; }
  .board .mode { font-size: 12px; }
  .board .c-route { display: none; }
  .scorecell .bar { display: none; }
  .scorecell .val { min-width: 0; text-align: left; }
  .scorecell .val small { display: block; margin-left: 0; }
  .board .r { white-space: normal; }
  .glowpanel, .plainpanel { padding: 28px; min-height: 0; border-radius: 22px; }
  .glowpanel { min-height: 400px; }
  .huge { font-size: 64px; }
  .glowpanel h2 { font-size: 26px; }
  .correction { padding: 18px; }
  .faults { grid-template-columns: 1fr; }
  .fault { min-height: 0; }
  .fault h3 { padding-top: 28px; }
  .bib { font-size: 11.5px; padding: 18px; }
}

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

/* Info tips: a small "i" next to a term, one shared popover (see app.js). */
.info { position: relative; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 6px; padding: 0; vertical-align: -2px; border: 1px solid currentColor; border-radius: 50%; background: none; color: inherit; opacity: 0.6; cursor: help; font: 600 9px/1 var(--sans); letter-spacing: 0; text-transform: none; transition: opacity .2s; }
.info::before { content: "i"; }
.info::after { content: ""; position: absolute; inset: -9px; }
.info[aria-expanded="true"] { opacity: 1; }
@media (hover: hover) { .info:hover { opacity: 1; } }
.tip { position: fixed; z-index: 60; max-width: min(300px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 14px; background: var(--ink); color: var(--paper); font: 400 12.5px/1.5 var(--sans); letter-spacing: 0; text-transform: none; text-wrap: pretty; box-shadow: 0 12px 32px rgba(18, 18, 16, 0.18); pointer-events: none; }
.tip[hidden] { display: none; }

/* FAQ: plain question and answer text for readers and crawlers */
.faq-list { max-width: 780px; margin-top: 28px; }
.faq-list dt { font-weight: 600; margin-top: 22px; }
.faq-list dd { margin: 6px 0 0; color: var(--grey); line-height: 1.6; }
.faq-list a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
