/* העולם במספרים – site styles. Paper and ink by day, night sky by night. */

@font-face { font-family: "Assistant"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(/assets/fonts/assistant-hebrew.woff2) format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Assistant"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(/assets/fonts/assistant-latin.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: "Noto Serif Hebrew"; font-style: normal; font-weight: 500 900; font-display: swap;
  src: url(/assets/fonts/noto-serif-hebrew-hebrew.woff2) format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Noto Serif Hebrew"; font-style: normal; font-weight: 500 900; font-display: swap;
  src: url(/assets/fonts/noto-serif-hebrew-latin.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: "Playpen Sans Hebrew"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/playpen-hebrew.woff2) format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Playpen Sans Hebrew"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/playpen-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  color-scheme: light;
  --bg: #F4F2EC;
  --surface: #FFFFFF;
  --surface-2: #EAE7DE;
  --ink: #14161B;
  --ink-2: #3E434B;
  --muted: #5E636C;
  --rule: #DAD6CB;
  --rule-strong: #14161B;
  --accent: #B4470F;
  --accent-soft: rgba(180, 71, 15, .10);
  --focus: #1F5FD1;
  --ok: #1E7A3C;
  --bad: #B42318;
  --shadow: 0 1px 2px rgba(20, 22, 27, .06), 0 12px 32px rgba(20, 22, 27, .10);

  --serif: "Noto Serif Hebrew", "Frank Ruhl Libre", Georgia, serif;
  --hand: "Playpen Sans Hebrew", "Assistant", system-ui, sans-serif;
  --sans: "Assistant", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --page: 1200px;
  --measure: 64ch;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 3px;  /* the drawing: thin lines and small corners, never a rounded app card */
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1A2B;
    --surface: #142339;
    --surface-2: #1B2D47;
    --ink: #E7EEF7;
    --ink-2: #C3CEDD;
    --muted: #93A3B8;
    --rule: #26395A;
    --rule-strong: #ECEDEF;
    --accent: #F2A15A;
    --accent-soft: rgba(242, 161, 90, .14);
    --focus: #8DB4FF;
    --ok: #5CC07C;
    --bad: #FF8A7A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1A2B; --surface: #142339; --surface-2: #1B2D47; --ink: #E7EEF7; --ink-2: #C3CEDD;
  --muted: #93A3B8; --rule: #26395A; --rule-strong: #ECEDEF; --accent: #F2A15A;
  --accent-soft: rgba(242, 161, 90, .14); --focus: #8DB4FF; --ok: #5CC07C; --bad: #FF8A7A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* Drafting paper: a faint 24px grid with a slightly stronger line every 120px. Kept quiet so
   it never competes with the sketch lines. */
:root { --grid: rgba(70, 58, 36, .022); --grid-2: rgba(70, 58, 36, .04); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --grid: rgba(200, 220, 255, .018); --grid-2: rgba(200, 220, 255, .035); }
}
:root[data-theme="dark"] { --grid: rgba(200, 220, 255, .018); --grid-2: rgba(200, 220, 255, .035); }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, var(--grid-2) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(90deg, var(--grid-2) 0 1px, transparent 1px 120px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.num, time, .tabular { font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 3px; font-weight: 600;
  text-decoration: none; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- header & footer ---------- */
.site-head { position: relative; z-index: 5; }
/* on the text pages (about, 404) the main navigation stays at the top while scrolling, like on the home
   page; a solid sheet under it so the text scrolls behind, not through it */
body:not(.page-home):not(.page-story) .site-head { position: sticky; top: 0; z-index: 20; background: var(--bg);
  border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { font-family: var(--serif); font-weight: 800; font-size: 21px; letter-spacing: -.005em; line-height: 1; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15.5px;
  padding: 10px 12px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.site-foot { border-top: 1px solid var(--rule); margin-top: 96px; color: var(--muted); font-size: 15px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; padding-block: 28px 40px; }
.site-foot a { color: var(--ink-2); }

/* ---------- shared bits ---------- */
.kicker { font-size: 14px; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.topic-chip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700;
  color: var(--ink-2); padding: 4px 12px 4px 12px; border: 1px solid var(--rule); border-radius: 2px;
  background: transparent; line-height: 1.4;
}
.topic-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--topic, var(--muted)); box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 2.5px color-mix(in srgb, var(--topic, var(--muted)) 55%, transparent); flex: none; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 10px 22px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg); font: 700 16px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.button:active { transform: translateY(1px); }
.button[disabled] { opacity: .55; cursor: progress; }
.button.ghost { background: transparent; color: var(--ink); }
.button.ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink); }
.icon { width: 1.1em; height: 1.1em; flex: none; }

