/* ============================================================
   The Agency Industrial Complex, 2035 — FT "Big Read" edition
   Serif body, sans furniture, salmon paper, hand-built charts.
   ============================================================ */
:root {
  --paper: #fff1e5;        /* FT salmon */
  --paper-2: #fbe9d9;      /* slightly deeper panel */
  --ink: #1a1817;
  --ink-soft: #3f3a36;
  --ink-faint: #6b635c;
  --line: #e6d4c3;
  --line-strong: #d8c3ae;
  --claret: #990f3d;       /* FT claret — headline accent / highlight */
  --teal: #0d7680;         /* FT teal — links */
  --creative: #990f3d;     /* hedge fund */
  --media: #0f5499;        /* endowment (FT oxford blue) */
  --chart-bar: #0f5499;
  --chart-bar-soft: #cfe0ef;
  --hl-yellow: #ffe49b;
  --hl-pink: #f6c9d8;
  --hl-blue: #bfdcef;
  --hl-green: #c2e6c8;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --measure: 680px;
  --shadow: 0 1px 2px rgba(26,24,23,.05), 0 10px 34px rgba(26,24,23,.08);
  --text-halo: transparent;
}
[data-theme="dark"] {
  --paper: #1b1714;
  --paper-2: #241f1b;
  --ink: #f3ebe2;
  --ink-soft: #cdc2b7;
  --ink-faint: #968b80;
  --line: #3a322b;
  --line-strong: #4a4038;
  --claret: #f06591;
  --teal: #4ec3cc;
  --creative: #f06591;
  --media: #6fa8dc;
  --chart-bar: #6fa8dc;
  --chart-bar-soft: #2c3c4e;
  --hl-yellow: #6a5a1f;
  --hl-pink: #6a3346;
  --hl-blue: #244a66;
  --hl-green: #245038;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 36px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 20px; line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .35s ease, color .35s ease;
  text-shadow: 0 1px 16px var(--text-halo);
}
::selection { background: var(--hl-yellow); }

/* ---------- progress + masthead ---------- */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--claret); z-index: 60; transition: width .1s linear;
}
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead-inner {
  max-width: 1080px; margin: 0 auto; padding: 11px 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-eyebrow {
  font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: .02em;
  color: var(--claret); text-decoration: none;
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  height: 36px; padding: 0 15px; border-radius: 8px;
  background: var(--claret); color: #fff; border: 1px solid var(--claret);
  transition: opacity .16s ease, transform .12s ease;
}
.share-btn:hover { opacity: .9; }
.share-btn:active { transform: scale(.97); }
.share-btn svg { stroke: #fff; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); color: var(--ink-soft);
  transition: all .18s ease;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.notes-count {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--claret); color: #fff; font-family: var(--sans); font-size: 10.5px;
  font-weight: 700; line-height: 17px; border-radius: 9px; text-align: center; display: none;
}
.notes-count.show { display: block; }

/* ---------- article shell ---------- */
.paper { max-width: var(--measure); margin: 0 auto; padding: 0 22px 80px; position: relative; z-index: 1; }

/* ---------- disclaimer ---------- */
.disclaimer {
  font-family: var(--sans); font-size: 12px; line-height: 1.5; font-style: italic;
  color: var(--ink-faint); margin: 0; padding-top: 18px;
}

/* ---------- headline block ---------- */
.headline-block { padding: 30px 0 0; }
.kicker {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em;
  font-size: 12.5px; font-weight: 700; color: var(--claret); margin: 0 0 18px;
}
.headline-block h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2.3rem, 6vw, 3.5rem);
  line-height: 1.08; letter-spacing: -.012em; margin: 0 0 22px;
}
.standfirst {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.15rem, 2.6vw, 1.42rem);
  line-height: 1.5; color: var(--ink-soft); margin: 0 0 24px;
}
.byline {
  font-family: var(--sans); font-size: 14px; color: var(--ink-faint);
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 20px;
}
.byline .by { color: var(--ink); font-weight: 600; }
.meta-dot { opacity: .5; }
.reader-hint {
  font-family: var(--sans); font-size: 13px; color: var(--ink-faint); line-height: 1.5;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 15px; margin: 0;
}
.reader-hint strong { color: var(--ink-soft); font-weight: 600; }
.reader-hint a { color: var(--teal); }

