/* Statizoid — light and dark are both selected, not an automatic flip.
   Series colours come from the validated categorical palette; the dark column is
   the same eight hues re-stepped for the dark surface. */

:root {
  color-scheme: light;
  --surface-0: #f4f4f2;
  --surface-1: #fcfcfb;
  --surface-2: #eeeeec;
  --border:    #dcdcd8;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #6f6e6a;
  --accent: #2a78d6;

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;

  --radius: 10px;
  --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-0: #121211;
    --surface-1: #1a1a19;
    --surface-2: #232322;
    --border:    #34343200;
    --border:    #343432;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #9a998f;
    --accent: #3987e5;

    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #121211;
  --surface-1: #1a1a19;
  --surface-2: #232322;
  --border:    #343432;
  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted:     #9a998f;
  --accent: #3987e5;

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.muted { color: var(--text-muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--surface-1);
  padding: .6rem 1rem; z-index: 20;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ── header ── */
.site-header {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding-top: .7rem; padding-bottom: .7rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; text-decoration: none; color: var(--text-primary);
  font-size: 1.1rem; letter-spacing: -.01em;
}
.brand-mark { color: var(--accent); font-size: 1.3rem; }
.crumb {
  color: var(--text-secondary); font-size: .9rem;
  border-left: 1px solid var(--border); padding-left: 1rem;
  max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-form { margin-left: auto; display: flex; gap: .4rem; }
.search-form input {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius);
  padding: .45rem .7rem; min-width: 12rem; font: inherit; font-size: .9rem;
}
.search-form button, .theme-toggle {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius);
  padding: .45rem .8rem; font: inherit; font-size: .9rem; cursor: pointer;
}
.search-form button:hover, .theme-toggle:hover { background: var(--border); }

/* ── hero ── */
.hero { padding: 3rem 0 1.5rem; }
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.1;
  letter-spacing: -.02em; margin: 0 0 .75rem;
}
.lede { font-size: 1.1rem; color: var(--text-secondary); max-width: 62ch; margin: 0; }
.hero-stats { display: flex; gap: 2.5rem; list-style: none; padding: 0; margin: 2rem 0 0; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-num { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.hero-cap { color: var(--text-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }

/* ── cards & categories ── */
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin: 1.5rem 0;
}
.card h2, .category-title { margin-top: 0; }
.empty-state { text-align: center; padding: 2.5rem 1.5rem; }

.category-block { margin: 2.5rem 0; }
.category-title {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.35rem; margin-bottom: .25rem;
}
.category-title a { color: var(--text-primary); text-decoration: none; }
.category-title a:hover { color: var(--accent); }
.category-title .count {
  font-size: .8rem; color: var(--text-muted); background: var(--surface-2);
  border-radius: 999px; padding: .1rem .55rem; font-weight: 500;
}
.category-desc { margin: 0 0 1rem; font-size: .95rem; }

.topic-grid {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}
.topic-card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem;
}
.topic-card:hover { border-color: var(--accent); }
.topic-link { text-decoration: none; color: inherit; }
.topic-card h3 { margin: 0 0 .35rem; font-size: 1.05rem; line-height: 1.35; }
.topic-sub { margin: 0; color: var(--text-secondary); font-size: .92rem; }
.topic-meta { margin: .8rem 0 0; font-size: .8rem; }
.topic-meta code { background: var(--surface-2); padding: .1rem .4rem; border-radius: 5px; }

.cat-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.cat-list li { display: flex; justify-content: space-between; gap: .5rem;
  padding: .4rem .6rem; background: var(--surface-2); border-radius: 8px; }
.cat-list a { text-decoration: none; }

/* ── topic page ── */
.topic-header { padding: 2.5rem 0 1rem; }
.eyebrow { margin: 0 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.eyebrow a { text-decoration: none; }
.topic-header h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.15;
  letter-spacing: -.02em; margin: 0 0 .6rem; }
.topic-facts { display: flex; gap: 2rem; flex-wrap: wrap; margin: 1.5rem 0 0; }
.topic-facts div { display: flex; flex-direction: column; }
.topic-facts dt { color: var(--text-muted); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em; }
.topic-facts dd { margin: 0; font-weight: 600; font-size: 1.05rem; }

.notice {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--series-4);
  border-radius: var(--radius); padding: .9rem 1.1rem; color: var(--text-secondary);
}

