/* GeoIME live demo — player for recorded runs of the GeoIME engine. Look: design 4 of geoime.com (tokens, Manrope + Public Sans). */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700 800; font-display: swap; src: url("/themes/geoime/fonts/manrope-latin.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/themes/geoime/fonts/public-sans-latin.woff2") format("woff2"); }

:root {
  --ink: #13262B; --deep: #0A171A; --night: #0F2125; --panel: rgba(10, 23, 26, .86); --panel-solid: #0F2125;
  --teal: #0B8592; --teal-lt: #86C9CF; --amber: #E59A2F; --red: #E2503D;
  --txt: #EAF2F2; --mut: #A6BCBF; --line: rgba(134, 201, 207, .22);
  --rec: #1FA9BA; --rep: #D98A1E;
  --f-display: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --head-h: 60px; --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--deep); color: var(--txt); font: 400 1rem/1.5 var(--f-body); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; }
a { color: var(--teal-lt); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
p { margin: 0; }

/* ---------- top bar ---------- */
.top { position: fixed; inset: 0 0 auto 0; height: var(--head-h); z-index: 30; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: rgba(10, 23, 26, .94); border-bottom: 1px solid var(--line); }
.top .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--txt); flex: none; }
.top .logo img { height: 26px; width: auto; display: block; }
.top .logo span { font: 700 .78rem/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(229,154,47,.5); padding: 4px 7px; border-radius: 4px; }
.tabs { display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 9px 12px; border-radius: 6px; cursor: pointer; color: var(--mut); font: 700 .92rem/1 var(--f-display); white-space: nowrap; }
.tabs button:hover { color: var(--txt); background: rgba(234,242,242,.06); }
.tabs button[aria-selected="true"] { color: var(--txt); background: rgba(11,133,146,.28); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .6em 1.1em; border-radius: 6px;
  font: 700 .95rem/1.1 var(--f-display); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background-color .2s, border-color .2s; }
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-amber:hover { background: #F0AD4C; }
.btn-ghost { border-color: rgba(234,242,242,.45); color: var(--txt); background: transparent; }
.btn-ghost:hover { border-color: var(--txt); background: rgba(234,242,242,.08); }
.top .btn { min-height: 38px; padding: .45em .9em; flex: none; }

/* ---------- stage ---------- */
#stage { position: fixed; inset: var(--head-h) 0 0 0; }
#map, #hmap { position: absolute; inset: 0; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(255,255,255,.85); }

/* ---------- home ---------- */
#home { position: fixed; inset: var(--head-h) 0 0 0; overflow-y: auto; z-index: 20; background:
  radial-gradient(1200px 600px at 80% -10%, rgba(11,133,146,.35), transparent 60%), radial-gradient(900px 500px at 0% 110%, rgba(229,154,47,.12), transparent 60%), var(--deep); }
#home .wrap { max-width: 1180px; margin: 0 auto; padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px) 48px; }
#home h1 { font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -0.035em; max-width: 18ch; }
#home .lede { margin-top: 14px; color: var(--mut); font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 46rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 34px; }
.card { background: var(--night); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; color: var(--txt); }
.card:hover { border-color: rgba(134,201,207,.55); }
.card img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; display: block; background: #0c1c1f; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .kicker { font: 700 .75rem/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }
.card h2 { font-size: 1.4rem; }
.card p { color: var(--mut); font-size: .98rem; }
.card .go { margin-top: auto; padding-top: 8px; font: 700 .95rem/1 var(--f-display); color: var(--teal-lt); }
.homenote { margin-top: 28px; color: var(--mut); font-size: .9rem; max-width: 52rem; }

