@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("fonts/fraunces-normal-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-2019, U+201C-201E, U+2022, U+2026, U+20AC, U+2190-2193, U+2212; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("fonts/fraunces-normal-latin-ext.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/IBMPlexSans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2013-2014, U+2018-2019, U+201C-201E, U+2022, U+2026, U+20AC, U+2190-2193, U+2212; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/IBMPlexSans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }

:root {
  color-scheme: light;
  --bg: #eceff0; --bg2: #e2e7e8; --paper: #f6f7f6; --ink: #0f1a22; --ink2: #3a4954; --mute: #5b6a74; --rule: rgba(15,26,34,.14);
  --today: #205696; --cc: #a85c00; --ccfill: #e2840a; --cci: #d6ba8c; --levee: #782814; --focus: #0b5cad;
  --serif: "Fraunces", Georgia, "Times New Roman", serif; --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --top: 52px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; --bg: #070e16; --bg2: #0d1824; --paper: #0f1c29; --ink: #e8eef3; --ink2: #b9c6d1; --mute: #8e9eab; --rule: rgba(200,220,235,.14); --today: #6fb0f0; --cc: #ffb23e; --ccfill: #ffaa2e; --cci: #968062; --levee: #fff0d2; --focus: #8cc8ff; } }
:root[data-theme="dark"] { color-scheme: dark; --bg: #070e16; --bg2: #0d1824; --paper: #0f1c29; --ink: #e8eef3; --ink2: #b9c6d1; --mute: #8e9eab; --rule: rgba(200,220,235,.14); --today: #6fb0f0; --cc: #ffb23e; --ccfill: #ffaa2e; --cci: #968062; --levee: #fff0d2; --focus: #8cc8ff; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.62 var(--serif); font-optical-sizing: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 50; }
.skip-link:focus { left: 8px; }
b, strong { font-weight: 650; }
.today { color: var(--today); font-weight: 650; }
.cc { color: var(--cc); font-weight: 650; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: calc(var(--top) + var(--inset-top, 0px)); padding: var(--inset-top, 0px) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); font: 500 14px/1 var(--sans); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--today) 0 42%, var(--ccfill) 43% 64%, transparent 65%); box-shadow: 0 0 0 1px var(--rule); flex: none; }
.topnav { display: flex; gap: 16px; margin-left: 18px; }
.topnav a { text-decoration: none; color: var(--ink2); }
.topnav a:hover { color: var(--ink); }
.spacer { flex: 1; }
.chip { font: 600 12px/1 var(--sans); padding: 7px 9px; border-radius: 999px; text-decoration: none; color: var(--ink2); border: 1px solid transparent; }
.chip[aria-current="page"] { border-color: var(--rule); color: var(--ink); }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; } :root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none; } :root:not([data-theme="light"]) .i-moon { display: block; } }
@media (max-width: 860px) { .topnav { display: none; } }