/* ── time range filter: one row above the charts ── */
.range-nav {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  margin: 1.5rem 0; padding: .6rem; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.range-label { color: var(--text-muted); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .06em; margin-right: .3rem; }
.range-chip {
  padding: .35rem .8rem; border-radius: 999px; font-size: .88rem;
  text-decoration: none; color: var(--text-secondary); border: 1px solid transparent;
}
.range-chip:hover { background: var(--surface-2); }
.range-chip.is-active {
  background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600;
}

/* ── metric blocks & charts ── */
.metric-block {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; margin: 1.25rem 0;
}
.metric-header h2 { margin: 0 0 .3rem; font-size: 1.2rem; }
.metric-meta { font-size: .85rem; margin: .4rem 0 0; }
.chart-figure { margin: 1.2rem 0 0; }
.chart-figure figcaption { font-size: .82rem; margin-top: .5rem; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--text-muted); font-size: 11px;
  font-family: inherit; }
.chart .pt { cursor: pointer; }
.chart .pt:hover { r: 6; }

.chart-legend {
  display: flex; flex-wrap: wrap; gap: .5rem 1.1rem;
  list-style: none; padding: 0; margin: 0 0 .8rem;
}
.lg-item { display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; color: var(--text-secondary); }
.lg-swatch { width: .7rem; height: .7rem; border-radius: 3px; flex: none; }

.stat-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.stat-tile {
  background: var(--surface-2); border-radius: var(--radius);
  padding: 1rem 1.25rem; min-width: 10rem; flex: 1 1 10rem;
}
.stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { color: var(--text-secondary); font-size: .9rem; margin-top: .2rem; }
.stat-when { color: var(--text-muted); font-size: .78rem; margin-top: .3rem; }

.bar-chart { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(6rem, 12rem) 1fr auto;
  align-items: center; gap: .75rem; font-size: .9rem; }
.bar-label { color: var(--text-secondary); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--surface-2); border-radius: 4px; height: 1.4rem; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── tables (also the relief for low-contrast light-mode slots) ── */
.table-wrap { margin-top: 1.2rem; }
.table-wrap summary { cursor: pointer; color: var(--text-secondary); font-size: .9rem; }
.table-scroll { overflow-x: auto; margin-top: .8rem; }
.data-table { border-collapse: collapse; width: 100%; font-size: .88rem; min-width: 20rem; }
.data-table th, .data-table td {
  text-align: left; padding: .45rem .7rem; border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--text-muted); font-weight: 600; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .04em; }
.data-table td { font-variant-numeric: tabular-nums; }

.source-list { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .4rem; }
.source-list a { word-break: break-all; font-size: .88rem; }

.prose p { max-width: 68ch; }

/* ── footer ── */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface-1);
  margin-top: 3rem; padding: 2rem 0; font-size: .9rem;
}
.site-footer p { margin: .3rem 0; }

@media (max-width: 640px) {
  .search-form { margin-left: 0; width: 100%; }
  .search-form input { flex: 1; min-width: 0; }
  .crumb { display: none; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; }
}

/* ── multiple views per metric (CSS-only tabs, no JS required) ── */
.views { margin-top: 1.1rem; }
.view-tabs {
  display: flex; gap: .3rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin-bottom: 1rem;
}
.view-tab {
  padding: .3rem .75rem; border-radius: 999px; font-size: .84rem;
  color: var(--text-secondary); cursor: pointer; user-select: none;
  border: 1px solid transparent;
}
.view-tab:hover { background: var(--surface-2); }
.view-panel { display: none; margin: 0; }

