@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/PublicSans.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f7faf9; --surface: #ffffff; --surface-2: #eff5f3; --line: #e1ebe8; --line-2: #c9dbd7;
  --ink: #0b2530; --ink-2: #33505c; --muted: #5b7480;
  --accent: #00897b; --accent-ink: #00695d; --accent-soft: #e0f1ee; --on-accent: #ffffff;
  --s1: #00897b; --s2: #6a5acd; --s3: #c0620c; --cloud: #9fb3b8; --land: #e4ebe9; --sea: #f4f9f8;
  --danger: #b3261e;
  --glass: rgb(255 255 255 / 0.62); --glass-edge: rgb(11 37 48 / 0.10); --glass-hi: rgb(255 255 255 / 0.9); --glass-shadow: 0 24px 64px rgb(11 37 48 / 0.10);
  --display: "Fraunces", Georgia, serif; --sans: "Public Sans", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06202a; --surface: #0b2a35; --surface-2: #0f3340; --line: #183d4a; --line-2: #285463;
    --ink: #e8f2f0; --ink-2: #c0d4d7; --muted: #93aeb4;
    --accent: #00c2a8; --accent-ink: #4fd8c4; --accent-soft: #0f3a3c; --on-accent: #06202a;
    --s1: #12a58f; --s2: #7b74e6; --s3: #c27e22; --cloud: #4d6b74; --land: #123542; --sea: #0a2630;
    --danger: #f2827a;
    --glass: rgb(11 42 53 / 0.55); --glass-edge: rgb(255 255 255 / 0.12); --glass-hi: rgb(255 255 255 / 0.08); --glass-shadow: 0 24px 64px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #06202a; --surface: #0b2a35; --surface-2: #0f3340; --line: #183d4a; --line-2: #285463;
  --ink: #e8f2f0; --ink-2: #c0d4d7; --muted: #93aeb4;
  --accent: #00c2a8; --accent-ink: #4fd8c4; --accent-soft: #0f3a3c; --on-accent: #06202a;
  --s1: #12a58f; --s2: #7b74e6; --s3: #c27e22; --cloud: #4d6b74; --land: #123542; --sea: #0a2630;
  --danger: #f2827a;
  --glass: rgb(11 42 53 / 0.55); --glass-edge: rgb(255 255 255 / 0.12); --glass-hi: rgb(255 255 255 / 0.08); --glass-shadow: 0 24px 64px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--display); font-weight: 450; font-variation-settings: "opsz" 72, "SOFT" 30; letter-spacing: -0.01em; margin: 0; color: var(--ink); }
h1 { font-size: 40px; line-height: 44px; margin: 8px 0 28px; }
h3 { font-size: 18px; line-height: 26px; font-variation-settings: "opsz" 24; margin-bottom: 16px; }
p { margin: 0 0 12px; max-width: 72ch; color: var(--ink-2); }
a { color: var(--accent-ink); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }

/* background contour: only in the page margins, fading into the background quickly */
.bgfield { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bgfield canvas { position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(90deg, #000 0, transparent max(0px, calc((100vw - 1280px) / 2 + 24px)), transparent min(100vw, calc(100vw - (100vw - 1280px) / 2 - 24px)), #000 100%);
  mask-image: linear-gradient(90deg, #000 0, transparent max(0px, calc((100vw - 1280px) / 2 + 24px)), transparent min(100vw, calc(100vw - (100vw - 1280px) / 2 - 24px)), #000 100%); }
@media (max-width: 1360px) { .bgfield { display: none; } }

/* glass */
.glass { background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow); }
.contour { overflow: hidden; }
.contour canvas { -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 30%, transparent 100%); }
.contour .glow-unused { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 40%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); }

/* navigation: floating glass rail, mono labels, sliding marker */
.nav { position: sticky; top: 12px; z-index: 20; max-width: 1280px; margin: 12px auto 0; padding: 0 24px; }
.nav .rail { display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 10px 0 20px; border-radius: 14px; }
.logo { height: 22px; display: block; }
.logo.dark { display: none; }
:root[data-theme="dark"] .logo.light { display: none; } :root[data-theme="dark"] .logo.dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo.light { display: none; } :root:not([data-theme="light"]) .logo.dark { display: block; } }
.tabs { position: relative; display: flex; gap: 2px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: 9px; text-decoration: none; color: var(--ink); opacity: .58; white-space: nowrap; transition: opacity .3s var(--ease); }
.tabs a i { font-style: normal; color: var(--muted); font-size: 10px; }
.tabs a:hover, .tabs a[aria-current="page"] { opacity: 1; }
.tabs a[aria-current="page"] i { color: var(--accent-ink); }
.tabs .marker { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 9px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2), 0 2px 8px rgb(0 0 0 / 0.06); transition: left .5s var(--ease), width .5s var(--ease); }
.nav .act { display: flex; gap: 6px; align-items: center; }
.btn { font: 600 13px/18px var(--sans); border-radius: 9px; padding: 8px 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; transition: background .3s var(--ease); }
.btn:hover { background: var(--surface-2); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-ink); }
.iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; }