/* lead image */
.hero-figure { margin: 28px 0 6px; }
@media (min-width: 1040px) { .hero-figure { width: calc(100% + 160px); margin-left: -80px; } }
.hero-figure img {
  width: 100%; height: auto; display: block; border-radius: 4px;
  box-shadow: var(--shadow); background: var(--paper-2);
}
.hero-figure figcaption {
  font-family: var(--sans); font-size: 12.5px; line-height: 1.5; color: var(--ink-faint);
  margin-top: 10px; padding-left: 2px;
}
.hero-figure .hero-cap { color: var(--ink-soft); }
.hero-figure .hero-credit { display: inline; }
@media (min-width: 1040px) { .hero-figure figcaption { padding-left: 80px; } }

.rule-thin { height: 1px; background: var(--line-strong); margin: 30px 0; }

/* ---------- body ---------- */
.body { font-size: 20px; }
.body p { margin: 0 0 24px; }
.lead { font-size: 1.08em; }
.lead::first-letter {
  initial-letter: 3; -webkit-initial-letter: 3;
  font-weight: 700; color: var(--claret); margin-right: 10px;
  font-family: var(--serif);
}
@supports not (initial-letter: 3) {
  .lead::first-letter { font-size: 3.4em; line-height: .9; float: left; padding: 6px 10px 0 0; font-weight: 700; color: var(--claret); }
}

a.src {
  font-family: var(--sans); font-size: .58em; vertical-align: super; line-height: 0;
  color: var(--claret); font-weight: 700; text-decoration: none; padding: 0 1px 0 2px;
  cursor: pointer;
}
a.src:hover { text-decoration: underline; }

.emphasis-line {
  font-weight: 600; font-size: 1.02em; padding-left: 18px;
  border-left: 3px solid var(--line-strong); color: var(--ink);
}

.crosshead {
  font-family: var(--serif); font-weight: 700; font-size: clamp(1.4rem, 3.4vw, 1.85rem);
  line-height: 1.15; letter-spacing: -.01em; margin: 48px 0 22px; padding-top: 8px;
}
.closing-line { font-style: italic; color: var(--ink-soft); }

.pull {
  margin: 36px 0; padding: 0 0 0 22px; border: 0; position: relative;
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 3.8vw, 2.05rem);
  line-height: 1.2; letter-spacing: -.015em; color: var(--ink);
}
.pull::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  background: var(--claret);
}
.pull.last { color: var(--claret); font-style: italic; }

/* ---------- figures / charts ---------- */
.chart {
  margin: 40px 0; padding: 0; border-top: 2px solid var(--ink);
  padding-top: 16px;
}
.chart.wide, .compare { margin: 44px 0; }
@media (min-width: 1040px) {
  .chart.wide, .compare { width: calc(100% + 160px); margin-left: -80px; }
}
.chart-head { margin-bottom: 16px; }
.chart-kicker {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .1em;
  font-size: 11px; font-weight: 700; color: var(--claret);
}
.chart-title {
  font-family: var(--sans); font-weight: 700; font-size: 18px; line-height: 1.25;
  margin: 4px 0 3px; color: var(--ink); letter-spacing: -.01em;
}
.chart-sub {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink-faint); margin: 0; line-height: 1.4;
}
.chart-svg { width: 100%; }
.chart-svg svg { width: 100%; height: auto; display: block; }
.chart-source {
  font-family: var(--sans); font-size: 11.5px; color: var(--ink-faint); line-height: 1.45;
  margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line);
}