/* ---------- home: story index ---------- */
.index-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; border-bottom: 2px solid var(--rule-strong); padding-bottom: 14px; }
.index-head h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; margin: 0; }
.index-head p { margin: 0; color: var(--muted); }
.story-list { list-style: none; margin: 0; padding: 0; counter-reset: story; }
.story-item { counter-increment: story; border-bottom: 1px solid var(--rule); }
.story-link {
  display: grid; grid-template-columns: 3.2rem 96px 1fr; gap: 8px 28px; align-items: center;
  padding: 22px 8px; text-decoration: none; color: var(--ink); border-radius: 2px;
  transition: background-color .2s var(--ease);
}
.story-link::before { content: counter(story, decimal-leading-zero); font: 600 15px/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; align-self: start; padding-top: 8px; }
.story-link:hover, .story-link.is-hot { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.story-link:hover .story-title, .story-link.is-hot .story-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.story-thumb { width: 96px; height: 96px; border-radius: 2px; background: transparent; border: 1px solid var(--rule); display: grid; place-items: center; overflow: hidden; }
.story-thumb img { width: 84px; height: 84px; }
.story-body { min-width: 0; }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.story-meta .topic { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--ink-2); }
.story-title { font-family: var(--serif); font-weight: 800; font-size: clamp(21px, 2.3vw, 27px); line-height: 1.2; margin: 6px 0 4px; text-wrap: balance; }
.story-finding { margin: 0; color: var(--ink-2); font-size: 16.5px; }

/* ---------- story page ---------- */
.crumbs { padding-top: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.back-link:hover { color: var(--ink); text-decoration: underline; }
.story-hero { display: grid; grid-template-columns: minmax(0, 1fr) clamp(180px, 24vw, 280px); gap: 24px 56px; align-items: start; padding-block: 20px 36px; }
.story-hero h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(36px, 5.6vw, 72px); line-height: 1.04; letter-spacing: -.015em; margin: 16px 0 20px; text-wrap: balance; }
.finding {
  /* the subtitle: clearly secondary to the title – body-large, not a second headline */
  font-family: var(--serif); font-weight: 500; font-size: clamp(17.5px, 1.45vw, 20px); line-height: 1.5; color: var(--ink-2);
  margin: 0; padding-inline-start: 16px; border-inline-start: 3px solid var(--accent); max-width: 44ch; text-wrap: pretty;
}
.summary { color: var(--ink-2); max-width: var(--measure); margin: 18px 0 0; }
.story-cover { margin: 0; background: transparent; border: 1px solid var(--rule); border-radius: 2px; padding: 14px; aspect-ratio: 1; display: grid; place-items: center; }
.story-cover img { width: 100%; height: 100%; object-fit: contain; }
.facts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 0; margin: 28px 0 0; border-block: 1px solid var(--rule); }
.facts-row > div { padding: 14px 16px 14px 0; }
.facts-row > div + div { border-inline-start: 1px solid var(--rule); padding-inline-start: 16px; }
.facts-row dt { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.facts-row dd { margin: 2px 0 0; font-weight: 700; font-size: 16.5px; }
.facts-row .updated { display: block; font-weight: 500; font-size: 14px; color: var(--muted); }
[data-views][aria-busy="true"] { color: var(--muted); }

.dash { margin-top: 8px; }
.dash-frame { display: block; width: 100%; min-height: 600px; border: 0; background: transparent; color-scheme: inherit; }
.dash-note { font-size: 14px; color: var(--muted); padding-block: 8px; }

/* sources: a footnote list in a drawing – a section label, one quiet line of method, compact rows
   between thin drafting lines; nothing is a card */
.sources { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--rule-strong); }
.sources h2 { font: 700 16px/1.3 var(--sans); letter-spacing: .01em; margin: 0 0 6px; }
.sources-note { margin: 0 0 10px; color: var(--muted); font-size: 14px; max-width: var(--measure); }
.sources-note summary { cursor: pointer; width: max-content; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; }
.sources-note summary::-webkit-details-marker { display: none; }
.sources-note summary::before { content: "+"; display: inline-grid; place-items: center; width: 16px; height: 16px; font: 700 12px/1 var(--sans);
  border: 1px solid var(--rule); border-radius: 2px; }
.sources-note[open] summary::before { content: "−"; }
.sources-note summary:hover { color: var(--ink); }
.sources-note p { margin: 4px 0 6px; color: var(--ink-2); line-height: 1.6; }
.source-list { list-style: none; margin: 0; padding: 0; counter-reset: src; border-top: 1px solid var(--rule); }
.source { counter-increment: src; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); column-gap: 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule); background: transparent; }
.source::before { content: counter(src); grid-row: span 3; font: 600 13px/1.6 var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); }
.source-type { justify-self: start; font-size: 11.5px; font-weight: 700; line-height: 1.5; padding: 0 6px; border-radius: 2px; max-width: 100%; }
.source-type.t-data { color: var(--ink-2); border: 1px solid var(--rule); }
.source-type.t-comparison { background: var(--accent-soft); color: var(--accent); border: 1px dashed var(--accent); }
.source-type.t-general { color: var(--ink-2); border: 1px dashed var(--muted); }
.source-name { font-weight: 700; font-size: 15px; margin: 2px 0 0; overflow-wrap: anywhere; }
.source-name a { display: inline; }
.source-name .ext { width: .8em; height: .8em; vertical-align: -1px; margin-inline-start: 4px; }
.source-desc { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.source-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.downloads { margin-top: 24px; }
.downloads h3 { font: 700 15px/1.3 var(--sans); margin: 0 0 6px; }
.download-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.download { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink); background: transparent; min-height: 44px; }
.download:hover .fname { text-decoration: underline; }
.download .badge { grid-row: span 2; font: 700 11px/1 var(--sans); letter-spacing: .06em; border: 1px solid currentColor; border-radius: 2px; padding: 5px 4px; min-width: 3rem; text-align: center; }
.download .fname { font-weight: 700; font-size: 15px; direction: ltr; text-align: right; overflow-wrap: anywhere; }
.download .fdesc { color: var(--ink-2); font-size: 14px; }

