/* ============================================================
   BROADSHEET — full report theme
   Cream paper, deep ink, terracotta accent, hairline rules
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; }

:root {
  --paper: #f4ece0;
  --paper-2: #ede2d0;
  --paper-3: #e6d9c2;
  --ink: #1a1614;
  --ink-soft: #5a514a;
  --ink-faint: #8e8479;
  --rule: #1a161422;
  --rule-strong: #1a161455;
  --accent: #c2491f;
  --accent-2: #8a3514;
  --accent-soft: #e88a64;
  --accent-faint: #c2491f15;
  --shell: 1280px;
  --pad: 56px;
}

body {
  font-family: "Geist", "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(rgba(26,22,20,0.025) 0.5px, transparent 0.6px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
  opacity: 0.6;
}

main, header, footer { position: relative; z-index: 1; }

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--pad); }

/* ---- Topbar (sticky) ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--shell); margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 32px;
  padding: 16px var(--pad);
}
.topbar-mast {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.topbar-mast img { width: 22px; height: 22px; }
.topbar-mast small {
  display: block; font-size: 10px; font-weight: 500;
  color: var(--ink-soft); margin-top: 1px; letter-spacing: 0.06em;
}
.topbar nav {
  display: flex; gap: 22px; justify-self: center;
  font-size: 12px; font-weight: 500; color: var(--ink-soft);
}
.topbar nav a { padding: 4px 0; transition: color 0.15s; }
.topbar nav a:hover, .topbar nav a.is-active { color: var(--ink); }
.topbar nav a.is-active { box-shadow: inset 0 -1.5px 0 var(--accent); }
.topbar-issue {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--ink-soft);
  grid-column: 3; grid-row: 1;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.topbar-issue.is-hidden {
  opacity: 0; transform: translateY(-6px); pointer-events: none;
}

/* Sponsor pill — fades in when sponsor-strip scrolls out of view */
.topbar-sponsor {
  grid-column: 3; grid-row: 1;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  border-radius: 100px;
  opacity: 0; transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.2s, background 0.2s;
}
.topbar-sponsor.is-pinned {
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}
.topbar-sponsor:hover {
  border-color: var(--rule-strong);
  background: color-mix(in srgb, var(--paper) 100%, transparent);
}
.topbar-sponsor-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft);
}
.topbar-sponsor img { height: 14px; width: auto; opacity: 0.92; }
@media (max-width: 600px) {
  .topbar-sponsor { padding: 4px 9px; gap: 7px; }
  .topbar-sponsor-label { display: none; }
  .topbar-sponsor img { height: 12px; }
}

.scroll-progress {
  position: absolute; left: 0; bottom: -1px;
  height: 2px; background: var(--accent);
  width: 0; transition: width 0.1s linear;
}

/* ---- Hero ---- */
.hero {
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--rule);
}
.hero .shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 72px;
  align-items: end;
}
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--accent);
}
.hero h1 {
  margin-top: 28px;
  font-size: 88px; line-height: 0.95; font-weight: 500;
  letter-spacing: -0.035em; max-width: 13ch;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal; color: var(--accent);
}
.hero-deck {
  margin-top: 32px; max-width: 56ch;
  font-size: 19px; line-height: 1.5; color: var(--ink-soft);
}
.hero-meta {
  margin-top: 44px;
  display: flex; gap: 36px; flex-wrap: wrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.hero-meta span b {
  display: block; font-family: "Geist", sans-serif;
  font-size: 14px; color: var(--ink); font-weight: 600;
  margin-top: 4px; text-transform: none; letter-spacing: 0;
}

.hero-stats {
  display: grid;
  border-top: 1px solid var(--ink);
}
.hero-stat {
  display: grid; grid-template-columns: 1fr auto;
  align-items: end;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--rule);
}
.hero-stat .num {
  font-size: 64px; line-height: 0.9; font-weight: 500;
  letter-spacing: -0.04em;
}
.hero-stat .num small { font-size: 28px; font-weight: 400; color: var(--ink-soft); }
.hero-stat .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-soft); padding-bottom: 8px;
  text-align: right; max-width: 16ch;
}

