:root {
  /* Dark only: the illustrations are night scenes, and the page is the night around them. */
  color-scheme: dark;
  --paper: #0F1322;
  --ink: #E8E2D4;
  --muted: #9C968A;
  --rule: #262C3D;
  --accent: #E8A53A;
  --accent-ink: #F2C37A;
  --night: #0B0F1C;
  --night-text: #ECE6D8;
  --night-muted: #A39D90;
  --gold: #E8A53A;

  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --measure: 34rem;
  --wide: 68rem;
  --gutter: 1.5rem;

  /* Three small arches, the third lit: the cover's doors as an ornament. */
  --doors: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 20'%3E%3Cg fill='none' stroke-width='1.6'%3E%3Cpath d='M6 19V9a5 5 0 0 1 10 0v10' stroke='%23A39D90'/%3E%3Cpath d='M27 19V9a5 5 0 0 1 10 0v10' stroke='%23A39D90'/%3E%3C/g%3E%3Cpath d='M48 19V9a5 5 0 0 1 10 0v10Z' fill='%23E8A53A'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.58;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
/* Phones get ~45 characters a line; wider screens ~62, the comfortable range for long reads.
   Line spacing grows with line length so the eye can find the next line. */
@media (max-width: 40rem) {
  :root { --gutter: 1.25rem; }
}
@media (min-width: 48rem) {
  :root { --measure: 38.5rem; }
  body { font-size: 1.25rem; line-height: 1.65; }
}
@media (min-width: 100rem) {
  :root { --measure: 40rem; }
  body { font-size: 1.3125rem; }
}

img { display: block; width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { color: var(--accent-ink); text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

::selection { background: color-mix(in srgb, var(--gold) 35%, transparent); }

/* Reading progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 10; pointer-events: none; }
.progress span {
  display: block; height: 100%;
  background: var(--gold);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--night);
  color: var(--night-text);
}
.hero-art {
  --frame-ar: 16 / 9;
  --img-ar: 16 / 9;
  margin: 0 auto;
  max-width: 1600px;
}
/* Phones get a taller crop than 16:9, so the doors are not a thin strip, but wide enough
   to give the doors and moon some sky on either side and to leave the title, dek and byline
   on the first screen. */
@media (max-width: 40rem) {
  .hero-art { --frame-ar: 9 / 8; }
  /* The title block shares the article's colour, and the cover's ground fades into it. */
  .hero { background: var(--paper); }
  .hero-art::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 22%;
    background: linear-gradient(to bottom, transparent, var(--paper));
    pointer-events: none;
  }
  .masthead { padding-top: 1.25rem; padding-bottom: 2.5rem; }
  .dek { margin-top: 0.8rem; }
  .byline { margin-top: 1.25rem; }
}
.masthead {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.75rem var(--gutter) 3.25rem;
}
.kicker {
  margin: 0 0 0.75rem;
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.25rem, 12vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.dek {
  margin: 1.1rem 0 0;
  max-width: 24ch;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  line-height: 1.3;
  color: #DCD5C6;
}
.byline {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.75rem 0 0;
  font: 500 0.95rem/1 var(--sans);
  letter-spacing: 0.02em;
  color: var(--night-text);
}
.byline::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: var(--gold);
}

/* On wide screens the title sits in the empty sky of the cover. */
@media (min-width: 60rem) {
  .masthead {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 1;
    max-width: none;
    padding-top: clamp(3rem, 7vw, 6.5rem);
    padding-left: max(var(--gutter), calc((100vw - min(100vw, 1600px)) / 2 + 5vw));
  }
  .masthead > * { max-width: 34rem; }
  h1 { font-size: clamp(4.5rem, 7.5vw, 7.5rem); text-shadow: 0 2px 30px rgba(8, 11, 22, 0.6); }
  .dek { font-size: clamp(1.4rem, 1.9vw, 1.8rem); }
  .hero::after {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 55%;
    background: linear-gradient(to bottom, rgba(8, 11, 22, 0.55), rgba(8, 11, 22, 0));
    pointer-events: none;
  }
}

/* ---------- Article ---------- */
article {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 5.5rem var(--gutter) 4rem;
}
article p { margin: 0 0 1.35em; }

.lede { font-size: 1.12em; line-height: 1.55; }
article > .lede:first-child::first-letter {
  float: left;
  margin: 0.06em 0.1em 0 -0.02em;
  font-family: var(--display);
  font-size: 4.4em;
  line-height: 0.78;
  color: var(--accent);
}

h2 {
  margin: 7rem 0 2.25rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 6vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-align: center;
  text-wrap: balance;
}
h2::before {
  content: "";
  display: block;
  width: 4rem; height: 1.25rem;
  margin: 0 auto 2.5rem;
  background: var(--doors) center / contain no-repeat;
}
h2 .part {
  display: block;
  margin-bottom: 1rem;
  font: 500 0.8rem/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

h3 {
  margin: 3.75rem 0 1.1rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Figures break out of the text column. */
figure { margin: 0; }
article figure.chart { margin: 4.5rem 0; }
figcaption {
  margin-top: 0.85rem;
  padding-inline: var(--gutter);
  font: 400 0.72rem/1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* ---------- Scenes ----------
   Each illustration meets the page differently. The cover is a full-bleed band; the inverse
   plague stands in an arched doorway, the cover's door shape, on a thin sill; the others have
   no frame at all and dissolve into the page. --frame-ar is the visible area, --img-ar the
   artwork; when they differ the art is cropped around --fx (0-1 across its width). */
.hero-art,
.scene-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--frame-ar);
}
.hero-art > img,
.hero-art > svg,
.scene-frame > img,
.scene-frame > svg {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: auto;
  max-width: none;
  aspect-ratio: var(--img-ar);
  transform: translateX(calc(var(--fx, 0.5) * -100%));
}

/* Every scene's subject stays within the text column. Only backgrounds (the flip's city,
   the orb's hills, crowd and stars) carry on past it to the edges of the screen. */
.scene {
  --frame-ar: 16 / 9;
  --img-ar: 16 / 9;
  margin: 5.5rem 0;
}

/* The one doorway. */
.scene--campfire { margin: 10rem 0 11rem; }

.scene--plague {
  --frame-ar: 796 / 900;
  --img-ar: 796 / 900;
  max-width: 27rem;
  margin-inline: auto;
}
.scene--plague .scene-frame {
  background: var(--night);
  border-radius: 50% 50% 0 0 / 44% 44% 0 0;
}
.scene--plague::after {
  content: "";
  display: block;
  height: 4px;
  margin: 0 -0.75rem;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
}

/* The flip, the campfire and the orb have no sky of their own. Each SVG's viewBox frames
   its subject at column width; everything outside the viewBox (the repeated city, forest
   and horde, extended hills and ground, the crowd, stars) is drawn anyway and spills out
   across the page. */
.scene--flip .scene-frame,
.scene--campfire .scene-frame,
.scene--questions .scene-frame {
  overflow: visible;
  aspect-ratio: auto;
}
.scene--flip .scene-frame > svg,
.scene--flip .scene-frame > img,
.scene--campfire .scene-frame > svg,
.scene--campfire .scene-frame > img,
.scene--questions .scene-frame > svg,
.scene--questions .scene-frame > img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  transform: none;
  overflow: visible;
}

@media (max-width: 40rem) {
  .scene { margin: 4rem calc(-1 * var(--gutter)); }
  .scene--plague::after { margin: 0; }
  .scene--plague { max-width: none; }
}

/* Motion blur from the static artwork; the live coin moves for real. */
.is-live .c-ghost, .is-live #cStreaks { display: none; }

/* Quiet loops. Scroll-linked motion lives in scenes.js; both stay off for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .is-live .stars circle:nth-child(3n) { animation: twinkle 5s ease-in-out infinite; }
  .is-live .stars circle:nth-child(3n + 1) { animation: twinkle 7s ease-in-out 2s infinite; }
  .is-live .shoot { animation: shoot 11s ease-out 3s infinite; }
  .is-live .blink { animation: blink 2.4s steps(1) infinite; }
  .is-live .blink--late { animation-delay: 1.2s; }
  .is-live .motes circle { transform-box: fill-box; animation: mote 9s linear infinite; }
  .is-live .motes circle:nth-child(2n) { animation-duration: 12s; animation-delay: -4s; }
  .is-live .motes circle:nth-child(3n) { animation-duration: 15s; animation-delay: -9s; }

  .is-live .hal-glow { animation: hal 4.5s ease-in-out infinite; }

  /* The inverse plague: the old valley's work is human and uneven; the new one's is in lockstep. */
  .is-live #ipSails { transform-origin: 520px 468px; animation: spin 16s linear infinite; }
  .is-live #ipSmoke { transform-box: fill-box; transform-origin: 50% 100%; animation: waver 6s ease-in-out infinite; }
  .is-live #ipBirds { animation: glide 30s ease-in-out infinite alternate; }
  .is-live .reap { transform-box: fill-box; transform-origin: 30% 100%; animation: reap 2.6s ease-in-out infinite; }
  .is-live .reap:nth-of-type(2n) { animation-delay: -0.9s; animation-duration: 3.1s; }
  .is-live .reap:nth-of-type(3n) { animation-delay: -1.7s; }
  /* Every android takes the same step at the same instant: feet lift in turn, arms swing opposite. */
  .is-live #ipRobots .rl, .is-live #ipRobots .ar { animation: step 1.2s ease-in-out infinite; }
  .is-live #ipRobots .rr, .is-live #ipRobots .al { animation: step 1.2s ease-in-out -0.6s infinite; }
  .is-live #ipRobots .al, .is-live #ipRobots .ar { animation-name: swing; }
  .is-live #ipWindows rect:nth-child(4n) { animation: blink 3s steps(1) infinite; }
  .is-live #ipWindows rect:nth-child(7n) { animation: blink 4.4s steps(1) 1s infinite; }
  .is-live #ipDrones .drone { animation: hover 3.4s ease-in-out infinite; }
  .is-live #ipDrones g:nth-child(2) .drone { animation-delay: -1.2s; }
  .is-live #ipDrones g:nth-child(3) .drone { animation-delay: -2.3s; }
  .scene--plague.is-live .beacon { animation: blink 2s steps(1) infinite; }

  /* The flip: a sleeping city, lights going on and off under the rising coin. */
  .is-live #cWindows rect:nth-child(5n) { animation: blink 6s steps(1) infinite; }
  .is-live #cWindows rect:nth-child(7n + 2) { animation: blink 9s steps(1) 2s infinite; }
  .is-live #cWindows rect:nth-child(4n + 3) { animation: dim 13s steps(1) 5s infinite; }
  .is-live .sparkle { transform-box: fill-box; transform-origin: 50% 50%; animation: sparkle 3.2s ease-in-out infinite; }
  .is-live .sparkle:nth-of-type(2n) { animation-delay: -1.1s; }

  .is-live #cpFlame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.7s ease-in-out infinite; }
  .is-live #cpGlow, .is-live #cpRockGlow { animation: firelight 7s ease-in-out infinite; }
  .is-live #cpShadow { transform-box: fill-box; transform-origin: 50% 100%; animation: shadow 7s ease-in-out infinite; }
  .is-live #cpCrown { animation: crown 7s ease-in-out infinite; }
  .is-live #cpZombies { animation: shamble 18s ease-in-out infinite alternate; }
  .is-live #cpSparks circle { transform-box: fill-box; animation: ember 3.6s ease-out infinite; }
  .is-live #cpSparks circle:nth-child(2n) { animation-duration: 4.4s; animation-delay: -1.5s; }
  .is-live #cpSparks circle:nth-child(3n) { animation-duration: 5.2s; animation-delay: -3s; }
  .is-live #cpSmoke circle { transform-box: fill-box; transform-origin: 50% 50%; animation: smoke 9s linear infinite; }
  .is-live #cpSmoke circle:nth-child(2) { animation-delay: -1.5s; }
  .is-live #cpSmoke circle:nth-child(3) { animation-delay: -3s; }
  .is-live #cpSmoke circle:nth-child(4) { animation-delay: -4.5s; }
  .is-live #cpSmoke circle:nth-child(5) { animation-delay: -6s; }
  .is-live #cpSmoke circle:nth-child(6) { animation-delay: -7.5s; }
  .is-live .fog { animation: fog 24s ease-in-out infinite alternate; }
  .is-live .fog--back { animation-duration: 31s; animation-direction: alternate-reverse; }

  .is-live #sPhones > :nth-child(2n) { animation: twinkle 3.5s ease-in-out infinite; }
  .is-live #sPhones > :nth-child(3n) { animation: twinkle 5s ease-in-out 1s infinite; }
  .is-live #sNet line { animation: pulse 4s ease-in-out infinite; }
  .is-live #sNet line:nth-child(2n) { animation-delay: -1.3s; }
  .is-live #sNet line:nth-child(3n) { animation-delay: -2.6s; }
  .is-live #sNodes circle { transform-box: fill-box; transform-origin: 50% 50%; animation: node 4s ease-in-out infinite; }
  .is-live #sNodes circle:nth-child(2n) { animation-delay: -2s; }
  .is-live #sHaloC { transform-box: fill-box; transform-origin: 50% 50%; animation: breathe 9s ease-in-out infinite; }

  .is-live #hGlowC { transform-box: fill-box; transform-origin: 50% 50%; animation: door 6s ease-in-out infinite; }
}
@keyframes twinkle { 0%, 100% { fill-opacity: 1; } 50% { fill-opacity: 0.3; } }
@keyframes shoot {
  0%, 88% { opacity: 0; transform: translate(-60px, -22px); }
  91% { opacity: 1; }
  100% { opacity: 0; transform: translate(60px, 22px); }
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
@keyframes dim { 0%, 100% { opacity: 1; } 40% { opacity: 0; } }
@keyframes mote {
  0% { transform: translate(0, 0); opacity: 0; }
  20%, 70% { opacity: 1; }
  100% { transform: translate(-14px, -70px); opacity: 0; }
}
@keyframes hal { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes waver {
  0%, 100% { transform: skewX(0) scaleY(1); opacity: 1; }
  50% { transform: skewX(-9deg) scaleY(1.08); opacity: 0.6; }
}
@keyframes glide { from { transform: translate(0, 0); } to { transform: translate(90px, -18px); } }
@keyframes reap { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(-7deg); } 60% { transform: rotate(3deg); } }
@keyframes hover { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(6px, -4px); } }
@keyframes step { 0%, 50%, 100% { transform: translateY(0); } 25% { transform: translateY(-3.5px); } }
@keyframes swing { 0%, 50%, 100% { transform: translateY(0); } 25% { transform: translateY(-2px); } }
@keyframes sparkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(0.45) rotate(45deg); opacity: 0.5; } }
/* Each puff starts small over the flames, then widens, leans with the breeze and thins out. */
@keyframes smoke {
  0% { transform: translate(0, var(--rise)) scale(0.5); opacity: 0; }
  12% { opacity: 1; }
  60% { opacity: 0.7; }
  100% { transform: translate(80px, calc(var(--rise) - 300px)) scale(2.6); opacity: 0; }
}
@keyframes ember {
  0% { transform: translate(0, 60px); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(18px, -90px); opacity: 0; }
}
@keyframes fog { from { transform: translateX(-60px); } to { transform: translateX(60px); } }
@keyframes pulse { 0%, 100% { stroke-opacity: 0.25; } 50% { stroke-opacity: 0.8; } }
@keyframes node { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1); }
  20% { transform: scale(0.97, 1.05); }
  45% { transform: scale(1.02, 0.95); }
  70% { transform: scale(0.98, 1.03); }
}
/* Every seven seconds the fire flares; only then does the shadow on the rock clearly wear its crown. */
@keyframes firelight { 0%, 55%, 100% { opacity: 0.8; } 63% { opacity: 1; } 75% { opacity: 0.78; } }
@keyframes shadow { 0%, 55%, 100% { transform: scale(1); } 63% { transform: scale(1.05); } 75% { transform: scale(0.99); } }
@keyframes crown { 0%, 54%, 100% { opacity: 0.35; } 63% { opacity: 1; } 76% { opacity: 0.38; } }
@keyframes shamble { from { transform: translateX(0); } to { transform: translateX(16px); } }
@keyframes door { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }

