@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-Italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Its own page, in the comic's colours: the same aged cream, purple-black
     ink and four-colour red, sky and yellow, used quietly. */
  --paper: #f9f6ec;
  --paper-2: #f1ebda;
  --ink: #1a1520;
  --ink-2: #3b3442;
  --muted: #615966;
  --rule: #e8e1cf;
  --rule-2: #d3c9b2;
  --clay: #cf5340;
  --clay-deep: #c8443a;
  --clay-ink: #a5372d;
  --sky: #5ba9cf;
  --sky-deep: #3f8db5;
  --sun: #e3c552;
  --salmon: #f5ded2;
  --night: #0f0b12;
  --night-2: #1a1520;
  --cream: #f4eedc;
  --cream-2: rgb(244 238 220 / 0.74);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --column: 41rem;
  --wide: 66rem;
  --hero: 76rem;
  --gutter: 1.25rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  text-wrap: balance;
}

a {
  color: var(--clay-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--clay-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

strong {
  font-weight: 620;
}

.sr-only,
.bars thead th {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 3;
  padding: 0.5rem 0.9rem;
  background: var(--cream);
  color: var(--ink);
  border-radius: 6px;
  font-family: var(--sans);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ------------------------------------------------------------ hero */

/* A dark sky with a warm horizon. The film sits beside the title, and the route of the
   five setups sits on the horizon line. */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: min(100svh, 60rem);
  background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 55%, #2c1619 100%);
  color: var(--cream);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -20%;
  right: -20%;
  bottom: 0;
  height: 70%;
  background:
    radial-gradient(ellipse 50% 46% at 50% 100%, rgb(232 120 88 / 0.55), rgb(207 83 64 / 0) 100%),
    radial-gradient(ellipse 70% 90% at 50% 100%, rgb(207 83 64 / 0.42), rgb(207 83 64 / 0) 72%);
  transform-origin: 50% 100%;
}

.hero::after,
.closing::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle, rgb(244 238 220 / 0.11) 0 1px, transparent 1.5px) 0 0 / 7px 7px;
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 100%, #000, transparent 80%);
  mask-image: radial-gradient(ellipse 65% 60% at 50% 100%, #000, transparent 80%);
  pointer-events: none;
}

.hero-inner {
  width: min(var(--hero), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(2rem, 6vh, 4.5rem) 0 clamp(2rem, 5vh, 3.5rem);
  display: flex;
  flex-direction: column;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-2);
}

.hero h1 {
  margin-top: clamp(2.5rem, 9vh, 6rem);
  max-width: 15ch;
  font-size: clamp(2.9rem, 1.4rem + 6vw, 6.2rem);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--cream);
}

.dek {
  margin-top: clamp(1.5rem, 3vh, 2.25rem);
  max-width: 36rem;
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  line-height: 1.5;
  color: var(--cream-2);
  text-wrap: pretty;
}

/* The film: tap to play, never autoplays. */

.film {
  margin-top: clamp(2rem, 5vh, 3rem);
}

.film video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: var(--night);
  box-shadow:
    0 0 0 1px rgb(244 238 220 / 0.14),
    0 30px 80px -24px rgb(0 0 0 / 0.75),
    0 0 120px -30px rgb(207 83 64 / 0.45);
}

.toc {
  margin-top: clamp(2rem, 5vh, 3.5rem);
  max-width: 50rem;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 1.75rem;
}

.toc a {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid rgb(244 238 220 / 0.22);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.98rem;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.toc a:hover {
  border-top-color: var(--clay);
  color: #fff;
}

.toc-n {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--sun);
}

.hero :focus-visible {
  outline-color: var(--cream);
}

.hero a:not(.toc a) {
  color: var(--sun);
}

/* On a wide screen the title and intro sit left of the film, and the contents run in one row below. */

