@font-face{font-family:"Fraunces";font-style:normal;font-weight:300 900;font-display:swap;src:url(fonts/Fraunces-display.woff2) format("woff2")}
@font-face{font-family:"Atkinson Next";font-style:normal;font-weight:200 800;font-display:swap;src:url(fonts/AtkinsonHyperlegibleNext.woff2) format("woff2")}

/* ------------------------------------------------------------------ tokens */
:root{
  color-scheme:light;
  --bg:#f0f5f3; --bg-2:#e2ecea; --surface:#ffffff; --surface-2:#eaf2f0;
  --text:#0e2a38; --text-2:#2c4a59; --muted:#2e444e;
  --line:#a9c4bd; --line-soft:#cfdeda;
  --accent:#084e70; --accent-ink:#ffffff; --accent-soft:#d7e9f2;
  --hot:#7c2e00; --hot-soft:#f6ddd0;
  --ok:#14501f; --ok-soft:#d8efe0; --no:#7f1a20; --no-soft:#f7dcd9;
  --river:#0b6b96; --river-deep:#084e70; --river-soft:#cfe6f0;
  --map-sea:#d3e6ee; --map-land:#e6e1cf; --map-rip:#faf5e4; --map-river:#0b6b96; --map-trib:#5b93a8;
  --band-a:#0b6b96; --band-b:#7fb6cc; --drop:#0b6b96;
  --sky-1:#bcd9e8; --sky-2:#8fc0da; --water-1:#1c7cae; --water-2:#0a4a6e;
  --shadow:0 1px 2px rgba(8,60,90,.10),0 8px 30px rgba(8,60,90,.12);
  --bar-h:3.25rem;
  --serif:"Fraunces",Georgia,"Times New Roman",serif;
  --sans:"Atkinson Next","Atkinson Hyperlegible",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#04121f; --bg-2:#0a1e2e; --surface:#0d2436; --surface-2:#123043;
  --text:#eaf4f7; --text-2:#c6d9e1; --muted:#a3bcc7;
  --line:#2c4d5e; --line-soft:#1d3542;
  --accent:#8fd6f5; --accent-ink:#04121f; --accent-soft:#123c52;
  --hot:#ffb08a; --hot-soft:#3b2119;
  --ok:#9be7b4; --ok-soft:#14352a; --no:#ffb0a8; --no-soft:#3d1c1a;
  --river:#4fb2dd; --river-deep:#8fd6f5; --river-soft:#123c52;
  --map-sea:#08202f; --map-land:#123043; --map-rip:#1b4258; --map-river:#4fb2dd; --map-trib:#3d7f9c;
  --band-a:#4fb2dd; --band-b:#2a6a8a; --drop:#8fd6f5;
  --sky-1:#062032; --sky-2:#0c3a55; --water-1:#0e4a6e; --water-2:#061c2c;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 34px rgba(0,0,0,.45);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#04121f; --bg-2:#0a1e2e; --surface:#0d2436; --surface-2:#123043;
    --text:#eaf4f7; --text-2:#c6d9e1; --muted:#a3bcc7;
    --line:#2c4d5e; --line-soft:#1d3542;
    --accent:#8fd6f5; --accent-ink:#04121f; --accent-soft:#123c52;
    --hot:#ffb08a; --hot-soft:#3b2119;
    --ok:#9be7b4; --ok-soft:#14352a; --no:#ffb0a8; --no-soft:#3d1c1a;
    --river:#4fb2dd; --river-deep:#8fd6f5; --river-soft:#123c52;
    --map-sea:#08202f; --map-land:#123043; --map-rip:#1b4258; --map-river:#4fb2dd; --map-trib:#3d7f9c;
    --band-a:#4fb2dd; --band-b:#2a6a8a; --drop:#8fd6f5;
    --sky-1:#062032; --sky-2:#0c3a55; --water-1:#0e4a6e; --water-2:#061c2c;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 34px rgba(0,0,0,.45);
  }
}