/* svg chart element styling (classes emitted by app.js) */
.ch-bar { fill: var(--chart-bar); }
.ch-bar.hl { fill: var(--claret); }
.ch-bar-creative { fill: var(--creative); }
.ch-bar-media { fill: var(--media); }
.ch-label { font-family: var(--sans); font-size: 16px; fill: var(--ink); }
.ch-label.muted { fill: var(--ink-faint); }
.ch-value { font-family: var(--sans); font-size: 16px; font-weight: 700; fill: var(--ink); }
.ch-value.hl { fill: var(--claret); }
.ch-axis { stroke: var(--ink); stroke-width: 1.4; }
.ch-grid { stroke: var(--line-strong); stroke-width: 1; }
.ch-tick { font-family: var(--sans); font-size: 14px; fill: var(--ink-faint); }
.ch-area-c { fill: var(--creative); opacity: .12; }
.ch-line-c { stroke: var(--creative); stroke-width: 2.5; fill: none; }
.ch-dot { fill: var(--claret); }
.ch-q-axis { stroke: var(--line-strong); stroke-width: 1.4; }
.ch-q-zone { font-family: var(--sans); font-size: 13px; fill: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
.ch-q-pt-c { fill: var(--creative); }
.ch-q-pt-m { fill: var(--media); }
.ch-q-name { font-family: var(--sans); font-weight: 700; font-size: 16px; }
.ch-q-tag { font-family: var(--sans); font-size: 13.5px; fill: var(--ink-faint); }
.ch-q-axislabel { font-family: var(--sans); font-size: 14px; fill: var(--ink-soft); font-weight: 600; }
.ch-annot { font-family: var(--sans); font-size: 14px; font-weight: 700; fill: var(--claret); }

/* ---------- comparison table ---------- */
.compare table {
  width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14.5px;
  border-top: 2px solid var(--ink);
}
.compare th, .compare td { text-align: left; padding: 13px 14px; vertical-align: top; line-height: 1.4; }
.compare thead th { border-bottom: 1px solid var(--line-strong); }
.compare thead .c-dim { width: 22%; }
.compare .c-type { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); font-weight: 700; }
.compare .c-class { display: block; font-size: 16px; font-weight: 700; }
.compare thead .c-creative .c-class { color: var(--creative); }
.compare thead .c-media .c-class { color: var(--media); }
.compare tbody th { font-weight: 600; color: var(--ink); width: 22%; }
.compare tbody td { color: var(--ink-soft); }
.compare tbody tr { border-bottom: 1px solid var(--line); }
.compare tbody td em, .compare tbody th em { font-style: normal; font-weight: 700; color: var(--ink); }
.compare .c-span { text-align: center; font-weight: 600; color: var(--claret); }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 0; }
@media (min-width: 720px) { .timeline { grid-template-columns: repeat(3, 1fr); } }
.tl-node { position: relative; padding: 0 0 30px 26px; cursor: pointer; }
@media (min-width: 720px) { .tl-node { padding: 34px 16px 0; text-align: center; } }
.tl-year { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .06em; color: var(--claret); }
.tl-dot { position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 3px solid var(--claret); z-index: 2; }
@media (min-width: 720px) { .tl-dot { left: 50%; top: 0; margin-left: -6px; } }
.tl-node::before { content: ""; position: absolute; background: var(--line-strong); left: 5px; top: 12px; bottom: 0; width: 2px; }
@media (min-width: 720px) {
  .tl-node::before { left: 0; right: 0; top: 5px; bottom: auto; width: auto; height: 2px; }
  .tl-node:first-child::before { left: 50%; }
  .tl-node:last-child::before { right: 50%; }
}
.tl-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-top: 10px; transition: transform .18s ease, border-color .18s ease; }
.tl-node:hover .tl-card { transform: translateY(-3px); border-color: var(--claret); }
.tl-card h3 { font-family: var(--serif); margin: 0 0 5px; font-size: 18px; font-weight: 700; }
.tl-card p { font-family: var(--sans); margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- further reading ---------- */
.further { margin-top: 60px; }
.further-title { font-family: var(--serif); font-weight: 700; font-size: 1.6rem; margin: 0 0 6px; }
.further-intro { font-family: var(--sans); font-size: 14px; color: var(--ink-faint); margin: 0 0 24px; line-height: 1.5; }
.source-groups { display: grid; gap: 14px; }
.src-group {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; scroll-margin-top: 84px;
}
.src-group.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%,100% { border-color: var(--line); } 30% { border-color: var(--claret); } }
.src-group h4 { font-family: var(--sans); margin: 0 0 4px; font-size: 14.5px; font-weight: 700; }
.src-group h4 .sg-num { color: var(--claret); }
.src-claim { font-family: var(--serif); font-style: italic; font-size: 14.5px; color: var(--ink-faint); margin: 0 0 12px; line-height: 1.45; }
.src-links { display: grid; gap: 6px; }
.src-link {
  font-family: var(--sans); display: flex; align-items: center; gap: 9px; text-decoration: none;
  color: var(--teal); font-size: 14px; padding: 6px 8px; border-radius: 7px; transition: background .15s ease;
}
.src-link:hover { background: var(--paper); }
.src-out { color: var(--teal); flex: none; }
.src-link .outlet { color: var(--ink-faint); font-size: 12px; margin-left: auto; flex: none; }

/* ---------- footer ---------- */
.article-foot { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); text-align: center; }
.article-foot p { font-family: var(--sans); font-size: 13px; color: var(--ink-faint); margin: 0 0 14px; }