@media (min-width: 960px) {
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas:
      "kicker kicker"
      "copy film"
      "toc toc";
    column-gap: clamp(2.5rem, 4vw, 4.5rem);
    align-content: center;
    align-items: center;
  }

  .kicker {
    grid-area: kicker;
    margin-bottom: clamp(2rem, 6vh, 4rem);
  }

  .hero-copy {
    grid-area: copy;
  }

  .hero h1 {
    margin-top: 0;
    max-width: none;
    font-size: clamp(3rem, 1rem + 3.3vw, 4.9rem);
  }

  .dek {
    font-size: clamp(1.05rem, 0.9rem + 0.35vw, 1.3rem);
  }

  .film {
    grid-area: film;
    margin-top: 0;
  }

  .toc {
    grid-area: toc;
    max-width: none;
  }

  .toc ol {
    grid-template-columns: repeat(6, 1fr);
    column-gap: 1.25rem;
  }
}

/* The route: five stops on one line. */

.route {
  position: relative;
  width: min(var(--hero), 100% - 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 0 2.25rem;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  font-family: var(--sans);
  /* Below the horizon is a little darker, so the labels read cleanly. */
  background: rgb(15 11 18 / 0.62);
  box-shadow: 0 0 0 100vmax rgb(15 11 18 / 0.62);
  clip-path: inset(0 -100vmax -100vmax);
}

.route::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgb(244 238 220 / 0.15), rgb(244 238 220 / 0.7) 30%, #e8806a 85%, var(--clay));
  transform-origin: 0 50%;
}

.route li {
  position: relative;
  padding-top: 1.35rem;
}

.route li:nth-child(1) { --i: 0; }
.route li:nth-child(2) { --i: 1; }
.route li:nth-child(3) { --i: 2; }
.route li:nth-child(4) { --i: 3; }
.route li:nth-child(5) { --i: 4; }

.route li::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--night);
  border: 1.5px solid var(--cream);
}

.route li:last-child::before {
  background: var(--sun);
  border-color: #f6e7a8;
  box-shadow: 0 0 0 5px rgb(207 83 64 / 0.25), 0 0 22px 6px rgb(227 197 82 / 0.4);
}

.route-when {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-2);
}

.route-name {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--cream);
}

.route li:last-child .route-name {
  color: var(--sun);
}

/* ------------------------------------------------------------ layout */

main,
.appendix {
  width: min(var(--column), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

main > section {
  margin-top: clamp(5rem, 11vh, 8rem);
}

main > section:first-child {
  margin-top: clamp(3.5rem, 8vh, 5.5rem);
}

section > p + p,
article > p + p,
.timeline li p + p {
  margin-top: 1.05em;
}

h2 {
  margin-bottom: 1.6rem;
  font-size: clamp(2rem, 1.5rem + 1.9vw, 2.9rem);
  font-weight: 350;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

/* The numbered sections carry the same numbers as the contents in the hero. */

#glance::before,
#method::before,
#setups::before,
#lessons::before,
#ai::before,
#numbers::before {
  display: block;
  width: fit-content;
  margin-bottom: 1rem;
  padding-left: 2.6rem;
  background: linear-gradient(var(--clay), var(--clay)) left 50% / 2rem 1px no-repeat;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--clay-ink);
}

#glance::before { content: "01" / ""; }
#method::before { content: "02" / ""; }
#setups::before { content: "03" / ""; }
#lessons::before { content: "04" / ""; }
#ai::before { content: "05" / ""; }
#numbers::before { content: "06" / ""; }

h3 {
  font-size: 1.6rem;
  font-weight: 450;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.quiet {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------ at a glance */

.glance {
  border-top: 2px solid var(--ink);
  padding-top: 1.6rem;
}

.glance h2 {
  font-size: 1.5rem;
  font-weight: 450;
  margin-bottom: 1.2rem;
}

.glance dl {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
}

.glance dt,
.glance dd {
  padding: 0.95rem 0;
  border-top: 1px solid var(--rule-2);
}

.glance dt {
  padding-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay-ink);
}

.glance dd {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.55;
}

/* ------------------------------------------------------------ opening */

.opening .lede {
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.65rem);
  line-height: 1.45;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.opening p + p {
  margin-top: 1.05em;
}

.pull {
  margin: 2.75rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--clay);
}

.pull p {
  font-style: italic;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  font-weight: 350;
  line-height: 1.28;
  color: var(--ink);
  text-wrap: balance;
}

/* The one quote in the opening gets a card of its own. */
.opening .pull {
  position: relative;
  margin: 2.75rem 0;
  padding: clamp(2.25rem, 1.5rem + 3vw, 3.25rem) clamp(1.5rem, 1rem + 3vw, 3rem) clamp(1.75rem, 1.25rem + 2vw, 2.5rem);
  border: 0;
  border-radius: 16px;
  background: var(--salmon);
}

.opening .pull::before {
  content: "“" / "";
  position: absolute;
  top: 0.15rem;
  left: clamp(1.1rem, 0.6rem + 2.6vw, 2.5rem);
  font-family: var(--serif);
  font-size: 5.5rem;
  line-height: 1;
  color: var(--clay);
}

/* ------------------------------------------------------------ how I worked */

.steps {
  margin-top: 2rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 1.15rem 0 1.25rem 3rem;
  border-top: 1px solid var(--rule-2);
}

.steps li:last-child {
  border-bottom: 1px solid var(--rule-2);
}

.steps li::before {
  content: counter(step, decimal-leading-zero) / "";
  position: absolute;
  left: 0;
  top: 1.57rem;
  line-height: 1;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--clay-ink);
}

