:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --ink: #1b1b1b;
  --ink-2: #565c65;
  --line: #dfe1e2;
  --accent: #0a3161;
  --accent-ink: #ffffff;
  --accent-soft: #e8eef7;
  --link: #005ea2;
  --red: #b31942;
  --navy: #0a3161;
  --gold: #c8962e;
  --warn: #8a4b08;
  --warn-soft: #faf3d1;
  --radius: 4px;
  --shadow: none;
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1080px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1520; --surface: #0d1520; --surface-2: #152030; --ink: #f0f2f5; --ink-2: #a9b3c1;
    --line: #2a3747; --accent: #8db4ec; --accent-ink: #0d1520; --accent-soft: #17293f; --link: #8db4ec;
    --red: #f0788f; --navy: #0a2447; --gold: #e3b75a; --warn: #f0b45b; --warn-soft: #33290f;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
h3 { font-size: 1.1rem; font-family: var(--sans); font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-top: 4px solid var(--navy); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; display: flex; gap: 10px; align-items: center; }
.brand-mark { width: 28px; height: 28px; border-radius: 3px; background: var(--navy); display: grid; place-items: center; color: #fff; }
.nav { display: flex; gap: 2px; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; font-size: .95rem; font-weight: 600; border-bottom: 3px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav .cta { background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); border-bottom: 0; margin-left: 8px; }
.nav .cta:hover { filter: brightness(1.12); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; color: var(--ink); font: inherit; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav .cta { margin: 8px 0 0; text-align: center; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: var(--radius); border: 2px solid transparent; font: 700 1rem var(--sans); text-decoration: none; cursor: pointer; min-height: 46px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Hero */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 64px); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.eyebrow { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: 10px; }
.lede { font-size: clamp(1.1rem, 2.2vw, 1.25rem); color: var(--ink-2); max-width: 680px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.pledge { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 6px 0; font-size: .92rem; color: var(--ink-2); }
.pill:not(:last-child)::after { content: ""; display: inline-block; width: 1px; height: .9em; background: var(--line); margin: 0 14px; vertical-align: -1px; }
@media (max-width: 600px) { .pledge { gap: 6px 18px; } .pill::after { display: none !important; } }

/* Sections */
section { padding: clamp(40px, 7vw, 72px) 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 28px; }
.grid { display: grid; gap: 24px 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 8px; }
.card { border-top: 1px solid var(--line); padding-top: 16px; }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--ink-2); font-size: .95rem; }
.card p:last-child { margin-bottom: 0; }
.stat { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 8px; }

/* Arguments */
.argument { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .argument { grid-template-columns: 5fr 7fr; gap: 56px; } }
.claims { list-style: none; padding: 0; margin: 0; }
.claims li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.claims li:first-child { padding-top: 0; }
.claims li strong { display: block; margin-bottom: 2px; }
.src { font-size: .82rem; color: var(--ink-2); }
.src a { color: var(--ink-2); }
sup a { text-decoration: none; font-size: .75em; }
.honest { margin-top: 20px; padding: 2px 0 2px 16px; border-left: 4px solid var(--gold); font-size: .95rem; color: var(--ink-2); }
.honest strong { color: var(--ink); }

details.sources { margin-top: 12px; }
details.sources summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; }
ol.reflist { font-size: .85rem; color: var(--ink-2); padding-left: 1.4em; }
ol.reflist li { margin-bottom: 6px; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: var(--navy); color: #c9d5e8; padding: 40px 0; font-size: .92rem; border-top: 4px solid var(--red); }
.site-footer a { color: #fff; }
.site-footer .wrap { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.site-footer h4 { margin: 0 0 8px; color: #fff; font-size: .95rem; }

/* Reps tool */
.tool { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .tool { grid-template-columns: 420px 1fr; align-items: start; } .tool .results { max-height: calc(100vh - 100px); overflow: auto; position: sticky; top: 76px; } }
#map { height: clamp(320px, 55vh, 620px); border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); z-index: 0; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input { flex: 1 1 220px; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; font: inherit; background: var(--surface); color: var(--ink); }
.search input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.notice { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0; padding: 12px 14px; font-size: .92rem; margin: 12px 0; }
.notice.warn { background: var(--warn-soft); }
.error { color: var(--warn); font-weight: 600; margin-top: 10px; }
.member { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.member-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.member-head img { width: 56px; height: 68px; object-fit: cover; border-radius: 8px; background: var(--surface-2); flex: none; }
.member-head h3 { margin: 0; }
.member-meta { font-size: .9rem; color: var(--ink-2); }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); margin-left: 4px; }
.scores { display: grid; gap: 8px; margin: 10px 0 14px; }
.score { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: .9rem; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--surface-2); position: relative; overflow: hidden; }
.bar span { position: absolute; top: 0; bottom: 0; left: 50%; border-radius: 999px; }
.bar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--line); }
.lbl { font-weight: 600; }
.member details { margin-top: 10px; }
.member summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.evidence { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; font-size: .9rem; }
.evidence li { border-left: 3px solid var(--line); padding-left: 10px; }
textarea.msg { width: 100%; min-height: 260px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font: .92rem/1.5 var(--sans); background: var(--surface-2); color: var(--ink); resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions .btn { min-height: 40px; padding: 8px 14px; font-size: .92rem; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: .85rem; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.1); }
.leaflet-container { font: inherit; }