/* ---------- buttons ---------- */
.ghost-btn {
  font-family: var(--sans); background: transparent; border: 1px solid var(--line-strong);
  color: var(--ink-soft); border-radius: 8px; padding: 8px 15px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all .16s ease;
}
.ghost-btn:hover { background: var(--paper-2); color: var(--ink); }
.ghost-btn.sm { padding: 6px 12px; font-size: 13px; }
.ghost-btn.danger { color: #b3261e; border-color: #e3b1ab; }
.ghost-btn.danger:hover { background: #f8e3e0; }
[data-theme="dark"] .ghost-btn.danger { color: #ff8b82; border-color: #5a2b27; }
[data-theme="dark"] .ghost-btn.danger:hover { background: #2a1715; }
.primary-btn {
  font-family: var(--sans); background: var(--claret); border: 1px solid var(--claret); color: #fff;
  border-radius: 8px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: opacity .16s ease;
}
.primary-btn:hover { opacity: .9; }
.primary-btn.sm { padding: 7px 16px; font-size: 13px; }

/* ---------- highlights ---------- */
mark.hl { border-radius: 2px; padding: 1px 0; cursor: pointer; color: inherit; transition: filter .15s ease; }
mark.hl:hover { filter: brightness(.95); }
mark.hl.has-note { box-shadow: inset 0 -2px 0 var(--claret); }
mark.hl-yellow { background: var(--hl-yellow); }
mark.hl-pink { background: var(--hl-pink); }
mark.hl-blue { background: var(--hl-blue); }
mark.hl-green { background: var(--hl-green); }

/* ---------- selection popover ---------- */
.sel-popover {
  position: absolute; z-index: 70; display: none; align-items: center; gap: 6px;
  background: var(--ink); padding: 7px 9px; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.32);
}
.sel-popover.show { display: flex; }
.sel-popover::after { content: ""; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.swatch { width: 21px; height: 21px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.swatch:hover { transform: scale(1.12); }
.sw-yellow { background: #ffe49b; } .sw-pink { background: #f6c9d8; } .sw-blue { background: #bfdcef; } .sw-green { background: #c2e6c8; }
.sel-popover .sep { width: 1px; height: 19px; background: rgba(255,255,255,.2); }
.pop-text { font-family: var(--sans); background: transparent; border: 0; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.pop-text:hover { background: rgba(255,255,255,.12); }

/* ---------- notes drawer ---------- */
.notes-drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(420px, 90vw); z-index: 90;
  background: var(--paper); border-left: 1px solid var(--line-strong); box-shadow: -10px 0 40px rgba(0,0,0,.14);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column;
}
.notes-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-family: var(--serif); margin: 0; font-size: 19px; font-weight: 700; }
.drawer-actions { display: flex; gap: 8px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.notes-list { flex: 1; overflow-y: auto; padding: 14px 18px; }
.notes-empty { font-family: var(--sans); padding: 30px 24px; color: var(--ink-faint); font-size: 14px; text-align: center; line-height: 1.6; }
.note-item { border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px 13px 19px; margin-bottom: 11px; cursor: pointer; position: relative; transition: border-color .15s ease, transform .15s ease; }
.note-item:hover { border-color: var(--line-strong); transform: translateX(-2px); }
.note-swatch { position: absolute; left: 0; top: 13px; bottom: 13px; width: 4px; border-radius: 4px; }
.ni-quote { font-family: var(--serif); font-size: 15px; color: var(--ink); line-height: 1.45; margin: 0 0 6px; }
.ni-note { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 0; padding-top: 6px; border-top: 1px dashed var(--line); }
.ni-meta { font-family: var(--sans); font-size: 11px; color: var(--ink-faint); margin-top: 8px; }

.scrim { position: fixed; inset: 0; background: rgba(26,18,10,.4); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .26s ease; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ---------- note modal ---------- */
.note-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 22px; }
.note-modal.show { display: flex; }
.note-modal-inner { background: var(--paper); border: 1px solid var(--line-strong); border-radius: 12px; width: min(480px, 100%); padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.nm-quote { font-family: var(--serif); font-size: 15px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 14px; padding: 10px 14px; background: var(--paper-2); border-radius: 8px; border-left: 3px solid var(--claret); max-height: 120px; overflow-y: auto; }
#nm-text { font-family: var(--sans); width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; padding: 12px 14px; font-size: 15px; color: var(--ink); background: var(--paper-2); resize: vertical; line-height: 1.5; }
#nm-text:focus { outline: 2px solid var(--claret); outline-offset: 1px; border-color: transparent; }
.nm-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 10px; }
.nm-right { display: flex; gap: 8px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  font-family: var(--sans); background: var(--ink); color: var(--paper); padding: 11px 20px;
  border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 110; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; box-shadow: 0 8px 30px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   WHIMSY + collapsible sources
   ============================================================ */
/* closing-line answer cycler */
.guess {
  color: var(--claret); cursor: pointer; border-bottom: 1.5px dotted var(--claret);
  padding-bottom: 1px; border-radius: 2px 2px 0 0; outline: none; transition: background .15s ease;
}
.guess:hover, .guess:focus-visible { background: var(--hl-yellow); }

/* collapsible Further Reading */
.further { margin-top: 0; }
.further summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; }
.further summary::-webkit-details-marker { display: none; }
.further-head-text { display: flex; flex-direction: column; gap: 2px; }
.further summary .further-title { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; margin: 0; }
.further-sub { font-family: var(--sans); font-size: 12.5px; color: var(--ink-faint); }
.further-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans);
  font-size: 13px; font-weight: 600; color: var(--claret); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 6px 13px; transition: background .15s ease, border-color .15s ease;
}
.further summary:hover .further-toggle { background: var(--paper-2); border-color: var(--claret); }
.ft-label { font-size: 0; }
.ft-label::before { content: "Show"; font-size: 13px; }
.further[open] .ft-label::before { content: "Hide"; }
.ft-chev { transition: transform .2s ease; }
.further[open] .ft-chev { transform: rotate(180deg); }
.further-inner { padding-top: 18px; }

/* starry night (fades in toward the bottom) */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .25s linear; }
.star { position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 3px rgba(255,255,255,.7); animation: twinkle var(--tw, 3s) ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .2; } to { opacity: 1; } }

/* surfacing whale (emoji) */
#whale { position: fixed; left: 0; bottom: 11%; z-index: 30; pointer-events: none; opacity: 0; transform: translateX(-90px); font-size: 42px; line-height: 1; user-select: none; }
#whale.swim { animation: whaleSwim 9s linear forwards; }
@keyframes whaleSwim {
  0% { opacity: 0; transform: translateX(-90px) translateY(0); }
  10% { opacity: 1; }
  50% { transform: translateX(46vw) translateY(-16px); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateX(106vw) translateY(0); }
}
@media (prefers-reduced-motion: reduce) { #whale { display: none; } .star { animation: none; opacity: .85; } }

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 600px) {
  body { font-size: 18px; line-height: 1.6; }
  .masthead-inner { padding: 10px 14px; }
  .section-eyebrow { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { gap: 6px; }
  .share-btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .icon-btn { width: 34px; height: 34px; }

  .paper { padding: 0 16px 64px; }
  .headline-block { padding-top: 30px; }
  .headline-block h1 { margin-bottom: 16px; }
  .standfirst { margin-bottom: 18px; }

  .hero-figure { margin: 22px 0 6px; }
  .hero-figure figcaption { font-size: 12px; }

  .body { font-size: 18px; }
  .body p { margin-bottom: 20px; }
  .lead::first-letter { font-size: 3em; }
  .crosshead { margin: 38px 0 18px; }
  .pull { margin: 30px 0; padding-left: 16px; }

  .chart { margin: 32px 0; }
  .chart.wide, .compare { margin: 34px 0; }
  .chart-title { font-size: 16.5px; }

  /* comparison table: compact, fits 3 short columns */
  .compare table { table-layout: fixed; font-size: 12.5px; }
  .compare th, .compare td { padding: 10px 8px; word-wrap: break-word; }
  .compare thead .c-dim, .compare tbody th { width: 26%; }
  .compare .c-class { font-size: 13.5px; }
  .compare .c-type { font-size: 9.5px; }

  .further { margin-top: 48px; }
  .further summary { gap: 12px; }
  .further summary .further-title { font-size: 1.22rem; }
  .further-toggle { padding: 6px 11px; }
  .src-group { padding: 16px 16px; }
  .src-link { font-size: 13.5px; }
  .src-link .outlet { display: none; }

  .notes-drawer { width: 100vw; }
  .note-modal { padding: 14px; }
  .toast { bottom: 18px; width: max-content; max-width: 90vw; }
}

@media (max-width: 380px) {
  /* keep the back-link; collapse the Share label to its icon instead */
  .share-btn span { display: none; }
  .share-btn { padding: 0 10px; }
}

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