/* Pair the Nth radio with the Nth label and the Nth panel. */
.views .view-radio:nth-of-type(1):checked ~ .view-tabs .view-tab:nth-of-type(1),
.views .view-radio:nth-of-type(2):checked ~ .view-tabs .view-tab:nth-of-type(2),
.views .view-radio:nth-of-type(3):checked ~ .view-tabs .view-tab:nth-of-type(3),
.views .view-radio:nth-of-type(4):checked ~ .view-tabs .view-tab:nth-of-type(4),
.views .view-radio:nth-of-type(5):checked ~ .view-tabs .view-tab:nth-of-type(5),
.views .view-radio:nth-of-type(6):checked ~ .view-tabs .view-tab:nth-of-type(6),
.views .view-radio:nth-of-type(7):checked ~ .view-tabs .view-tab:nth-of-type(7),
.views .view-radio:nth-of-type(8):checked ~ .view-tabs .view-tab:nth-of-type(8),
.views .view-radio:nth-of-type(9):checked ~ .view-tabs .view-tab:nth-of-type(9) {
  background: var(--accent); color: #fff; font-weight: 600; border-color: var(--accent);
}
.views .view-radio:nth-of-type(1):checked ~ .view-panel-1,
.views .view-radio:nth-of-type(2):checked ~ .view-panel-2,
.views .view-radio:nth-of-type(3):checked ~ .view-panel-3,
.views .view-radio:nth-of-type(4):checked ~ .view-panel-4,
.views .view-radio:nth-of-type(5):checked ~ .view-panel-5,
.views .view-radio:nth-of-type(6):checked ~ .view-panel-6,
.views .view-radio:nth-of-type(7):checked ~ .view-panel-7,
.views .view-radio:nth-of-type(8):checked ~ .view-panel-8,
.views .view-radio:nth-of-type(9):checked ~ .view-panel-9 { display: block; }
.views .view-radio:focus-visible ~ .view-tabs .view-tab { outline: 2px solid var(--accent); }

/* stat tile extras */
.stat-delta { font-size: .78rem; color: var(--text-secondary); margin-top: .25rem; }
.sparkline { width: 100%; max-width: 9rem; height: 1.75rem; margin-top: .5rem; display: block; }

/* dot / lollipop plot */
.lolli-chart { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .55rem; }
.lolli-row { display: grid; grid-template-columns: minmax(6rem, 12rem) 1fr auto;
  align-items: center; gap: .75rem; font-size: .9rem; }
.lolli-label { color: var(--text-secondary); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.lolli-track { position: relative; height: 1rem; display: flex; align-items: center; }
.lolli-track::before { content: ""; position: absolute; left: 0; right: 0;
  height: 1px; background: var(--border); }
.lolli-stem { height: 2px; border-radius: 2px; position: relative; }
.lolli-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%;
  transform: translateX(-50%); border: 2px solid var(--surface-1); }
.lolli-value { font-variant-numeric: tabular-nums; font-weight: 600; }

/* 100% share bar */
.share-bar { display: flex; height: 2rem; border-radius: 6px; overflow: hidden;
  margin: 1rem 0 .8rem; gap: 2px; background: var(--surface-2); }
.share-seg { display: block; height: 100%; }
.share-legend { margin-top: .5rem; }

/* heatmap */
.heatmap { border-collapse: separate; border-spacing: 2px; font-size: .7rem; }
.heatmap th { color: var(--text-muted); font-weight: 500; }
.hm-day { text-align: right; padding-right: .4rem; white-space: nowrap; }
.hm-hour { text-align: center; font-size: .65rem; }
.hm-cell { width: 14px; height: 14px; border-radius: 3px; padding: 0; }
.hm-empty { background: var(--surface-2); opacity: 1; }

@media (max-width: 640px) {
  .lolli-row { grid-template-columns: 1fr auto; }
  .lolli-track { grid-column: 1 / -1; }
}

/* ── share bar ── */
.share {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin: 1.5rem 0;
}
.share-title { margin: 0 0 .9rem; font-size: 1.05rem; }
.share-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem; border-radius: 999px; font-size: .85rem;
  text-decoration: none; cursor: pointer;
  background: var(--surface-2); color: var(--text-primary);
  border: 1px solid var(--border); font-family: inherit;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn span[aria-hidden] { font-weight: 700; opacity: .8; }