.steps strong {
  font-weight: 600;
}

/* ------------------------------------------------------------ the five setups */

/* A rail down the left. Each month gets a stop on it, and the rail fills as you read. */

.timeline {
  position: relative;
  margin-top: 2.5rem;
  padding: 0 0 0 2.25rem;
  list-style: none;
}

.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.55rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--rule-2);
}

.timeline::after {
  width: 2px;
  left: 4.5px;
  background: linear-gradient(180deg, var(--rule-2), var(--clay) 8%, var(--clay));
  transform-origin: 50% 0;
}

.timeline li {
  position: relative;
}

.timeline li + li {
  margin-top: 3.25rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-2.25rem + 0.5px);
  top: 0.4rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--clay);
  box-shadow: 0 0 0 4px var(--paper);
}

.timeline li:last-child::before {
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 7px rgb(207 83 64 / 0.3);
}

.when {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-ink);
}

.timeline h3 {
  margin: 0.45rem 0 0.85rem;
}

/* ------------------------------------------------------------ figures */

.figure {
  margin: 3rem 0;
  padding-top: 1.1rem;
  border-top: 2px solid var(--ink);
}

.figure.wide {
  width: min(var(--wide), 100vw - 2 * var(--gutter));
  margin-top: 4.5rem;
  margin-inline: calc(50% - min(var(--wide), 100vw - 2 * var(--gutter)) / 2);
}