/* ---- Environment page ---------------------------------------------------- */
:root { --bad: var(--red); --neutral-bar: #c3c9d2; }
@media (prefers-color-scheme: dark) { :root { --neutral-bar: #3d4a5c; } }

.firm { border-left: 4px solid var(--ink); padding: 4px 0 4px 16px; font-family: var(--serif); font-size: clamp(1.15rem, 2.4vw, 1.4rem); font-weight: 600; line-height: 1.35; margin: 24px 0; }
.figure { border-top: 1px solid var(--line); padding: 24px 0 8px; margin: 28px 0; }
.figure h3 { margin-bottom: 4px; }
.figure .sub { color: var(--ink-2); font-size: .92rem; margin-bottom: 18px; }
.figure figcaption, .figure .cap { font-size: .82rem; color: var(--ink-2); margin-top: 14px; }
.figure details { margin-top: 10px; font-size: .88rem; }
.figure details summary { cursor: pointer; color: var(--ink-2); }
.figure table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.figure th, .figure td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.figure td.n, .figure th.n { text-align: right; }

/* Community impact table (home #local): hairline rules; stacks into labeled rows on phones */
.figure table.impact { font-size: .92rem; margin-top: 0; font-variant-numeric: normal; }
.impact th, .impact td { vertical-align: top; padding: 10px 12px 10px 0; }
.impact thead th { font-size: .8rem; font-weight: 600; color: var(--ink-2); border-bottom-color: var(--ink-2); }
.impact tbody th { font-weight: 700; width: 20%; }
.impact tbody th span { display: block; font-weight: 400; font-size: .82rem; color: var(--ink-2); }
@media (max-width: 640px) {
  .impact thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .impact, .impact tbody, .impact tr, .impact th, .impact td { display: block; width: auto; }
  .impact tr { border-top: 1px solid var(--ink-2); padding: 10px 0 4px; }
  .impact tbody th, .impact td { border-bottom: 0; padding: 4px 0; width: auto; }
  .impact td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
}
#better { scroll-margin-top: 84px; }
/* Group labels inside a claims column (home #compute) */
h3.group { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 32px 0 14px; }
h3.group:first-child { margin-top: 0; }

/* Horizontal bars: one baseline, thin marks, value at the tip */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 4px 12px; align-items: center; border-radius: 6px; padding: 2px 0; }
.hbars li:focus-visible { outline-offset: 4px; }
.hbars .lab { font-size: .92rem; }
.hbars .track { position: relative; height: 20px; display: flex; align-items: center; gap: 8px; }
.hbars .bar-fill { height: 16px; min-width: 2px; width: calc(var(--v) * (100% - 84px)); background: var(--neutral-bar); border-radius: 0 4px 4px 0; flex: none; }
.hbars .val { font-size: .85rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbars li.me .lab { font-weight: 700; }
.hbars li.me .bar-fill { background: var(--accent); }
.hbars li.me .val { color: var(--ink); font-weight: 600; }
.hbars li:hover .bar-fill { filter: brightness(.92); }
@media (max-width: 560px) { .hbars li { grid-template-columns: 1fr; } }

.chart-tip { position: absolute; z-index: 200; max-width: 280px; background: var(--ink); color: var(--bg); font-size: .82rem; line-height: 1.4; padding: 8px 10px; border-radius: 8px; pointer-events: none; box-shadow: var(--shadow); }

/* Dot grids (1 dot = a fixed share of a whole) */
.dots { display: grid; grid-template-columns: repeat(50, 1fr); gap: 2px; max-width: 560px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--neutral-bar); opacity: .55; }
.dots i.on { background: var(--accent); opacity: 1; }
.dots i.part { opacity: 1; background: linear-gradient(90deg, var(--accent) var(--p), var(--neutral-bar) var(--p)); }
@media (max-width: 560px) { .dots { grid-template-columns: repeat(25, 1fr); } }
.dot-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; color: var(--ink-2); margin-top: 12px; }
.dot-key span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: var(--neutral-bar); }
.dot-key span.on::before { background: var(--accent); }