/* ------------------------------------------------------------------ base */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:1.125rem;line-height:1.62;overflow-x:clip;text-rendering:optimizeLegibility}
img,svg{max-width:100%}
img{height:auto;display:block}
a{color:var(--accent);text-underline-offset:.18em;text-decoration-thickness:.08em}
a:hover{text-decoration-thickness:.14em}
:focus-visible{outline:3px solid var(--accent);outline-offset:3px;border-radius:4px}
button{font:inherit;color:inherit}
[hidden]{display:none !important}
.skip{position:absolute;left:-999px;top:0;background:var(--accent);color:var(--accent-ink);padding:.6rem 1rem;z-index:100;border-radius:0 0 .5rem 0}
.skip:focus{left:0}
.vh{position:absolute !important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

h1,h2,h3{font-family:var(--serif);font-variation-settings:"SOFT" 100;line-height:1.04;letter-spacing:-.015em;margin:0;text-wrap:balance}
h1{font-weight:850;font-size:clamp(2.4rem,7.2vw,5.4rem)}
h2{font-weight:800;font-size:clamp(1.9rem,4.8vw,3.4rem)}
h3{font-weight:750;font-size:clamp(1.3rem,2.5vw,1.7rem);line-height:1.15}
p{margin:0 0 1.1em}
.wrap{width:min(100% - 2.5rem,41rem);margin-inline:auto}
.wide{width:min(100% - 2.5rem,74rem);margin-inline:auto}
section{scroll-margin-top:calc(var(--bar-h) + .75rem)}
.chapter{padding:clamp(4rem,10vw,8rem) 0 clamp(2rem,5vw,4rem)}
.chapter-head{margin-bottom:clamp(1.5rem,3vw,2.5rem)}
.kicker{font-family:var(--sans);font-weight:700;font-size:.82rem;letter-spacing:.14em;text-transform:uppercase;color:var(--hot);margin:0 0 .9rem}
.lede{font-size:clamp(1.2rem,2.2vw,1.45rem);line-height:1.5;color:var(--text-2)}
.note{font-size:.95rem;color:var(--muted)}
strong{font-weight:700}
.num{font-variant-numeric:tabular-nums}

/* ------------------------------------------------------------------ top bar */
.topbar{position:sticky;top:0;z-index:50;height:var(--bar-h);display:flex;align-items:center;gap:.4rem;padding:0 max(.75rem,env(safe-area-inset-left)) 0 max(.9rem,env(safe-area-inset-left));background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--line-soft)}
.topbar .home{font-weight:700;font-size:.95rem;color:var(--text);text-decoration:none;white-space:nowrap;padding:.7rem .3rem}
.topnav{display:flex;gap:.1rem;overflow-x:auto;scrollbar-width:none;min-width:0;flex:0 1 auto;margin-left:.5rem}
.topnav::-webkit-scrollbar{display:none}
.topnav a{white-space:nowrap;text-decoration:none;color:var(--text-2);font-size:.95rem;padding:.7rem .6rem;border-radius:.5rem}
.topnav a[aria-current="true"]{color:var(--accent);font-weight:700}
.spacer{flex:1 1 0}
.chip{display:inline-flex;align-items:center;min-height:2.75rem;padding:0 .8rem;border:1px solid var(--line);border-radius:999px;color:var(--text);text-decoration:none;font-size:.9rem;font-weight:600;white-space:nowrap}
.icon-btn{display:inline-grid;place-items:center;width:2.75rem;height:2.75rem;border-radius:50%;border:1px solid var(--line);background:transparent;cursor:pointer;flex:none}
.icon-btn svg{display:block}
.icon-btn svg[hidden]{display:none}

