/* Most Expensive Street. Tokens only: see CLAUDE.md. Font URLs are filled in by the build. */
@font-face { font-family: Outfit; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/outfit-400.1e67833c2e.woff2) format("woff2"); }
@font-face { font-family: Outfit; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/outfit-600.ef34f8773c.woff2) format("woff2"); }
@font-face { font-family: Outfit; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/outfit-700.d2443eae7b.woff2) format("woff2"); }
@font-face { font-family: Outfit; font-weight: 800; font-style: normal; font-display: swap; src: url(/fonts/outfit-800.2e3c722cea.woff2) format("woff2"); }

:root {
  --street-blue: #3896FF;
  --blue-edge: #2D78CC;
  --night: #14171B;
  --card: #0D0F10;
  --card-92: rgba(13, 15, 16, 0.92);
  --street: #2B3037;
  --kerb: #0A0C0E;
  --park: #172A1F;
  --river: #11304B;
  --river-line: #AEEAE8;
  --grey: #CACACA;
  --white: #FFFFFF;
  --gutter: 16px;
  --header-h: 108px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--white);
  font: 400 17px/1.5 Outfit, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--white); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-weight: 700; line-height: 1.12; margin: 0; }
p { margin: 0; }

/* Header */
.top {
  position: relative;
  z-index: 5;
  background: var(--night);
  padding: 8px var(--gutter) 0;
  border-bottom: 1px solid var(--street);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-weight: 700; font-size: 18px; text-decoration: none;
}
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 calc(var(--gutter) - 8px); }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none;
  display: inline-flex; align-items: center;
  min-height: 48px; padding: 0 8px;
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav a[aria-current="page"] { border-bottom-color: var(--white); }

/* Page body */
.page { max-width: 680px; margin: 0 auto; padding: 28px var(--gutter) 56px; }
.page > * + * { margin-top: 24px; }
.page h1 { font-size: 34px; }
.lede { font-size: 19px; }
.street-line { font-size: 24px; font-weight: 600; margin-top: 10px !important; }

.map-figure { margin: 24px 0 0; }
.map-figure img { width: 100%; border-radius: 16px; background: var(--street); }

/* Numbers card */
.numbers { background: var(--card); border-radius: 20px; padding: 22px 22px 20px; }
.label { color: var(--street-blue); font-weight: 600; font-size: 15px; letter-spacing: 0.02em; text-transform: uppercase; }
.big { font-weight: 800; font-size: 56px; line-height: 1.05; margin-top: 6px; letter-spacing: -0.01em; }
.compare { font-size: 18px; margin-top: 8px; }
.sales { font-size: 16px; margin-top: 4px; }
.runner-up { font-size: 16px; margin-top: 4px; }
.source { color: var(--grey); font-size: 14px; margin-top: 14px; }

/* The Short */
.short { display: grid; gap: 14px; justify-items: start; }
.facade, .facade iframe {
  display: block; width: 100%; max-width: 360px; aspect-ratio: 9 / 16;
  border: 0; border-radius: 16px; overflow: hidden; background: var(--card);
}
.facade { position: relative; padding: 0; cursor: pointer; }
.facade img { width: 100%; height: 100%; object-fit: cover; }
.facade .play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; background: var(--white);
}
.facade .play::after {
  content: ""; position: absolute; left: 30px; top: 23px;
  border-style: solid; border-width: 15px 0 15px 24px;
  border-color: transparent transparent transparent var(--night);
}
.links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.links a, .text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Story */
.story p + p { margin-top: 14px; }
.story { font-size: 18px; line-height: 1.6; }

/* Buttons */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: var(--white); color: var(--night);
  font: 600 17px/1 Outfit, system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.button:hover { text-decoration: none; }
.button[disabled] { opacity: 0.6; cursor: default; }

/* Up and down the ladder */
.ladder-nav { display: grid; gap: 6px; }
.ladder-nav p { font-size: 17px; }
.ladder-nav span { color: var(--grey); }
.ladder-nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Forms */
.panel { background: var(--card); border-radius: 20px; padding: 22px; }
.panel h2 { font-size: 24px; }
.panel h2 + p { margin-top: 8px; }
.form { display: grid; gap: 14px; margin-top: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--night); color: var(--white);
  border: 1px solid var(--street); border-radius: 12px;
  font: 400 17px/1.4 Outfit, system-ui, sans-serif;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--white); outline-offset: 1px; border-color: var(--white); }
.form .button { justify-self: start; }
.msg:empty { display: none; }
.msg { font-size: 16px; font-weight: 600; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Top votes */
.votes { list-style: none; margin: 14px 0 0; padding: 0; }
.votes li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--street); }
.votes .n { font-weight: 600; }