/* ---------- cover (before Play) ---------- */
.cover { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(180deg, rgba(10,23,26,.25), rgba(10,23,26,.78)); }
.cover .inner { max-width: 640px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cover .kicker { font: 700 .78rem/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.cover h1 { font-size: clamp(1.8rem, 4.4vw, 3rem); }
.cover .sub { color: var(--mut); font-size: 1.05rem; }
.cover .memoriam { font-style: italic; color: var(--txt); opacity: .9; font-size: .98rem; border-top: 1px solid var(--line); padding-top: 10px; }
.play-big { width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--amber); color: var(--ink); cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(229,154,47,.18); margin: 10px 0 4px; transition: transform .2s var(--ease); }
.play-big:hover { transform: scale(1.05); }
.play-big svg { width: 38px; height: 38px; margin-left: 6px; }
.cover .len { color: var(--mut); font-size: .88rem; }

/* ---------- overlays during playback ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }
.caption { position: absolute; left: 16px; bottom: 84px; width: min(460px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; backdrop-filter: blur(6px); }
.caption .step { font: 700 .72rem/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); }
.caption h2 { font-size: 1.28rem; margin-top: 6px; }
.caption p { margin-top: 8px; color: var(--txt); font-size: .98rem; line-height: 1.5; }
.caption.fade { animation: capIn .5s var(--ease); }
@keyframes capIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.counters { position: absolute; top: 14px; left: 16px; display: flex; flex-direction: column; gap: 8px; max-width: 280px; }
.ctr { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--teal-lt); border-radius: 8px; padding: 8px 12px; }
.ctr b { display: block; font: 800 1.55rem/1.1 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ctr span { display: block; color: var(--mut); font-size: .82rem; line-height: 1.3; margin-top: 2px; }
.ctr { transition: opacity .4s, transform .4s; } .ctr.wait { opacity: .3; transform: translateY(4px); }
.ctr.red { border-left-color: var(--red); } .ctr.amber { border-left-color: var(--amber); } .ctr.dark { border-left-color: #B3404F; }
.clock { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 14px; font: 700 1.05rem/1.2 var(--f-display); font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.clock small { display: block; font: 400 .72rem/1.2 var(--f-body); color: var(--mut); }
.legend { position: absolute; right: 16px; top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: .82rem; max-width: 240px; }
.legend h3 { font: 700 .78rem/1.2 var(--f-display); letter-spacing: .04em; margin-bottom: 6px; color: var(--mut); text-transform: uppercase; }
.legend div { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend i { width: 14px; height: 14px; border-radius: 3px; flex: none; border: 1px solid rgba(255,255,255,.2); }
.chart { position: absolute; right: 16px; bottom: 84px; width: min(460px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 6px; }
.chart h3 { font: 700 .86rem/1.3 var(--f-display); }
.chart .keys { display: flex; gap: 14px; font-size: .78rem; color: var(--mut); margin-top: 3px; }
.chart .keys i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.chart svg { display: block; width: 100%; height: auto; margin-top: 4px; font-family: var(--f-body); }
.chart .tip { position: absolute; pointer-events: none; background: #06110f; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: .78rem; white-space: nowrap; display: none; }

/* ---------- controls ---------- */
.controls { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
.ib { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--txt); }
.ib:hover { background: rgba(234,242,242,.1); }
.ib svg { width: 20px; height: 20px; }
.dots { display: flex; gap: 6px; padding: 0 6px; }
.dots button { width: 26px; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.dots button i { display: block; width: 10px; height: 10px; border-radius: 50%; background: rgba(234,242,242,.28); transition: all .25s; }
.dots button[aria-current="step"] i { background: var(--amber); width: 22px; border-radius: 6px; }
.dots button.done i { background: var(--teal-lt); }

/* ---------- explore ---------- */
.explore { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; max-width: calc(100% - 32px); }
.explore p { color: var(--mut); font-size: .92rem; margin-right: 6px; }
.explore .btn { min-height: 38px; padding: .4em .9em; font-size: .88rem; }
.bcard { position: absolute; right: 16px; top: 14px; width: min(320px, calc(100% - 32px)); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; z-index: 11; }
.bcard h3 { font-size: 1.02rem; }
.bcard dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .86rem; }
.bcard dt { color: var(--mut); } .bcard dd { margin: 0; font-variant-numeric: tabular-nums; }
.bcard .x { position: absolute; top: 6px; right: 6px; }
.bcard .note { margin-top: 8px; color: var(--mut); font-size: .78rem; }

/* ---------- footer / sources ---------- */
.prov { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; pointer-events: none; padding: 0 16px 2px; font-size: .72rem; color: var(--mut); text-align: left; }
.prov button { pointer-events: auto; background: none; border: 0; color: var(--teal-lt); text-decoration: underline; cursor: pointer; font-size: inherit; padding: 2px 4px; }
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(4,10,12,.7); padding: 16px; }
.sheet[hidden] { display: none; }
.sheet .box { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; max-width: 620px; width: 100%; max-height: calc(100vh - 40px); overflow-y: auto; padding: 22px 22px 18px; position: relative; }
.sheet h2 { font-size: 1.4rem; padding-right: 40px; }
.sheet p, .sheet li { color: var(--mut); font-size: .95rem; }
.sheet p { margin-top: 10px; }
.sheet ul { margin: 10px 0 0; padding-left: 18px; }
.sheet li { margin: 5px 0; }
.sheet .x { position: absolute; top: 10px; right: 10px; }
.sheet .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- hazard map ---------- */
.hpanel { position: absolute; left: 16px; top: 14px; width: min(340px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; z-index: 5; max-height: calc(100% - 40px); overflow-y: auto; }
.hpanel h2 { font-size: 1.15rem; }
.hpanel > p { color: var(--mut); font-size: .88rem; margin-top: 6px; }
.hl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; margin-top: 12px; }
.hl input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); }
.hl label { font: 700 .95rem/1.3 var(--f-display); cursor: pointer; }
.hl small { grid-column: 2; color: var(--mut); font-size: .78rem; line-height: 1.35; }
.hl small.err { color: #F2A08F; }
.hl select { grid-column: 2; margin-top: 4px; background: var(--deep); color: var(--txt); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: .85rem; width: fit-content; }
.ramp { grid-column: 2; height: 8px; border-radius: 4px; margin-top: 4px; }
.maplibregl-popup-content { background: var(--panel-solid); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; font: .85rem/1.4 var(--f-body); }
.maplibregl-popup-tip { border-top-color: var(--panel-solid) !important; border-bottom-color: var(--panel-solid) !important; }
.maplibregl-popup-close-button { color: var(--txt); font-size: 18px; }

.loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 13; color: var(--mut); background: rgba(10,23,26,.6); }
[hidden] { display: none !important; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  :root { --head-h: 104px; }
  .top { flex-wrap: wrap; height: auto; min-height: var(--head-h); padding: 8px 12px; gap: 6px 10px; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .top .btn { margin-left: auto; }
  .caption { left: 8px; right: 8px; width: auto; bottom: 74px; padding: 10px 12px; }
  .caption h2 { font-size: 1.06rem; } .caption p { font-size: .9rem; }
  .counters { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; max-width: calc(100% - 16px); left: 8px; top: 56px; }
  .ctr { flex: none; padding: 5px 9px; } .ctr b { font-size: 1.1rem; } .ctr span { font-size: .72rem; max-width: 140px; }
  .clock { top: 8px; font-size: .92rem; padding: 5px 10px; }
  .legend { display: none; }
  .legend.show-mobile { display: block; top: auto; bottom: 74px; right: 8px; }
  .chart { left: 8px; right: 8px; width: auto; bottom: auto; top: 118px; padding: 6px 8px 2px; }
  .chart h3 { font-size: .76rem; } .chart .keys { font-size: .7rem; }
  .controls { bottom: 12px; padding: 3px 6px; gap: 2px; }
  .dots button { width: 18px; } .dots button i { width: 7px; height: 7px; } .dots button[aria-current="step"] i { width: 14px; }
  .explore { bottom: 74px; }
  .bcard { top: auto; bottom: 140px; right: 8px; left: 8px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Open Graph stills (?og=1) ---------- */
body.og .controls, body.og .prov, body.og .maplibregl-ctrl, body.og .explore { display: none !important; }
body.og .caption p, body.og .caption .step { display: none; }

/* ---------- layout fixes ---------- */
.hud.exploring .caption { display: none; }
.explore .memo { flex-basis: 100%; text-align: center; font-style: italic; color: var(--mut); font-size: .86rem; margin: 0; }
.prov { right: 330px; background: linear-gradient(0deg, rgba(10,23,26,.85), rgba(10,23,26,0)); padding-top: 6px; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { margin-bottom: 6px; }
/* film playing: the director holds the camera, so no zoom buttons (they also sat under the river chart) */
.directed .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
.hud.exploring .chart { right: 64px; }
.pausehint { position: absolute; left: 50%; top: 76px; transform: translateX(-50%); z-index: 12; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 6px 6px 16px; font-size: .9rem; color: var(--txt); box-shadow: 0 8px 24px rgba(0,0,0,.35); white-space: nowrap;
  display: flex; align-items: center; gap: 12px; }
.pausehint .resume { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 6px 14px 6px 10px; cursor: pointer;
  background: var(--amber); color: #10161a; font: 700 .88rem/1 var(--f-display); }
.pausehint .resume svg { width: 14px; height: 14px; fill: currentColor; }
.pausehint .resume:hover { filter: brightness(1.08); }
@media (min-width: 761px) { .controls { bottom: 26px; } .prov { white-space: nowrap; } }
@media (max-width: 760px) {
  .pausehint { white-space: normal; width: calc(100% - 32px); text-align: center; border-radius: 12px; }
  .prov { right: 0; bottom: 0; font-size: .66rem; line-height: 1.3; padding: 4px 8px 2px; background: rgba(10,23,26,.9); }
  .controls { bottom: 40px; } .caption { bottom: 100px; } .explore { bottom: 100px; } .legend.show-mobile { bottom: 100px; }
  .maplibregl-ctrl-bottom-right { bottom: 34px; } .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
  .bcard { bottom: 100px; top: auto; max-height: 55%; overflow-y: auto; }
}
.chart { margin: 0; }
@media (max-width: 760px) {
  .top .btn { display: none; }
  .controls { bottom: 50px; } .caption, .explore, .bcard, .legend.show-mobile { bottom: 108px; }
  .maplibregl-ctrl-bottom-right { top: 6px; bottom: auto; }
  .clock { top: 6px; } .counters { top: 52px; } .chart { top: 112px; }
}