/* ---------- prose & about ---------- */
.prose { max-width: 720px; padding-block: 32px 0; }
.prose h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(40px, 6vw, 72px); line-height: 1.04; margin: 8px 0 20px; }
.prose h2 { font-family: var(--serif); font-weight: 800; font-size: 26px; margin: 40px 0 8px; }
.prose p { color: var(--ink-2); }
.prose .lead { font-size: 20px; color: var(--ink); }

.contact { margin-top: 20px; max-width: 500px; padding: clamp(16px, 3vw, 24px); background: transparent; border: 1px solid var(--rule); border-radius: 3px; }
.contact .field { margin-bottom: 14px; }
.contact .field input, .contact .field textarea { font-size: 16px; padding: 9px 12px; min-height: 44px; }
.contact .field textarea { min-height: 120px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 700; }
.field .help { font-size: 14px; color: var(--muted); }
.field input, .field textarea {
  font: 400 17px/1.5 var(--sans); color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule-strong, var(--rule)); border-radius: 3px; padding: 11px 14px; min-height: 48px; width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
.field [aria-invalid="true"] { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: 14.5px; font-weight: 600; min-height: 0; }
.field input[type="email"] { direction: ltr; text-align: right; }
.hp { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 16px; padding: 12px 14px; border-radius: 3px; border: 1px solid currentColor; font-weight: 600; }
.form-status[hidden] { display: none; }
.form-status.is-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.form-status.is-err { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.turnstile-box { min-height: 65px; margin-bottom: 16px; }
.dev-note { font-size: 14px; color: var(--muted); border: 1px dashed var(--rule); border-radius: 3px; padding: 10px 14px; margin-bottom: 16px; }

/* ---------- 404 ---------- */
.notfound { padding-block: 80px; }
.notfound h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(40px, 7vw, 88px); margin: 0 0 12px; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .story-link { grid-template-columns: 64px 1fr; gap: 6px 14px; padding: 18px 4px; }
  .story-link::before { display: none; }
  .story-thumb { width: 64px; height: 64px; }
  .story-thumb img { width: 56px; height: 56px; }
  .story-hero { grid-template-columns: 1fr; }
  .story-cover { width: 132px; padding: 8px; order: -1; }
  .facts-row > div { padding: 12px 0; }
  .facts-row > div + div { border-inline-start: 0; border-top: 1px solid var(--rule); padding-inline-start: 0; }
  .brand-name { font-size: 19px; }
  .site-nav a { padding: 10px 10px; font-size: 15px; }
  .source { grid-template-columns: 1fr; padding: 16px; }
  .source::before { display: none; }
  .source-date { grid-column: 1; }
}
@media (forced-colors: active) {
  .topic-dot { forced-color-adjust: none; }
  .city-stage canvas { display: none; }
}
@media print {
  .site-head nav, .city, .dash, .contact, .skip-link, .close-story { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- topic colors (validated categorical order; fixed per topic by first appearance) ---------- */
.t0 { --topic: #2a78d6; } .t1 { --topic: #eb6834; } .t2 { --topic: #1baf7a; } .t3 { --topic: #eda100; }
.t4 { --topic: #e87ba4; } .t5 { --topic: #008300; } .t6 { --topic: #4a3aa7; } .t7 { --topic: #e34948; }
.t8 { --topic: #1d8fa8; }
.t-other { --topic: #8a8f98; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t0 { --topic: #3987e5; } :root:not([data-theme="light"]) .t1 { --topic: #d95926; }
  :root:not([data-theme="light"]) .t2 { --topic: #199e70; } :root:not([data-theme="light"]) .t3 { --topic: #c98500; }
  :root:not([data-theme="light"]) .t4 { --topic: #d55181; } :root:not([data-theme="light"]) .t5 { --topic: #008300; }
  :root:not([data-theme="light"]) .t6 { --topic: #9085e9; } :root:not([data-theme="light"]) .t7 { --topic: #e66767; }
  :root:not([data-theme="light"]) .t8 { --topic: #3fb6cc; }
}


/* The plain list is for screen readers and keyboards; it becomes visible when focused or without 3D. */
.story-index { padding-block: 32px 64px; }
.story-index h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; }
.page-home:not(.no-city) .story-index:not(:focus-within) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.page-home:not(.no-city) .story-index:focus-within {
  position: fixed; inset: 68px 0 0; z-index: 30; overflow: auto; background: var(--bg); border-top: 1px solid var(--rule);
}
.no-city .city { display: none; }

/* ---------- story page: close (X) ---------- */
.close-story {
  position: fixed; z-index: 40; top: 12px; inset-inline-end: 12px; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink); background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--rule); backdrop-filter: blur(6px);
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.close-story svg { width: 22px; height: 22px; }
.close-story:hover { background: var(--ink); color: var(--bg); transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .close-story:hover { transform: none; } }

@media (max-width: 760px) {
  .close-story { top: 10px; inset-inline-end: 10px; }
}
.page-story .site-nav { display: none; }

/* ---------- home: the city of numbers (an architect's sketch) ---------- */
.page-home main { display: flex; flex-direction: column; }
.city {
  --sheet: var(--bg); --sheet-ink: var(--ink); --sheet-muted: var(--muted); --sheet-red: #C2410C; --sheet-rule: color-mix(in srgb, var(--ink) 26%, transparent);
  position: relative; isolation: isolate; flex: 1; min-height: calc(100svh - 68px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto;
  color: var(--sheet-ink);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .city { --sheet-red: #FF9B7A; } }
/* the drawing gets its own column: nothing of it ever sits under the neighborhood column */
.city-stage { position: relative; grid-column: 1; grid-row: 1 / -1; min-height: 0; overflow: hidden; }
.city-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; opacity: 0; transition: opacity .5s var(--ease);
  /* the drawing fades into the paper at its edges instead of ending in a hard cut */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent), linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 48px), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent), linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 48px), transparent);
  mask-composite: intersect;
}
.city.is-live .city-stage canvas { opacity: 1; }
.city-status { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; transition: opacity .6s var(--ease); }
.city.is-live .city-status { opacity: 0; }
.city.is-settled .city-status { display: none; }
.loader { display: grid; justify-items: center; gap: 12px; text-align: center; }
.loader[hidden] { display: none; }
.loader-mark { width: 76px; height: 76px; }
.loader-line { fill: none; stroke: var(--sheet-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: sketch 2.2s var(--ease) infinite; }
@keyframes sketch { 0% { stroke-dashoffset: 1; } 60%, 100% { stroke-dashoffset: 0; } }
.loader-text { margin: 0; font: 600 16px/1.3 var(--hand); color: var(--sheet-ink); font-variant-numeric: tabular-nums; }
.loader-bar { width: min(240px, 60vw); height: 3px; background: var(--sheet-rule); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--sheet-red); transition: width .25s var(--ease); }
@media (prefers-reduced-motion: reduce) { .loader-line { animation: none; stroke-dashoffset: 0; } }

/* neighborhood filters: a compact column on the left, outside the drawing */
/* the column sits on the left (the end side in RTL), so the page margin goes on its left: padding-inline-end */
.city-hoods { grid-column: 2; grid-row: 1 / span 2; align-self: start; position: relative; z-index: 2; padding-block: 16px; padding-inline: 12px var(--gutter); }
.city-hoods ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hood-btn {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; width: 100%; min-width: 9.5rem; min-height: 44px;
  padding: 5px 10px 5px 12px; font: 600 15px/1.1 var(--hand); color: var(--sheet-ink); text-align: start;
  background: color-mix(in srgb, var(--bg) 85%, transparent); border: 1.2px solid var(--sheet-rule); border-radius: 3px; cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.hood-btn img { width: 30px; height: 30px; }
.hood-btn .num { color: var(--sheet-muted); font: 600 13px/1 var(--sans); }
.hood-btn:hover { border-color: var(--sheet-ink); background: var(--surface); }
.hood-btn.is-empty { cursor: default; opacity: .55; border-style: dashed; }
.hood-btn.is-empty:hover { border-color: var(--sheet-rule); background: color-mix(in srgb, var(--bg) 85%, transparent); }
.hood-btn.is-empty img { filter: grayscale(1); }
.hood-btn .soon { font: 600 11.5px/1 var(--sans); color: var(--sheet-muted); }

.city-foot { grid-column: 1; grid-row: 2; position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 6px var(--gutter) 14px; }
.city-tools { display: flex; gap: 6px; }
.city-tools button {
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  color: var(--sheet-ink); background: color-mix(in srgb, var(--bg) 85%, transparent);
  border: 1.2px solid var(--sheet-rule); border-radius: 3px;
}
.city-tools button:hover { border-color: var(--sheet-ink); background: var(--surface); }
.city-tools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.city-hint { margin: 0; font: 500 12.5px/1.3 var(--sans); color: var(--sheet-muted); }

.city-leaders { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.city-leaders line { stroke: var(--sheet-ink); stroke-width: 1.2; stroke-dasharray: 5 3; opacity: 0; }
.city.has-card .city-leaders line { opacity: .9; }
.city-card {
  position: absolute; left: 0; top: 0; z-index: 4; width: min(330px, calc(100% - 20px));
  padding: 12px 16px 14px; color: var(--sheet-ink); background: var(--surface);
  border: 1.5px solid var(--sheet-ink); box-shadow: 4px 4px 0 var(--sheet-rule); pointer-events: none;
}
.city-card[hidden] { display: none; }
.city-card.is-pinned { pointer-events: auto; }
.city-card::before, .city-card::after { content: ""; position: absolute; width: 10px; height: 10px; border: 0 solid var(--sheet-ink); }
.city-card::before { top: -6px; inset-inline-start: -6px; border-top-width: 1.5px; border-inline-start-width: 1.5px; }
.city-card::after { bottom: -6px; inset-inline-end: -6px; border-bottom-width: 1.5px; border-inline-end-width: 1.5px; }
.cc-title { margin: 6px 0 4px; font: 800 18px/1.25 var(--serif); }
.cc-finding { margin: 10px 0 0; font-size: 15px; line-height: 1.45; font-weight: 600; }
/* the gauge in the callout: the key number on its scale, glass blue like the tower */
.cc-gauge { --glass: #3F86D8; margin-top: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cc-gauge { --glass: #5FA4EC; } }
:root[data-theme="dark"] .cc-gauge { --glass: #5FA4EC; }
.cc-gauge-num { margin: 0 0 5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font: 700 15px/1.3 var(--sans); font-variant-numeric: tabular-nums; }
.cc-gauge-mark { font: 600 13px/1.3 var(--sans); color: var(--sheet-red); }
.cc-gauge-mark[hidden] { display: none; }
.cc-gauge-bar { position: relative; height: 12px; border: 1.2px solid var(--sheet-ink); background: var(--sheet); }
.cc-gauge-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--glass); }
.cc-gauge-tick { position: absolute; inset-block: -4px; width: 3px; margin-inline-start: -1.5px; background: var(--sheet-red); }
.cc-gauge-tick[hidden] { display: none; }
.cc-gauge-key { margin: 5px 0 0; font: 500 12.5px/1.3 var(--hand); color: var(--sheet-muted); }
.cc-highlight { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--sheet-rule); }
.cc-hl-kicker { font: 600 12.5px/1.2 var(--hand); color: var(--sheet-muted); }
.cc-hl-text { margin: 3px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.cc-chart { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.cc-axis { stroke: var(--sheet-ink); stroke-width: 1.2; }
.cc-barmark { fill: color-mix(in srgb, var(--bg) 70%, transparent); stroke: var(--sheet-ink); stroke-width: 1.2; }
.cc-hatch { stroke: var(--sheet-ink); stroke-width: .8; opacity: .55; }
.cc-line { fill: none; stroke: var(--sheet-ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.cc-dot { fill: var(--surface); stroke: var(--sheet-ink); stroke-width: 1.2; }
.cc-label { font: 500 10.5px var(--sans); fill: var(--sheet-muted); }
.cc-value { font: 700 11px var(--sans); fill: var(--sheet-ink); font-variant-numeric: tabular-nums; }
.cc-hint { margin: 8px 0 0; font: 500 12.5px/1.3 var(--hand); color: var(--sheet-muted); }
.cc-hint[hidden] { display: none; }
.cc-open { margin-top: 10px; width: 100%; min-height: 44px; }
.cc-open[hidden] { display: none; }
.city-fade { position: fixed; inset: 0; z-index: 20; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); }
.city-fade.is-on { opacity: 1; }
@media (max-width: 760px) {
  .city-hoods { padding-block: 10px; padding-inline: 6px 10px; }
  .hood-btn { grid-template-columns: 30px; min-width: 0; width: 46px; padding: 6px; justify-items: center; position: relative; }
  .hood-btn .hood-name, .hood-btn .soon { display: none; }
  .hood-btn .num { position: absolute; top: -5px; inset-inline-start: -5px; background: var(--surface); border: 1px solid var(--sheet-rule); border-radius: 999px; padding: 2px 5px; font-size: 11px; }
  .city-hint { display: none; }
  .city-foot { justify-content: center; padding-bottom: 10px; }
}

/* callout head: cover + tags + title + date, so similar titles are easy to tell apart */
.cc-head { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; }
.cc-cover { width: 64px; height: 64px; border: 1.2px solid var(--sheet-ink); background: var(--sheet); padding: 4px; }
.cc-cover[hidden] { display: none; }
.cc-tags { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 600 13.5px/1.3 var(--hand); color: var(--sheet-muted); }
.cc-tag { border: 1px dashed var(--sheet-rule); padding: 0 6px; }
.cc-tag[hidden] { display: none; }
.cc-date { margin: 0; font: 500 13px/1.3 var(--hand); color: var(--sheet-muted); }
.cc-head .cc-title { margin: 4px 0 2px; }

/* story page tags */
.story-tags { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag { font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 4px 12px; border: 1px dashed var(--rule); border-radius: 2px; }

/* entering a story: the tower's sketch unfolds into the page like a drawing sheet */
.unfold {
  position: fixed; z-index: 50; display: grid; place-items: center; overflow: hidden; pointer-events: none;
  background-color: var(--bg); border: 1.5px solid var(--ink); transform-origin: 50% 50%;
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}
.unfold { align-content: center; gap: 22px; }
.unfold span { font: 900 clamp(20px, 3.4vw, 40px)/1.15 var(--serif); color: var(--ink); text-align: center; padding: 0 24px; white-space: nowrap; }
.unfold i {
  display: block; width: min(560px, 70vw); height: 150px; justify-self: center; opacity: .5;
  background:
    linear-gradient(var(--rule), var(--rule)) 100% 0 / 70% 10px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 100% 22px / 52% 10px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 0 52px / 100% 1px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 0 92px / 100% 1px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 0 110px / 31% 40px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 50% 110px / 31% 40px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 100% 110px / 31% 40px no-repeat;
}

/* home icon in the nav, in the sketch style */
.nav-home { width: 44px; justify-content: center; padding: 8px !important; }
.nav-home svg { width: 26px; height: 26px; }
.nav-home .ink { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.nav-home .thin { stroke-width: 1.6; }
.nav-home .hatch { fill: none; stroke: var(--accent); stroke-width: 1.1; stroke-linecap: round; opacity: .8; }
.site-nav .nav-home[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }

/* logo: a few buildings that read as a bar chart */
.brand-mark { width: 30px; height: 30px; }
.brand-mark .bm-ink { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .bm-hatch { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-linecap: round; }

/* view counter: a small sketched eye next to the number */
.eye { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.eye .eye-hatch { stroke: var(--accent); stroke-width: 1.3; }
.facts-row .views { display: flex; align-items: center; gap: 7px; }
.facts-row .views .eye { color: var(--muted); }
.cc-date { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.cc-views { display: inline-flex; align-items: center; gap: 4px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.cc-views[hidden] { display: none; }

/* about: a link to the author's profile, in the sketch style */
.social a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.social svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.foot-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.foot-in { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-inline-start: 6px; color: inherit; }
.foot-in svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.foot-in:hover svg { stroke: var(--accent); }

/* the city's labels: an HTML layer over the drawing, always facing the viewer */
.city-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.tower-tag, .hood-tag { position: absolute; left: 0; top: 0; pointer-events: auto; transition: opacity .2s var(--ease); will-change: transform; }
.tower-tag {
  display: flex; align-items: center; gap: 8px; max-width: 210px; padding: 4px 10px 5px; text-decoration: none;
  font: 700 13.5px/1.25 var(--sans); color: var(--sheet-ink); background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1.4px solid var(--sheet-ink); border-radius: 3px; box-shadow: 2px 2px 0 var(--sheet-rule);
}
/* the whole title, on up to two balanced lines */
.tower-tag .tt-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-wrap: balance; }
/* leader lines from each tower's top to its label (drawn under the labels) */
.tag-leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tag-leaders line { stroke: var(--sheet-ink); stroke-width: 1.3; stroke-linecap: round; }
.tag-leaders line { transition: opacity .2s var(--ease); }
.tag-leaders line.is-faded { opacity: .3; }
.tag-leaders line.is-hidden { opacity: 0; }
.tower-tag .tt-cover { display: none; width: 56px; height: 56px; border-radius: 4px; background: var(--surface-2); flex: none; }
/* the hovered tower's label keeps its size (the card shows the cover), so no other label moves */
.tower-tag.is-open { z-index: 2; border-color: var(--sheet-ink); background: var(--surface); box-shadow: 3px 3px 0 var(--sheet-rule); }
.tower-tag:hover { background: var(--surface); }
.hood-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; min-height: 32px; cursor: pointer;
  font: 700 14.5px/1 var(--hand); color: var(--sheet-ink); background: color-mix(in srgb, var(--bg) 82%, transparent);
  border: 1px dashed var(--sheet-rule); border-radius: 999px;
}
.hood-tag img { width: 26px; height: 26px; }
.hood-tag:hover { border-style: solid; border-color: var(--sheet-ink); }
.tower-tag.is-hidden, .hood-tag.is-hidden { opacity: 0; pointer-events: none; }
/* the labels layer switched off: no callouts or leaders (the neighborhood names stay) */
.city-labels.labels-off .tower-tag, .city-labels.labels-off .tag-leaders { visibility: hidden; }
.city-tools button[aria-pressed="false"] { border-style: dashed; }
.tower-tag.is-faded, .hood-tag.is-faded { opacity: .3; }
.hood-btn[aria-pressed="true"] { border-color: var(--sheet-ink); background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
/* touch: one finger rotates the city, two fingers zoom and pan it (the city fills the page) */
.city-stage canvas { touch-action: none; }
@media (max-width: 760px) {
  .tower-tag { font-size: 12px; max-width: 152px; padding: 3px 7px 4px; }
  .hood-tag { font-size: 13px; min-height: 28px; }
  .hood-tag img { width: 22px; height: 22px; }
}

/* light / dark switch in the header */
.theme-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 3px;
  background: transparent; color: var(--ink-2); cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; } }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* the sky over the city: birds and a plane, in pencil, under the labels */
.city-sky { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

/* ---------- story page: the guided intro (the shared component; [guided] in story.toml) ----------
   The site's drawing: step texts are numbered annotations with a hairline leader toward the chart; the
   chart is hatched glass with thin ink outlines, red only for the reference line; nothing is a card. */
.guided { --gd-glass: #3F86D8; --gd-ink: #23272F; --gd-wash: #B6B0A3; --gd-red: #C2410C;
  margin-block: 24px 8px; border-top: 1px solid var(--rule); padding-top: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .guided { --gd-glass: #5FA4EC; --gd-ink: #E7EEF7; --gd-wash: #5C6B80; --gd-red: #FF9B7A; } }
:root[data-theme="dark"] .guided { --gd-glass: #5FA4EC; --gd-ink: #E7EEF7; --gd-wash: #5C6B80; --gd-red: #FF9B7A; }
.guided-skip { display: inline-block; font-size: 14.5px; font-weight: 600; color: var(--ink-2); padding: 8px 0; min-height: 44px; }
.guided-skip::after { content: " ↓"; }
/* desktop: the steps on the reading side, the chart beside them, sticky; after the steps, the takeaway
   block is at least as tall as the chart, so the chart comes to rest right beside it */
.guided-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-areas: "steps chart" "end chart"; gap: 0 56px; }
.guided-figure { grid-area: chart; position: sticky; top: 88px; align-self: end; margin: 0 0 4px; padding: 16px 18px 12px;
  background: transparent; border: 1px solid var(--rule); border-radius: 3px; }
.guided-grid > .guided-figure { align-self: start; }
.guided-title { margin: 0; font: 800 clamp(19px, 2.1vw, 24px)/1.25 var(--serif); }
.guided-series { margin: 4px 0 12px; color: var(--muted); font-size: 14.5px; }
.guided-switch { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 12px; border: 1px solid var(--rule); border-radius: 3px; width: fit-content; max-width: 100%; }
.guided-switch[hidden] { display: flex; visibility: hidden; }
.guided:not(.is-exploring) .guided-switch { visibility: hidden; }
.guided-switch button { flex: 1 1 auto; min-width: 0; white-space: normal; text-align: start; font: 600 13.5px/1.2 var(--sans); color: var(--ink-2); background: transparent; border: 0; padding: 8px 12px; min-height: 36px; cursor: pointer; }
.guided-switch button + button { border-inline-start: 1px solid var(--rule); }
.guided-switch button[aria-pressed="true"] { background: var(--gd-ink); color: var(--bg); }
.guided-detail { min-height: 4.6em; max-height: 6.5em; overflow: auto; margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--rule); font-size: 13.5px; color: var(--muted); }
.guided-detail[hidden] { display: block; }
.guided-detail p { margin: 0; }
.gd-detail-head { color: var(--ink); font-size: 14.5px; }
.gd-detail-items { margin-top: 4px !important; line-height: 1.55; }
/* the steps: numbered annotations, a hairline leader toward the chart on the active one */
.guided-steps { grid-area: steps; list-style: none; margin: 0; padding: 0; counter-reset: gd; }
.guided-step { min-height: 64vh; display: flex; align-items: center; }
.guided-step:first-child { min-height: 46vh; align-items: flex-start; padding-top: 12px; }
.guided-note { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 6px 14px; padding: 4px 0; }
.guided-n { grid-row: span 2; width: 26px; height: 26px; display: grid; place-items: center; font: 700 13px/1 var(--sans);
  font-variant-numeric: tabular-nums; color: var(--muted); border: 1px solid var(--rule); border-radius: 2px; background: var(--bg); }
.guided-step.is-active .guided-n { color: var(--bg); background: var(--gd-ink); border-color: var(--gd-ink); }
.guided-note::after { content: ""; position: absolute; top: 13px; inset-inline-end: -48px; width: 40px; border-top: 1px solid var(--gd-ink); opacity: 0; }
.guided-step.is-active .guided-note::after { opacity: 1; }
.guided-text { margin: 0; font: 500 clamp(17.5px, 1.6vw, 20px)/1.55 var(--serif); color: var(--ink); }
.guided-step:not(.is-active) .guided-text { color: var(--ink-2); }
.guided-state { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
/* after the last step: the takeaway, then the head of the explorable section */
.guided-end { grid-area: end; min-height: var(--gd-figh, 0px); display: flex; flex-direction: column; justify-content: flex-start;
  padding-block: 12px 4px; scroll-margin-top: 88px; outline-offset: 6px; }
.guided-takeaway { margin: 0; padding-top: 14px; border-top: 1px solid var(--gd-ink); font: 600 clamp(18px, 1.7vw, 21px)/1.5 var(--serif); }
.guided-label { display: block; width: max-content; margin-bottom: 6px; padding: 2px 8px; font: 700 12.5px/1.4 var(--sans);
  color: var(--ink-2); border: 1px solid var(--rule); border-radius: 2px; }
.data-head { margin-top: 28px; }
.data-title { margin: 0; font: 800 clamp(19px, 2vw, 23px)/1.25 var(--serif); }
.data-hint { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; max-width: 46ch; }
.guided-rest { display: none; }
/* the bars: proportional from zero, the value right after each bar's end */
.gd-bars { display: grid; gap: 7px; }
.gd-row { display: grid; grid-template-columns: minmax(6.5rem, 34%) 1fr; align-items: center; gap: 10px; font-size: 14.5px; padding: 1px 4px; border-radius: 2px; }
.gd-head { min-height: 16px; }
.gd-track { position: relative; height: 20px; margin-inline-end: var(--gd-valw, 5ch); }
.gd-head .gd-track { height: 16px; }
.gd-bar { --bar: var(--gd-glass); position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 2px 0 0 2px;
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bar) 70%, var(--gd-ink)) 0 1.2px, transparent 1.2px 5px),
              color-mix(in srgb, var(--bar) 58%, var(--bg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gd-ink) 75%, transparent);
  transition: width .7s var(--ease); }
.gd-val { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 600 13.5px/1 var(--sans);
  font-variant-numeric: lining-nums tabular-nums; color: var(--ink-2); transition: inset-inline-start .7s var(--ease); }
.gd-row.is-muted .gd-bar { --bar: var(--gd-wash); }
.gd-row.is-hl .gd-name, .gd-row.is-hl .gd-val { font-weight: 800; color: var(--ink); }
.gd-row.is-muted .gd-name, .gd-row.is-muted .gd-val { color: var(--muted); }
.is-exploring .gd-row:not(.gd-head) { cursor: default; }
.is-exploring .gd-row:not(.gd-head):hover, .is-exploring .gd-row.is-on { background: color-mix(in srgb, var(--gd-glass) 10%, transparent); }
.is-exploring .gd-row.is-on .gd-bar { box-shadow: inset 0 0 0 1.5px var(--gd-ink); }
.gd-mark { position: absolute; inset-block: -5px; width: 0; margin-inline-start: -1px; border-inline-start: 1.5px dashed var(--gd-red); transition: inset-inline-start .5s var(--ease); }
.gd-mark[hidden], .gd-marklabel[hidden] { display: none; }
.gd-marklabel { position: absolute; bottom: 0; transform: translateX(50%); white-space: nowrap; font: 700 12.5px/1 var(--sans); color: var(--gd-red); }
@media (prefers-reduced-motion: reduce) { .gd-bar, .gd-val, .gd-mark { transition: none; } }
/* phones: the chart sticks to the top and the steps scroll under it; a spacer of the chart's height at
   the end lets it unpin right after the takeaway and the head of the explorable section */
@media (max-width: 760px) {
  .guided-grid { grid-template-columns: 1fr; grid-template-areas: "chart" "steps" "end" "rest"; gap: 0; }
  /* pinned flush to the top on a solid sheet (nothing scrolls through above it), compact rows, and no step
     counter while the steps run: the text below gets most of the screen */
  .guided-grid > .guided-figure { top: 0; z-index: 2; padding: 14px 2px 8px; padding-inline-end: 56px; border: 0;
    border-bottom: 1px solid var(--gd-ink); border-radius: 0; background: var(--bg); box-shadow: 0 -60px 0 var(--bg); }
  .guided-title { font-size: 17px; }
  .guided-series { margin: 2px 0 6px; font-size: 12.5px; }
  .guided-switch { margin-bottom: 8px; }
  .guided-switch button { font-size: 12.5px; padding: 6px 10px; min-height: 32px; }
  .guided:not(.is-exploring) .guided-switch { display: none; }
  .guided-detail { min-height: 3.4em; max-height: 4.6em; margin-top: 8px; }
  .guided:not(.is-exploring) .guided-detail { display: none; }
  .gd-bars { gap: 3px; }
  /* the chart keeps one height for every series (so the text never jumps); a shorter series sits in its
     middle instead of leaving an empty gap under it */
  .guided-chart { display: flex; flex-direction: column; justify-content: center; }
  .gd-row { font-size: 12.5px; gap: 8px; }
  .gd-track { height: 12px; }
  .guided-step, .guided-step:first-child { min-height: 72vh; align-items: center; padding-top: 0; }
  .guided-note { background: var(--bg); padding: 10px 0; }
  .guided-note::after { display: none; }
  .guided-end { min-height: 0; padding-bottom: 32px; scroll-margin-top: 56px; }
  .guided-rest { display: block; grid-area: rest; height: var(--gd-figh, 0px); }
}

/* The city is a drawing, not text: its labels can't be selected (a drag that starts on one rotates the
   city instead of selecting every label), and a pinch over a label never zooms the page. The callout's
   own text stays selectable. */
.city-stage { -webkit-user-select: none; user-select: none; }
.city-labels, .tower-tag, .hood-tag { touch-action: none; -webkit-touch-callout: none; }
.city-card { -webkit-user-select: text; user-select: text; }