/* Pull quote */
.pull {
  margin: 3.75rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.pull p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.2;
  color: var(--accent-ink);
}

.pull--cited blockquote { margin: 0; }
.pull--cited figcaption { margin-top: 1.1rem; padding: 0; text-align: center; }
.pull--cited figcaption::before { content: "— "; }

/* A pause inside a section, smaller than a heading */
hr.break { margin: 2.6rem 0; border: 0; height: auto; overflow: visible; text-align: center; }
hr.break::before {
  content: "\25C6\2003\25C6\2003\25C6";
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.85;
}

/* Section guide, in the margin on wide screens only */
.toc { display: none; }
@media (min-width: 75rem) {
  .toc {
    display: block;
    position: fixed;
    right: 2rem;
    top: 50%;
    z-index: 5;
    width: 12.5rem;
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0s 0.35s;
  }
  .toc.is-on { opacity: 1; visibility: visible; transition: opacity 0.35s; }
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a {
  display: block;
  margin-left: -1px;
  padding: 0.45rem 0 0.45rem 0.9rem;
  border-left: 1px solid transparent;
  color: var(--muted);
  font: 500 0.64rem/1.35 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.toc a:hover { color: var(--accent-ink); opacity: 1; }
.toc a[aria-current] { color: var(--ink); opacity: 1; border-left-color: var(--accent); }
h2[id] { scroll-margin-top: 2rem; }

/* Bulleted list in the running text */
.points { margin: 0 0 1.6em; padding: 0; list-style: none; }
.points li { position: relative; margin: 0 0 0.85em; padding-left: 1.6rem; }
.points li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.68em;
  width: 0.45rem; height: 0.45rem;
  transform: rotate(45deg);
  background: var(--accent);
}

/* Rebuttals: each claim, then why it fails */
.rebuttals { list-style: none; margin: 2rem 0 0; padding: 0; }
.rebuttals li { margin: 0 0 2.25rem; }
.rebuttals p { margin: 0; }
.rebuttals .claim {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.12em;
  line-height: 1.35;
}
.rebuttals .claim::before { content: "“"; margin-left: -0.42em; }
.rebuttals .claim::after { content: "”"; }
.rebuttals .reply {
  margin-top: 0.8rem;
  padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 2px solid var(--accent);
  line-height: 1.55;
}
.rebuttals .why {
  display: block;
  margin-bottom: 0.3rem;
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* Closing list */
.signals-box { margin: 3.5rem 0; }
@media (min-width: 60rem) {
  .signals-box { margin-inline: -4rem; }
}
.signals-box h4 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.signals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 36rem) {
  .signals { grid-template-columns: 1fr 1fr; }
}
.signals li {
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--rule);
  border-top: 2px solid color-mix(in srgb, var(--accent) 70%, var(--rule));
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 3%, var(--paper));
}
.sig-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.signals p { margin: 0; }
.sig-title {
  font-weight: 600;
  font-size: 1.05em;
  line-height: 1.25;
}
.sig-text {
  margin-top: 0.4rem !important;
  font-size: 0.84em;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 78%, var(--paper));
}

