@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");
}

:root {
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f5f2ea;
  --card: #fcfcfb;
  --ink: #14130f;
  --muted: #52514e;
  --line: #e0dccf;
  --signal: #b3261e;
  --neutral: #a3a29c;
  --band-arctic-monkeys: #2a78d6;
  --band-oasis: #eb6834;
  --band-linkin-park: #19a170;
  --band-twenty-one-pilots: #c28400;
  --band-muse: #d57197;
  --band-metallica: #008300;
  --band-avenged-sevenfold: #6851ea;
}
:root[data-theme="dark"] {
  --bg: #161512;
  --card: #1e1d19;
  --ink: #ece9df;
  --muted: #a8a59b;
  --line: #302e28;
  --signal: #e2574c;
  --neutral: #8a877d;
}

/* Encore. Tokens (colours, fonts) are generated from encore/site/theme.py and prepended at build time. */

:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--font-sans);
}
img, svg { max-width: 100%; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(1.7rem, 4vw + 1rem, 2.6rem); font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; max-width: 68ch; }
h2 + p, h3 + p { margin-top: 0.5rem; }
section > h3 { margin-top: 2.25rem; }
p + figure, p + .card { margin-top: 1rem; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--card); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.5rem; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.brand { font: 500 1.25rem var(--font-mono); text-decoration: none; letter-spacing: -0.02em; margin-right: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font: 400 0.8125rem var(--font-mono); }
.nav a { text-decoration: none; padding: 0.15rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.pills { display: flex; align-items: center; gap: 0.5rem; }
.pill-group { display: inline-flex; gap: 0.25rem; }
.pill {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.2rem 0.75rem; font: 500 0.75rem var(--font-mono); color: var(--ink);
  background: transparent; text-decoration: none; cursor: pointer; line-height: 1.4;
}
.pill:hover { border-color: var(--ink); }
.pill[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }
.theme-toggle { display: none; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle .on-dark, :root[data-theme="dark"] .theme-toggle .on-light { display: none; }
:root[data-theme="dark"] .theme-toggle .on-dark { display: inline; }

/* Status line */
.statusline { border-bottom: 1px solid var(--line); font: 400 0.75rem var(--font-mono); color: var(--muted); }
.statusline .wrap { display: flex; flex-wrap: wrap; gap: 0.4rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line);
  border-radius: 999px; padding: 0.1rem 0.6rem; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); display: inline-block; }

/* Text furniture */
main.wrap { padding-top: 2.5rem; padding-bottom: 3rem; }
.kicker { font: 500 0.75rem var(--font-mono); color: var(--signal); letter-spacing: 0.02em; margin: 0 0 0.4rem; }
.kicker::before { content: "// "; }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 62ch; }
/* Layer 1 of a finding: the plain-language claim, read first. */
h2.claim { font-size: clamp(1.35rem, 2.4vw + 0.9rem, 1.8rem); line-height: 1.25; max-width: 30ch; margin-bottom: 0.9rem; }
.lede.claim { color: var(--ink); font-size: 1.25rem; font-weight: 500; line-height: 1.4; margin-bottom: 0.75rem; }
.finding > .lede { color: var(--ink); }
/* One line under a chart on how to read it. */
.read { font: 400 0.8125rem/1.5 var(--font-mono); color: var(--ink); margin: 0.6rem 0 0; max-width: 78ch; }
.read strong { font-weight: 500; }
.read strong::after { content: ""; }
/* Layer 3: caveats and limits, collapsed and set in smaller type, out of the main flow. */
details.caveats { margin-top: 1rem; border-left: 2px solid var(--line); padding-left: 0.9rem; font-size: 0.8125rem; line-height: 1.55; color: var(--muted); }
details.caveats > summary { font: 500 0.75rem var(--font-mono); color: var(--muted); }
details.caveats ul { margin: 0.6rem 0 0; padding-left: 1.1rem; max-width: 74ch; }
details.caveats li { margin: 0 0 0.5rem; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
section { margin-top: 3rem; }
.section-head { margin-bottom: 1rem; }
.note { font: 400 0.8125rem/1.5 var(--font-mono); color: var(--muted); max-width: 72ch; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0 0; padding: 0; list-style: none; font: 400 0.75rem var(--font-mono); }

/* Cards, figures */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 1rem; }
.stack > * + * { margin-top: 1.25rem; }
figure { margin: 0; }
figcaption { font: 400 0.8125rem/1.5 var(--font-mono); color: var(--muted); margin-top: 0.5rem; }
.chart svg { display: block; width: 100%; height: auto; }
details { margin-top: 0.75rem; font-size: 0.875rem; }
summary { cursor: pointer; font: 500 0.75rem var(--font-mono); color: var(--muted); }

/* Data tables: stack into labelled rows on narrow screens, so the page never scrolls sideways */
table { border-collapse: collapse; width: 100%; font: 400 0.8125rem/1.4 var(--font-mono); font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: baseline; }
th:first-child, td:first-child { text-align: left; }
thead th { font-weight: 500; color: var(--muted); border-bottom-color: var(--ink); }
tbody tr:hover { background: color-mix(in srgb, var(--line) 35%, transparent); }
.swatch { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.5rem; vertical-align: -0.05rem; }
h1 .swatch-lg { width: 0.9rem; height: 0.9rem; margin-right: 0.75rem; vertical-align: 0.1em; border-radius: 3px; }
li .pill .swatch { width: 0.6rem; height: 0.6rem; margin-right: 0.4rem; }
ul.chips { list-style: none; } ul.chips > li { display: inline-flex; }
td.dim, .dim { color: var(--muted); }
@media (max-width: 640px) {
  table.stackable thead { position: absolute; left: -999px; }
  table.stackable, table.stackable tbody, table.stackable tr, table.stackable td { display: block; width: 100%; }
  table.stackable tr { border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
  table.stackable td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0.15rem 0; text-align: right; }
  table.stackable td::before { content: attr(data-label); color: var(--muted); text-align: left; }
  table.stackable td:first-child { font-weight: 500; }
  table.stackable td:first-child::before { content: none; }
}

ul.plain { list-style: none; margin: 0; padding: 0; max-width: 68ch; }
ul.plain li { margin: 0 0 1em; }

/* Findings: hero stat and small multiples */
.finding { display: grid; gap: 1rem; }
.hero-stat { font: 500 clamp(2.2rem, 6vw, 3.4rem)/1 var(--font-mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-stat small { display: block; font: 400 0.8125rem/1.4 var(--font-mono); color: var(--muted); letter-spacing: 0; margin-top: 0.4rem; }
.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 0.6rem; }
.multiples .cell { border: 1px solid var(--line); padding: 0.5rem; background: var(--card); }
.multiples h3 { font: 500 0.75rem var(--font-mono); margin-bottom: 0.25rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); font: 400 0.8125rem/1.6 var(--font-mono); color: var(--muted); padding: 1.5rem 0 2.5rem; }
.site-footer p { margin: 0 0 0.3rem; }
.site-footer a { color: var(--ink); }

@media (max-width: 640px) {
  .bar { gap: 0.5rem 1rem; }
  .nav { order: 3; width: 100%; }
  main.wrap { padding-top: 1.5rem; }
}
@media (prefers-reduced-motion: no-preference) { .pill { transition: border-color 0.15s; } }