/* The ladder */
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { border-bottom: 1px solid var(--street); }
.ladder a {
  display: grid; grid-template-columns: 2.2em 1fr auto; align-items: baseline; gap: 4px 12px;
  padding: 16px 0; text-decoration: none; min-height: 44px;
}
.ladder .rank { color: var(--grey); font-weight: 600; font-size: 18px; }
.ladder .row-name { font-weight: 600; font-size: 20px; }
.ladder .street { grid-column: 2; color: var(--white); font-size: 16px; }
.ladder .avg { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-weight: 800; font-size: 22px; }
.coming-up { color: var(--white); }
.coming-up strong { font-weight: 600; }

/* Body text blocks (privacy) */
.rule p + p { margin-top: 10px; }
.rule { font-size: 18px; }

/* Footer */
.foot { border-top: 1px solid var(--street); padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom)); color: var(--grey); font-size: 14px; }
.foot-in { max-width: 680px; margin: 0 auto; display: grid; gap: 10px; }
.foot a { color: var(--grey); }
.foot .foot-links { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.foot .foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--white); font-weight: 600; }

/* Photo headers: full bleed straight under the header. Keep in step with LAYOUT in scripts/photos.py */
.hero { position: relative; height: 45vh; height: 45svh; overflow: hidden; background: var(--night); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; }
.hero-in { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 40px; }
.hero h1 { font-size: 34px; line-height: 1.12; color: var(--white); }
.hero-credit {
  position: absolute; z-index: 1; right: 12px; bottom: 10px; margin: 0;
  background: var(--card-92); color: var(--grey); border-radius: 8px; padding: 2px 8px; font-size: 13px; line-height: 18px;
}

/* Stats */
.stats h2 { font-size: 28px; }
.stats section + section { margin-top: 44px; }
.stats .lede { margin-top: 6px; }
.chart-fig { margin: 22px 0 0; }
.chart-fig h3 { font-size: 20px; margin-bottom: 14px; }
.chart-box svg { display: block; max-width: 100%; height: auto; }
.chart-wide { display: none; }
.chart-note { margin-top: 12px; font-weight: 600; }
details { margin-top: 10px; }
summary { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
summary::-webkit-details-marker { color: var(--grey); }
table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 15px; }
th { text-align: left; color: var(--grey); font-weight: 600; font-size: 13px; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--street); }
td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--street); vertical-align: top; }
th:not(:first-child), td:not(:first-child) { text-align: right; white-space: nowrap; }
.footnote { color: var(--grey); font-size: 14px; margin-top: 36px !important; }

/* 404 */
.not-found { min-height: 50vh; display: grid; align-content: center; gap: 20px; }

/* ---------- Home: the map ---------- */
/* The header scrolls away with the page (round 2: a sticky header sat over the map's overlays). */
.map-wrap { position: relative; height: calc(100vh - var(--header-h) - 56px); height: calc(100svh - var(--header-h) - 56px); min-height: 420px; overflow: hidden; background: var(--night); }
#map { position: absolute; inset: 0; }
.map-intro {
  position: absolute; z-index: 2; top: 12px; left: 12px; right: 12px;
  background: var(--card-92); border-radius: 16px; padding: 14px 16px;
  pointer-events: none;
}
.map-intro h1 { font-size: 22px; }
.map-intro p { margin-top: 4px; font-size: 16px; }

.sheet {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  background: var(--card-92); border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform 280ms ease-out;
  max-height: 78%; overflow-y: auto;
}
.sheet.open { transform: none; }
.sheet h2 { font-size: 26px; padding-right: 52px; }
.sheet .label { margin-top: 12px; }
.sheet .big { font-size: 48px; }
.sheet .compare { font-size: 17px; }
.sheet .button { margin-top: 16px; }
.sheet .coming { margin-top: 6px; font-weight: 600; font-size: 18px; }
.sheet .card-links { margin-top: 6px; }
.sheet .card-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.sheet .panel { padding: 0; background: transparent; margin-top: 16px; }
.sheet .panel h2 { font-size: 20px; padding: 0; }
.close {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: var(--street); color: var(--white);
  font: 600 24px/1 Outfit, system-ui, sans-serif; cursor: pointer;
}

.tag {
  background: var(--street-blue); color: var(--white);
  font: 700 19px/1 Outfit, system-ui, sans-serif; letter-spacing: 0.02em; text-transform: uppercase;
  border-radius: 14px; padding: 9px 14px 8px; white-space: nowrap; pointer-events: none;
}

.list-wrap { max-width: 680px; margin: 0 auto; padding: 18px var(--gutter) 40px; }
.list-wrap h2 { font-size: 24px; min-height: 30px; }
.streets { list-style: none; margin: 12px 0 0; padding: 0; }
.streets li { border-bottom: 1px solid var(--street); }
.streets a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 0; text-decoration: none; min-height: 44px; }
.streets .row-name { font-weight: 600; font-size: 19px; }
.streets .street { grid-column: 1; font-size: 16px; }
.streets .avg { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 800; font-size: 20px; }