.share-copy { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.share-copy:hover { color: #fff; filter: brightness(1.08); }
.share-url-wrap { display: block; margin-top: .9rem; }
.share-url {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: .5rem .7rem; color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
}
.share-feedback { margin: .5rem 0 0; font-size: .82rem; min-height: 1.2em; }

/* ══════════════════════════════════════════════════════════════
   Warehouse pages (/data, /stat, /place, /compare)

   The categorical palette above is reused unchanged — it was re-validated for
   both surfaces when these pages were added (light: all checks pass with a
   contrast WARN on slots 3/4/5; dark: all pass). The light-mode WARN obliges
   "relief": every chart on these pages is accompanied by a visible data table
   (the decade table on a series page, the ranking table on a dataset page), so
   no value is ever carried by a low-contrast hue alone.
   ══════════════════════════════════════════════════════════════ */

/* ── breadcrumbs ── */
.breadcrumbs { margin: 1.25rem 0 .5rem; font-size: .85rem; }
.breadcrumbs ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .35rem .5rem;
}
.breadcrumbs li { display: flex; align-items: center; gap: .5rem; color: var(--text-muted); }
.breadcrumbs li:not(:last-child)::after { content: "›"; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-secondary); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ── page head ── */
.page-head { margin: .5rem 0 1.75rem; }
.page-head h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.15rem); line-height: 1.2;
  letter-spacing: -.02em; margin: 0 0 .5rem;
}
.page-head .lede { color: var(--text-secondary); font-size: 1.05rem; margin: 0; }

/* ── stat tiles ──
   A headline figure is not a chart. The number carries the weight; the label is
   recessive; the note is quieter still. Values wear text tokens, never a series
   colour — the tone modifier tints only the left rule. */
.tiles {
  display: grid; gap: .75rem; margin: 0 0 2rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.tile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .85rem 1rem;
  border-left: 3px solid var(--border);
}
.tile-up    { border-left-color: var(--series-3); }
.tile-down  { border-left-color: var(--series-2); }
.tile-label {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: .3rem;
}
.tile-value {
  font-size: 1.5rem; font-weight: 650; line-height: 1.15;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.tile-note { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

/* ── trend badge ── */
.badge {
  display: inline-block; font-size: .75rem; font-weight: 600;
  padding: .12rem .5rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-secondary);
  background: var(--surface-2); white-space: nowrap;
}

/* ── chart block ── */
.chart-block { margin: 0 0 2rem; }
.chart-block h2, .analysis h2, .decades h2, .leaderboard h2,
.neighbours h2, .siblings h2, .faq h2, .downloads h2,
.source-note h2, .related h2, .highlights h2, .cat-list h2 {
  font-size: 1.15rem; letter-spacing: -.01em; margin: 0 0 .75rem;
}
.chart-block .chart {
  width: 100%; height: auto; display: block;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .5rem;
}
.small { font-size: .85rem; }

/* ── analysis prose ── */
.analysis { margin: 0 0 2rem; max-width: 72ch; }
.analysis p { margin: 0 0 .8rem; color: var(--text-secondary); }

/* ── tables ── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rank-table { min-width: 640px; }
.data-table td, .data-table th { font-variant-numeric: tabular-nums; }
.rank-no {
  color: var(--text-muted); font-variant-numeric: tabular-nums;
  text-align: right; width: 3.5rem;
}
.data-table .sparkline { vertical-align: middle; margin-left: .5rem; opacity: .85; }

/* Proportion bar: anchored at zero, 4px rounded data-end, 2px surface gap
   from the number beside it. */
.rankbar {
  display: inline-block; vertical-align: middle; width: 84px; height: 8px;
  margin-left: .5rem; background: var(--surface-2);
  border-radius: 4px; overflow: hidden;
}
.rankbar-fill { display: block; height: 100%; border-radius: 4px; }

/* ── rank list ── */
.rank-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.rank-list li {
  display: flex; align-items: baseline; gap: .75rem;
  padding: .4rem 0; border-bottom: 1px solid var(--border);
}
.rank-list .rank-no { flex: 0 0 2.5rem; }
.rank-list .rank-val {
  margin-left: auto; font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.rank-list .vs { font-size: .78rem; color: var(--text-muted); }

/* ── link + card grids ── */
.link-grid {
  list-style: none; margin: 0 0 1.25rem; padding: 0;
  display: grid; gap: .5rem .9rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.link-grid li {
  display: flex; justify-content: space-between; gap: .75rem;
  align-items: baseline; padding: .35rem 0;
  border-bottom: 1px solid var(--border);
}
.link-grid.compact { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.link-grid.compact li { font-size: .92rem; }

.card-grid {
  list-style: none; margin: 0 0 2rem; padding: 0;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.card-grid .card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-grid .card a {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .9rem 1rem; text-decoration: none; color: var(--text-primary);
  height: 100%;
}
.card-grid .card a:hover { background: var(--surface-2); }
.card-icon { font-size: 1.25rem; }
.card-title { font-weight: 600; }

/* ── dataset list ── */
.dataset-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.dataset-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  align-items: baseline; padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}

/* ── FAQ ── */
.faq { margin: 0 0 2rem; max-width: 72ch; }
.faq dt { font-weight: 620; margin-top: .9rem; }
.faq dd { margin: .25rem 0 0; color: var(--text-secondary); }

/* ── source note ── */
.source-note {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.15rem; margin: 0 0 2rem;
}
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .9rem; margin: 0; }
.meta-list dt { color: var(--text-muted); font-size: .85rem; }
.meta-list dd { margin: 0; font-size: .9rem; }
.definition { color: var(--text-secondary); font-size: .9rem; margin: .9rem 0 0; }

/* ── pagination ── */
.pagination {
  display: flex; gap: 1rem; align-items: center; justify-content: center;
  margin: 1.5rem 0; flex-wrap: wrap;
}

/* ── downloads ── */
.downloads { margin: 0 0 2rem; }

@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  .tile-value { font-size: 1.25rem; }
}

/* ── main nav ──
   Present on every page including topic subdomains, so the warehouse hubs are
   never more than one click from anywhere on the network. */
.site-nav { display: flex; gap: 1rem; margin-left: auto; }
.site-nav a {
  color: var(--text-secondary); text-decoration: none;
  font-size: .92rem; font-weight: 550;
}
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 720px) { .site-nav { margin-left: 0; order: 3; } }

/* ══════════════════════════════════════════════════════════════
   Homepage live monitor

   The pulse and the counters are the only animated things on the site, and
   they animate because the underlying number genuinely is changing. Both
   respect prefers-reduced-motion.
   ══════════════════════════════════════════════════════════════ */

.monitor {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 0 0 2.25rem;
}
.monitor-head { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.monitor-head h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: .55rem; }
.monitor-head p { margin: 0; }

/* A quiet "this is live" indicator. Green reads as a status, and status
   colours are reserved — so it is paired with the word "pipeline" and the
   throughput figures, never carrying meaning by colour alone. */
.pulse {
  width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--series-3); flex: 0 0 auto;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--series-3) 60%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
