/* A newspaper's map desk: pale neutral land on pale water with real terrain under it, flat colours for who holds what, a
   serif for reading and a Franklin gothic for everything on the map. Short notes pass over one map that stays put. */
:root {
  --bg: #ffffff; --ink: #1a1a18; --muted: #66645e; --rule: #d8d5cd; --link: #1f5a8a;
  --water: #dce6eb; --land: #f7f4ed; --land-far: #eceae2; --border: #aca79b; --halo: #ffffff; --river: #a9c4d2; --road: #bdb7a9; --shade: 0.72;
  --navy-deep: #0e3463; --red-deep: #771710; --navy: #2a6db0; --red: #c23b2e; --ochre: #d99a1c; --teal: #1f9a84; --plum: #8a55a8; --slate: #7c8791;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", "Franklin Gothic Medium", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a; --ink: #eceae5; --muted: #a4a29b; --rule: #33363b; --link: #8fbde0;
    --water: #10161b; --land: #34373b; --land-far: #24272a; --border: #5a5e64; --halo: #15171a; --river: #2d4654; --road: #5a5e64; --shade: 0.85;
    --navy-deep: #bfdcff; --red-deep: #ffc9bf; --navy: #4f8fd6; --red: #e0604f; --ochre: #c28d18; --teal: #1fa58c; --plum: #a679c9; --slate: #8c98a4; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a; --ink: #eceae5; --muted: #a4a29b; --rule: #33363b; --link: #8fbde0;
  --water: #10161b; --land: #34373b; --land-far: #24272a; --border: #5a5e64; --halo: #15171a; --river: #2d4654; --road: #5a5e64; --shade: 0.85;
  --navy-deep: #bfdcff; --red-deep: #ffc9bf; --navy: #4f8fd6; --red: #e0604f; --ochre: #c28d18; --teal: #1fa58c; --plum: #a679c9; --slate: #8c98a4; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--serif); }
[hidden] { display: none !important; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--serif); font-weight: 650; text-wrap: balance; margin: 0; letter-spacing: -0.005em; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.kicker, .when { font: 700 12px/1.3 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0; }

/* the world of stories */
#home { max-width: 1040px; margin: 0 auto; padding-block: 36px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
#home h1 { font-size: clamp(38px, 6vw, 58px); line-height: 1.05; }
.home-dek { max-width: 60ch; margin: 10px 0 18px; font-size: 20px; color: var(--muted); }
.world-box { position: relative; aspect-ratio: 2 / 1; width: 100%; margin-bottom: 30px; }
#world { width: 100%; height: 100%; display: block; }
.world-pin { position: absolute; display: flex; align-items: center; gap: 6px; transform: translate(-6px, -50%); text-decoration: none; color: var(--ink); font: 700 13.5px var(--sans); }
.world-pin i { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); border: 2px solid var(--bg); flex: none; }
.world-pin span { background: var(--bg); padding: 1px 7px; border: 1px solid var(--rule); white-space: nowrap; }
.world-pin:hover span { border-color: var(--ink); }
#story-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 32px; }
.story-link { display: flex; flex-direction: column; gap: 5px; color: inherit; text-decoration: none; }
.story-link img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; display: block; margin-bottom: 6px; }
.story-link strong { font: 650 27px/1.15 var(--serif); }
.story-link span:last-child { color: var(--muted); }
.story-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* the map, held still while the steps pass over it */
#stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font: 600 13px var(--sans); pointer-events: none; z-index: 5; }
#topbar a, #topbar button { pointer-events: auto; color: var(--ink); text-decoration: none; background: var(--bg); padding: 3px 9px; border: 1px solid var(--rule); font: inherit; cursor: pointer; white-space: nowrap; }
.topbar-right { display: flex; gap: 6px; align-items: center; min-width: 0; }
#story-title { background: var(--bg); padding: 3px 9px; border: 1px solid var(--rule); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#side { position: absolute; right: max(18px, env(safe-area-inset-right, 0px)); top: 46px; width: 300px; max-width: calc(100% - 36px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; z-index: 1; }
#key, #chart, #held { background: var(--bg); border: 1px solid var(--rule); padding: 8px 11px; font: 500 12.5px/1.3 var(--sans); pointer-events: auto; }
#key { display: flex; flex-direction: column; gap: 4px; }
#key span { display: flex; gap: 7px; align-items: center; }
#key i { width: 16px; height: 12px; flex: none; background: var(--c); opacity: .85; }
#key i.hatch { background: repeating-linear-gradient(135deg, var(--c) 0 2px, transparent 2px 6px); opacity: 1; outline: 1px solid var(--rule); }
#held p { margin: 0 0 4px; }
.held-bar { height: 8px; background: var(--south, var(--navy)); position: relative; }
#held-north, #held2-north { position: absolute; left: 0; top: 0; bottom: 0; display: block; background: var(--north, var(--red)); }
#held2 { margin-top: 6px; }
#ledger, #overlay-ctl { background: var(--bg); border: 1px solid var(--rule); padding: 8px 11px; font: 500 12.5px/1.3 var(--sans); pointer-events: auto; }
#ledger p, #overlay-ctl p { margin: 0; }
#overlay-name { font-weight: 600; margin-bottom: 4px; }
.ov-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.ov-row input { flex: 1; min-width: 0; accent-color: var(--ink); }
.led-row { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; margin-top: 5px; font-size: 12px; }
.led-num { font-variant-numeric: tabular-nums; }
.led-row i { grid-column: 1 / -1; height: 6px; display: block; margin-top: 2px; }
#chart p { margin: 0; }
.chart-title { font-weight: 700; font-size: 13px; }
.chart-sub, .chart-note { color: var(--muted); font-size: 11px; font-weight: 400; }
#chart svg { display: block; width: 100%; height: auto; margin-block: 3px; font: 500 10px var(--sans); overflow: visible; }
#chart .grid { stroke: var(--rule); stroke-width: 1; }
#chart .tick { fill: var(--muted); }
#chart .end-name { fill: var(--ink); font-size: 10px; font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.chart-table { font-size: 11px; color: var(--muted); }
.chart-table summary { cursor: pointer; }
.chart-table table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; margin-top: 3px; display: block; max-height: 150px; overflow-y: auto; }
.chart-table th, .chart-table td { padding: 1px 6px 1px 0; text-align: right; font-weight: 400; }
.chart-table th { font-weight: 600; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
#date { position: absolute; right: max(18px, env(safe-area-inset-right, 0px)); bottom: 68px; font: 700 clamp(42px, 6vw, 68px)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--ink); text-shadow: 0 0 10px var(--halo), 0 0 3px var(--halo); pointer-events: none; text-align: right; max-width: 44vw; }
#date.long { font-size: clamp(20px, 2.6vw, 32px); line-height: 1.1; }
#pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pin { position: absolute; left: 0; top: 0; width: 136px; padding: 3px; background: var(--bg); border: 1px solid var(--ink); cursor: zoom-in; box-shadow: 0 2px 8px rgb(0 0 0 / .22); }
.pin img { display: block; width: 100%; height: auto; max-height: 110px; object-fit: cover; }

/* the timeline: who governed, or who was winning, with a needle for now */
#timeline { position: absolute; left: max(18px, env(safe-area-inset-left, 0px)); right: max(18px, env(safe-area-inset-right, 0px)); bottom: 12px; height: 50px; z-index: 1; }
#now { position: absolute; left: 0; bottom: 34px; font: 600 12px var(--sans); background: var(--bg); padding: 1px 7px 1px 5px; border: 1px solid var(--rule); border-left: 4px solid var(--c); white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
#ribbon { position: absolute; left: 0; right: 0; bottom: 19px; height: 8px; background: var(--rule); }
#ribbon i { position: absolute; top: 0; bottom: 0; display: block; }
#needle { position: absolute; bottom: 16px; width: 3px; height: 14px; margin-left: -1.5px; background: var(--ink); box-shadow: 0 0 0 1px var(--bg); pointer-events: none; }
#ticks { position: absolute; left: 0; right: 0; bottom: 27px; height: 7px; }
#ticks button { position: absolute; bottom: 0; width: 10px; height: 10px; margin-left: -5px; padding: 0; background: none; border: 0; cursor: pointer; }
#ticks button::after { content: ""; position: absolute; left: 4px; bottom: 0; width: 2px; height: 5px; background: var(--muted); }
#ticks button[aria-current="true"]::after { background: var(--ink); height: 8px; left: 3px; width: 4px; }
#ribbon-key { position: absolute; left: 0; bottom: 0; max-width: 100%; display: flex; flex-wrap: wrap; gap: 0 12px; height: 15px; overflow: hidden; padding: 0 5px 0 0; font: 500 11px/15px var(--sans); color: var(--ink); background: color-mix(in srgb, var(--halo) 78%, transparent); }
#ribbon-key span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#ribbon-key i { width: 10px; height: 8px; display: block; }

/* the steps */
#scroller { position: relative; margin-top: -100vh; margin-top: -100dvh; pointer-events: none; z-index: 3; }
#intro, .card { pointer-events: auto; background: var(--bg); width: min(390px, calc(100% - 32px)); margin-left: max(28px, 3.5vw); padding: 16px 20px; box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 6px 22px rgb(0 0 0 / .1); }
#intro { margin-top: 62px; margin-bottom: 55vh; padding-block: 20px; }
#intro h1 { font-size: clamp(30px, 3.8vw, 42px); line-height: 1.07; margin: 6px 0 10px; }
.dek { margin: 0 0 10px; font-size: 18px; color: var(--muted); }
.hint { margin: 0; font: 600 13px var(--sans); color: var(--muted); }
#steps { display: flex; flex-direction: column; gap: 58vh; padding-bottom: 60vh; }
.card { display: flex; flex-direction: column; gap: 7px; }
.card > * { margin: 0; }
.card h2 { font-size: 21px; line-height: 1.18; }
.card p { font-size: 16.5px; line-height: 1.48; }
.card p.when { font-size: 11.5px; line-height: 1.3; }
.card p.follow { font: 700 11.5px/1.3 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--bg); background: var(--ink); align-self: flex-start; padding: 2px 8px; }
.card.person { border-top: 4px solid var(--ink); }
figure { margin: 3px 0 0; }
.card figure img { width: 100%; height: auto; max-height: 210px; object-fit: cover; object-position: 50% 28%; display: block; }
.zoom { all: unset; display: block; width: 100%; cursor: zoom-in; }
.zoom:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
figcaption { font: 400 12.5px/1.4 var(--sans); color: var(--muted); margin-top: 5px; }
.credit { display: block; font-size: 11.5px; margin-top: 2px; }
.pin-fig { display: none; }
.card p.pin-credit { font: 400 11.5px/1.35 var(--sans); color: var(--muted); }
.src { font: 400 12.5px/1.4 var(--sans); color: var(--muted); }
.src summary { cursor: pointer; }
.src ul { margin: 5px 0 0; padding-left: 16px; }
.src p { margin: 5px 0 0; }