/* ---- Section heading ---- */
.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--rule);
}
.section-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-soft);
}
.section-tag em {
  font-style: normal; color: var(--accent);
  font-family: "JetBrains Mono", monospace; font-weight: 500;
  margin-right: 10px;
}
.section-head {
  display: grid; grid-template-columns: 280px 1fr; gap: 64px;
  margin-bottom: 56px;
}
.section-head h2 {
  font-size: 48px; line-height: 1.04; font-weight: 500;
  letter-spacing: -0.028em; max-width: 22ch;
  text-wrap: balance;
}
.section-head .lede {
  margin-top: 20px; max-width: 56ch;
  font-size: 17px; line-height: 1.55; color: var(--ink-soft);
}
.section-head .section-note {
  margin-top: 16px; max-width: 64ch;
  font-size: 12px; line-height: 1.5; color: var(--ink-soft);
  padding: 10px 14px; border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.section-head .section-note span {
  display: inline-block; margin-right: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
}

/* ---- Sponsor strip ---- */
.sponsor-strip {
  padding: 28px 0; border-bottom: 1px solid var(--rule);
}
.sponsor-strip .shell {
  display: grid; grid-template-columns: auto auto 1fr auto;
  gap: 28px; align-items: center;
}
.sponsor-strip .sponsor-logo { height: 22px; width: auto; opacity: 0.92; }
.sponsor-strip .label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-soft);
}
.sponsor-strip p {
  font-size: 14px; color: var(--ink-soft); line-height: 1.5; max-width: 80ch;
}
.sponsor-strip p strong { color: var(--ink); font-weight: 600; }
.sponsor-strip img { height: 22px; opacity: 0.85; }
.sponsor-strip a {
  font-size: 12px; font-weight: 600; color: var(--accent);
  border-bottom: 1px solid var(--accent); padding-bottom: 2px;
}

/* ---- Sample / countries ---- */
.sample-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
  align-items: start;
}
.country-list { display: grid; gap: 0; }
.country-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 1fr 50px;
  align-items: center; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.15s;
}
.country-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.country-row .rank {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.country-row .name { font-size: 15px; font-weight: 500; }
.country-row .name small {
  display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
}
.country-row .bar {
  height: 8px; background: var(--paper-2); border-radius: 1px;
  position: relative; overflow: hidden;
}
.country-row .bar span {
  position: absolute; inset: 0 auto 0 0; background: var(--ink);
}
.country-row .count {
  text-align: right; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sample-pubs {
  display: grid; gap: 0;
  border-top: 1px solid var(--rule);
}
.pub-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px;
  align-items: baseline; gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.pub-row .pub-name { font-weight: 500; }
.pub-row .pub-name small { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 2px; }
.pub-row .pub-count {
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
}
.pub-row .pub-tag {
  text-align: right; font-size: 11px; color: var(--ink-soft);
  font-family: "JetBrains Mono", monospace;
}

/* ---- Why-it-matters cards ---- */
.thesis-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.thesis-card {
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
  display: grid; gap: 16px; align-content: start;
}
.thesis-card:nth-child(3n) { border-right: 0; }
.thesis-card:nth-child(n+4) { border-top: 1px solid var(--rule); }
.thesis-card .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--accent); font-weight: 600;
  letter-spacing: 0.12em;
}
.thesis-card h3 {
  font-size: 20px; font-weight: 500; line-height: 1.2;
  letter-spacing: -0.015em; max-width: 22ch;
}
.thesis-card p {
  font-size: 14px; line-height: 1.55; color: var(--ink-soft);
}

/* ---- Bar charts ---- */
.bars {
  display: grid; gap: 0;
  border-top: 1px solid var(--ink);
}
.bar-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 80px;
  align-items: center; gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.bar-row .label { font-size: 14px; font-weight: 500; }