/* Equation comparison */
.eqc { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .eqc { grid-template-columns: 1fr 1fr; } }
.eqc-col { padding-top: 12px; }
.eqc-col.bad { border-top: 3px solid var(--bad); }
.eqc-col.good { border-top: 3px solid var(--accent); }
.eqc-col h4 { margin: 0 0 2px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.eqc-col.bad h4 { color: var(--bad); }
.eqc-col.good h4 { color: var(--accent); }
.eqc-col .who { font-size: .85rem; color: var(--ink-2); margin-bottom: 12px; }
.eq { list-style: none; margin: 0; padding: 0; display: grid; }
.eq li { display: grid; grid-template-columns: 28px 1fr; align-items: baseline; gap: 2px 8px; padding: 9px 8px; border-bottom: 1px solid var(--line); outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .15s, background .15s; cursor: default; }
.eq .op { font: 700 1.05rem var(--sans); color: var(--ink-2); text-align: center; }
.eq .t { font-size: .9rem; }
.eq .t b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .98rem; font-weight: 600; display: block; overflow-wrap: anywhere; }
.eq li.changed { background: var(--warn-soft); }
.eqc-col.bad .eq li.changed b { color: var(--bad); }
.eqc-col.good .eq li.changed { background: var(--accent-soft); }
.eqc-col.good .eq li.changed b { color: var(--accent); }
.eq li .why { grid-column: 2; font-size: .8rem; color: var(--ink-2); }
.eq li.hl { outline-color: var(--gold); }
.eq li.result { border-top: 2px solid var(--ink); border-bottom: 0; padding-top: 12px; }
.eq li.result b { font-family: var(--sans); font-size: 1.35rem; }
.eqc-col.bad .eq li.result b { color: var(--bad); }
.eqc-col.good .eq li.result b { color: var(--accent); }
/* Ratio bars under each equation: label | bar from a shared baseline | value.
   Fixed label and value columns keep the baseline at the same x in both columns,
   and bars use one scale across the pair so the two sides compare directly. */
.ratio { margin-top: 16px; display: grid; gap: 8px; align-self: start; font-size: .82rem; color: var(--ink-2); }
.ratio > div { display: grid; grid-template-columns: 88px 1fr 7.5em; gap: 10px; align-items: center; }
.ratio .track { display: flex; align-items: center; height: 18px; border-left: 1px solid var(--ink-2); }
.ratio span.b { height: 14px; border-radius: 0 3px 3px 0; background: var(--neutral-bar); width: calc(var(--v) * 100%); min-width: 2px; }
.ratio span.b.me { background: var(--accent); }
.ratio .val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.ratio .me-row .lab, .ratio .me-row .val { font-weight: 600; color: var(--ink); }
/* Side by side: both columns share one row grid (subgrid), so every equation line,
   the result and the bars sit on the same horizontal line in both versions. */