/* people's own words */
.card.voice { gap: 9px; border-left: 4px solid var(--ink); }
.card.voice blockquote { margin: 0; font: 400 22px/1.32 var(--serif); }
.card p.voice-who { font: 400 13.5px/1.35 var(--sans); }
.card p.voice-note { font: 400 12.5px/1.4 var(--sans); color: var(--muted); }
/* who's who */
.who { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.who:hover { text-decoration-style: solid; }
#who-pop { position: fixed; z-index: 30; width: min(320px, calc(100vw - 24px)); background: var(--bg); border: 1px solid var(--ink); padding: 12px 14px; font: 400 14.5px/1.42 var(--serif); box-shadow: 0 4px 18px rgb(0 0 0 / .28); max-height: 70vh; overflow: auto; }
#who-pop img { display: block; width: 90px; height: 90px; object-fit: cover; float: right; margin: 0 0 6px 10px; }
#who-pop strong { font: 700 15px var(--sans); }
#who-pop p { margin: 4px 0; }
#who-pop .who-role { font: 500 12.5px var(--sans); color: var(--muted); }
.who-close { position: absolute; top: 4px; right: 6px; background: var(--bg); border: 0; font: 700 18px var(--sans); cursor: pointer; color: var(--ink); line-height: 1; padding: 2px 5px; }
.card.wide { width: min(560px, calc(100% - 32px)); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.side { border-top: 4px solid var(--c); padding-top: 6px; }
.side h3 { font: 700 14px var(--sans); margin-bottom: 5px; }
.side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font: 400 12.5px/1.32 var(--sans); }
.side li .who { font-weight: 600; }
.side li span { color: var(--muted); display: block; }
.cast h3, .quiz h3 { font-size: 20px; margin-bottom: 8px; }
.cast-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 8px 22px; }
.cast-name { text-align: left; text-decoration: none; display: flex; flex-direction: column; font: 400 13px/1.3 var(--sans); }
.cast-name strong { font-weight: 600; font-size: 14.5px; text-decoration: underline dotted; text-underline-offset: 3px; }
.cast-name span { color: var(--muted); }
/* what happens next */
.card.predict h2 { margin-top: 2px; }
.options { display: flex; flex-direction: column; gap: 6px; }
.options button { text-align: left; font: 500 14.5px/1.3 var(--sans); padding: 8px 10px; background: none; border: 1px solid var(--ink); color: var(--ink); cursor: pointer; }
.options button:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.options button:disabled { cursor: default; color: var(--muted); border-color: var(--rule); }
.options button.right { color: var(--ink); border: 2px solid var(--ink); font-weight: 700; }
.options button.right::before { content: "✓ "; }
.options button.chose-wrong { text-decoration: line-through; }
.reveal { border-left: 3px solid var(--ink); padding-left: 10px; }
.reveal p { margin: 0; }
/* then and now */
.compare { pointer-events: auto; position: relative; width: 100%; height: 100vh; height: 100dvh; margin: 0; background: #0d0e0f; overflow: hidden; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.c-before { clip-path: inset(0 calc(100% - var(--cut)) 0 0); }
.compare.fit img { object-fit: contain; padding-bottom: 76px; }
.card a.thread { font: 600 13.5px/1.35 var(--sans); }
.c-line { position: absolute; top: 0; bottom: 0; left: var(--cut); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px rgb(0 0 0 / .7); pointer-events: none; }
.c-line::after { content: "⇆"; position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%); background: #fff; color: #111; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 19px var(--sans); box-shadow: 0 1px 6px rgb(0 0 0 / .5); }
.c-tag { position: absolute; top: 54px; background: rgb(0 0 0 / .72); color: #fff; font: 700 13px var(--sans); padding: 3px 9px; pointer-events: none; }
.c-tag-a { left: 16px; } .c-tag-b { right: 16px; }
.compare input { position: absolute; inset: 0 0 90px 0; width: 100%; height: calc(100% - 90px); margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.compare figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding-block: 30px 14px; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); color: #f5f4f0; font: 400 15px/1.4 var(--serif); background: linear-gradient(to top, rgb(0 0 0 / .86), rgb(0 0 0 / 0)); margin: 0; pointer-events: none; }
.compare figcaption strong { font-weight: 700; }
.compare .credit { color: #d7d5cf; font: 400 11.5px var(--sans); }
.compare .credit a { color: #d7d5cf; pointer-events: auto; }
/* test yourself */
.quiz { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.quiz p { margin: 0; }
.quiz-intro { font: 500 13px var(--sans); color: var(--muted); }
.quiz-last { font: 500 14px/1.4 var(--sans); color: var(--ink); background: var(--panel, var(--bg)); border-left: 3px solid var(--ochre); padding: 6px 10px; }
.recap { max-width: 1100px; margin: 0 0 28px; }
.recap h3 { font-size: 20px; margin-bottom: 4px; }
.recap-dek { font: 500 14px/1.4 var(--sans); color: var(--muted); margin: 0 0 12px; }
.recap ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.recap li { display: flex; flex-direction: column; gap: 6px; }
.recap img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 25%; display: block; }
.recap li p { margin: 0; font-size: 15px; line-height: 1.4; }
.recap li b { font: 700 13px var(--sans); color: var(--ochre); margin-right: 2px; }
@media (max-width: 860px) { .recap ol { grid-template-columns: 1fr; gap: 12px; } .recap li { display: grid; grid-template-columns: 116px 1fr; gap: 10px; align-items: start; } .recap img { height: 88px; aspect-ratio: auto; } }
.quiz-q { font: 650 21px/1.2 var(--serif); }
.quiz-map { aspect-ratio: 4 / 3; width: 100%; max-height: 72vh; }
#quiz-canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.quiz-result { font-size: 16px; line-height: 1.45; min-height: 1.4em; }
.quiz-actions { display: flex; gap: 8px; }
.quiz-actions button { background: var(--ink); color: var(--bg); border: 0; padding: 7px 16px; font: 600 14px var(--sans); cursor: pointer; }
.quiz-order { display: flex; flex-direction: column; gap: 6px; }
.quiz-order button { text-align: left; background: none; border: 1px solid var(--ink); color: var(--ink); padding: 8px 10px; font: 500 14.5px var(--sans); cursor: pointer; }
.quiz-order button.picked { background: var(--ink); color: var(--bg); }
/* playing */
#play-bar { position: absolute; left: 50%; transform: translateX(-50%); top: 44px; display: flex; gap: 6px; z-index: 6; font: 600 13px var(--sans); }
#play-bar button { background: var(--bg); color: var(--ink); border: 1px solid var(--ink); padding: 3px 10px; font: inherit; cursor: pointer; white-space: nowrap; }

/* a photo or a period map that takes the whole screen between chapters */
.bleed { pointer-events: auto; position: relative; width: 100%; height: 100vh; height: 100dvh; margin: 0; background: #0d0e0f; display: block; overflow: hidden; }
.bleed img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bleed.contain img { object-fit: contain; background: #f2f0ea; padding-bottom: 76px; }
.bleed.film video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0d0e0f; }
.film-toggle { position: absolute; top: 56px; right: max(14px, env(safe-area-inset-right, 0px)); background: rgb(0 0 0 / .55); color: #f5f4f0; border: 1px solid rgb(255 255 255 / .4); font: 600 12.5px var(--sans); padding: 5px 12px; cursor: pointer; }
.film-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hear { margin: 6px 0 2px; }
.hear button { background: var(--ink); color: var(--bg); border: 0; padding: 6px 12px; font: 600 13px var(--sans); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.hear button[aria-pressed="true"] { background: var(--red); }
.hear-words { margin-top: 6px; font: 400 13px/1.45 var(--sans); }
.hear-words summary { cursor: pointer; color: var(--muted); }
.hear-words p { margin: 6px 0 0; }
.bleed figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding-block: 30px 14px; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); color: #f5f4f0; font: 400 15px/1.4 var(--serif); background: linear-gradient(to top, rgb(0 0 0 / .82), rgb(0 0 0 / 0)); margin: 0; }
.bleed.contain figcaption { background: #0d0e0f; padding-top: 12px; }
.bleed figcaption strong { font-weight: 700; }
.bleed .credit { color: #d7d5cf; font: 400 11.5px var(--sans); }
.bleed .credit a { color: #d7d5cf; }

/* what to take from it */
#teach { pointer-events: auto; background: var(--bg); position: relative; z-index: 4; padding-block: 56px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-top: 1px solid var(--rule); }
.teach-inner { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.teach-inner h2 { font-size: clamp(27px, 4vw, 40px); line-height: 1.1; }
.teach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 26px 34px; }
.teach-grid h3 { font-size: 20px; margin-bottom: 8px; }
.teach-grid ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 16.5px; line-height: 1.45; }
.teach-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font: 600 14px var(--sans); }
#explore-open { background: var(--ink); color: var(--bg); border: 0; padding: 8px 16px; cursor: pointer; font: inherit; }

/* exploring freely */
body.exploring #scroller, body.exploring #teach { display: none; }
body.exploring #map { cursor: grab; touch-action: none; }
body.exploring #map:active { cursor: grabbing; }
#explore-bar { position: absolute; left: max(18px, env(safe-area-inset-left, 0px)); bottom: 76px; width: min(430px, calc(100% - 36px)); background: var(--bg); border: 1px solid var(--ink); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font: 500 13px var(--sans); z-index: 2; }
#explore-bar input { width: 100%; accent-color: var(--ink); }
#explore-title { font-weight: 600; min-height: 2.5em; }
.explore-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.explore-row button { border: 1px solid var(--rule); background: none; padding: 2px 10px; cursor: pointer; font: inherit; color: var(--ink); }
.explore-hint { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: auto; }
#pop { position: absolute; width: 280px; max-width: calc(100% - 16px); background: var(--bg); border: 1px solid var(--ink); padding: 10px 12px; font: 400 14px/1.4 var(--serif); z-index: 3; box-shadow: 0 3px 14px rgb(0 0 0 / .25); }
#pop strong { font: 700 14px var(--sans); }
#pop p { margin: 4px 0; }
.pop-head { font-weight: 650; }
#pop button { border: 1px solid var(--ink); background: none; padding: 2px 10px; font: 600 12.5px var(--sans); cursor: pointer; color: var(--ink); }
dialog { border: 1px solid var(--ink); background: var(--bg); color: var(--ink); padding: 12px; max-width: min(900px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / .6); }
dialog img { display: block; max-width: 100%; max-height: 72vh; }
dialog p { font: 400 14px/1.4 var(--sans); margin: 8px 0; }
dialog button { border: 1px solid var(--ink); background: none; padding: 3px 12px; cursor: pointer; font: 600 13px var(--sans); color: var(--ink); }

@media (max-width: 859px) {
  body { font-size: 16px; }
  #intro, .card { width: calc(100% - 24px); margin-left: 12px; padding: 12px 14px; }
  #intro { margin-top: 56vh; margin-bottom: 38vh; }
  #steps { gap: 66vh; }
  .card h2 { font-size: 19px; }
  .card p { font-size: 15.5px; }
  /* on a phone the photo sits as a thumbnail beside its caption, so the card covers less of the map; tapping still opens it whole */
  .card figure { display: grid; grid-template-columns: 116px 1fr; gap: 9px; align-items: start; }
  .card figure img { height: 88px; max-height: none; }
  .card figure figcaption { margin-top: 0; }
  .pin-fig { display: block; }
  .card p.pin-credit { display: none; }
  #side { top: 42px; right: 8px; width: 56vw; gap: 5px; }
  #key { font-size: 10.5px; padding: 4px 6px; }
  #key i { width: 12px; height: 9px; }
  #held { font-size: 10.5px; padding: 4px 6px; }
  #chart { padding: 4px 6px; }
  .chart-sub, .chart-note, .chart-table { display: none; }
  .chart-title { font-size: 11px; }
  #date, #date.long { top: 42px; bottom: auto; right: auto; left: 12px; text-align: left; font-size: 20px; max-width: 38vw; line-height: 1.05; }
  #date:not(.long) { font-size: 32px; }
  #timeline { left: 10px; right: 10px; bottom: 6px; height: 34px; }
  #ribbon-key { display: none; }
  #now { font-size: 10.5px; bottom: 18px; }
  #ribbon { bottom: 3px; }
  #needle { bottom: 0; }
  #ticks { bottom: 11px; }
  #story-title { display: none; }
  /* on a phone the land and people bars already name the two colours, so the key gives its room back to the map */
  #side:has(#held2:not([hidden])) #key { display: none; }
  #side:has(#held2:not([hidden])) { width: 46vw; }
  /* the flows' ledger needs the room more than the bars do */
  #side:has(#ledger:not([hidden])) #held { display: none; }
  #play-bar { top: auto; bottom: 50px; }
  #ledger, #overlay-ctl { font-size: 10.5px; padding: 4px 6px; }
  .led-row { font-size: 10.5px; margin-top: 2px; }
  .sides { grid-template-columns: 1fr; gap: 8px; }
  .card.voice blockquote { font-size: 18px; }
  .card.wide { width: calc(100% - 24px); }
  .side ul { font-size: 12px; }
  #explore-bar { bottom: 46px; left: 8px; width: calc(100% - 16px); padding: 7px 9px; }
  .explore-hint { display: none; }
}

/* while a story's files load */
body.loading { cursor: progress; }
body.loading::after { content: 'Loading the story'; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--ink); color: var(--bg); font: 600 14px var(--sans); padding: 8px 14px; z-index: 50; }
.load-error { font: 500 14px var(--sans); color: var(--red); }
.share-step { all: unset; display: inline-block; margin-top: 6px; font: 600 12px var(--sans); color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.share-step:hover { color: var(--ink); }
.share-step:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* the tip that Space turns the page, on computers only, until the reader has used it once */
#keys-tip { position: absolute; left: 50%; transform: translateX(-50%); top: 46px; z-index: 5; margin: 0; background: var(--bg); color: var(--ink); border: 1px solid var(--rule); padding: 5px 11px; font: 500 12.5px/1.3 var(--sans); white-space: nowrap; pointer-events: none; }
#keys-tip kbd, .keys-hint kbd { font: 600 11.5px var(--sans); border: 1px solid var(--muted); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; }
@media (hover: none), (pointer: coarse), (max-width: 859px) { #keys-tip, .keys-hint { display: none; } }