/* ------------------------------------------------------------------ reading rail */
.rail{display:none}
@media (min-width:76rem){
  .rail{display:flex;flex-direction:column;gap:.15rem;position:fixed;right:1.1rem;top:50%;transform:translateY(-50%);z-index:40}
  .rail-dot{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;min-height:1.6rem;text-decoration:none;color:var(--text)}
  .rail-dot .dot{width:7px;height:7px;border-radius:50%;background:var(--line);transition:transform .2s,background .2s}
  .rail-dot[aria-current="true"] .dot{background:var(--hot);transform:scale(1.6)}
  .rail-label{font-size:.8rem;font-weight:600;opacity:0;transform:translateX(6px);transition:opacity .15s,transform .15s;background:var(--surface);border:1px solid var(--line-soft);padding:.1rem .5rem;border-radius:.4rem;pointer-events:none}
  .rail-dot:hover .rail-label,.rail-dot:focus-visible .rail-label{opacity:1;transform:none}
}

/* ------------------------------------------------------------------ hero */
.hero{position:relative;min-height:calc(100svh - var(--bar-h));display:grid;align-items:end;overflow:clip;isolation:isolate}
.scene{position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,var(--sky-1) 0%,var(--sky-2) 46%,var(--water-1) 66%,var(--water-2) 100%)}
.river-lines{position:absolute;inset:auto 0 0 0;width:100%;height:46%}
.rl{fill:none;stroke:var(--accent-ink);stroke-width:2.5;opacity:.28}
.r1{animation:drift 9s linear infinite}
.r2{animation:drift 13s linear infinite reverse}
.r3{animation:drift 17s linear infinite}
.r4{animation:drift 22s linear infinite reverse}
@keyframes drift{from{transform:translateX(-40px)}to{transform:translateX(40px)}}
.hero .drop{position:absolute;left:12%;top:16%;width:clamp(3rem,7vw,5rem);color:var(--accent-ink);opacity:.92;animation:fall 7s ease-in infinite}
.hero .drop svg{display:block;width:100%;height:auto;fill:currentColor}
@keyframes fall{0%{transform:translateY(-6vh);opacity:0}18%{opacity:.95}80%{opacity:.95}100%{transform:translateY(46vh);opacity:0}}
.hero-days{position:absolute;right:clamp(1rem,6vw,5rem);top:12%;background:color-mix(in srgb,var(--surface) 88%,transparent);border:1px solid var(--line-soft);border-radius:1rem;padding:.9rem 1.4rem;text-align:center;box-shadow:var(--shadow)}
.hd-num{font-family:var(--serif);font-weight:850;font-size:clamp(2.6rem,6vw,4.2rem);line-height:1;margin:0;color:var(--river-deep)}
.hd-unit{margin:.2rem 0 0;font-weight:700;color:var(--text-2)}
.hero-copy{padding:0 0 clamp(2rem,6vh,4rem)}
.hero .panel{background:color-mix(in srgb,var(--surface) 93%,transparent);border:1px solid var(--line-soft);border-radius:1.25rem;box-shadow:var(--shadow);padding:clamp(1.4rem,3.5vw,2.6rem);width:min(100% - 2.5rem,46rem);margin-inline:auto}
.hero h1{margin:.6rem 0 1rem}
.deck{font-size:clamp(1.15rem,2.2vw,1.4rem);line-height:1.5;color:var(--text-2)}
.byline{margin:1.2rem 0 0;color:var(--muted);font-size:.95rem}
.cta{display:inline-flex;align-items:center;gap:.6rem;min-height:2.75rem;padding:.55rem 1.3rem;background:var(--accent);color:var(--accent-ink);font-weight:700;text-decoration:none;border-radius:999px;border:none;cursor:pointer}
.cta:hover{text-decoration:none;filter:brightness(1.06)}
button.cta{border:none}