.bar-row .label small {
  display: block; margin-top: 3px;
  font-size: 11px; font-weight: 500; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.bar-row .bar {
  height: 22px; background: var(--paper-2); border-radius: 1px;
  position: relative; overflow: hidden;
}
.bar-row .bar span {
  position: absolute; inset: 0 auto 0 0;
  background: var(--ink);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-row.is-accent .bar span { background: var(--accent); }
.bar-row .pct {
  font-family: "JetBrains Mono", monospace;
  font-size: 18px; font-weight: 500; text-align: right;
  font-variant-numeric: tabular-nums;
}

.chart-foot {
  margin-top: 36px;
  display: grid; grid-template-columns: 280px 1fr; gap: 64px;
}
.chart-foot p {
  font-size: 14px; line-height: 1.55; color: var(--ink-soft);
  max-width: 60ch;
}
.chart-foot p::before {
  content: "Read"; display: inline-block;
  margin-right: 12px; padding: 2px 8px;
  background: var(--accent-faint); color: var(--accent);
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; vertical-align: 2px;
  border-radius: 2px;
}

/* ---- Donut + comparison ---- */
.access-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 56px;
  align-items: start;
}
.paid-topics-card {
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: start;
}
.paid-topics-head h3 {
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.paid-topics-sub {
  font-size: 13px; color: var(--ink-soft); line-height: 1.55; max-width: 32ch;
}
.paid-topic-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.paid-topic-row {
  display: grid; grid-template-columns: 180px 1fr 40px 44px;
  gap: 16px; align-items: center;
  font-size: 13px;
}
.paid-topic-label { color: var(--ink); font-weight: 500; }
.paid-topic-track {
  position: relative; height: 14px; background: var(--paper-2, #ebe4d6);
  border: 1px solid var(--rule);
}
.paid-topic-fill {
  position: absolute; inset: 0 auto 0 0; background: var(--accent);
  display: block;
}
.paid-topic-count { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); font-weight: 600; }
.paid-topic-pct { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink-soft); font-size: 12px; }
@media (max-width: 760px) {
  .paid-topics-card { grid-template-columns: 1fr; gap: 24px; }
  .paid-topic-row { grid-template-columns: 120px 1fr 36px 40px; gap: 10px; }
}
.donut-card { display: grid; gap: 28px; }
.donut-card h3 {
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  padding-bottom: 14px; border-bottom: 1px solid var(--rule);
}
.donut-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: center;
}
.donut {
  width: 180px; height: 180px; border-radius: 50%;
  display: grid; place-items: center;
  position: relative;
}
.donut::after {
  content: ""; position: absolute;
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--paper);
}
.donut .donut-center {
  position: absolute; z-index: 1;
  display: grid; place-items: center; gap: 2px; text-align: center;
}
.donut .donut-center b {
  font-size: 32px; font-weight: 600; line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.donut .donut-center small {
  font-size: 10px; font-weight: 600; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.donut-legend { display: grid; gap: 10px; align-content: center; }
.legend-item {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.legend-item:last-child { border-bottom: 0; }
.legend-item .swatch {
  width: 12px; height: 12px; border-radius: 1px;
}
.legend-item .name { font-weight: 500; }
.legend-item .name small { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.legend-item .v {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600; font-variant-numeric: tabular-nums;
}

/* ---- Cadence (vertical bars) ---- */
.cadence-grid {
  display: grid; grid-template-columns: 1fr 320px; gap: 56px;
  align-items: end;
}
.cadence-bars {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 16px; align-items: end; height: 320px;
}
.cadence-col {
  display: grid; grid-template-rows: auto 1fr auto; gap: 8px;
  text-align: center; height: 100%;
  align-items: end; justify-items: center;
}
.cadence-col .col-bar { align-self: end; width: 100%; min-height: 4px; }
.cadence-col .col-num { align-self: end; }
.cadence-col .col-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.cadence-col .col-bar {
  background: var(--ink); border-radius: 1px 1px 0 0;
  width: 100%; transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.cadence-col.is-peak .col-bar { background: var(--accent); }
.cadence-col .col-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.cadence-callout {
  border: 1px solid var(--ink); border-radius: 4px;
  padding: 24px; background: var(--paper-2);
}
.cadence-callout .num {
  font-size: 56px; line-height: 0.9; font-weight: 500;
  letter-spacing: -0.04em; color: var(--accent);
}
.cadence-callout p {
  margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--ink-soft);
}

/* ---- Heatmap ---- */
.heatmap {
  display: grid; gap: 4px;
  grid-template-columns: 100px repeat(7, 1fr);
  align-items: center;
  font-size: 11px;
}
.heatmap .day-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.08em;
  text-align: center; padding-bottom: 8px;
}
.heatmap .row-label {
  font-size: 13px; font-weight: 500; padding-right: 12px;
  text-align: right;
}
.heatmap .row-label small { display: block; color: var(--ink-soft); font-size: 10px; }
.heatmap .cell {
  aspect-ratio: 1; border-radius: 2px;
  display: grid; place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 500;
  color: var(--ink); transition: transform 0.15s;
  cursor: pointer;
}
.heatmap .cell:hover { transform: scale(1.06); z-index: 1; }
.heatmap .cell.is-empty { background: var(--paper-2); color: transparent; }
.heatmap .row-total {
  text-align: right; font-family: "JetBrains Mono", monospace;
  font-weight: 600; font-variant-numeric: tabular-nums;
}

/* ---- Topic ranking ---- */
.topic-list {
  display: grid; gap: 0;
  border-top: 1px solid var(--ink);
}
.topic-row {
  display: grid;
  grid-template-columns: 36px 1fr minmax(120px, 200px) 60px 50px;
  align-items: center; gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  transition: padding-left 0.2s;
}
.topic-row:hover { padding-left: 8px; background: color-mix(in srgb, var(--accent) 4%, transparent); }
.topic-row .rank {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--ink-soft);
}
.topic-row .name { font-size: 16px; font-weight: 500; }
.topic-row .bar {
  height: 8px; background: var(--paper-2); border-radius: 1px;
  position: relative; overflow: hidden;
}
.topic-row .bar span {
  position: absolute; inset: 0 auto 0 0;
  background: var(--ink);
}
.topic-row.is-top .bar span { background: var(--accent); }
.topic-row .count {
  text-align: right; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.topic-row .pct {
  text-align: right; font-size: 12px;
  color: var(--ink-soft); font-variant-numeric: tabular-nums;
  font-family: "JetBrains Mono", monospace;
}

/* ---- Synthesis pull quote ---- */
.synthesis {
  padding: 120px 0; background: var(--ink); color: var(--paper);
  border-bottom: 0;
}
.synthesis .shell {
  display: grid; grid-template-columns: 280px 1fr; gap: 64px;
}
.synthesis .section-tag { color: var(--accent-soft); }
.synthesis .section-tag em { color: var(--paper); }
.synthesis blockquote {
  font-size: 38px; line-height: 1.15; font-weight: 500;
  letter-spacing: -0.025em; max-width: 26ch;
  text-wrap: balance;
}
.synthesis blockquote em { font-style: normal; color: var(--accent-soft); }
.synthesis-body {
  margin-top: 36px; padding-top: 32px;
  border-top: 1px solid color-mix(in srgb, var(--paper) 20%, transparent);
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.synthesis-body p {
  font-size: 15px; line-height: 1.65;
  color: color-mix(in srgb, var(--paper) 80%, transparent);
}

/* ---- Explorer ---- */
.explorer {
  padding: 96px 0;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.explorer-controls {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.explorer-controls input { grid-column: 1 / -1; }
.explorer-controls select:nth-of-type(1) { grid-column: 1 / span 1; }
@media (max-width: 900px) {
  .explorer-controls { grid-template-columns: 1fr 1fr; }
  .explorer-controls input { grid-column: 1 / -1; }
}
.explorer-meta-right {
  display: inline-flex; gap: 16px; align-items: center;
}
.exp-reset {
  font: inherit; font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 6px 12px; background: transparent; color: var(--accent);
  border: 1px solid var(--accent); cursor: pointer;
}
.exp-reset:hover { background: var(--accent); color: var(--paper); }
.exp-table-wrap { overflow-x: auto; }
.exp-table thead th.sort { cursor: pointer; user-select: none; }
.exp-table thead th.sort:hover { color: var(--accent); }
.exp-table thead th.is-active { color: var(--accent); }
.exp-table .sort-ind { display: inline-block; margin-left: 6px; opacity: 0.7; }
.exp-table .exp-empty {
  padding: 40px; text-align: center; color: var(--ink-soft);
  font-style: italic; cursor: default;
}
.exp-pager {
  margin-top: 20px; display: flex; gap: 8px; align-items: center;
  justify-content: center; flex-wrap: wrap;
}
.exp-pager button {
  font: inherit; font-size: 12px; font-weight: 500;
  padding: 8px 14px; background: var(--paper); border: 1px solid var(--rule-strong);
  color: var(--ink); cursor: pointer; font-family: "JetBrains Mono", monospace;
}
.exp-pager button:hover:not(:disabled) { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.exp-pager button:disabled { opacity: 0.35; cursor: not-allowed; }
.exp-pager-state {
  font-size: 12px; font-family: "JetBrains Mono", monospace;
  color: var(--ink-soft); padding: 0 12px;
}
.explorer-controls input,
.explorer-controls select {
  font: inherit; font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
.explorer-controls input:focus,
.explorer-controls select:focus {
  outline: 2px solid var(--accent); outline-offset: -1px;
}
.explorer-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.explorer-meta b { color: var(--ink); }

.exp-table {
  width: 100%; border-collapse: collapse;
  background: var(--paper); border: 1px solid var(--rule-strong);
}
.exp-table thead th {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
  text-align: left; padding: 14px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
}
.exp-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px; vertical-align: top;
}
.exp-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.exp-table tbody tr { cursor: pointer; }
.exp-table .nl-name {
  font-weight: 600; max-width: 280px;
}
.exp-table .nl-name small {
  display: block; font-size: 11px; color: var(--ink-soft); margin-top: 3px;
  font-weight: 500;
}
.tag {
  display: inline-block;
  padding: 3px 8px; border-radius: 2px;
  background: var(--paper-2); border: 1px solid var(--rule);
  font-size: 11px; font-weight: 500;
  font-family: "JetBrains Mono", monospace;
}
.tag.is-paid { background: var(--accent-faint); color: var(--accent); border-color: var(--accent); }
.tag.is-free { background: transparent; }

/* ---- Footer ---- */
.site-footer {
  padding: 80px 0 48px;
  background: var(--paper);
}
.site-footer .shell {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 48px;
  border-top: 2px solid var(--ink); padding-top: 48px;
}
.site-footer h3 {
  font-size: 28px; line-height: 1.05; font-weight: 500;
  letter-spacing: -0.025em; max-width: 18ch;
}
.site-footer p { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.site-footer ul { display: grid; gap: 8px; font-size: 13px; }
.site-footer a:hover { color: var(--accent); }

/* ---- Tweaks panel target ---- */
[data-accent="terracotta"] { --accent: #c2491f; --accent-2: #8a3514; --accent-soft: #e88a64; --accent-faint: #c2491f15; }
[data-accent="rust"]       { --accent: #a04020; --accent-2: #6e2a13; --accent-soft: #d27051; --accent-faint: #a0402015; }
[data-accent="oxblood"]    { --accent: #8a2e2a; --accent-2: #5e1e1c; --accent-soft: #c4655e; --accent-faint: #8a2e2a15; }
[data-accent="ochre"]      { --accent: #b07012; --accent-2: #7a4a09; --accent-soft: #e0a55a; --accent-faint: #b0701215; }
[data-accent="ink-only"]   { --accent: #1a1614; --accent-2: #1a1614; --accent-soft: #5a514a; --accent-faint: #1a161410; }

/* ============================================================
   RESPONSIVE — tablet (≤960px) and mobile (≤600px)
   ============================================================ */

@media (max-width: 960px) {
  :root { --pad: 32px; }

  /* Topbar: drop center nav, keep mast + issue */
  .topbar-inner { grid-template-columns: 1fr auto; gap: 16px; padding: 12px var(--pad); }
  .topbar nav {
    grid-column: 1 / -1; justify-self: stretch;
    overflow-x: auto; scrollbar-width: none;
    gap: 18px; padding-bottom: 4px;
    border-top: 1px solid var(--rule); padding-top: 10px;
  }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; }
  .topbar-issue { font-size: 10px; }

  /* Hero: stack copy + stats */
  .hero { padding: 56px 0 48px; }
  .hero .shell { grid-template-columns: 1fr; gap: 48px; align-items: start; }
  .hero h1 { font-size: 56px; max-width: none; }
  .hero-deck { font-size: 17px; }
  .hero-meta { gap: 24px; margin-top: 28px; }
  .hero-stat .num { font-size: 48px; }
  .hero-stat .num small { font-size: 22px; }

  /* Section heading: stack */
  .section { padding: 64px 0; }
  .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 36px; }
  .section-head h2 { font-size: 34px; max-width: none; }
  .section-head .lede { font-size: 16px; }

  /* Sponsor strip: stack */
  .sponsor-strip .shell {
    grid-template-columns: auto 1fr; gap: 14px 20px; align-items: center;
  }
  .sponsor-strip .label { grid-column: 1; }
  .sponsor-strip .sponsor-logo { grid-column: 2; justify-self: start; }
  .sponsor-strip p { grid-column: 1 / -1; font-size: 13px; }
  .sponsor-strip a { grid-column: 1 / -1; justify-self: start; }

  /* Sample: stack */
  .sample-grid { grid-template-columns: 1fr; gap: 48px; }
  .country-row { grid-template-columns: 24px minmax(0, 1.4fr) 1fr 44px; gap: 12px; }
  .country-row .name small { font-size: 10px; }
  .pub-row { grid-template-columns: 1fr 60px 70px; gap: 12px; font-size: 13px; }

  /* Thesis: 1 column */
  .thesis-grid { grid-template-columns: 1fr; }
  .thesis-card { border-right: 0; border-bottom: 1px solid var(--rule); padding: 24px 0; }
  .thesis-card:last-child { border-bottom: 0; }
  .thesis-card:nth-child(n+4) { border-top: 0; }
  .thesis-card h3 { font-size: 18px; }

  /* Bar charts: tighten */
  .bar-row { grid-template-columns: 1fr; gap: 8px; padding: 14px 0; }
  .bar-row .label { font-size: 13px; }
  .bar-row .bar { height: 16px; }
  .bar-row .pct {
    grid-row: 1; grid-column: 1; justify-self: end;
    font-size: 14px; align-self: start;
  }
  .bar-row > .label { padding-right: 60px; }
  .chart-foot { grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }

  /* Access: stack donuts */
  .access-grid { grid-template-columns: 1fr; gap: 40px; }
  .donut-row { grid-template-columns: 1fr; gap: 20px; justify-items: center; }
  .donut-legend { width: 100%; }
  .paid-topics-card { grid-template-columns: 1fr; gap: 20px; margin-top: 36px; }

  /* Cadence: stack callout below bars */
  .cadence-grid { grid-template-columns: 1fr; gap: 32px; align-items: start; }
  .cadence-bars { gap: 8px; height: 220px; }
  .cadence-col .col-label { font-size: 9px; letter-spacing: 0.04em; }
  .cadence-col .col-num { font-size: 10px; }
  .cadence-callout { padding: 20px; }
  .cadence-callout .num { font-size: 44px; }

  /* Heatmap: tighter columns */
  .heatmap {
    grid-template-columns: 70px repeat(7, 1fr);
    gap: 3px;
  }
  .heatmap .row-label { font-size: 11px; padding-right: 8px; }
  .heatmap .row-label small { font-size: 9px; }
  .heatmap .day-label { font-size: 9px; padding-bottom: 4px; }
  .heatmap .cell { font-size: 9px; }

  /* Topic ranking */
  .topic-row {
    grid-template-columns: 24px 1fr 50px;
    grid-template-areas:
      "rank name count"
      ".    bar  pct";
    gap: 4px 12px; padding: 14px 0;
  }
  .topic-row > .rank { grid-area: rank; }
  .topic-row > .name { grid-area: name; font-size: 14px; }
  .topic-row > .bar { grid-area: bar; height: 6px; }
  .topic-row > .count { grid-area: count; }
  .topic-row > .pct { grid-area: pct; text-align: right; }
  .topic-row:hover { padding-left: 0; }

  /* Synthesis */
  .synthesis { padding: 72px 0; }
  .synthesis .shell { grid-template-columns: 1fr; gap: 28px; }
  .synthesis blockquote { font-size: 28px; max-width: none; }
  .synthesis-body { grid-template-columns: 1fr; gap: 24px; margin-top: 24px; padding-top: 24px; }

  /* Explorer */
  .explorer { padding: 64px 0; }
  .explorer-controls { grid-template-columns: 1fr 1fr; gap: 8px; }
  .explorer-controls input { grid-column: 1 / -1; }
  .explorer-meta { flex-wrap: wrap; gap: 8px; }
  .exp-table { font-size: 12px; }
  .exp-table thead th, .exp-table tbody td { padding: 10px 12px; }
  .exp-table .nl-name { max-width: 200px; }

  /* Footer */
  .site-footer .shell { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .site-footer h3 { font-size: 24px; }
}

@media (max-width: 600px) {
  :root { --pad: 20px; }

  .topbar-mast { font-size: 11px; }
  .topbar-mast img { width: 18px; height: 18px; }
  .topbar-mast small { font-size: 9px; }
  .topbar-issue { display: none; }
  .topbar-inner { grid-template-columns: 1fr; }
  .topbar nav { font-size: 11px; gap: 14px; }

  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 40px; letter-spacing: -0.03em; }
  .hero-deck { font-size: 16px; }
  .hero-meta { font-size: 10px; gap: 18px; }
  .hero-stat { padding: 16px 0 14px; }
  .hero-stat .num { font-size: 38px; }
  .hero-stat .num small { font-size: 18px; }
  .hero-stat .label { font-size: 10px; max-width: 12ch; }

  .section { padding: 48px 0; }
  .section-head h2 { font-size: 26px; line-height: 1.1; }
  .section-head .lede { font-size: 15px; }
  .section-head .section-note { font-size: 11px; padding: 8px 12px; }

  .country-row { grid-template-columns: 20px minmax(0, 1.6fr) 1fr 40px; gap: 10px; padding: 12px 0; }
  .country-row .name { font-size: 13px; }
  .country-row .count { font-size: 13px; }

  .pub-row { grid-template-columns: 1fr 50px; gap: 10px; padding: 10px 0; }
  .pub-row .pub-tag { display: none; }

  .thesis-card { padding: 20px 0; }
  .thesis-card h3 { font-size: 17px; }
  .thesis-card p { font-size: 13px; }

  .bar-row .label { font-size: 12px; }
  .bar-row .label small { font-size: 10px; }
  .bar-row .pct { font-size: 13px; }

  .donut { width: 140px; height: 140px; }
  .donut::after { width: 86px; height: 86px; }
  .donut .donut-center b { font-size: 26px; }

  .paid-topic-row {
    grid-template-columns: 1fr 36px 40px;
    grid-template-areas: "label count pct" "track track track";
    gap: 4px 10px;
  }
  .paid-topic-row .paid-topic-label { grid-area: label; font-size: 12px; }
  .paid-topic-row .paid-topic-track { grid-area: track; height: 8px; }
  .paid-topic-row .paid-topic-count { grid-area: count; font-size: 12px; }
  .paid-topic-row .paid-topic-pct { grid-area: pct; font-size: 11px; }

  .cadence-bars { height: 180px; gap: 5px; }
  .cadence-col .col-label { font-size: 8px; }
  .cadence-col .col-num { font-size: 9px; }

  /* Heatmap: scrollable horizontally on tiny screens */
  .heatmap-wrap { overflow-x: auto; scrollbar-width: thin; }
  .heatmap { min-width: 460px; grid-template-columns: 64px repeat(7, 1fr); }
  .heatmap .cell { font-size: 8px; }
  .heatmap .day-label { font-size: 9px; }

  .topic-row { grid-template-columns: 20px 1fr 44px; }
  .topic-row > .name { font-size: 13px; }
  .topic-row > .count { font-size: 13px; }

  .synthesis { padding: 56px 0; }
  .synthesis blockquote { font-size: 22px; }
  .synthesis-body p { font-size: 14px; }

  .explorer { padding: 48px 0; }
  .explorer-controls { grid-template-columns: 1fr; }
  .exp-table { font-size: 11px; }
  .exp-table thead th, .exp-table tbody td { padding: 8px 10px; }
  .exp-table thead th { font-size: 9px; letter-spacing: 0.06em; }
  .exp-table .nl-name { max-width: 160px; }
  .exp-pager button { padding: 6px 10px; font-size: 11px; }

  .site-footer { padding: 56px 0 32px; }
  .site-footer h3 { font-size: 20px; }

  /* Hide tweaks panel button on mobile to save room (still toggleable) */
  .tweaks-panel { right: 12px !important; bottom: 12px !important; max-width: calc(100vw - 24px); }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 34px; }
  .section-head h2 { font-size: 22px; }
}