main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 96px; }
section[data-tab] { display: none; }
section[data-tab].on { display: block; animation: rise .5s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* layout */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack { display: grid; gap: 16px; margin-top: 16px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; min-width: 0; }
.cardhead { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.cardhead h3 { margin-bottom: 12px; }
.cap { font-size: 12.5px; line-height: 18px; color: var(--muted); margin: 12px 0 0; max-width: 90ch; }

/* stat tiles: sans numerals, tabular, readable */
.stat .k { font-size: 13px; color: var(--muted); line-height: 18px; }
.stat .v { font: 600 34px/40px var(--sans); letter-spacing: -0.02em; margin-top: 8px; color: var(--ink); }
.stat .n { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.hero .v { font-size: 44px; line-height: 50px; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; padding: 16px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field > span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
select, input[type="number"] { font: 500 14px/20px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 12px; min-width: 150px; }
input[type="range"] { accent-color: var(--accent); width: 160px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; background: var(--surface-2); }
.seg button { font: 500 13px/18px var(--sans); color: var(--ink-2); background: none; border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; transition: background .3s var(--ease), color .3s var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.seg.small button { padding: 4px 10px; }
details.loads { flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 12px; }
details.loads summary { cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
details.loads .row { display: flex; flex-wrap: wrap; gap: 16px 32px; margin-top: 12px; }
.range { display: grid; grid-template-columns: auto 48px; gap: 4px 8px; align-items: center; font-size: 13px; color: var(--muted); }
.range b { color: var(--ink); font-weight: 600; text-align: right; }
.range span { grid-column: 1 / -1; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 12.5px/18px var(--sans); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 3px 11px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

/* charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 400 12px var(--sans); fill: var(--muted); }
.chart .lbl { fill: var(--ink-2); font-weight: 500; }
.chart .ytitle { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; fill: var(--muted); }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin: 0 0 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 2px; vertical-align: 3px; border-radius: 1px; }
.legend i.dash { height: 0; border-top: 2px dashed currentColor; vertical-align: 3px; border-radius: 0; background: none !important; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 18px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); opacity: 0; transition: opacity .2s var(--ease); max-width: 280px; }
.tip.on { opacity: 1; }
.tip b { font-weight: 600; }
.tip .r { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-2); }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-weight: 500; color: var(--muted); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
td.num, th.num { text-align: right; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover td { background: var(--surface-2); }
table.compact th, table.compact td { padding: 6px 10px; }
.scroll { max-height: 460px; overflow-y: auto; }
.scroll thead th { position: sticky; top: 0; background: var(--surface); }
.pill { display: inline-block; font-size: 12px; line-height: 18px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.pill.yes { background: color-mix(in srgb, var(--s3) 18%, transparent); color: var(--ink); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0 0 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; }
.mapbar { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 6px; }
.mapbar .btn { padding: 6px 10px; }

/* walkthrough */
.walk { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; }
.walk .steps { padding: 12vh 0 30vh; }
.walk .step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transition: opacity .5s var(--ease); }
.walk .step.on { opacity: 1; }
.walk .step .n { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--accent-ink); margin-bottom: 10px; }
.walk .step h2 { font-size: 30px; line-height: 36px; margin-bottom: 12px; }
.walk .step p { font-size: 16px; line-height: 26px; }
.walk .stage { position: sticky; top: 96px; height: calc(100vh - 128px); display: flex; flex-direction: column; justify-content: center; }
.walk .stage .card { padding: 20px; }
.walk .count { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.walk .count b { color: var(--ink); font-weight: 500; }

@media (max-width: 1000px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-21, .g-12, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .walk { grid-template-columns: minmax(0, 1fr); gap: 0; } .walk .stage { order: -1; position: sticky; top: 76px; height: auto; z-index: 2; } .walk .step { min-height: 55vh; } .walk .steps { padding: 4vh 0 20vh; }
}
@media (max-width: 720px) {
  .nav { padding: 0 12px; top: 8px; } .nav .rail { gap: 8px; padding: 0 6px 0 12px; } .tabs a i { display: none; } .tabs a { padding: 8px; }
  .nav .act .btn:not(.iconbtn) { display: none; }
}
@media (max-width: 560px) {
  main { padding: 24px 16px 64px; } .g-4 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 30px; line-height: 36px; } .card { padding: 16px; } .logo { height: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* footer: always deep navy, like the business card */
.foot { position: relative; margin-top: 64px; border-radius: 20px; overflow: hidden; background: #06202a; color: #d9ebe8; padding: 40px 40px 24px; }
.foot-art { position: absolute; inset: 0 0 auto 0; height: 240px; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.foot-art svg { width: 100%; height: 240px; display: block; }
.foot-top { position: relative; min-height: 180px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; }
.foot-logo { height: 56px; width: auto; align-self: flex-start; }
.foot-top p { font-family: var(--display); font-size: 22px; line-height: 30px; color: #ffffff; max-width: 32ch; margin: 0; }
.foot-grid { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid rgb(255 255 255 / 0.12); }
.foot-grid .label { color: #9fb8bd; margin-bottom: 10px; }
.foot-grid a { display: block; color: #ffffff; text-decoration: none; font-size: 14px; line-height: 24px; opacity: .85; transition: opacity .3s var(--ease); }
.foot-grid a:hover { opacity: 1; text-decoration: underline; }
.foot-grid p { color: #d9ebe8; font-size: 14px; line-height: 22px; margin: 0; }
.foot-base { position: relative; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; font-size: 12px; color: #9fb8bd; }
@media (max-width: 1000px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .foot { padding: 28px 20px 20px; } .foot-logo { height: 40px; } .foot-grid { grid-template-columns: minmax(0, 1fr); } }

/* v5: map stays in its box, quote caveat, player, footer with a pixelated satellite image that fades in */
.mapbox { overflow: hidden; border-radius: 10px; }
.mapbox svg.hm { overflow: hidden; }
.star { margin: -16px 0 24px; font-size: 13px; color: var(--muted); }
.player { display: flex; align-items: center; gap: 10px; }
.player input[type="range"] { width: 160px; }
.player .label { min-width: 120px; color: var(--ink-2); }
.site-foot { position: relative; margin-top: 48px; color: var(--ink-2); overflow: hidden; }
.foot-inner { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 48px 24px 0; }
.foot-top { display: flex; flex-direction: column; gap: 12px; }
.foot-logo { height: 48px; width: auto; }
.foot-top p { font-family: var(--display); font-size: 24px; line-height: 32px; color: var(--ink); max-width: 34ch; margin: 0; }
.foot-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.foot-grid .label { color: var(--muted); margin-bottom: 10px; }
.foot-grid a { display: block; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 24px; }
.foot-grid a:hover { text-decoration: underline; }
.foot-grid p { font-size: 14px; line-height: 22px; margin: 0; color: var(--ink-2); }
.legal { margin: 32px 0 0; font-size: 12px; line-height: 18px; color: var(--muted); max-width: 110ch; }
.foot-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: 11.5px; color: var(--muted); }
.foot-image { height: 320px; margin-top: -40px; background: url("img/footer_pixels.png") center / cover no-repeat; image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / 0.35) 30%, #000 75%); mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / 0.35) 30%, #000 75%); }
@media (max-width: 1000px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: minmax(0, 1fr); } .foot-logo { height: 36px; } .foot-image { height: 200px; } .player input[type="range"] { width: 100px; } }