/* ------------------------------------------------------------------ share */
.share{margin-top:1.5rem}
.share-row{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem;background:var(--surface);border:1px solid var(--line-soft);border-radius:1rem;padding:.8rem 1rem;box-shadow:var(--shadow)}
.share-row .lab{font-weight:700;font-size:.95rem;margin-right:.3rem}
.share-row a,.share-row button{display:inline-flex;align-items:center;min-height:2.75rem;padding:.4rem 1rem;border-radius:.7rem;border:1px solid var(--line);background:var(--bg-2);color:var(--text);text-decoration:none;font-weight:600;font-size:.95rem;cursor:pointer}
.share-status{min-height:1.4em;margin:.4rem 0 0}
.share-field{width:100%;min-height:2.75rem;margin-top:.5rem;font:inherit;color:var(--text);background:var(--bg);border:2px solid var(--line);border-radius:.7rem;padding:.4rem .8rem}

/* ------------------------------------------------------------------ choice widgets */
.choice-btns{display:flex;flex-wrap:wrap;gap:.6rem;margin:1.2rem 0}
.choice-btns button{min-height:2.75rem;padding:.55rem 1.2rem;border-radius:.8rem;border:2px solid var(--river);background:var(--surface);font-weight:700;cursor:pointer}
.choice-btns button[aria-pressed="true"]{background:var(--river);color:#fff;border-color:var(--river)}
:root[data-theme="dark"] .choice-btns button[aria-pressed="true"]{color:#04121f}
.verdict{visibility:hidden;max-height:0;overflow:hidden;margin:0;transition:max-height .3s}
.verdict.on{visibility:visible;max-height:40rem}
.verdict p{background:var(--accent-soft);border-left:5px solid var(--river);border-radius:0 .8rem .8rem 0;padding:1rem 1.2rem;margin:0 0 1.2rem}
.no-js .verdict{visibility:visible;max-height:none}
.no-js #ro-arrive-item{display:none}
.no-js .choice-btns{display:none}
.choice-cta{margin-top:.5rem}

/* ------------------------------------------------------------------ journey */
.journey{background:var(--surface);border:1px solid var(--line-soft);border-radius:1.25rem;box-shadow:var(--shadow);padding:clamp(1.2rem,3vw,2.2rem);margin-bottom:2.5rem}
.journey-controls{display:flex;flex-wrap:wrap;gap:1rem 1.6rem;align-items:end;margin-bottom:1.4rem}
.journey-controls .field{display:flex;flex-direction:column;gap:.35rem}
.journey-controls label,.flows legend{font-weight:700;font-size:.95rem}
.journey-controls select{min-height:2.75rem;font:inherit;color:var(--text);background:var(--bg);border:2px solid var(--line);border-radius:.7rem;padding:.4rem .8rem;max-width:min(100%,22rem)}
.flows{border:none;margin:0;padding:0;display:flex;gap:.4rem;flex-wrap:wrap;align-items:center}
.flows legend{padding:0;margin-bottom:.35rem;width:100%}
.flows label{display:inline-flex;align-items:center;gap:.45rem;min-height:2.75rem;padding:.4rem .9rem;border:2px solid var(--line);border-radius:999px;cursor:pointer;font-weight:600}
.flows input{width:1.2rem;height:1.2rem;accent-color:var(--river)}
.flows label:has(input:checked){border-color:var(--river);background:var(--river-soft)}
.btn{min-height:2.75rem;padding:.55rem 1.4rem;border-radius:999px;border:none;background:var(--accent);color:var(--accent-ink);font-weight:700;cursor:pointer}
.btn:hover{filter:brightness(1.06)}
.readout{display:grid;grid-template-columns:repeat(4,1fr);gap:.8rem;margin-bottom:1.4rem}
.ro-item{background:var(--bg-2);border-radius:.8rem;padding:.8rem 1rem}
.ro-item .lab{font-size:.85rem;font-weight:700;color:var(--muted);margin:0 0 .2rem}
.ro-item .big{font-family:var(--serif);font-weight:800;font-size:clamp(1.25rem,2.6vw,1.9rem);line-height:1.1;margin:0}
@media (max-width:44rem){.readout{grid-template-columns:1fr 1fr}}
.journey-visual{display:grid;grid-template-columns:1fr 220px;gap:1.2rem;align-items:start}
@media (max-width:52rem){.journey-visual{grid-template-columns:1fr}.prof-fig{max-width:19rem;margin-inline:auto;width:100%}}
.map-fig,.prof-fig{margin:0}
.map-fig figcaption,.prof-fig figcaption{margin:0}
.course{display:block;width:100%;height:auto;border-radius:.8rem;border:1px solid var(--line-soft)}
.m-sea{fill:var(--map-sea)}
.m-land{fill:var(--map-land)}
.m-rip{fill:var(--map-rip);stroke:var(--line);stroke-width:1}
.rv{fill:none;stroke:var(--map-trib);stroke-width:1.6;opacity:.85}
.rv-danube{stroke:var(--map-river);stroke-width:3.4;opacity:1}
.city-dot{fill:var(--hot)}
.conf-dot{fill:var(--map-river)}
.m-label{font-family:var(--sans);font-size:17px;font-weight:600;fill:var(--text)}
.map-drop{fill:var(--drop);stroke:#fff;stroke-width:2.5;opacity:0;transition:opacity .3s}
.map-drop.on{opacity:1}
.profile{display:block;width:100%;height:auto}
.pr{stroke:var(--river);stroke-linecap:round}
.pr-u{stroke-width:5}
.pr-m{stroke-width:9}
.pr-l{stroke-width:14}
.band{opacity:.85}
.b0{fill:var(--band-a)}
.b1{fill:var(--band-b)}
.pm-launch{fill:var(--hot);stroke:var(--surface);stroke-width:1.5}
.pm-conf{fill:var(--river)}
.p-label{font-family:var(--sans);font-size:12.5px;font-weight:600;fill:var(--text)}
.dam rect{fill:var(--surface);stroke:var(--hot);stroke-width:2.5}
.dam-label{font-size:11px}
.sea-label{font-weight:700;fill:var(--river-deep)}
.prof-drop{fill:var(--drop);stroke:#fff;stroke-width:2.5;opacity:0;transition:opacity .3s}
.leader{stroke:var(--muted);stroke-width:1.2}
.prof-drop.on{opacity:1}
.static-days{margin:1.2rem 0 0}
.countries{list-style:none;margin:1.4rem 0 0;padding:0;display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem 1.4rem;counter-reset:c}
@media (max-width:44rem){.countries{grid-template-columns:1fr}}
.countries li{display:flex;gap:.7rem;align-items:baseline;background:var(--surface);border:1px solid var(--line-soft);border-radius:.7rem;padding:.55rem .9rem}
.countries li::before{counter-increment:c;content:counter(c);font-family:var(--serif);font-weight:800;color:var(--river);min-width:1.4em}
.countries b{white-space:nowrap}
.countries span{color:var(--text-2)}

/* ------------------------------------------------------------------ tiles, bars */
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:.9rem;margin:1.4rem 0}
@media (max-width:44rem){.tiles{grid-template-columns:1fr}}
.tile{background:var(--surface);border:1px solid var(--line-soft);border-top:6px solid var(--river);border-radius:.9rem;padding:1.2rem 1.2rem;box-shadow:var(--shadow)}
.tile-num{font-family:var(--serif);font-weight:850;font-size:clamp(1.8rem,4.2vw,2.7rem);line-height:1;margin:0 0 .5rem;color:var(--river-deep);white-space:nowrap}
.tile p:last-child{margin:0;color:var(--text-2)}
.bars{background:var(--surface);border:1px solid var(--line-soft);border-radius:.9rem;padding:1.2rem 1.3rem;box-shadow:var(--shadow);margin:1.4rem 0}
.bars .lab{font-weight:700;margin:0 0 .9rem}
.bar-row{display:grid;grid-template-columns:minmax(7rem,11rem) 1fr minmax(3.2rem,auto);gap:.8rem;align-items:center;padding:.32rem 0}
.bar-name{font-size:.95rem;font-weight:600}
.bar-track{display:block;background:var(--bg-2);border-radius:999px;height:.95rem;overflow:hidden}
.bar-fill{display:block;height:100%;background:var(--river);border-radius:999px;min-width:6px}
.bar-val{font-weight:700;text-align:right}
.w0{width:2%}.w5{width:5%}.w10{width:10%}.w15{width:15%}.w20{width:20%}.w25{width:25%}.w30{width:30%}.w35{width:35%}.w40{width:40%}.w45{width:45%}.w50{width:50%}.w55{width:55%}.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}.w95{width:95%}.w100{width:100%}

/* ------------------------------------------------------------------ figures */
figure{margin:0}
.fig-wide{width:min(100% - 2.5rem,56rem);margin:2rem auto}
.fig-full{width:min(100% - 2.5rem,74rem);margin:2rem auto}
figure img{border-radius:1rem;border:1px solid var(--line-soft);box-shadow:var(--shadow)}
figcaption{font-size:.95rem;color:var(--text-2);margin-top:.7rem}
.credit{display:block;font-size:.85rem;color:var(--muted);margin-top:.3rem}

/* ------------------------------------------------------------------ game */
.game{background:var(--surface);border:1px solid var(--line-soft);border-radius:1.1rem;padding:clamp(1.2rem,3vw,2rem);box-shadow:var(--shadow)}
.game-progress{list-style:none;display:flex;gap:.45rem;margin:0 0 .6rem;padding:0}
.game-progress li{width:2rem;height:.5rem;border-radius:999px;background:var(--bg-2)}
.game-progress li.right{background:var(--ok)}
.game-progress li.wrong{background:var(--no)}
.game-count{margin:0 0 .4rem}
.game .q{font-family:var(--serif);font-weight:750;font-size:clamp(1.4rem,3vw,1.9rem);line-height:1.2;margin:.4rem 0 1rem}
.answers{display:flex;gap:.7rem;flex-wrap:wrap}
.answers button{min-height:2.75rem;min-width:9rem;padding:.6rem 1.6rem;border-radius:.8rem;border:2px solid var(--river);background:var(--bg);font-weight:700;cursor:pointer}
.explain{margin-top:1.2rem;background:var(--bg-2);border-radius:.8rem;padding:1rem 1.2rem}
.explain .tag{display:inline-block;font-weight:800;padding:.15rem .8rem;border-radius:999px;margin-bottom:.5rem}
.explain .tag.ok{background:var(--ok-soft);color:var(--ok)}
.explain .tag.no{background:var(--no-soft);color:var(--no)}
.explain .next{margin-top:.8rem}
.result .score{font-family:var(--serif);font-weight:850;font-size:clamp(2rem,5vw,3rem);margin:0}
.result .rank{margin:.4rem 0}
.no-js .game-play{display:none}

/* ------------------------------------------------------------------ sources, footer */
.sources{background:var(--bg-2);border-top:1px solid var(--line-soft)}
.sources ul{padding-left:1.2rem}
.sources li{margin-bottom:.7rem;color:var(--text-2)}
.sources h3{margin:1.8rem 0 .8rem}
.site-footer{border-top:1px solid var(--line-soft);padding:2rem 0 3rem;text-align:center;color:var(--muted)}
.site-footer a{color:var(--text-2)}
.nf-main{padding:6rem 0;text-align:center}

/* ------------------------------------------------------------------ reveal */
.reveal{opacity:0;transform:translateY(18px);transition:opacity .5s ease,transform .5s ease}
.reveal.in{opacity:1;transform:none}
.no-js .reveal{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation:none !important;transition:none !important}
  .reveal{opacity:1;transform:none}
  .hero .drop{display:none}
}
