@font-face { font-family: Archivo; src: url(fonts/archivo-normal-latin.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
  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: Archivo; src: url(fonts/archivo-normal-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, 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: Archivo; src: url(fonts/archivo-italic-latin.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap;
  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: Archivo; src: url(fonts/archivo-italic-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #05080f; --ink: #f1ece2; --muted: #c9c2b4; --rule: rgba(241, 236, 226, .16);
  --panel: rgba(6, 9, 17, .78); --panel-edge: rgba(241, 236, 226, .1); --accent: #ffae55;
  --k-office: #bcd4f2; --k-home: #ffae55; --k-mixed: #e7d2a8; --k-other: #9aa7b8;
  --lbl-bg: rgba(5, 8, 15, .72); --lbl-stem: rgba(241, 236, 226, .55);
  --vh: 1vh;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #e8e5de; --ink: #191815; --muted: #45423b; --rule: rgba(25, 24, 21, .18);
  --panel: rgba(246, 244, 239, .86); --panel-edge: rgba(25, 24, 21, .1); --accent: #a8401d;
  --k-office: #3a6c9e; --k-home: #b8502c; --k-mixed: #8a6a3a; --k-other: #6b7480;
  --lbl-bg: rgba(246, 244, 239, .82); --lbl-stem: rgba(25, 24, 21, .5);
  color-scheme: light;
}
[hidden] { display: none !important; }
svg[hidden] { display: none; }
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 18px/1.6 Archivo, system-ui, sans-serif; font-stretch: 96%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* top bar floats over the city */
.top { position: fixed; z-index: 40; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; pointer-events: none; }
.top > * { pointer-events: auto; }
.home { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; font-size: 14px; letter-spacing: .02em; font-weight: 500; padding: 6px 10px 6px 6px; border-radius: 8px; background: var(--lbl-bg); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tools { display: flex; gap: 8px; align-items: center; }
.lang, .theme { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; min-width: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--panel-edge); background: var(--lbl-bg); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer; }
.theme { padding: 0; }
:root[data-theme="dark"] .theme .moon, :root[data-theme="light"] .theme .sun { display: none; }

/* the stage: the whole viewport on desktop, the text column floats over it */
.story { position: relative; }
.stage { position: sticky; top: 0; height: calc(var(--vh) * 100); height: 100svh; overflow: hidden; background: var(--bg); z-index: 1; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, var(--bg) 0, transparent 34%), linear-gradient(0deg, color-mix(in srgb, var(--bg) 55%, transparent) 0, transparent 22%); opacity: 0; transition: opacity .8s; }
.stage.ready::after { opacity: .55; }
.steps { position: relative; z-index: 2; margin-top: calc(var(--vh) * -100); margin-top: -100svh; width: min(440px, 38vw); margin-left: clamp(20px, 5vw, 72px); padding-bottom: 30vh; pointer-events: none; }
.steps > * { pointer-events: auto; }
.intro { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 0 14svh; }
.kicker { margin: 0 0 14px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
h1 { margin: 0; font-size: clamp(44px, 5.4vw, 84px); line-height: .98; font-weight: 700; font-stretch: 72%; letter-spacing: -.01em; text-wrap: balance; }
.deck { margin: 22px 0 0; font-size: 20px; line-height: 1.5; max-width: 30em; }
.cue { margin: 28px 0 0; font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.intro > * { text-shadow: 0 1px 18px var(--bg), 0 0 2px var(--bg); }
.step { min-height: 110svh; display: flex; align-items: center; }
.step:last-child { min-height: 80svh; }
.card-in { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 4px; padding: 22px 26px 8px; backdrop-filter: blur(10px) saturate(1.1); -webkit-backdrop-filter: blur(10px) saturate(1.1); }
.when { margin: 0 0 6px; font-size: 30px; line-height: 1.1; font-weight: 700; font-stretch: 74%; }
.card-in p { margin: 0 0 16px; }
.sw { white-space: nowrap; }
.sw::before { content: ''; display: inline-block; width: .62em; height: .62em; margin: 0 .3em .06em .1em; border-radius: 1px; background: var(--c); vertical-align: baseline; }
.k-office { --c: var(--k-office); } .k-home { --c: var(--k-home); } .k-mixed { --c: var(--k-mixed); } .k-other { --c: var(--k-other); }
.explore-cta { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 4px; font-weight: 600; cursor: pointer; }

/* readout */
.hud { position: absolute; right: clamp(16px, 3vw, 44px); top: 64px; padding: 10px 12px 10px; border-radius: 4px; width: min(340px, 30vw); text-align: right; pointer-events: none; z-index: 3; }
:root[data-theme="light"] .hud { background: color-mix(in srgb, var(--bg) 52%, transparent); }
.yr { margin: 0; font-size: clamp(56px, 6.6vw, 112px); line-height: .82; font-weight: 250; font-stretch: 62%; font-variant-numeric: tabular-nums; letter-spacing: -.02em; text-shadow: 0 0 30px var(--bg); }
.cnt { margin: 10px 0 12px; font-size: 15px; font-weight: 600; text-shadow: 0 0 10px var(--bg), 0 0 2px var(--bg); }
.chart { display: block; width: 100%; height: 64px; transition: opacity .6s; }
.stage.early .chart { opacity: 0; }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; font-size: 13px; font-weight: 500; }
.legend li { display: inline-flex; align-items: center; gap: 6px; text-shadow: 0 0 8px var(--bg); }
.legend i { width: 10px; height: 10px; border-radius: 1px; background: var(--c); display: inline-block; }

/* labels with a stem down to the roof */
.labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.lbl { position: absolute; left: 0; top: 0; padding: 4px 8px 5px; background: var(--lbl-bg); border-left: 2px solid var(--ink); font-size: 13px; line-height: 1.25; white-space: nowrap; opacity: 0; transition: opacity .35s; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.lbl.on { opacity: 1; }
.lbl b { display: block; font-weight: 650; }
.lbl span { color: var(--muted); font-variant-numeric: tabular-nums; }
.lbl::after { content: ''; position: absolute; left: var(--sx, 50%); top: 100%; width: 1px; height: var(--stem, 20px); background: var(--lbl-stem); }

/* explore mode */
.explore-btn { position: absolute; right: clamp(16px, 3vw, 44px); bottom: 22px; z-index: 4; border: 1px solid var(--panel-edge); background: var(--panel); padding: 10px 16px; border-radius: 4px; font-weight: 600; font-size: 15px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.xp { display: none; }
body.exploring .stage { position: fixed; inset: 0; height: auto; z-index: 60; }
body.exploring #gl { touch-action: none; cursor: grab; }
body.exploring .explore-btn { display: none; }
body.exploring .xp { display: grid; position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); bottom: 18px; width: min(680px, calc(100% - 24px)); grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 14px 16px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.xp-year { grid-column: 1 / -1; display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.xp-year input { width: 100%; accent-color: var(--accent); }
.xp-jumps, .xp-zoom { display: flex; gap: 6px; flex-wrap: wrap; }
.xp button { border: 1px solid var(--panel-edge); background: transparent; padding: 7px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 600; min-height: 36px; }
.xp-zoom button { min-width: 38px; font-size: 18px; padding: 4px 10px; }
.xp-close { grid-column: 1 / -1; justify-self: start; }
body.exploring .steps, body.exploring .after { visibility: hidden; }
.tcard { position: absolute; z-index: 6; left: 20px; top: 70px; max-width: 320px; background: var(--panel); border: 1px solid var(--panel-edge); border-left: 3px solid var(--accent); padding: 12px 40px 12px 14px; border-radius: 4px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tcard h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.2; }
.tcard p { margin: 0; font-size: 14px; color: var(--muted); }
.tcard button { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; background: none; font-size: 22px; cursor: pointer; }

.nogl-msg { display: none; }
.stage.nogl .nogl-msg { display: block; position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); max-width: 26em; text-align: center; }
.stage.nogl .hud, .stage.nogl .explore-btn { display: none; }

/* after the story */
.after { position: relative; z-index: 3; background: var(--bg); max-width: 760px; margin: 0 auto; padding: 60px 20px 40px; font-size: 16px; }
.after h2 { font-size: 26px; font-stretch: 76%; margin: 36px 0 12px; }
.after p { color: var(--ink); }
.srcs { padding-left: 1.1em; }
.srcs li { margin: 6px 0; }
.share { display: flex; gap: 10px; align-items: center; margin: 36px 0 12px; border-top: 1px solid var(--rule); padding-top: 22px; }
.share p { margin: 0 6px 0 0; font-weight: 600; }
.sh { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--rule); border-radius: 50%; background: none; cursor: pointer; }
.sh.done { border-color: var(--accent); }
.foot { margin-top: 24px; font-size: 14px; color: var(--muted); }
.foot p { margin: 4px 0; color: var(--muted); }

/* phone: the city as a 40svh strip on top, the text below it */
@media (max-width: 899px) {
  body { font-size: 17px; }
  .top { padding: 10px 12px; }
  .home span { display: none; }
  .stage { height: 40svh; z-index: 3; box-shadow: 0 1px 0 var(--rule); }
  .steps { z-index: 1; }
  .stage::after { background: linear-gradient(0deg, color-mix(in srgb, var(--bg) 60%, transparent) 0, transparent 30%); }
  .steps { margin: 0; width: auto; padding: 0 16px 20vh; }
  .intro { min-height: auto; padding: 26px 0 30px; }
  .intro > * { text-shadow: none; }
  h1 { font-size: 40px; }
  .deck { font-size: 18px; }
  .step { min-height: 72svh; align-items: flex-start; padding-top: 4svh; scroll-margin-top: 42svh; }
  .card-in { background: none; border: 0; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .when { font-size: 26px; }
  .hud { top: auto; bottom: 8px; left: 8px; right: auto; width: auto; text-align: left; padding: 4px 8px; }
  .yr { font-size: 40px; }
  .cnt { font-size: 13px; margin: 4px 0 0; }
  .chart, .legend { display: none; }
  .explore-btn { right: 10px; bottom: 10px; padding: 8px 12px; font-size: 14px; }
  .lbl { font-size: 12px; padding: 3px 6px 4px; }
  body.exploring .chart { display: none; }
  .tcard { top: 56px; left: 10px; right: 10px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .lbl, .stage::after, .chart { transition: none; } }