@media (min-width: 820px) {
  /* rows per column: heading, source line, n equation lines, bars */
  .eqc { --n: 3; --rows: 6; grid-auto-flow: column; column-gap: 28px; row-gap: 0; }
  .eqc:has(.eq > li:nth-child(4)) { --n: 4; --rows: 7; }
  .eqc:has(.eq > li:nth-child(5)) { --n: 5; --rows: 8; }
  .eqc-col { display: grid; grid-template-rows: subgrid; grid-row: span var(--rows); }
  .eqc-col .eq { grid-template-rows: subgrid; grid-row: span var(--n); }
}
.eq-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .82rem; color: var(--ink-2); margin-top: 12px; }
.eq-legend span:not(.scale)::before { content: ""; display: inline-block; width: 22px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -2px; background: linear-gradient(90deg, var(--warn-soft) 50%, var(--accent-soft) 50%); border: 1px solid var(--line); }

/* Prompt calculator */
.prompt-calc .pc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.prompt-calc button { font: 600 .9rem var(--sans); padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 40px; }
.prompt-calc button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pc-big { font: 700 clamp(2.4rem, 7vw, 3.6rem)/1 var(--sans); }
.pc-big small { font-size: 1rem; font-weight: 500; color: var(--ink-2); margin-left: 8px; }
.pc-note { font-size: .88rem; color: var(--ink-2); margin: 6px 0 14px; min-height: 1.4em; }
.pc-grid { display: grid; grid-template-columns: repeat(40, 1fr); gap: 2px; max-width: 520px; }
.pc-grid i { aspect-ratio: 1; border-radius: 50%; background: var(--accent); }
.pc-grid[data-capped="true"]::after { content: "+ more"; grid-column: 1 / -1; font-size: .8rem; color: var(--ink-2); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--line); display: grid; gap: 18px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -27px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); }
.timeline li.loss::before { border-color: var(--bad); background: var(--bad); }
.timeline li.win::before { border-color: var(--accent); background: var(--accent); }
.timeline .yr { font: 700 .85rem var(--sans); color: var(--ink-2); letter-spacing: .04em; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.toc a { text-decoration: none; }

/* Change log */
.log-day { padding: 0; margin-top: 32px; }
.log-day h2 { font-size: 1.25rem; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.log-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.log-entry { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 14px 16px; }
.log-entry p { margin: 0 0 6px; }
.log-entry p:last-child { margin-bottom: 0; }
.log-kind { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.log-edited { border-left-color: var(--gold); } .log-edited .log-kind { color: var(--warn); }
.log-removed { border-left-color: var(--red); } .log-removed .log-kind { color: var(--red); }
.log-status { border-left-color: var(--ink-2); } .log-status .log-kind { color: var(--ink-2); }
.log-baseline { border-left-color: var(--line); background: var(--surface-2); }
.log-who { font-weight: 700; }
.log-struck { text-decoration: line-through; color: var(--ink-2); }
.log-diff { margin: 6px 0; padding-left: 1.2em; }
.log-diff del { color: var(--red); } .log-diff ins { color: var(--accent); text-decoration: none; font-weight: 600; }
.log-entry .badge { margin: 0 4px 0 0; }

/* Motion: smooth, quiet, and off for reduced-motion users */
:root { --ease: cubic-bezier(.22, .7, .2, 1); }
section[id], [id^="ref-"] { scroll-margin-top: 84px; }
a, .btn, .nav a { transition: color .2s, background-color .2s, border-color .2s, filter .2s, text-decoration-color .2s; }
.btn:active { transform: translateY(1px); }
.site-header { transition: box-shadow .3s var(--ease); }
.site-header.scrolled { box-shadow: 0 1px 0 var(--line), 0 6px 20px -12px rgba(11, 29, 54, .25); }
.site-header .wrap { transition: min-height .3s var(--ease); }
.site-header.scrolled .wrap { min-height: 56px; }
.nav a.active { border-bottom-color: var(--accent); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
@media (max-width: 760px) { .site-header.scrolled .wrap { min-height: 64px; } }

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease) var(--d, 0ms), transform .8s var(--ease) var(--d, 0ms); }
  [data-reveal].in { opacity: 1; transform: none; }
  .claims > li[data-reveal] { transform: translateY(10px); }
  .honest[data-reveal] { transform: none; clip-path: inset(0 100% 0 0); transition: opacity .6s var(--ease) .15s, clip-path .9s var(--ease) .1s; }
  .honest[data-reveal].in { clip-path: inset(0 0 0 0); }
  .card[data-reveal] { border-top-color: transparent; transition: opacity .8s var(--ease) var(--d, 0ms), transform .8s var(--ease) var(--d, 0ms), border-color .9s var(--ease) calc(var(--d, 0ms) + 200ms); }
  .card[data-reveal].in { border-top-color: var(--line); }
  .figure:not(.in) .bar-fill, .figure:not(.in) .ratio span.b { transform: scaleX(0); }
  .figure .bar-fill, .figure .ratio span.b { transform-origin: 0 50%; transition: transform 1s var(--ease) .25s; }
}

/* ---- Care-gap chart (#care) ------------------------------------------------ */
.care-gap { --cg-need: #005ea2; --cg-catch: #c05600; --cg-track: var(--ink-2); --cg-gap: var(--red); margin-top: 40px; }
@media (prefers-color-scheme: dark) { .care-gap { --cg-need: #3d8ee0; --cg-catch: #d9732a; } }
.cg-legend { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .85rem; color: var(--ink-2); }
.cg-legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 8px; }
.cg-legend .k-need { border-color: var(--cg-need); }
.cg-legend .k-track { border-color: var(--cg-track); }
.cg-legend .k-catch { border-color: var(--cg-catch); }
.cg-legend .k-gap { height: 12px; border: 0; border-radius: 2px; background: color-mix(in srgb, var(--cg-gap) 14%, transparent); vertical-align: -2px; }
.cg-plot { position: relative; }
.cg-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.cg-svg:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.cg-grid { stroke: var(--line); stroke-width: 1; }
.cg-grid.base { stroke: var(--ink-2); }
.cg-tick { fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.cg-gap { fill: var(--cg-gap); fill-opacity: .1; }
.cg-need, .cg-track, .cg-catch { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cg-need { stroke: var(--cg-need); }
.cg-track { stroke: var(--cg-track); }
.cg-track.ext { stroke-dasharray: 5 4; stroke-linecap: butt; }
.cg-catch { stroke: var(--cg-catch); }
.cg-pnr { stroke: var(--red); stroke-width: 2; }
.cg-pnr-label { fill: var(--ink); font-size: 13px; font-weight: 700; }
.cg-end, .cg-inline { fill: var(--ink-2); font-size: 12px; }
.cg-end .v { fill: var(--ink); font-weight: 700; }
.cg-bracket { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.cg-cross { stroke: var(--ink-2); stroke-width: 1; }
.cg-dot { stroke: var(--surface); stroke-width: 2; }
.cg-dot.need { fill: var(--cg-need); }
.cg-dot.track { fill: var(--cg-track); }
.cg-dot.catch { fill: var(--cg-catch); }
.cg-hit { cursor: crosshair; }
.cg-tip { position: absolute; z-index: 5; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; font-size: .82rem; line-height: 1.5; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.cg-tip .yr { font-weight: 700; margin-bottom: 2px; }
.cg-tip .r { display: grid; grid-template-columns: 14px auto 1fr; gap: 8px; align-items: center; }
.cg-tip .r i { width: 14px; height: 0; border-top: 2px solid; }
.cg-tip .r b { font-variant-numeric: tabular-nums; }
.cg-tip .r span { color: var(--ink-2); }
.cg-tip .need i { border-color: var(--cg-need); } .cg-tip .track i { border-color: var(--cg-track); }
.cg-tip .catch i { border-color: var(--cg-catch); }
.cg-tip .gap i { height: 8px; border: 0; background: color-mix(in srgb, var(--cg-gap) 25%, transparent); }
.care-gap figcaption p { margin-bottom: .6em; }
.care-gap figcaption p:last-child { margin-bottom: 0; }
.care-gap figcaption strong { color: var(--ink); }

/* ---- Home-page figures ------------------------------------------------------
   Flat, labeled charts that sit inside an .argument column. Every value is printed;
   tooltips (charts.js) only add scope and source detail. */
:root { --neutral-2: #8d95a1; --accent-2: #6d8fbf; }
@media (prefers-color-scheme: dark) { :root { --neutral-2: #6a7889; --accent-2: #4f74a8; } }
.argument .figure { margin: 32px 0 0; }
.argument .figure + .figure { margin-top: 8px; }
/* The last claim's bottom rule already divides it from a following chart. */
.claims + .figure { border-top: 0; margin-top: 0; }
.figure h4 { font: 700 .82rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 18px 0 8px; }
.figure h4:first-of-type { margin-top: 0; }
.hbars.solid li { grid-template-columns: 64px 1fr; }
.hbars.solid .bar-fill { background: var(--accent); width: calc(var(--v) * (100% - 112px)); }
@media (max-width: 560px) { .hbars.solid li { grid-template-columns: 64px 1fr; } }
.hbars.solid li.capped .val::after { content: " cap"; font-size: .75rem; color: var(--ink-2); font-weight: 400; }

/* Segmented bars: one row = one whole, split into labeled parts */
.srows { display: grid; gap: 18px; }
.srow-lab { font-size: .92rem; margin-bottom: 6px; }
.srow-lab b { font-weight: 700; }
.srow-lab span { color: var(--ink-2); }
.sbar { display: flex; gap: 2px; height: 22px; }
.sbar > span { flex: var(--w) 1 0; min-width: 3px; background: var(--neutral-bar); }
.sbar > span:first-child { border-radius: 4px 0 0 4px; }
.sbar > span:last-child { border-radius: 0 4px 4px 0; }
.sbar > span.on { background: var(--accent); }
.sbar > span.on2 { background: var(--accent-2); }
.sbar > span.dk { background: var(--neutral-2); }
.sbar > span.open { background: transparent; box-shadow: inset 0 0 0 1px var(--neutral-2); }
.sbar > span[data-tip]:hover, .sbar > span[data-tip]:focus-visible { filter: brightness(.9); }
.srow-note { font-size: .85rem; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.srow-note b { color: var(--ink); }
.seg-key { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.seg-key li { display: grid; grid-template-columns: 14px auto 1fr; gap: 8px; align-items: baseline; }
.seg-key i { width: 12px; height: 12px; border-radius: 2px; background: var(--neutral-bar); align-self: center; }
.seg-key i.on { background: var(--accent); }
.seg-key i.on2 { background: var(--accent-2); }
.seg-key i.dk { background: var(--neutral-2); }
.seg-key i.open { background: transparent; box-shadow: inset 0 0 0 1px var(--neutral-2); }
.seg-key b { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; min-width: 3.2em; }
/* Bracket under part of a bar, e.g. "17 Republicans" */
.brk { position: relative; height: 22px; font-size: .78rem; color: var(--ink-2); }
.brk span { position: absolute; top: 0; left: var(--l); width: var(--w); border-top: 1px solid var(--ink-2); padding-top: 3px; white-space: nowrap; }
.brk span::before, .brk span::after { content: ""; position: absolute; top: -5px; height: 5px; border-left: 1px solid var(--ink-2); }
.brk span::before { left: 0; } .brk span::after { right: 0; }

/* 10 x 10 dot squares: "6 of every 100" */
.waffles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px 28px; }
.waffle .dots { grid-template-columns: repeat(10, 1fr); gap: 3px; max-width: 170px; }
.waffle .dots i { opacity: .45; }
.waffle .dots i.on { opacity: 1; }
.waffle .big { font: 700 2rem/1 var(--sans); margin: 10px 0 4px; }
.waffle p { font-size: .85rem; color: var(--ink-2); margin: 0; }
@media (max-width: 560px) { .waffle .dots { grid-template-columns: repeat(10, 1fr); } }

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .figure .sbar { transition: clip-path 1.1s var(--ease) .25s; }
  .figure:not(.in) .sbar { clip-path: inset(0 100% 0 0); }
  .figure .waffle .dots i.on { transition: opacity .5s var(--ease) calc(.3s + var(--i, 0) * 60ms); }
  .figure:not(.in) .waffle .dots i.on { opacity: .45; }
}