/* MapLibre: the few rules it needs, in tokens (its own CSS isn't loaded) */
.maplibregl-map { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; font: 400 12px/1.4 Outfit, system-ui, sans-serif; }
.maplibregl-canvas { position: absolute; left: 0; top: 0; }
.maplibregl-canvas-container.maplibregl-interactive { cursor: grab; }
.maplibregl-canvas-container.maplibregl-interactive:active { cursor: grabbing; }
/* touch-action as MapLibre's own CSS sets it. With cooperative gestures one finger scrolls the page. */
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate, .maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas { touch-action: pan-x pan-y; }
.maplibregl-canvas-container.maplibregl-touch-drag-pan, .maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas { touch-action: pinch-zoom; }
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan, .maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas { touch-action: none; }
.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures, .maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas { touch-action: pan-x pan-y; }
/* The scroll and two-finger hint, in the brand: a Card panel, Outfit, white */
.maplibregl-cooperative-gesture-screen {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: transparent; opacity: 0; pointer-events: none; transition: opacity 400ms 900ms;
}
.maplibregl-cooperative-gesture-screen.maplibregl-show { opacity: 1; transition: opacity 50ms; }
.maplibregl-cooperative-gesture-screen > div {
  background: var(--card-92); color: var(--white); font: 600 18px/1.3 Outfit, system-ui, sans-serif;
  border-radius: 16px; padding: 14px 18px; max-width: 320px; text-align: center;
}
.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message { display: none; }
@media (hover: none), (pointer: coarse) {
  .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message { display: none; }
  .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message { display: block; }
}
.maplibregl-marker { position: absolute; top: 0; left: 0; will-change: transform; }
.maplibregl-ctrl-top-left, .maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }
.maplibregl-ctrl-top-left { top: 0; left: 0; }
.maplibregl-ctrl-top-right { top: 0; right: 0; }
.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }
.maplibregl-ctrl-bottom-right { right: 0; bottom: var(--sheet-h, 0px); transition: bottom 280ms ease-out; display: flex; flex-direction: column; align-items: flex-end; }
.maplibregl-ctrl { pointer-events: auto; }
.maplibregl-ctrl-group { margin: 0 10px 10px 0; display: grid; gap: 8px; }
.maplibregl-ctrl-group button {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--white); cursor: pointer; padding: 0;
  display: grid; place-items: center;
}
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { width: 18px; height: 18px; display: block; background-repeat: no-repeat; background-position: center; }
.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 2v14M2 9h14' stroke='%2314171B' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M2 9h14' stroke='%2314171B' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.maplibregl-ctrl-group button:disabled { opacity: 0.5; cursor: default; }
.maplibregl-ctrl-attrib {
  margin: 0; padding: 3px 8px; border-radius: 10px 0 0 0;
  background: var(--card-92); color: var(--grey); font-size: 12px;
}
.maplibregl-ctrl-attrib a { color: var(--grey); text-decoration: none; }
.maplibregl-ctrl-attrib-button { display: none; }
.maplibregl-hidden { visibility: hidden; }

@media (min-width: 600px) {
  .page h1 { font-size: 44px; }
  .hero h1 { font-size: 44px; }
  .big { font-size: 64px; }
  .map-intro { right: auto; max-width: 440px; }
  .map-intro h1 { font-size: 26px; }
}

@media (min-width: 700px) {
  .chart-narrow { display: none; }
  .chart-wide { display: block; }
}

@media (min-width: 760px) {
  :root { --header-h: 64px; }
  .hero { height: 55vh; height: 55svh; }
  .hero-in { left: 32px; right: 32px; bottom: 48px; }
  .top { display: flex; align-items: center; justify-content: space-between; padding: 8px 24px; }
  .nav { margin: 0; padding: 0; gap: 8px; }
  .nav a { min-height: 44px; }
}

@media (min-width: 900px) {
  .sheet {
    left: auto; right: 16px; top: 16px; bottom: auto; width: 380px;
    border-radius: 20px; padding: 24px 22px 22px;
    transform: translateX(calc(100% + 32px)); max-height: calc(100% - 32px);
  }
  .sheet.open { transform: none; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .maplibregl-ctrl-bottom-right, .maplibregl-cooperative-gesture-screen { transition: none; }
  html { scroll-behavior: auto; }
}

/* Photo headers: generated by scripts/build.mjs from data/photos.json and the measured overlays */
.hero-ladder::after { background: rgba(20, 23, 27, 0.34); }
.hero-ladder img { object-position: 50% 50%; }
@media (min-width: 760px) { .hero-ladder img { object-position: 50% 85%; } }
.hero-next::after { background: rgba(20, 23, 27, 0.52); }
.hero-next img { object-position: 0% 0%; }
@media (min-width: 760px) { .hero-next img { object-position: 30% 85%; } }
.hero-stats::after { background: rgba(20, 23, 27, 0.38); }
.hero-stats img { object-position: 80% 80%; }
@media (min-width: 760px) { .hero-stats img { object-position: 80% 80%; } }