.pulse-idle { background: var(--text-muted); animation: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--series-3) 55%, transparent); }
  70%  { box-shadow: 0 0 0 .5rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}

.monitor-grid {
  display: grid; gap: .7rem; margin: 1rem 0 .5rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.monitor-grid .tile { background: var(--surface-2); border-color: transparent; }

.throughput { margin: .75rem 0 0; }
.throughput figcaption { margin-bottom: .3rem; }
.chart-sm { width: 100%; height: 90px; display: block; }

/* ── activity feed ── */
.feed { list-style: none; margin: 0 0 2rem; padding: 0; }
.feed li {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: .45rem 0; border-bottom: 1px solid var(--border);
}
.feed li span { font-size: .85rem; text-align: right; white-space: nowrap;
                overflow: hidden; text-overflow: ellipsis; }

/* ── spotlight ── */
.spotlight-grid {
  list-style: none; margin: 0 0 2.25rem; padding: 0;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.spot-card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); border-left: 3px solid var(--series-1);
}
.spot-card a {
  display: flex; flex-direction: column; gap: .25rem;
  padding: .85rem 1rem; text-decoration: none; color: var(--text-primary);
  height: 100%;
}
.spot-card a:hover { background: var(--surface-2); }
.spot-head { font-size: .85rem; color: var(--text-secondary); line-height: 1.35; }
.spot-value {
  font-size: 1.3rem; font-weight: 650; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.spot-meta { font-size: .8rem; }

/* Counters use tabular figures so a ticking number does not reflow its row. */
.hero-num { font-variant-numeric: tabular-nums; }