.endmark {
  width: 4rem; height: 1.25rem;
  margin: 5.5rem auto 2rem;
  background: var(--doors) center / contain no-repeat;
}

/* ---------- Chart ---------- */
/* One comparison: power concentration (gold) against traditional governance (night blue),
   both validated for CVD and contrast on the dark page. The other lenses step through quiet neutrals
   in a fixed order, so the legend, the order and the tooltips identify them. */
:root {
  --c-power: #C68620; --t-power: #0B0F1C;
  --c-gov: #7A8FD4;   --t-gov: #0B0F1C;
  --c-control: #535C7E;
  --c-skeptic: #414967;
  --c-accel: #323952;
  --c-fact: #252A3D;
  --t-other: #D4CEC2;
}
figure.chart {
  position: relative;
  font-family: var(--sans);
}
article figure.chart { margin-inline: 0; }
figure.chart h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.legend {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.legend li { display: flex; }
.lens {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s;
}
.sw { width: 0.7rem; height: 0.7rem; border-radius: 2px; background: var(--c); }
.bars { display: flex; flex-direction: column; }
/* Rows touch, so the whole band from one bar to the next is tappable. */
.row { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.55rem 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.row.expert { margin-top: 0.6rem; }
.row.expert .lbl { font-style: italic; }
.lbl { font-size: 0.85rem; color: var(--ink); }
.track { display: flex; gap: 2px; height: 1.6rem; }
.seg {
  flex: 0 1 auto;
  min-width: 3px;
  display: flex;
  align-items: center;
  padding-left: 0.45rem;
  background: var(--c);
  color: var(--t, transparent);
  font: 500 0.72rem/1 var(--mono);
  overflow: hidden;
  white-space: nowrap;
}
.seg:first-child { border-radius: 3px 0 0 3px; }
.seg:last-child { border-radius: 0 3px 3px 0; }
.seg { transition: opacity 0.15s, background-color 0.15s, color 0.15s; }

/* Spotlight: the focused lens goes solid on every bar, the rest fall back. */
figure.chart[data-focus] .seg { opacity: 0.28; }
figure.chart[data-focus] .lens { opacity: 0.45; }
/* Power concentration stays lit as the baseline every other lens is compared against. */
figure.chart[data-focus] .seg.power,
figure.chart[data-focus="gov"] .seg.gov,
figure.chart[data-focus="control"] .seg.control,
figure.chart[data-focus="skeptic"] .seg.skeptic,
figure.chart[data-focus="accel"] .seg.accel,
figure.chart[data-focus="fact"] .seg.fact { opacity: 1; }
figure.chart[data-focus] .lens[data-lens="power"],
figure.chart[data-focus="gov"] .lens[data-lens="gov"],
figure.chart[data-focus="control"] .lens[data-lens="control"],
figure.chart[data-focus="skeptic"] .lens[data-lens="skeptic"],
figure.chart[data-focus="accel"] .lens[data-lens="accel"],
figure.chart[data-focus="fact"] .lens[data-lens="fact"] { opacity: 1; color: var(--ink); }
/* The neutral lenses are too pale to stand out alone, so they take ink when focused. */
figure.chart[data-focus="control"] .seg.control,
figure.chart[data-focus="skeptic"] .seg.skeptic,
figure.chart[data-focus="accel"] .seg.accel,
figure.chart[data-focus="fact"] .seg.fact,
figure.chart[data-focus="control"] .lens[data-lens="control"] .sw,
figure.chart[data-focus="skeptic"] .lens[data-lens="skeptic"] .sw,
figure.chart[data-focus="accel"] .lens[data-lens="accel"] .sw,
figure.chart[data-focus="fact"] .lens[data-lens="fact"] .sw { background: var(--ink); color: var(--paper); }
.power { --c: var(--c-power); --t: var(--t-power); }
.gov { --c: var(--c-gov); --t: var(--t-gov); }
.control { --c: var(--c-control); --t: var(--t-other); }
.skeptic { --c: var(--c-skeptic); --t: var(--t-other); }
.accel { --c: var(--c-accel); --t: var(--t-other); }
.fact { --c: var(--c-fact); --t: var(--t-other); }
figure.chart figcaption {
  margin-top: 1.5rem;
  padding: 0;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  font: 400 0.8rem/1.5 var(--sans);
  color: var(--muted);
}

.data-link { margin: 1rem 0 0; }
.data-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0 0.95rem;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 3px;
  color: var(--ink);
  font: 500 0.85rem/1 var(--sans);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.data-link a span { color: var(--accent); transition: transform 0.15s; }
.data-link a:hover { border-color: var(--accent); color: var(--accent-ink); }
.data-link a:hover span { transform: translateX(3px); }

.tip {
  position: absolute;
  left: 0; top: 0;
  z-index: 2;
  padding: 0.4rem 0.6rem;
  border-radius: 3px;
  background: var(--night);
  color: var(--night-text);
  font: 400 0.78rem/1.3 var(--sans);
  white-space: nowrap;
  pointer-events: none;
}
.tip[hidden] { display: none; }

/* ---------- Source cards (sources.js) ---------- */
.src-card {
  position: absolute;
  z-index: 30;
  width: max-content;
  max-width: min(21rem, calc(100vw - 1.5rem));
  padding: 0.75rem 0.9rem 0.8rem;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  background: #151A2C;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.src-card.touch { pointer-events: auto; }
.src-card[hidden] { display: none; }
.src-card p { margin: 0; }
.src-card [hidden] { display: none; }
.src-meta {
  font: 500 0.68rem/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.src-title {
  margin-top: 0.35rem !important;
  font: 500 1rem/1.3 var(--serif);
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.src-by {
  margin-top: 0.35rem !important;
  font: 400 0.8rem/1.35 var(--sans);
  color: var(--muted);
}
.src-open {
  display: inline-block;
  margin-top: 0.6rem;
  font: 500 0.8rem/1 var(--sans);
  color: var(--accent-ink);
  text-decoration: none;
}
@media (prefers-reduced-motion: no-preference) {
  .src-card:not([hidden]) { animation: src-in 0.14s ease-out; }
  @keyframes src-in { from { opacity: 0; transform: translateY(3px); } }
  .src-card.above:not([hidden]) { animation-name: src-in-above; }
  @keyframes src-in-above { from { opacity: 0; transform: translateY(-3px); } }
}

/* ---------- Footer ---------- */
/* Same colour as the article, so the page runs on into the horizon with no seam. */
footer {
  background: var(--paper);
  color: var(--night-text);
}
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 6.5rem var(--gutter) 3rem;
  text-align: center;
}
/* A distant horizon with one lit door: the traveller from the cover, arrived. */
.footer-art img,
.footer-art svg {
  display: block;
  width: 100%;
  height: clamp(150px, 17vw, 250px);
  object-fit: cover;
  object-position: 50% 100%;
}
.footer-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.75rem, 7vw, 4rem);
  line-height: 1;
}
.contact {
  margin: 1.25rem auto 0;
  font: italic 400 1.15rem/1.5 var(--serif);
  color: var(--night-muted);
}
.contact a { color: var(--night-text); text-decoration-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.contact a:hover { color: var(--gold); }
.share { margin-top: 3.25rem; }
.share h2 {
  margin: 0 0 1rem;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.share h2::before { content: none; }
.share-links {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 54rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.share-links li { display: flex; }
.share-links [hidden] { display: none; }
.share-links a,
.share-links button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.95rem;
  border: 1px solid rgba(236, 230, 216, 0.18);
  border-radius: 3px;
  background: transparent;
  color: var(--night-text);
  font: 400 0.92rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.share-links a:hover,
.share-links button:hover { border-color: var(--gold); color: var(--gold); }

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


/* Guide links focus the heading they scroll to (for screen readers); no ring on it. */
h2[tabindex="-1"]:focus { outline: none; }
