@font-face{font-family:"Newsreader";font-style:normal;font-weight:200 800;font-display:swap;src:url(fonts/newsreader-latin.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Newsreader";font-style:normal;font-weight:200 800;font-display:swap;src:url(fonts/newsreader-latin-ext.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Newsreader";font-style:italic;font-weight:400;font-display:swap;src:url(fonts/newsreader-italic-400-latin.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Newsreader";font-style:italic;font-weight:400;font-display:swap;src:url(fonts/newsreader-italic-400-latin-ext.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Plex Mono";font-style:normal;font-weight:400;font-display:swap;src:url(fonts/IBMPlexMono-Regular.woff2) format("woff2")}

/* The map is the page. The story sits on glass beside it; the page around (sources, footer) follows the theme. */
:root{
  --bg:#f4f1e8;--bg-2:#ebe6d8;--card:#fbf9f3;--ink:#1d1a14;--ink-2:#4b453a;--rule:#d8d0bd;--rule-2:#8a806c;
  --accent:#0b5563;--link:#0a4c57;--bar-bg:rgba(244,241,232,.9);
  --s-ink:#f6f8f5;--s-ink-2:#c9d6d1;--s-acc:#ffcf8a;--s-glass:rgba(9,24,30,.86);--s-rule:rgba(220,240,232,.18);
  --sea:#237f97;--old:#c95a3c;--ubaid:#ffb347;--river:#2f86b4;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#0c1416;--bg-2:#121d20;--card:#122024;--ink:#ece9e1;--ink-2:#b8c3bf;--rule:#243538;--rule-2:#6a7f7a;
  --accent:#7fd4c1;--link:#93dcc9;--bar-bg:rgba(12,20,22,.88);color-scheme:dark;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0c1416;--bg-2:#121d20;--card:#122024;--ink:#ece9e1;--ink-2:#b8c3bf;--rule:#243538;--rule-2:#6a7f7a;
    --accent:#7fd4c1;--link:#93dcc9;--bar-bg:rgba(12,20,22,.88);color-scheme:dark;
  }
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{margin:0;background:#0c3550;color:var(--ink);font:400 1.1875rem/1.6 "Newsreader",Georgia,serif;font-optical-sizing:auto}
a{color:var(--link);text-underline-offset:.18em;text-decoration-thickness:1px}
a:hover{text-decoration-thickness:2px}
:focus-visible{outline:3px solid var(--s-acc);outline-offset:3px;border-radius:4px}
b,strong{font-weight:640}
.skip{position:absolute;left:-999px;top:0;background:var(--card);color:var(--ink);padding:.5rem .8rem;z-index:99}
.skip:focus{left:.5rem;top:.5rem}
section[id],header[id]{scroll-margin-top:2.75rem}
.num{font-variant-numeric:tabular-nums}

/* ---- top bar ---- */
.topbar{position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:.9rem;height:2.75rem;padding:0 1rem;background:var(--bar-bg);border-bottom:1px solid var(--rule);font-size:.9rem}
.topbar a{color:var(--ink);text-decoration:none}
.topbar .home{font-weight:600;white-space:nowrap}
.topnav{display:flex;gap:1rem;overflow-x:auto;scrollbar-width:none;min-width:0;flex:0 1 auto}
.topnav::scrollbar{display:none}
.topnav a{white-space:nowrap;color:var(--ink-2)}
.topnav a:hover,.topnav a[aria-current="true"]{color:var(--ink);text-decoration:underline}
.spacer{flex:1 1 0}
.chip{border:1px solid var(--rule-2);border-radius:99px;padding:.1rem .6rem;font-size:.82rem;white-space:nowrap}
.icon-btn{display:inline-grid;place-items:center;width:2.75rem;height:2.75rem;margin-right:-.6rem;background:none;border:0;color:var(--ink);cursor:pointer;border-radius:50%}
.icon-btn svg[hidden]{display:none}
@media (max-width:760px){.topnav{display:none}.topbar{gap:.6rem}}

/* ---- reading rail ---- */
.rail{position:fixed;right:.9rem;top:50%;transform:translateY(-50%);z-index:30;display:flex;flex-direction:column;gap:.55rem}
.rail a{display:flex;align-items:center;justify-content:flex-end;gap:.5rem;text-decoration:none;color:var(--s-ink);font-size:.8rem;min-height:24px}
.rail a span{opacity:0;transform:translateX(6px);transition:opacity .2s,transform .2s;background:var(--s-glass);color:var(--s-ink);padding:.1rem .5rem;border-radius:4px;white-space:nowrap}
.rail a:hover span,.rail a:focus-visible span{opacity:1;transform:none}
.rail i{width:9px;height:9px;border-radius:50%;border:1.5px solid rgba(255,255,255,.9);background:rgba(9,24,30,.35);box-shadow:0 0 0 1px rgba(9,24,30,.35);flex:none;transition:background .2s,transform .2s}
.rail a[aria-current="true"] i{background:var(--s-acc);border-color:var(--s-acc);transform:scale(1.35)}
@media (max-width:900px){.rail{display:none}}

/* ---- the map ---- */
.stage{position:fixed;inset:0;z-index:0;background:#0c3550 url(lgm-map.jpg) center/cover no-repeat}
html.map-ready .stage{background-image:none}
.stage canvas{display:block;width:100%;height:100%}
main,.foot{position:relative;z-index:1}

/* ---- opening ---- */
.hero{min-height:calc(100svh - 2.75rem);display:flex;flex-direction:column;justify-content:flex-end;padding:3rem max(16px,5vw) 3.2rem;color:var(--s-ink);max-width:40rem}
.hero-card{background:var(--s-glass);border:1px solid var(--s-rule);border-radius:16px;padding:1.6rem 1.7rem 1.5rem;}
.kicker{font:400 .78rem/1.3 "Plex Mono",ui-monospace,monospace;letter-spacing:.12em;text-transform:uppercase;color:var(--s-acc);margin:0 0 1rem}
.hero h1{font-weight:300;font-size:clamp(2.6rem,6.4vw,4.9rem);line-height:.98;letter-spacing:-.02em;margin:0 0 1.1rem;text-wrap:balance}
.deck{font-size:clamp(1.12rem,1.9vw,1.32rem);line-height:1.5;margin:0 0 1.4rem}
.go{display:flex;flex-wrap:wrap;gap:.7rem;align-items:center}
.btn{font:inherit;font-size:1rem;display:inline-flex;align-items:center;gap:.55rem;min-height:2.9rem;padding:.55rem 1.2rem;border-radius:99px;border:1px solid var(--s-rule);background:rgba(230,245,240,.1);color:var(--s-ink);cursor:pointer;transition:background .2s}
.btn:hover{background:rgba(230,245,240,.2)}
.btn.primary{background:#f6f8f5;color:#0a2e36;border-color:#f6f8f5;font-weight:560}
.btn.primary:hover{background:#fff}
.fine{font-size:.9rem;color:var(--s-ink-2);margin:1rem 0 0}
.scroll-cue{margin:1.4rem 0 0;font-size:1.3rem;color:var(--s-ink);text-shadow:0 1px 8px rgba(0,0,0,.6);animation:cue 2.4s ease-in-out infinite}
@keyframes cue{50%{transform:translateY(6px);opacity:.5}}
@media (prefers-reduced-motion:reduce){.scroll-cue{animation:none}}
html:not(.js) .go,html:not(.js) .fine,html:not(.js) .scroll-cue{display:none}

/* ---- the story ---- */
.chapter{padding:0 max(16px,5vw)}
.ch{display:inline-block;font-weight:350;font-size:clamp(1.7rem,3.6vw,2.6rem);line-height:1.08;letter-spacing:-.01em;color:var(--s-ink);max-width:30rem;margin:0;padding:.5rem 1rem .6rem;margin-top:34vh;background:var(--s-glass);border-radius:12px;text-wrap:balance}
.ch a,.block h2 a{color:inherit;text-decoration:none}
.ch a:hover::after,.block h2 a:hover::after{content:" #";color:var(--s-acc);font-size:.6em}
.step{min-height:92vh;display:flex;align-items:center;padding:6vh 0}
.card{width:100%;max-width:31rem;background:var(--s-glass);color:var(--s-ink);padding:1.35rem 1.55rem;border-radius:14px;border:1px solid var(--s-rule)}
.card p{margin:0 0 .85rem}.card p:last-child{margin-bottom:0}
.card a{color:var(--s-acc)}
.card .big{font-size:1.3rem;line-height:1.45}
.card .stat{display:flex;align-items:baseline;gap:.6rem;margin:0 0 .6rem;font:400 .8rem/1.2 "Plex Mono",ui-monospace,monospace;letter-spacing:.06em;text-transform:uppercase;color:var(--s-acc)}
.card .stat b{font:300 2.3rem/1 "Newsreader",Georgia,serif;letter-spacing:-.01em;text-transform:none;color:var(--s-ink)}
.key{display:flex;flex-wrap:wrap;gap:.35rem 1rem;margin:.8rem 0 0;padding:0;list-style:none;font-size:.9rem;color:var(--s-ink-2)}
.key li{display:flex;align-items:center;gap:.4rem}
.key i{display:inline-block;width:12px;height:12px;border-radius:50%;flex:none}
.key .k-old{background:var(--old)}.key .k-ubaid{background:var(--ubaid)}
.key .k-river{width:18px;height:3px;border-radius:2px;background:var(--river)}
.key .k-ghost{width:18px;height:2px;border-radius:0;background:#fff7e2}
.key .k-floor{border-radius:3px;background:#a3a86e}
.key .k-gb{width:16px;height:0;border-top:2px dashed #e0666b;border-radius:0}
.key .k-lane{width:18px;height:0;border-top:2px dashed #fff;border-radius:0}
.key .k-basin{border:1.5px dashed #8fd0e0;background:transparent}
.key .k-hollow{border-radius:3px;background:#a9d0d1}
.coda{font-size:1.3rem;line-height:1.5}

/* ---- figures inside cards ---- */
.card svg{width:100%;height:auto;display:block;margin-top:.9rem;overflow:visible}
.fig-cap{font-size:.86rem;color:var(--s-ink-2);margin-top:.5rem;line-height:1.45}
.tl .ax{stroke:var(--s-rule);stroke-width:1}
.tl .tk{fill:var(--s-ink-2);font:400 14px "Plex Mono",ui-monospace,monospace}
.tl .bar{fill:rgba(255,255,255,.12)}
.tl .ev{fill:var(--s-ink);font:560 18px "Newsreader",Georgia,serif}
.tl .sub{fill:var(--s-ink-2);font:400 15.5px "Newsreader",Georgia,serif}
.tl .dot{fill:var(--s-acc)}
.tl .sea{fill:#3fa3bb}
.tl .now{fill:#fff}
.curve .gr{stroke:var(--s-rule);stroke-width:1}
.curve .tk{fill:var(--s-ink-2);font:400 14px "Plex Mono",ui-monospace,monospace}
.curve .ax{fill:var(--s-ink-2);font:400 15px "Newsreader",Georgia,serif}
.curve .line{fill:none;stroke:#7fd4c1;stroke-width:2.4}
.curve .pt{fill:#ffcf8a}
.curve .sill{stroke:#ffcf8a;stroke-width:1.2;stroke-dasharray:4 4}
.curve .sl{fill:#ffcf8a;font:italic 400 15px "Newsreader",Georgia,serif}
.curve .area{fill:rgba(63,163,187,.18)}

/* ---- the dial ---- */
.dial .card{max-width:34rem}
.dial label{display:block;font-size:1.02rem;margin-bottom:.5rem}
.dial input[type=range]{width:100%;height:2.75rem;accent-color:var(--s-acc);margin:0;cursor:pointer}
.dial .ends{display:flex;justify-content:space-between;font:400 .78rem/1 "Plex Mono",ui-monospace,monospace;color:var(--s-ink-2);margin-top:.1rem}
.dial output{display:block;font:400 .9rem/1.4 "Plex Mono",ui-monospace,monospace;color:var(--s-acc);margin-top:.8rem;min-height:1.4em}
html:not(.js) .dial{display:none}

/* ---- readout and sound ---- */
.hud{position:fixed;right:max(12px,1.2vw);bottom:max(12px,1.2vw);z-index:35;display:flex;align-items:center;gap:.5rem;max-width:calc(100vw - 24px);padding:.3rem .35rem .3rem .9rem;border-radius:99px;background:var(--s-glass);color:var(--s-ink);border:1px solid var(--s-rule);font:400 .8rem/1.2 "Plex Mono",ui-monospace,monospace;letter-spacing:.04em;opacity:0;pointer-events:none;transition:opacity .4s}
.hud.show{opacity:1;pointer-events:auto}
#rd{font-variant-numeric:tabular-nums}
.snd{display:inline-flex;align-items:center;gap:.4rem;min-height:2.3rem;padding:0 .8rem;border-radius:99px;border:0;background:rgba(230,245,240,.14);color:inherit;font:inherit;cursor:pointer;white-space:nowrap}
.snd[aria-pressed="false"] .w{opacity:.2}
html:not(.js) .hud{display:none}

/* ---- sources and footer ---- */
.block{position:relative;z-index:1;background:var(--bg);color:var(--ink);padding:4rem max(16px,8vw) 3rem;margin-top:12vh}
.block h2{font-weight:400;font-size:1.9rem;margin:0 0 1.2rem}
.block h3{font-weight:500;font-size:1.2rem;margin:2rem 0 .6rem}
.method{max-width:44rem;color:var(--ink-2);font-size:1.02rem}
.srcs{padding-left:1.1rem;max-width:52rem;font-size:.95rem;color:var(--ink-2)}
.srcs li{margin:0 0 .45rem}
.srcs a{word-break:break-word}
.also{max-width:44rem;color:var(--ink-2)}
.foot{background:var(--bg);color:var(--ink-2);padding:1.5rem max(16px,8vw) 3rem;border-top:1px solid var(--rule);font-size:.92rem}
.foot p{margin:.2rem 0}.foot a{color:var(--ink)}

/* ---- 404 ---- */
body.nf{background:var(--bg);min-height:100vh;display:grid;place-items:center;text-align:center}
body.nf h1{font-weight:300;font-size:2.4rem}

/* Narrow screens: the map owns the top of the screen, the story the bottom. */
@media (max-width:899px){
  .hero{justify-content:flex-end;padding:40vh 12px 1.5rem}
  .hero-card{padding:1.2rem 1.2rem 1.1rem}
  .chapter{padding:0 12px}
  .ch{margin-top:48vh;font-size:1.6rem}
  .step{min-height:95vh;align-items:flex-end;padding:0 0 12vh}
  .card{padding:1.1rem 1.15rem;font-size:1.06rem;max-width:none}
  .card .stat b{font-size:1.9rem}
  .tl .ev{font-size:22px}.tl .sub{font-size:19px}.tl .tk{font-size:18px}
  .curve .tk{font-size:19px}.curve .ax{font-size:20px}.curve .sl{font-size:20px}
  .hud{font-size:.68rem;padding:.2rem .25rem .2rem .7rem;left:12px;right:auto;bottom:auto;top:3.3rem}
  .snd{min-height:2.1rem;padding:0 .6rem}
}
@media (max-width:420px){.snd span{display:none}}