/* story: sticky stage beside steps */
.story { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 470px); }
.stage { position: sticky; top: calc(var(--top) + var(--inset-top, 0px)); height: calc(100vh - var(--top) - var(--inset-top, 0px)); height: calc(100svh - var(--top) - var(--inset-top, 0px)); grid-column: 1; grid-row: 1; overflow: hidden; }
.stage canvas, .map canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage canvas { touch-action: pan-y; }
.steps { grid-column: 2; grid-row: 1; padding: 0 clamp(18px, 3vw, 40px) 30vh; position: relative; z-index: 2; }
.step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; }
.step > div { background: color-mix(in srgb, var(--paper) 92%, transparent); border: 1px solid var(--rule); border-radius: 14px; padding: 22px 24px; box-shadow: 0 18px 60px -30px rgba(0,0,0,.45); }
.step p { margin: 0 0 .7em; } .step p:last-child { margin-bottom: 0; }
.step h2 { font: 600 clamp(24px, 2.4vw, 30px)/1.15 var(--serif); margin: 0 0 .5em; letter-spacing: -.01em; }
.hero-step { min-height: calc(100svh - var(--top)); justify-content: flex-end; padding-bottom: 9vh; }
.hero-step > div { background: none; border: 0; box-shadow: none; padding: 0; }
.kicker { font: 600 13px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--cc); margin: 0 0 14px; }
h1 { font: 650 clamp(34px, 4.3vw, 58px)/1.04 var(--serif); letter-spacing: -.022em; margin: 0 0 18px; font-variation-settings: "SOFT" 30, "WONK" 0; }
.deck { font-size: 20px; line-height: 1.5; color: var(--ink2); margin: 0 0 18px; }
.big { display: flex; gap: 22px; flex-wrap: wrap; margin: 6px 0 18px; }
.big div { min-width: 120px; }
.big .n { font: 650 clamp(34px, 3.6vw, 46px)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; display: block; }
.big .l { font: 500 13.5px/1.35 var(--sans); color: var(--mute); display: block; margin-top: 6px; max-width: 16ch; }
.stage-ui { position: absolute; left: 16px; bottom: 16px; right: 16px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; pointer-events: none; }
.stage-ui > * { pointer-events: auto; }
.when { display: inline-flex; border-radius: 999px; padding: 3px; background: color-mix(in srgb, var(--paper) 90%, transparent); border: 1px solid var(--rule); box-shadow: 0 8px 30px -14px rgba(0,0,0,.5); }
.when button { font: 600 13.5px/1 var(--sans); border: 0; background: transparent; color: var(--ink2); padding: 9px 14px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.when button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.when .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.t { background: var(--today); } .sw.c { background: var(--ccfill); }
.legend { font: 500 12.5px/1.4 var(--sans); color: var(--ink2); background: color-mix(in srgb, var(--paper) 90%, transparent); border: 1px solid var(--rule); border-radius: 10px; padding: 8px 11px; display: grid; gap: 4px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.legend i.t { background: var(--today); } .legend i.c { background: var(--ccfill); } .legend i.ci { background: var(--cci); } .legend i.l { height: 3px; background: var(--levee); border-radius: 2px; }
.stage-cap { font: 500 13px/1.4 var(--sans); color: var(--ink2); max-width: 44ch; background: color-mix(in srgb, var(--paper) 86%, transparent); padding: 6px 10px; border-radius: 8px; margin: 0; }
.stage-cap:empty { display: none; }

@media (max-width: 860px) {
  .story { display: block; }
  .stage { height: 40svh; height: min(40svh, 380px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--rule); box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
  .steps { z-index: 1; }
  .steps { padding: 0 16px 20vh; }
  .step { min-height: 64vh; }
  .hero-step { min-height: auto; padding: 22px 0 8vh; }
  .stage-ui { left: 8px; right: 8px; bottom: 8px; gap: 6px; }
  .legend { font-size: 11px; padding: 5px 8px; gap: 2px; order: 3; }
  .stage .legend span:last-child { display: none; }
  .stage-cap { font-size: 12px; max-width: none; flex: 1 1 100%; }
  .when button { padding: 7px 11px; font-size: 12.5px; }
  body { font-size: 17.5px; }
  .deck { font-size: 18px; }
}

/* prose sections */
.sec { max-width: 720px; margin: 0 auto; padding: 64px 18px 8px; }
.sec h2 { font: 650 clamp(28px, 3vw, 38px)/1.12 var(--serif); letter-spacing: -.015em; margin: 0 0 .5em; }
.sec h3 { font: 600 21px/1.25 var(--serif); margin: 1.6em 0 .4em; }
.sec p { margin: 0 0 1em; }
.wide { max-width: 1180px; }
.note { font: 400 14.5px/1.55 var(--sans); color: var(--mute); }

/* explorer */
.explorer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; background: var(--paper); margin-top: 18px; }
.map { position: relative; height: min(76vh, 720px); background: var(--bg2); }
.map-tools { position: absolute; right: 12px; top: 12px; display: grid; gap: 6px; }
.map-tools button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: 600 18px/1 var(--sans); cursor: pointer; }
.map-tools button[hidden] { display: none; }
.map-ui { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.map-msg { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); font: 500 12.5px/1.3 var(--sans); color: var(--ink2); background: color-mix(in srgb, var(--paper) 88%, transparent); padding: 5px 10px; border-radius: 99px; pointer-events: none; }
.map-msg:empty { display: none; }
.levtog { font: 500 13px/1 var(--sans); display: inline-flex; gap: 7px; align-items: center; background: color-mix(in srgb, var(--paper) 90%, transparent); border: 1px solid var(--rule); border-radius: 999px; padding: 8px 12px; color: var(--ink2); }
.panel { padding: 20px; display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--rule); }
.pick { position: relative; }
.pick label { font: 600 13px/1.3 var(--sans); color: var(--ink2); display: block; margin-bottom: 6px; }
.pick-row { display: flex; gap: 6px; }
.pick input { flex: 1; min-width: 0; font: 500 16px/1.2 var(--sans); padding: 12px 13px; border-radius: 10px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); }
.btn { font: 600 14px/1 var(--sans); padding: 11px 14px; border-radius: 10px; border: 1px solid var(--rule); background: var(--ink); color: var(--bg); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn[hidden] { display: none; }
.sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 18px 40px -20px rgba(0,0,0,.5); font: 400 15px/1.3 var(--sans); }
.sugg li { padding: 9px 10px; border-radius: 7px; cursor: pointer; }
.sugg li[aria-selected="true"], .sugg li:hover { background: var(--bg2); }
.sugg span { color: var(--mute); font-size: 13.5px; }
.examples { font: 400 13.5px/1.6 var(--sans); color: var(--mute); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.res-empty { font: 400 15px/1.55 var(--sans); color: var(--mute); margin: 0; }
.res h3 { font: 650 28px/1.1 var(--serif); margin: 0; }
.res .sub { font: 500 13.5px/1.3 var(--sans); color: var(--mute); margin: 4px 0 12px; }
.res .h { font: 600 18px/1.4 var(--sans); margin: 0 0 10px; }
.res .b { font: 400 15.5px/1.55 var(--sans); color: var(--ink2); margin: 0 0 12px; }
.bar { height: 12px; border-radius: 6px; background: var(--bg2); display: flex; overflow: hidden; margin: 0 0 4px; }
.bar span { display: block; height: 100%; }
.b-today { background: var(--today); } .b-cc { background: var(--ccfill); } .b-cci { background: var(--cci); }
.bar-l { font: 500 12px/1.3 var(--sans); color: var(--mute); display: flex; justify-content: space-between; margin-bottom: 12px; }
.shared { font: 500 14.5px/1.45 var(--sans); background: color-mix(in srgb, var(--ccfill) 18%, var(--paper)); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; }
.share { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.share .lbl { font: 600 12.5px/1 var(--sans); color: var(--mute); flex: 1 1 100%; margin-bottom: 2px; }
.share a, .share button { font: 600 13px/1 var(--sans); padding: 9px 11px; border-radius: 9px; border: 1px solid var(--rule); background: transparent; color: var(--ink); text-decoration: none; cursor: pointer; }
.share [hidden] { display: none; }
.share-msg { font: 500 12.5px/1.3 var(--sans); color: var(--mute); flex: 1 1 100%; min-height: 1em; }
@media (max-width: 860px) {
  .explorer { grid-template-columns: 1fr; border-radius: 12px; }
  .map { height: 58svh; }
  .panel { border-left: 0; border-top: 1px solid var(--rule); }
}

/* figures and table */
figure { margin: 22px 0; }
figcaption { font: 500 13.5px/1.45 var(--sans); color: var(--mute); margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font: 400 14.5px/1.35 var(--sans); }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
th { font-weight: 600; color: var(--ink2); font-size: 12.5px; letter-spacing: .02em; }
td .cty { color: var(--mute); font-size: 12.5px; display: block; }
td.x { font-weight: 650; color: var(--cc); }
.tbl-wrap { overflow-x: auto; }
.mini { display: inline-block; vertical-align: middle; height: 8px; border-radius: 4px; background: var(--bg2); width: 90px; position: relative; overflow: hidden; }
.mini i, .mini b { position: absolute; top: 0; bottom: 0; left: 0; }
.mini i { background: var(--ccfill); } .mini b { background: var(--today); }
.attrib { font: 500 14px/1.5 var(--sans); border-left: 3px solid var(--today); padding: 8px 14px; background: var(--paper); border-radius: 0 10px 10px 0; }
.src li { margin-bottom: .55em; font: 400 15px/1.5 var(--sans); }
footer { max-width: 720px; margin: 60px auto 0; padding: 26px 18px 60px; border-top: 1px solid var(--rule); font: 400 14px/1.5 var(--sans); color: var(--mute); }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.flag { color: var(--mute); font: 600 13px/1 var(--sans); }
.bar-l { gap: 8px; flex-wrap: wrap; } .cci-l { color: var(--mute); }
.ex-legend { padding: 6px 9px; }
@media (max-width: 860px) { .ex-legend { display: none; } }
