@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(vendor/fonts/barlow-condensed-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(vendor/fonts/barlow-condensed-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(vendor/fonts/barlow-condensed-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(vendor/fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(vendor/fonts/barlow-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(vendor/fonts/barlow-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(vendor/fonts/barlow-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(vendor/fonts/barlow-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --ink: #1d2433;
  --ink-2: #4a5263;
  --ink-3: #6b7383;
  --paper: #ffffff;
  --wash: #f2f4f7;
  --rule: #dde1e8;
  --focus: #2a78d6;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, sans-serif;
  --panel-w: 400px;
  --gap: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--wash); color: var(--ink); font: 400 15px/1.45 var(--text); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#map { position: fixed; inset: 0; }

/* ---------- panel ---------- */
#panel {
  position: fixed; z-index: 3; top: var(--gap); left: var(--gap); bottom: calc(var(--gap) + 64px);
  width: var(--panel-w); display: flex; flex-direction: column;
  background: var(--paper); border-radius: 14px; box-shadow: 0 1px 2px rgba(29,36,51,.12), 0 8px 28px rgba(29,36,51,.14);
  overflow: hidden;
}
#sheet-handle { display: none; }
.brand { padding: 18px 22px 6px; }
.brand a { color: inherit; text-decoration: none; }
.brand h1 { margin: 0; font: 700 40px/0.95 var(--cond); letter-spacing: -0.01em; }
.brand p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.tabs { display: flex; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid var(--rule); }
.tabs button { background: none; border: 0; padding: 8px 6px 9px; margin-bottom: -1px; font: 500 19px/1 var(--cond); color: var(--ink-3); border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
#view { flex: 1; overflow-y: auto; padding: 16px 22px 28px; overscroll-behavior: contain; }
#view:focus { outline: none; }

h2 { font: 700 30px/1 var(--cond); margin: 0 0 6px; }
h2 + .fun { margin-top: 16px; }
h3 { font: 700 20px/1.1 var(--cond); margin: 26px 0 10px; }
.sub { color: var(--ink-2); margin: 0 0 14px; }
.muted { color: var(--ink-3); }
.back { background: none; border: 0; padding: 0; color: var(--ink-2); font-weight: 600; margin-bottom: 10px; }
.back:hover { color: var(--ink); }

/* the headline number on the home view */
.hero { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 2px; }
.hero b { font: 700 64px/0.9 var(--cond); letter-spacing: -0.02em; }
.hero span { font: 500 24px/1 var(--cond); color: var(--ink-2); }

.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; margin: 16px 0 0; }
.facts div { border-left: 3px solid var(--rule); padding-left: 10px; }
.facts dt { color: var(--ink-3); font-size: 13px; }
.facts dd { margin: 0; font: 700 24px/1.1 var(--cond); }
.facts dd small { font: 500 15px var(--cond); color: var(--ink-2); }

/* tour chip: the roman numeral in the tour's colour */
.chip { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 6px; border-radius: 13px; color: #fff; font: 700 15px/1 var(--cond); background: var(--c); }

.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; width: 100%; padding: 10px 4px; background: none; border: 0; text-align: left; border-radius: 8px; }
.row:hover, .row.on { background: var(--wash); }
.row .t { font-weight: 600; }
.row .s { color: var(--ink-3); font-size: 13px; grid-column: 2; }
.row .n { font: 700 18px var(--cond); text-align: right; grid-row: 1 / span 2; grid-column: 3; white-space: nowrap; }
.row .n small { display: block; font: 500 13px var(--text); color: var(--ink-3); }
.row .d { grid-row: 1 / span 2; font: 700 22px/1 var(--cond); color: var(--ink-3); min-width: 34px; text-align: center; }

/* segmented controls */
.seg { display: inline-flex; background: var(--wash); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(29,36,51,.15); }

/* charts */
.chart { width: 100%; margin-top: 10px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font: 500 12px var(--cond); fill: var(--ink-3); }
.chart .val { font: 700 13px var(--cond); fill: var(--ink-2); }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.profile { position: relative; margin: 14px 0 4px; touch-action: pan-y; }
.profile text { font: 500 11px var(--cond); fill: var(--ink-3); }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.daynav { display: flex; justify-content: space-between; gap: 8px; margin-top: 22px; }
.btn { border: 1px solid var(--rule); background: var(--paper); border-radius: 9px; padding: 8px 12px; font-weight: 600; }
.btn:hover:not(:disabled) { border-color: var(--ink-3); }
.btn:disabled { opacity: .4; cursor: default; }
.btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* records & curiosities */
.rec { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; text-align: left; background: none; border: 0; padding: 12px 4px; border-radius: 8px; }
.rec:hover { background: var(--wash); }
.rec .k { color: var(--ink-2); font-size: 14px; }
.rec .v { font: 700 26px/1 var(--cond); grid-row: 1 / span 2; grid-column: 2; align-self: center; text-align: right; }
.rec .w { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.fun { margin: 0 0 18px; }
.fun b { display: block; font: 700 34px/1 var(--cond); }
.fun p { margin: 4px 0 0; color: var(--ink-2); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.missing { color: var(--ink-3); font-size: 13px; }

/* ---------- basemap switcher ---------- */
#basemaps { position: fixed; z-index: 2; top: var(--gap); right: calc(var(--gap) + 44px); display: flex; background: var(--paper); border-radius: 10px; padding: 3px; gap: 2px; box-shadow: 0 1px 2px rgba(29,36,51,.12), 0 4px 14px rgba(29,36,51,.12); }
#basemaps button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
#basemaps button[aria-pressed="true"] { background: var(--ink); color: #fff; }
#basemaps button[data-3d] { margin-left: 4px; }

/* ---------- the year rail ---------- */
#rail {
  position: fixed; z-index: 2; left: calc(var(--panel-w) + var(--gap) * 2); right: var(--gap); bottom: var(--gap);
  height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 8px;
  background: var(--paper); border-radius: 26px; box-shadow: 0 1px 2px rgba(29,36,51,.12), 0 4px 14px rgba(29,36,51,.12);
}
#play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ink); display: grid; place-items: center; }
#play svg { width: 14px; fill: #fff; margin-left: 2px; }
#play.on svg { margin-left: 0; }
#rail-list { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
#rail-list button { width: 100%; height: 40px; padding-bottom: 6px; border: 0; border-radius: 8px; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: 700 18px/1 var(--cond); color: var(--ink); position: relative; }
#rail-list button::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 3px; height: 4px; border-radius: 2px; background: var(--c); }
#rail-list button small { font: 500 11px/1 var(--cond); color: var(--ink-3); }
#rail-list button:hover, #rail-list button[aria-current="true"] { background: var(--wash); }
#rail-list button.dim { opacity: .35; }
#rail-year { display: none; }

#tip { position: fixed; z-index: 5; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 9px; border-radius: 7px; font-size: 13px; line-height: 1.3; max-width: 240px; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
#tip b { font-weight: 600; }

.maplibregl-ctrl-top-right { top: 0; }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--gap) + 58px); }
.maplibregl-ctrl-attrib { font-size: 11px; }
.year-flash { position: fixed; z-index: 2; left: calc(var(--panel-w) + var(--gap) * 2 + 24px); bottom: 92px; font: 700 96px/0.9 var(--cond); color: var(--ink); text-shadow: 0 0 18px #fff, 0 0 4px #fff; pointer-events: none; }
.year-flash small { display: block; font-size: 32px; color: var(--ink-2); }

/* ---------- phone: the panel becomes a bottom sheet ---------- */
@media (max-width: 760px) {
  :root { --gap: 10px; }
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 42vh; border-radius: 16px 16px 0 0; transition: height .25s ease; padding-bottom: env(safe-area-inset-bottom); }
  #panel.open { height: 82vh; }
  #panel.min { height: 112px; }
  #sheet-handle { display: block; border: 0; background: none; padding: 8px 0 0; }
  #sheet-handle span { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--rule); margin: 0 auto; }
  .brand { padding: 4px 16px 2px; display: flex; align-items: baseline; gap: 10px; }
  .brand h1 { font-size: 28px; }
  .brand p { font-size: 13px; }
  .tabs { padding: 4px 12px 0; }
  .tabs button { font-size: 17px; }
  #view { padding: 12px 16px 24px; }
  .hero b { font-size: 52px; }
  #rail { left: var(--gap); right: var(--gap); bottom: calc(42vh + 8px); height: 44px; padding: 0 6px 0 4px; gap: 4px; transition: bottom .25s ease; }
  body.sheet-open #rail { bottom: calc(82vh + 8px); }
  body.sheet-min #rail { bottom: 120px; }
  #play { width: 34px; height: 34px; }
  #rail-list { gap: 0; }
  #rail-list button { height: 36px; font-size: 14px; padding-bottom: 6px; }
  #rail-list button small { display: none; }
  #basemaps { top: var(--gap); left: var(--gap); right: auto; }
  #basemaps button { padding: 6px 7px; font-size: 12px; }
  .maplibregl-ctrl-bottom-right { display: none; }
  .year-flash { left: 20px; bottom: auto; top: 64px; font-size: 64px; }
  .year-flash small { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { #panel, #rail { transition: none; } }
