/* Keel Labs · a services systems company. Bright, open, readable. No italics. */
@font-face { font-family: 'Inter'; src: url('fonts/Inter.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('fonts/Newsreader.woff2') format('woff2'); font-weight: 400 500; font-style: normal; font-display: swap; }
/* Metric-matched fallbacks: text set in Georgia/Arial while the web fonts load occupies the same
   space, so nothing reflows when they arrive. size-adjust measured on this page's own text. */
@font-face { font-family: 'Inter Fallback'; src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('Helvetica');
  size-adjust: 97.63%; ascent-override: 99.23%; descent-override: 24.71%; line-gap-override: 0%; }
@font-face { font-family: 'Newsreader Fallback'; src: local('Georgia'), local('Gelasio');
  size-adjust: 100.70%; ascent-override: 72.99%; descent-override: 26.32%; line-gap-override: 0%; }
@font-face { font-family: 'Caveat'; src: url('fonts/Caveat.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }

:root {
  --bg: #FFFFFF;
  --band: #F5F8FE;           /* highlighted sections */
  --ink: #0E1B34;            /* deep navy: headings and sketches */
  --body: #3A4660;           /* reading text */
  --mute: #6B7690;
  --line: #E4E9F2;
  --blue: #3B5BDB;           /* the Keel pencil */
  --blue-ink: #2F4BC4;
  --blue-soft: #EDF1FF;
  --marker: rgba(59, 91, 219, .16);
  --wrap: 1120px;
  --text: 620px;
  --margin: 340px;
  /* Type scale (~1.2): every size on the page is one of these. */
  --fs-micro: 11px; --fs-label: 12.5px; --fs-caption: 14px; --fs-small: 16px; --fs-body: 18px; --fs-lead: 21px;
  --fs-4: 25px; --fs-5: 30px; --fs-6: 36px; --fs-7: 42px; --fs-8: 56px; --fs-9: 76px;
}

* { box-sizing: border-box; }
em, i, cite { font-style: normal; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; hanging-punctuation: first allow-end last; }
/* No orphans: headings balance their lines; paragraphs never end on a lone word. */
h1, h2, h3, .pull, .ch-line, .final-line, .lede, .intro, .stat b { text-wrap: balance; }
p, li, .side, .unfold { text-wrap: pretty; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font-family: 'Inter', 'Inter Fallback', system-ui, sans-serif; font-size: var(--fs-body); line-height: 1.75; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: 'ss01', 'cv11';
}
::selection { background: var(--marker); }
a { color: inherit; }
strong { color: var(--ink); font-weight: 600; }
.blue { color: var(--blue); }

/* ── Header ─────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--wrap); margin: 0 auto; padding: 20px 28px;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 0 0 100vmax rgba(255,255,255,.86); clip-path: inset(0 -100vmax);
  font-size: var(--fs-caption);
}
.top nav { display: flex; gap: 28px; }
.top nav a { text-decoration: none; color: var(--mute); font-weight: 500; transition: color .2s; }
.top nav a:hover { color: var(--ink); }

main { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

/* ── Hero: centered ─────────────────────────────────────────────────── */
.hero { position: relative; isolation: isolate; text-align: center; padding: 18vh 0 16vh; }
/* The hero drawing: full-bleed, faint, behind the type. */
body { overflow-x: clip; }
.hero-head { position: relative; padding-bottom: 210px; }
.hero-head .lede { margin-bottom: 0; }
.hero-art { position: absolute; z-index: -1; left: 50%; bottom: 30px; width: 100vw; aspect-ratio: 1440 / 170; transform: translateX(-50%); pointer-events: none; will-change: opacity, transform; }
.hero-art svg { display: block; width: 100%; height: 100%; }
.hero-art .ink.rb { fill: #0E1B34; opacity: .16; }
.hero-art .pen.rb { fill: var(--blue); opacity: .38; }
/* Hero kicker: rough handwriting in, a system line sweeps across, finished type out. */
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 40px; }
.k-stage { position: relative; display: inline-block; line-height: 1; }
.k-done { display: inline-block; font-size: var(--fs-caption); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.k-raw { display: none; position: absolute; left: 0; top: 50%; transform: translateY(-54%) rotate(-1.2deg); white-space: nowrap;
  font-family: 'Caveat', cursive; font-weight: 500; color: var(--blue); line-height: 1; clip-path: inset(-12px 100% -12px 0); }
.k-scan { position: absolute; top: -9px; bottom: -9px; left: 0; width: 1.5px; border-radius: 2px; background: var(--blue); opacity: 0; }
.k-check { width: 16px; height: 13px; opacity: 1; }
.k-check path { fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 0; }

/* ── The first second, on one clock (≈1.5 s) ──────────────────────────
   0–.45 s the header settles · .12–.95 s the headline rises word by word ·
   .5–1.0 s the kicker is written by hand · 1.0–1.4 s it is swept into type · 1.36 s tick.
   Only under html.hello (set in <head>), so no-JS, reduced motion and deep links see the page at rest. */
.hello .k-done { clip-path: inset(-6px 100% -6px 0); }
.hello .k-raw { display: block; }
.hello .k-check path { stroke-dashoffset: 24; }
.hero h1 .w { display: inline-block; }
.hello:not(.hello-go) .top, .hello:not(.hello-go) .hero h1 .w, .hello:not(.hello-go) .hero .lede { opacity: 0; }
.hello-go .top { animation: settle .5s cubic-bezier(.2,.7,.2,1) both; }
.hello-go .hero h1 .w { animation: rise .62s cubic-bezier(.2,.7,.2,1) calc(.12s + var(--i) * .065s) both; }
.hello-go .hero .lede { animation: rise .6s cubic-bezier(.2,.7,.2,1) .72s both; }
.hello-go .k-raw  { animation: k-write .5s linear .5s forwards, k-consume .4s cubic-bezier(.5,0,.3,1) 1s forwards; }
.hello-go .k-done { animation: k-reveal .4s cubic-bezier(.5,0,.3,1) 1s forwards; }
.hello-go .k-scan { animation: k-scan .4s cubic-bezier(.5,0,.3,1) 1s forwards; }
.hello-go .k-check path { animation: k-tick .3s cubic-bezier(.45,.05,.35,1) 1.36s forwards; }
@keyframes settle    { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes rise      { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes k-write   { from { clip-path: inset(-12px 100% -12px 0); } to { clip-path: inset(-12px 0 -12px 0); } }
@keyframes k-consume { from { clip-path: inset(-12px 0 -12px 0); } to { clip-path: inset(-12px 0 -12px 100%); } }
@keyframes k-reveal  { from { clip-path: inset(-6px 100% -6px 0); } to { clip-path: inset(-6px 0 -6px 0); } }
@keyframes k-scan    { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes k-tick    { to { stroke-dashoffset: 0; } }

/* Logo: a hull and its keel, the part that keeps a ship steady. */
.logo { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.logo b { font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-weight: 500; font-size: 23px; letter-spacing: -.02em; line-height: 1; }
.logo i { width: 1px; height: 16px; background: #C9D1E2; }
.logo span { font-size: var(--fs-micro); font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--mute); padding-top: 1px; }
.logo.small b { font-size: 18px; }

/* 50 ms, felt */
.flash-btn { margin-top: 14px; font: 600 13px/1 'Inter', 'Inter Fallback', sans-serif; color: var(--blue-ink); background: none; border: 1px solid #D5DDF5; border-radius: 8px; padding: 8px 12px; cursor: pointer; transition: border-color .2s, background .2s; }
.flash-btn:hover { border-color: var(--blue); background: var(--blue-soft); }
.stat { position: relative; }
.flash { position: absolute; inset: 0; display: none; place-items: center; background: #fff; z-index: 2; }
.flash.on { display: grid; }
.flash svg { width: 70%; max-width: 220px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.flash-said { margin: 10px 0 0 !important; min-height: 1.4em; font-size: var(--fs-caption) !important; color: var(--blue-ink); }
h1 {
  font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-weight: 450; color: var(--ink);
  font-size: clamp(42px, 6.2vw, var(--fs-9)); line-height: 1.01; letter-spacing: -.034em;
  max-width: 900px; margin: 0 auto 28px; font-variation-settings: 'opsz' 72;
}
.lede { font-size: var(--fs-lead); line-height: 1.6; color: var(--body); max-width: 640px; margin: 0 auto 96px; }
/* The abstract: laid out like a paper, left-aligned with the sections below. */
.paper { display: grid; grid-template-columns: 170px minmax(0, 700px); column-gap: 56px; text-align: left; padding-top: 56px; border-top: 1px solid var(--line); }
.paper-label { margin: .5em 0 0; font-size: var(--fs-label); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.paper-body p { margin: 0 0 1.1em; font-size: var(--fs-lead); line-height: 1.66; color: var(--body); }
.paper-body p:last-child { margin-bottom: 0; }
/* Pencil underline that draws itself when the line is reached. */
.ul {
  color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5.4 C 34 3.4, 70 6.2, 108 4.6 S 170 3.4, 199 5' fill='none' stroke='%233B5BDB' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% .38em; padding-bottom: .12em;
  transition: background-size 1.2s cubic-bezier(.45,.05,.3,1); -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.ul.on { background-size: 100% .38em; }

/* ── Sections ───────────────────────────────────────────────────────── */
.sec { padding: 150px 0 130px; position: relative; scroll-margin-top: 20px; }
.sec + .sec::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line); }
/* Icons: drawn in the same hand as the sketches (sketch.js), no tile behind them. */
.ic { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; }
.ic svg { width: 34px; height: 34px; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ic svg .a { stroke: var(--blue); }
.ic.sm { width: 30px; height: 30px; margin-bottom: 16px; } .ic.sm svg { width: 30px; height: 30px; }
symbol .a { stroke: var(--blue); }

/* Predictions: an editorial numbered list, two columns, hairlines between items. */
ol.preds { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; }
.pred { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 20px; padding: 40px 0 44px; border-top: 1px solid var(--line); }
.pn { font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-weight: 400; font-size: var(--fs-8); line-height: .9; font-variant-numeric: lining-nums tabular-nums; color: var(--ink); letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums; }
.pbody .sketch.small { height: 108px; margin: 0 0 16px; display: flex; align-items: center; }
.pbody .sketch.small svg { max-height: 108px; width: auto; max-width: 100%; }
.pred h3 { font-size: var(--fs-body); margin-bottom: 8px; }
.pred p { font-size: var(--fs-small); line-height: 1.68; margin: 0; }
.pred:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pred:last-child:nth-child(odd) .pbody { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 36px; align-items: center; }
.pred:last-child:nth-child(odd) .sketch.small { grid-row: span 2; margin: 0; }

/* Outcomes, builds, audiences: editorial columns separated by hairlines. No boxes. */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 48px; margin-bottom: 96px; }
.duo { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 64px; }
.col { border-top: 1px solid #C3CADA; padding-top: 26px; }
.col p { font-size: var(--fs-small); line-height: 1.68; margin: 0; }
.duo .col p { font-size: var(--fs-body); }
.builders-sketch { max-width: 400px; margin: 30px 0 0; }

.sh { display: flex; align-items: center; gap: 16px; margin: 0 0 44px; }
.sh.center { justify-content: center; }
.sh .n { font-size: var(--fs-label); font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
h2 {
  font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-weight: 500; color: var(--ink);
  font-size: clamp(30px, 3.4vw, var(--fs-7)); line-height: 1.08; letter-spacing: -.024em; margin: 0; font-variation-settings: 'opsz' 48;
}
h3 { font-size: var(--fs-body); line-height: 1.35; color: var(--ink); font-weight: 600; letter-spacing: -.01em; margin: 0 0 10px; }
.t h3 { margin-top: .2em; }

/* ── Chapter breaks: a pause in the rhythm, one sentence at display size ── */
.chapter { position: relative; min-height: 86vh; display: grid; align-content: center; padding: 120px 0; border-top: 1px solid var(--line); }
.chapter + .sec::before { display: none; }
.ch-n { display: block; font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-weight: 400; font-size: clamp(140px, 19vw, 260px); line-height: .8; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1.3px #B7C4F0; font-variant-numeric: lining-nums tabular-nums; margin: 0 0 56px -.04em; font-variation-settings: 'opsz' 72; }
.ch-line { font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-weight: 500; color: var(--ink); font-size: clamp(38px, 5.2vw, var(--fs-9)); line-height: 1.02; letter-spacing: -.032em;
  max-width: 15em; margin: 0; text-wrap: balance; font-variation-settings: 'opsz' 72; }
.chapter .ul { background-size: 0% .2em; transition-duration: 1.4s; } .chapter .ul.on { background-size: 100% .2em; }
@media (max-width: 640px) { .chapter { min-height: 0; padding: 96px 0 88px; } .ch-n { margin-bottom: 32px; } }
@media print { .chapter { min-height: 0; padding: 48px 0; break-inside: avoid; } .ch-n { -webkit-text-stroke: 0; color: #C9D3F4; } }

/* Icon tiles */
symbol .a { stroke: var(--blue); }

/* Text + notebook margin */
.row { display: grid; grid-template-columns: minmax(0, var(--text)) var(--margin); column-gap: clamp(48px, 7vw, 110px); align-items: start; margin-bottom: 40px; }
.row + .row { margin-top: 56px; }
.t p { margin: 0 0 1.15em; }
.m { margin: 0; position: sticky; top: 110px; }
.sketch svg { display: block; width: 100%; height: auto; overflow: visible; }
/* Reserve each drawing's space before the script draws it: no layout shift. (Generated from SIZES in sketch.js.) */
.sketch[data-sketch] { aspect-ratio: 200 / 108; }
.sketch[data-sketch="overhang"] { aspect-ratio: 320 / 250; }
.sketch[data-sketch="atm"] { aspect-ratio: 320 / 200; }
.sketch[data-sketch="dynamo"] { aspect-ratio: 320 / 262; }
.sketch[data-sketch="commodity"] { aspect-ratio: 320 / 168; }
.sketch[data-sketch="warmth"] { aspect-ratio: 320 / 236; }
.sketch[data-sketch="cycle"] { aspect-ratio: 320 / 272; }
.sketch[data-sketch="cycle-final"] { aspect-ratio: 320 / 272; }
.sketch[data-sketch="backwards"] { aspect-ratio: 320 / 136; }
.sketch[data-sketch="build"] { aspect-ratio: 320 / 190; }
.sketch[data-sketch="eraser"] { aspect-ratio: 320 / 240; }
.sketch[data-sketch="human"] { aspect-ratio: 320 / 206; }
.intro { font-size: var(--fs-lead); line-height: 1.6; max-width: 680px; margin: -12px 0 48px; color: var(--body); }

/* Pull quotes */
.pull {
  margin: 64px 0; padding: 0 0 0 28px; border-left: 3px solid var(--blue); max-width: 820px;
  font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-weight: 450; color: var(--ink);
  font-size: clamp(24px, 2.6vw, var(--fs-5)); line-height: 1.32; letter-spacing: -.012em;
}
.pull.big { font-size: clamp(27px, 3.1vw, var(--fs-6)); border-left-width: 4px; }

/* Marker highlight: sweeps in once, when its sentence is read */
.mark {
  background-image: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%);
  background-repeat: no-repeat; background-size: 0% 100%; transition: background-size 1.1s cubic-bezier(.45,.05,.3,1);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; color: var(--ink);
}
.mark.on { background-size: 100% 100%; }

/* Pencil underline on hover-linked phrases */
.u {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5.2 C 40 3.2, 80 6.4, 120 4.4 S 180 3.6, 199 4.8' fill='none' stroke='%233B5BDB' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% .42em;
  transition: background-size .55s cubic-bezier(.4,.1,.3,1); padding-bottom: .08em; color: var(--ink); cursor: default;
}
.u:hover, .u.on { background-size: 100% .42em; }

/* Cards (predictions) */

/* Tiles (outcomes, builds, audiences) */

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 8px 0 88px; }
.stat { border-top: 2px solid var(--blue); padding-top: 18px; }
.stat b { display: block; font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-weight: 500; font-size: var(--fs-8); line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; margin-bottom: 12px; }
.stat b small { font-size: .45em; margin-left: 4px; color: var(--blue); font-family: 'Inter', 'Inter Fallback', sans-serif; font-weight: 600; }
.stat p { margin: 0; font-size: var(--fs-small); line-height: 1.6; }

/* Closing */
.closing-sec { text-align: left; }
.center-sketch { max-width: 360px; margin: 0 auto 40px; }
.narrow { max-width: 660px; margin: 0 auto; }
.sig-line { position: relative; display: inline-block; }
.sig-line svg { position: absolute; left: -2%; bottom: -12px; width: 104%; height: 16px; overflow: visible; }

/* Footnotes that unfold beside the text */
a.fn {
  font-size: var(--fs-micro); font-weight: 700; color: var(--blue); text-decoration: none; font-variant-numeric: tabular-nums;
  vertical-align: super; line-height: 0; margin-left: 2px; padding: 1px 4px; border-radius: 4px; background: var(--blue-soft);
}
a.fn:hover, a.fn[aria-expanded="true"] { background: var(--blue); color: #fff; }
.unfold {
  display: block; font-size: var(--fs-caption); line-height: 1.55; color: var(--body);
  background: var(--blue-soft); border-radius: 10px; padding: 12px 16px; margin: -.4em 0 1.2em;
  animation: unfold .35s ease-out both;
}
@keyframes unfold { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Sidenotes: on wide screens, citations live in the margin beside their sentence. */
.side { display: none; }
@media (min-width: 1000px) {
  .row.has-notes { position: relative; }
  .row.has-notes > .m { position: static; }
  .side { display: block; position: absolute; font-size: var(--fs-caption); line-height: 1.55; color: var(--mute); padding-left: 14px; border-left: 1px solid var(--line);
    transition: color .2s, border-color .2s; }
  .side.under { position: static; margin-top: 14px; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); font-size: var(--fs-caption); }
  .side b { display: inline-block; min-width: 18px; margin-right: 7px; padding: 0 4px; border-radius: 4px; background: var(--blue-soft); color: var(--blue);
    font-size: var(--fs-micro); font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; transition: background .2s, color .2s; }
  .stat .side b { margin: 0 7px 0 0; font-family: 'Inter', 'Inter Fallback', sans-serif; letter-spacing: 0; }
  .side.hot { color: var(--ink); border-color: var(--blue); }
  .side.hot b { background: var(--blue); color: #fff; }
  .side.ping { animation: ping 1.1s ease-out; }
}
@keyframes ping { 0% { background: var(--blue-soft); } 100% { background: transparent; } }
a.fn.hot { background: var(--blue); color: #fff; }

/* Notes + footer */
.notes { max-width: 760px; padding: 90px 0 70px; font-size: var(--fs-caption); color: var(--mute); border-top: 1px solid var(--line); }
.notes h2 { font-family: 'Inter', 'Inter Fallback', sans-serif; font-size: var(--fs-label); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); font-weight: 600; margin-bottom: 16px; }
.notes ol { padding-left: 1.4em; margin: 0; } .notes li { margin-bottom: .55em; }
.notes li:target { color: var(--ink); background: var(--blue-soft); border-radius: 4px; }
.foot {
  max-width: var(--wrap); margin: 0 auto; padding: 32px 28px 56px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 24px; font-size: var(--fs-caption); color: var(--mute);
}
.colophon { margin: 0; }

/* The final frame: the loop, large, and one line. */
.final { min-height: 92vh; display: grid; align-content: center; justify-items: center; text-align: center; padding: 120px 0 150px; border-top: 1px solid var(--line); }
.final-loop { width: min(540px, 88vw); margin: 0 0 40px; }
.final-line { font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-weight: 500; color: var(--ink); font-size: clamp(40px, 6.2vw, var(--fs-9)); line-height: 1.02; letter-spacing: -.032em; margin: 0; font-variation-settings: 'opsz' 72; }
.final-line .sig-line svg { bottom: -20px; height: 22px; }
@media (max-width: 640px) { .final { min-height: 0; padding: 88px 0 110px; } .foot { flex-direction: column; align-items: flex-start; gap: 10px; } }
@media print { .final { min-height: 0; padding: 48px 0; break-inside: avoid; } }

/* Sketch strokes (navy ink, Keel-blue pencil) */
.ink   { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.pen   { fill: none; stroke: var(--blue); stroke-linecap: round; stroke-linejoin: round; }
.hatch { fill: none; stroke: var(--ink); stroke-linecap: round; opacity: .32; }
.rb { stroke: none; } .ink.rb, .hatch.rb { fill: var(--ink); } .pen.rb { fill: var(--blue); }
.mk { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.hand  { font-family: 'Caveat', cursive; fill: var(--ink); }
.hand.blue { fill: var(--blue); }
.tick { transition: stroke .3s, stroke-width .3s; }
.ticks-on .tick { stroke: var(--blue); stroke-width: 2.4; }
.grid { stroke: var(--ink); opacity: .05; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .m { position: static; max-width: 420px; margin: 8px 0 12px; }
  .trio, .stats { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  ol.preds { column-gap: 40px; }
}
@media (max-width: 640px) {
  :root { --fs-body: 17px; --fs-lead: 19px; }
  .top { padding: 16px 20px; } main { padding: 0 20px; }
  .sh { flex-wrap: wrap; row-gap: 14px; } .sh h2 { flex-basis: 100%; }
  .hero { padding: 12vh 0 10vh; }
  .hero-head { padding-bottom: 150px; }
  .hero-art { aspect-ratio: auto; height: 110px; bottom: 24px; }
  .paper { grid-template-columns: 1fr; row-gap: 12px; padding-top: 40px; }
  .sec { padding: 96px 0 84px; }
  ol.preds, .trio, .stats, .duo { grid-template-columns: 1fr; row-gap: 36px; }
  .pred { grid-template-columns: 52px minmax(0,1fr); } .pn { font-size: var(--fs-7); }
  .pred:last-child:nth-child(odd) .pbody { display: block; } .pred:last-child:nth-child(odd) .sketch.small { margin: 0 0 16px; }
  .pull { padding-left: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .u, .unfold, .mark, .ul { transition: none; animation: none; }
  .mark { background-size: 100% 100%; } .ul { background-size: 100% .38em; }
}

/* ── Reading rail ───────────────────────────────────────────────────── */
.rail {
  position: fixed; z-index: 4; top: 50%; transform: translateY(-50%);
  left: max(18px, calc((100vw - var(--wrap)) / 2 - 64px));
  display: flex; flex-direction: column; gap: 12px; padding: 4px 0;
  opacity: 0; pointer-events: none; transition: opacity .45s ease;
}
.rail.shown { opacity: 1; pointer-events: auto; }
.rail-line { display: none; }
.rail a { position: relative; display: flex; align-items: center; text-decoration: none; padding: 3px 0; }
.ri { position: relative; width: 26px; height: 26px; display: grid; place-items: center; }
.ri::before { content: ''; position: absolute; left: -12px; top: 2px; width: 2px; height: 22px; border-radius: 2px; background: var(--line); }
.ri .fill { position: absolute; left: -12px; top: 2px; width: 2px; height: calc(var(--p, 0) * 22px); border-radius: 2px; background: var(--blue); transition: height .12s linear; }
.ri svg { position: relative; width: 20px; height: 20px; fill: none; stroke: #9AA3B7; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke .3s; }
.rail a.done .ri svg { stroke: var(--blue); }
.rail a.current .ri svg { stroke: var(--ink); }
.rail a:hover .ri svg { stroke: var(--ink); }
.rl {
  position: absolute; left: 48px; white-space: nowrap; pointer-events: none;
  background: var(--ink); color: #fff; font-size: var(--fs-caption); font-weight: 500; line-height: 1; padding: 8px 11px; border-radius: 8px;
  opacity: 0; transform: translateX(-4px); transition: opacity .18s, transform .18s;
}
.rl b { font-weight: 600; color: #9DB0FF; margin-right: 8px; font-variant-numeric: tabular-nums; }
.rail a:hover .rl, .rail a:focus-visible .rl { opacity: 1; transform: none; }
.rail a:focus-visible .ri { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

/* Mobile / narrow: a thin progress bar under the header instead. */
.readbar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; display: none; }
.readbar i { display: block; height: 100%; width: calc(var(--total, 0) * 100%); background: var(--blue); transition: width .12s linear; }
.rail a.on-dark .ri::before { background: rgba(255,255,255,.16); }
.rail a.on-dark .ri .fill { background: #93A9FF; }
.rail a.on-dark .ri svg { stroke: #6F7FA8; }
.rail a.on-dark.done .ri svg { stroke: #93A9FF; }
.rail a.on-dark.current .ri svg, .rail a.on-dark:hover .ri svg { stroke: #fff; }
@media (max-width: 1299px) { .rail { display: none; } .readbar { display: block; } .top { position: sticky; } }
@media (prefers-reduced-motion: reduce) { .rail, .ri, .ri .fill, .rail-line i, .readbar i, .rl { transition: none; } }
@media print { .rail, .readbar, .hero-art { display: none; } }

/* ── The dark set piece: "The human part" ─────────────────────────── */
.dark {
  --ink: #EEF2FF; --body: #C9D3EE; --mute: #8C9AC4; --line: rgba(255,255,255,.14); --blue: #93A9FF; --blue-ink: #B5C4FF; --marker: rgba(147,169,255,.22);
  background: #0B1631; color: var(--body);
  box-shadow: 0 0 0 100vmax #0B1631; clip-path: inset(0 -100vmax);
  padding: 190px 0 200px;
}
.dark + .sec::before, .dark::before { display: none; }
.dark h2 { color: #fff; }
.dark .narrow { max-width: 700px; }
.dark .narrow p { font-family: 'Newsreader', 'Newsreader Fallback', Georgia, serif; font-size: var(--fs-4); line-height: 1.62; color: #E3E9FA; letter-spacing: -.005em; font-variation-settings: 'opsz' 24; }
.dark .center-sketch { max-width: 420px; margin-bottom: 56px; }
.dark .sketch svg { filter: url(#chalk); }
.dark .hand { fill: var(--ink); } .dark .hand.blue { fill: var(--blue); }
@media (max-width: 640px) { .dark { padding: 120px 0 130px; } .dark .narrow p { font-size: 21px; } }
@media print { .dark { background: #fff; box-shadow: none; --ink: #0E1B34; --body: #3A4660; --blue: #3B5BDB; } .dark .narrow p { color: #0E1B34; } .dark .sketch svg { filter: none; } }

/* ── Print: a considered paper, not a screenshot ─────────────────────────
   Letter, point sizes, sketches kept in the margin, breaks controlled per block. */
@page { size: letter; margin: 16mm 17mm 18mm; }
@media print {
  :root { --fs-micro: 7pt; --fs-label: 7.5pt; --fs-caption: 8pt; --fs-small: 9pt; --fs-body: 10pt; --fs-lead: 11.5pt;
    --fs-4: 13pt; --fs-5: 15pt; --fs-6: 18pt; --fs-7: 20pt; --fs-8: 26pt; --fs-9: 34pt; }
  html, body { background: #fff; } body { line-height: 1.55; overflow: visible; }
  main { padding: 0; max-width: none; }
  .top { position: static; display: flex; padding: 0 0 14pt; box-shadow: none; background: none; clip-path: none; backdrop-filter: none; animation: none; }
  .top nav, .rail, .readbar, .hero-art, .flash-btn, .flash, .flash-said, .unfold, .side { display: none !important; }
  .hero { padding: 36pt 0 0; } .hero-head { padding-bottom: 28pt; }
  .hero h1 { font-size: var(--fs-9); } .kicker { margin-bottom: 14pt; }
  .paper { padding-top: 18pt; grid-template-columns: 90pt minmax(0, 1fr); column-gap: 20pt; }
  .sec { padding: 26pt 0 8pt; break-inside: auto; }
  .sec + .sec::before { display: none; }
  .sh { margin-bottom: 14pt; break-after: avoid; } h2 { font-size: var(--fs-7); } .sh .ic { width: 22px; height: 22px; }
  .row { grid-template-columns: minmax(0, 1fr) 34%; column-gap: 20pt; margin-bottom: 10pt; }
  .row + .row { margin-top: 12pt; }
  .m { position: static; max-width: none; margin: 0; }
  .row, figure, .pred, .col, .stat, blockquote, .chapter, .final, li, h3 { break-inside: avoid; }
  h3 { break-after: avoid; }
  .pull { font-size: var(--fs-4); margin: 14pt 0; } .pull.big { font-size: var(--fs-5); }
  ol.preds { column-gap: 24pt; } .pn { font-size: var(--fs-8); } .pbody .sketch.small { height: 64px; } .pbody .sketch.small svg { max-height: 64px; }
  .trio { grid-template-columns: repeat(3, 1fr); column-gap: 18pt; } .duo { grid-template-columns: 1fr 1fr; column-gap: 24pt; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 14pt; margin-bottom: 18pt; } .stat b { font-size: var(--fs-8); }
  .chapter { min-height: 0; padding: 30pt 0 26pt; border-top: 0; }
  .ch-n { font-size: 64pt; margin-bottom: 10pt; -webkit-text-stroke: 0; color: #C9D3F4; } .ch-line { font-size: 24pt; }
  .dark { background: #fff; box-shadow: none; clip-path: none; padding: 26pt 0 8pt; --ink: #0E1B34; --body: #3A4660; --blue: #3B5BDB; }
  .dark h2 { color: var(--ink); }
  .dark .narrow p { color: #0E1B34; font-size: 12pt; } .dark .sketch svg { filter: none; } .dark .center-sketch { max-width: 220px; margin-bottom: 14pt; }
  .builders-sketch { max-width: 240px; margin-top: 12pt; }
  .final { min-height: 0; padding: 30pt 0 20pt; border-top: 0; } .final-loop { width: 230px; margin-bottom: 12pt; } .final-line { font-size: 26pt; }
  .notes { padding: 22pt 0 10pt; max-width: none; break-before: page; }
  .foot { padding: 12pt 0 0; }
  .mark { background-size: 100% 100%; } .ul, .chapter .ul { background-size: 100% .3em; }
  a.fn { background: none; padding: 0 1px; }
  .hello .k-done, .k-done { clip-path: none; } .k-raw { display: none !important; } .k-check path { stroke-dashoffset: 0; }
}