.figure-title {
  margin-bottom: 1.5rem;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.figure figcaption {
  margin-top: 1.25rem;
  max-width: 46rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-narrow {
  display: none;
}

@media (max-width: 680px) {
  .chart-wide {
    display: none;
  }

  .chart-narrow {
    display: block;
    max-width: 26rem;
    margin-inline: auto;
  }
}

.chart text {
  font-family: var(--sans);
}

.chart .ax {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.chart-narrow .ax {
  font-size: 12px;
}

.chart .lbl {
  fill: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.chart-narrow .lbl {
  font-size: 13px;
}

/* The busiest-day label has to fit between two marker pins. */
.chart-narrow .lbl.peak {
  font-size: 12px;
}

.chart .row-name {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.chart-narrow .row-name {
  font-size: 14px;
}

.chart .grid {
  stroke: var(--rule);
  stroke-width: 1;
}

.chart .base {
  stroke: #b3a993;
  stroke-width: 1;
}

.chart .bar {
  fill: var(--clay);
}

.chart .pin {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.chart .marker circle {
  fill: var(--ink);
}

.chart .marker text {
  fill: var(--paper);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  text-anchor: middle;
}

.chart-narrow .marker text {
  font-size: 11.5px;
}

.chart .dot {
  fill: var(--clay);
  stroke: var(--paper);
  stroke-width: 1.2;
}

.chart .dot.receipt {
  fill: var(--sky-deep);
}

.chart .median {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.markers {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: marker;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.6rem 1.75rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.markers li {
  counter-increment: marker;
  position: relative;
  padding-left: 2rem;
}

.markers li::before {
  content: counter(marker);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3rem;
  text-align: center;
}

.markers .m-date {
  margin-right: 0.4rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

/* ------------------------------------------------------------ lessons */

.lesson + .lesson {
  margin-top: 5rem;
}

.lesson h3 {
  display: grid;
  grid-template-columns: 3rem 1fr;
  align-items: baseline;
  margin-bottom: 1.1rem;
  font-size: clamp(1.55rem, 1.3rem + 0.9vw, 1.95rem);
}

.lesson-n {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--clay-ink);
}

.lesson-n::before {
  content: "0";
}

.cuts {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.cuts li {
  padding: 1rem 0 1.1rem;
  border-top: 1px solid var(--rule-2);
}

.cuts li:last-child {
  border-bottom: 1px solid var(--rule-2);
}

.cuts strong {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
}

/* Delivery numbers */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem 1.25rem;
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.4rem;
}

.stats dd {
  margin: 0;
  font-size: clamp(1.9rem, 1.5rem + 1.1vw, 2.3rem);
  font-weight: 350;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

.stats div:first-child {
  grid-column: 1 / -1;
}

.stats div:first-child dd {
  font-size: clamp(3rem, 2rem + 3.5vw, 4.6rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--clay-ink);
}

.stats dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 760px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1.25rem;
  }
}

/* Encoding bars */

.bars {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.95rem;
}

.bars tbody + tbody th[scope="rowgroup"] {
  padding-top: 1.2rem;
}

.bars th[scope="rowgroup"] {
  text-align: left;
  font-weight: 600;
  padding: 0 0 0.4rem;
}

.bars td {
  padding: 0.2rem 0;
  vertical-align: middle;
}

.bars .enc {
  width: 10rem;
  color: var(--ink-2);
  padding-right: 0.75rem;
  white-space: nowrap;
}

.bars .bar-cell svg {
  display: block;
  width: 100%;
  height: 0.95rem;
}

.bars .val {
  width: 5.75rem;
  padding-left: 0.75rem;
  text-align: right;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.bars rect.rust {
  fill: var(--clay);
}

.bars rect.turbo {
  fill: var(--sky);
}

.bars tbody:nth-of-type(1) { --k: 0; }
.bars tbody:nth-of-type(2) { --k: 1; }
.bars tbody:nth-of-type(3) { --k: 2; }
.bars tr:nth-child(2) { --j: 0; }
.bars tr:nth-child(3) { --j: 1; }

@media (max-width: 480px) {
  .bars .enc {
    width: 6.5rem;
    white-space: normal;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .bars .val {
    width: 4.9rem;
  }
}

/* ------------------------------------------------------------ lists */

.plain {
  padding-left: 1.2rem;
  color: var(--ink-2);
}

.plain li + li {
  margin-top: 0.6rem;
}

.plain li::marker {
  color: var(--clay);
}

.small {
  font-size: 0.95rem;
}

/* ------------------------------------------------------------ closing */

/* The end mirrors the start: the same dark sky and warm horizon. */

.closing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2.25rem, 1.5rem + 4vw, 4rem) clamp(1.5rem, 1rem + 4vw, 3.75rem) clamp(3rem, 2rem + 5vw, 5.5rem);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 60%, #2f171a 100%);
  color: var(--cream-2);
}

.closing::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 40% -30% 0;
  background: radial-gradient(ellipse 55% 75% at 50% 100%, rgb(207 83 64 / 0.5), rgb(207 83 64 / 0) 75%);
}

.closing h2 {
  color: var(--cream);
}

.closing p + p {
  margin-top: 1.05em;
}

.closing .last {
  margin-top: 2rem;
  font-style: italic;
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem);
  font-weight: 350;
  line-height: 1.32;
  color: var(--cream);
  text-wrap: balance;
}

/* ------------------------------------------------------------ appendix */

.appendix {
  margin-top: clamp(5rem, 12vh, 8rem);
  padding: 2.5rem 0 4rem;
  border-top: 2px solid var(--ink);
  color: var(--ink-2);
  font-size: 1.05rem;
}

.appendix h2 {
  font-size: 2rem;
  color: var(--ink);
}

.appendix > p {
  margin-bottom: 1.75rem;
}

details {
  border-top: 1px solid var(--rule-2);
}

details:last-of-type {
  border-bottom: 1px solid var(--rule-2);
}

summary {
  cursor: pointer;
  padding: 0.95rem 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

summary::marker {
  color: var(--clay);
}

details[open] summary {
  margin-bottom: 0.5rem;
}

details > :last-child {
  margin-bottom: 1.5rem;
}

.table-wrap {
  overflow-x: auto;
}

.data {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.data caption {
  text-align: left;
  color: var(--muted);
  padding-bottom: 0.5rem;
}

.data th,
.data td {
  padding: 0.4rem 0.6rem 0.4rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: right;
  white-space: nowrap;
}

.data td {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.data th:first-child,
.data td:first-child {
  text-align: left;
}

.data thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  vertical-align: bottom;
  border-bottom-color: var(--ink);
}

.figure .data th[scope="row"] {
  white-space: normal;
}

.colophon {
  margin-top: 2.5rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ------------------------------------------------------------ narrow screens */

@media (max-width: 760px) {
  .toc ol {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1.0938rem;
  }

  .hero {
    min-height: 0;
  }

  .hero h1 {
    margin-top: 3rem;
  }

  .toc ol {
    grid-template-columns: 1fr;
  }

  .toc a {
    padding: 0.6rem 0;
  }

  /* On a phone the route runs down the page instead of across it. */
  .route {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 1.75rem 0 2.25rem 1.75rem;
  }

  .route::before {
    left: 5px;
    right: auto;
    top: 2.1rem;
    bottom: 2.6rem;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, rgb(244 238 220 / 0.25), rgb(244 238 220 / 0.7) 40%, var(--clay));
    transform-origin: 50% 0;
  }

  .route li {
    padding-top: 0;
    display: flex;
    gap: 0.9rem;
    align-items: baseline;
  }

  .route li::before {
    left: -1.75rem;
    top: 0.3rem;
  }

  .route-when {
    min-width: 2.4rem;
  }

  .glance dl {
    grid-template-columns: 1fr;
  }

  .glance dd {
    padding-top: 0.2rem;
    border-top: 0;
  }

  .glance dt {
    padding-bottom: 0;
  }

  .steps li {
    padding-left: 2.4rem;
  }

  .lesson h3 {
    grid-template-columns: 2.4rem 1fr;
  }

  .timeline {
    padding-left: 1.85rem;
  }

  .timeline li::before {
    left: calc(-1.85rem + 0.5px);
  }

  .opening .pull {
    border-radius: 12px;
  }

  .closing {
    border-radius: 14px;
  }
}

/* ------------------------------------------------------------ motion */

/* Nothing moves for anyone who asks for less motion, and nothing is hidden without it. */

@media (prefers-reduced-motion: no-preference) {
  .hero::before {
    animation: dawn 2.6s var(--ease-out) both;
  }

  .film {
    animation: rise 1.1s var(--ease-out) 0.35s both;
  }

  .route::before {
    animation: draw-x 1.5s cubic-bezier(0.65, 0, 0.35, 1) 0.45s both;
  }

  .route li {
    animation: appear 0.7s var(--ease-out) calc(0.75s + var(--i) * 0.24s) both;
  }

  .route li::before {
    animation: pop 0.55s var(--ease-spring) calc(0.75s + var(--i) * 0.24s) both;
  }

  .route li:last-child::before {
    animation:
      pop 0.55s var(--ease-spring) 1.71s both,
      beacon 2.8s ease-in-out 2.3s 3;
  }

  @media (max-width: 560px) {
    .route::before {
      animation-name: draw-y;
    }
  }

  /* Charts draw as they scroll into view, in the order time runs. */
  @supports (animation-timeline: view()) {
    .chart {
      view-timeline: --chart block;
      view-timeline-inset: 0 18%;
    }

    .chart .bar {
      transform-box: fill-box;
      transform-origin: 50% 100%;
      animation: grow-y linear both;
      animation-timeline: --chart;
      animation-range: entry 0% entry 100%;
      animation-range:
        entry calc((sibling-index() - 1) * 0.95%)
        entry calc((sibling-index() - 1) * 0.95% + 38%);
    }

    .chart .dot {
      transform-box: fill-box;
      transform-origin: 50% 50%;
      animation: pop linear both;
      animation-timeline: --chart;
      animation-range: entry 10% entry 90%;
      animation-range:
        entry calc((sibling-index() - 1) * 3%)
        entry calc((sibling-index() - 1) * 3% + 22%);
    }

    .chart .median,
    .chart .pin,
    .chart .marker,
    .chart .lbl {
      animation: appear linear both;
      animation-timeline: --chart;
      animation-range: entry 70% entry 100%;
    }

    .bars {
      view-timeline: --bars block;
      view-timeline-inset: 0 18%;
    }

    .bars rect {
      transform-box: fill-box;
      transform-origin: 0 50%;
      animation: grow-x linear both;
      animation-timeline: --bars;
      animation-range:
        entry calc(var(--k, 0) * 22% + var(--j, 0) * 9%)
        entry calc(var(--k, 0) * 22% + var(--j, 0) * 9% + 40%);
    }

    /* The rail fills to the middle of the screen as you read down it. */
    .timeline {
      view-timeline: --rail block;
    }

    .timeline::after {
      animation: grow-y linear both;
      animation-timeline: --rail;
      animation-range: entry 50% exit 50%;
    }

    .timeline li {
      view-timeline: --stop block;
      view-timeline-inset: 0 50%;
    }

    .timeline li::before {
      animation: light linear both;
      animation-timeline: --stop;
      animation-range: entry 0% entry 3rem;
    }
  }
}

@keyframes dawn {
  from {
    opacity: 0;
    transform: scaleY(0.55);
  }
}

@keyframes draw-x {
  from {
    transform: scaleX(0);
  }
}

@keyframes draw-y {
  from {
    transform: scaleY(0);
  }
}

@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
}

@keyframes grow-y {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0);
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes beacon {
  50% {
    box-shadow: 0 0 0 9px rgb(207 83 64 / 0.12), 0 0 34px 12px rgb(227 197 82 / 0.55);
  }
}

@keyframes light {
  from {
    background: var(--paper);
    box-shadow: 0 0 0 4px var(--paper), inset 0 0 0 1.5px var(--rule-2);
  }
}

/* ------------------------------------------------------------ print */

@media print {
  body {
    background: #fff;
    font-size: 11pt;
  }

  .skip-link,
  .film {
    display: none;
  }

  .hero,
  .closing {
    background: none;
    color: var(--ink);
  }

  .hero::before,
  .hero::after,
  .closing::before,
  .closing::after {
    display: none;
  }

  .hero h1,
  .dek,
  .kicker,
  .toc a,
  .route-name,
  .route-when,
  .closing h2,
  .closing .last {
    color: var(--ink);
  }

  .figure,
  .cuts li,
  .timeline li {
    break-inside: avoid;
  }

  a {
    color: inherit;
  }
}
