@font-face { font-family: "Space Grotesk"; src: url("../fonts/SpaceGrotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #050806;
  --bg-2: #0b110e;
  --panel: rgba(14, 22, 18, 0.82);
  --line: rgba(220, 255, 230, 0.12);
  --ink: #e9f3ec;
  --muted: #93a79c;
  --mint: #7cf29a;
  --mint-ink: #04140a;
  --sand: #e8b373;
  --g0: #1a2620; --g1: #24513a; --g2: #2f7d4c; --g3: #47ad64; --g4: #7cf29a;
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; font-family: var(--display); font-size: 18px; line-height: 1.5; overflow-x: hidden; }
body.is-loading { overflow: hidden; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; }
::selection { background: var(--mint); color: var(--mint-ink); }

/* film grain over everything */
.grain { position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.07; background-image: var(--noise); animation: grain 0.9s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -4%); } 75% { transform: translate(-1%, 3%); } 100% { transform: translate(3%, 1%); } }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; justify-content: space-between; padding: 22px 28px 0; overflow: hidden; }
.loader-top { display: flex; justify-content: space-between; color: var(--muted); text-transform: uppercase; }
.loader-mid { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.loader-count { font-size: clamp(48px, 7vw, 110px); font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.loader-what { color: var(--muted); margin: 0; min-height: 1.4em; }
.loader-logo { font-weight: 700; font-size: 19vw; line-height: 0.74; letter-spacing: -0.04em; color: var(--mint); white-space: nowrap; margin: 0 -1vw -1.2vw; transform-origin: bottom left; }
.loader.done { pointer-events: none; }

/* ---------- buttons, pills ---------- */
.pill-button { display: inline-flex; align-items: center; gap: 10px; background: var(--mint); color: var(--mint-ink); border: 0; border-radius: 999px; padding: 13px 22px; font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: transform 0.4s var(--ease), background 0.3s; }
.pill-button:hover { transform: translateY(-2px) scale(1.03); background: #a5f8b9; }
.pill-button:disabled { opacity: 0.35; cursor: default; transform: none; }
.pill-button.small { padding: 10px 18px; font-size: 13px; }
.text-link { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 0; }
.text-link:hover { color: var(--ink); }
.pill { position: relative; display: inline-block; color: var(--mint-ink); padding: 0 0.18em; z-index: 0; }
.pill::before { content: ""; position: absolute; inset: 0.06em -0.02em 0.02em; background: var(--mint); border-radius: 0.24em; z-index: -1; transform-origin: left center; transform: scaleX(var(--pill, 1)); }

/* ---------- nav ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; mix-blend-mode: difference; }
.logo { font-weight: 700; font-size: 22px; letter-spacing: -0.03em; text-decoration: none; }
.logo span { font-weight: 300; font-style: italic; margin-left: 2px; }
.nav nav { display: flex; gap: 28px; }
.nav nav a, .nav-cta { text-decoration: none; text-transform: uppercase; }
.nav nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-cta { border: 1px solid currentColor; padding: 7px 12px; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; overflow: hidden; background: #000; }
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-title { position: absolute; left: 0; right: 0; top: 13vh; margin: 0; padding: 0 2.5vw; font-size: clamp(44px, 9.4vw, 170px); font-weight: 500; line-height: 0.98; letter-spacing: -0.035em; text-transform: uppercase; pointer-events: none; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero-title .line:nth-child(2) { text-align: center; }
.hero-title .line:nth-child(3) { text-align: right; }
.hero-title .w { display: inline-block; }
.hud { position: absolute; left: 28px; right: 28px; bottom: 26px; display: grid; grid-template-columns: auto auto auto 1fr; gap: 40px; align-items: end; pointer-events: none; }
.hud .label { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.hud-year span:last-child { font-size: clamp(54px, 7vw, 120px); font-weight: 300; line-height: 0.85; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.hud-stat span:last-child { font-size: 26px; font-variant-numeric: tabular-nums; }
.hud-info { max-width: 460px; justify-self: end; }
.hud-info p { margin: 0 0 10px; font-size: 15px; line-height: 1.45; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-family: var(--mono); font-size: 11px; background: rgba(233, 243, 236, 0.92); color: #000; padding: 2px 7px; border-radius: 3px; }
.scroll-cue { position: absolute; right: 22px; top: 50%; transform: rotate(90deg); transform-origin: right center; color: var(--muted); text-transform: uppercase; }
.scroll-cue span { display: inline-block; animation: bob 1.6s var(--ease) infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
.words .wd { display: inline-block; white-space: pre; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; white-space: nowrap; text-transform: uppercase; color: var(--muted); background: var(--bg); }
.marquee-track { display: inline-block; will-change: transform; }
.marquee-track b { color: var(--mint); font-weight: 400; margin: 0 18px; }

/* ---------- shared section type ---------- */
section { position: relative; }
.eyebrow { color: var(--mint); text-transform: uppercase; margin: 0 0 18px; }
.big { font-size: clamp(38px, 5.6vw, 96px); font-weight: 500; line-height: 1; letter-spacing: -0.035em; margin: 0 0 22px; text-transform: uppercase; max-width: 15ch; }
.huge { font-size: clamp(42px, 7vw, 128px); font-weight: 500; line-height: 1; letter-spacing: -0.04em; margin: 0 0 8vh; text-transform: uppercase; }
.huge .w { display: inline-block; }
.lede { max-width: 640px; color: #c6d6cc; font-size: 19px; margin: 0 0 28px; }
.rl { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0.02em 0.08em; margin: -0.04em -0.02em -0.08em; }
.rl > span { display: inline-block; }
.caption { color: var(--muted); font-size: 12px; margin: 12px 0 0; }

/* ---------- years strip ---------- */
.years { background: var(--bg); }
.years-pin { height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 2vh; overflow: hidden; padding: 84px 0 24px; }
.years-head { padding: 0 6vw; }
.years-head .big { font-size: clamp(30px, 3.8vw, 66px); max-width: none; margin-bottom: 12px; }
.years-head { display: grid; grid-template-columns: auto 1fr; column-gap: 4vw; align-items: end; }
.years-head .eyebrow { grid-column: 1 / -1; margin-bottom: 10px; }
.years-head .lede { margin: 0 0 12px; font-size: 16px; max-width: 520px; }
.years-track { display: flex; gap: 2.2vw; padding: 0 6vw; will-change: transform; }
.year-card { flex: none; width: min(30vw, 50vh); }
.year-card figure { margin: 0; position: relative; border: 1px solid var(--line); background: #07090a; aspect-ratio: 1; overflow: hidden; }
.year-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.year-card .yc-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; }
.year-card .yc-years { font-size: clamp(22px, 2.2vw, 34px); font-weight: 500; letter-spacing: -0.02em; }
.year-card .yc-flow { display: flex; gap: 16px; margin-top: 10px; }
.flow-g { color: var(--mint); }
.flow-l { color: var(--sand); }
.year-card .bar { height: 6px; display: flex; margin-top: 8px; gap: 2px; }
.year-card .bar i { display: block; height: 100%; border-radius: 3px; }
.year-card.total .yc-years { color: var(--mint); }
.year-card .note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* ---------- numbers ---------- */
.numbers { padding: 18vh 6vw 14vh; background: radial-gradient(1200px 600px at 80% 10%, rgba(124, 242, 154, 0.08), transparent 60%), var(--bg); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-top: 40px; }
.stat { padding: 26px 26px 0 0; }
.stat + .stat { padding-left: 26px; border-left: 1px solid var(--line); }
.stat .num { font-size: clamp(44px, 5vw, 86px); font-weight: 400; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .num small { font-size: 0.45em; letter-spacing: 0; margin-left: 4px; color: var(--muted); }
.stat p { color: var(--muted); max-width: 30ch; margin: 10px 0 0; font-size: 16px; }
.numbers-actions { display: flex; gap: 26px; align-items: center; margin-top: 54px; flex-wrap: wrap; }
.fact { display: inline-flex; align-items: center; gap: 10px; margin-top: 34px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 6px; color: #cfe0d5; min-height: 40px; }
.fact::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }

/* ---------- sticky map ---------- */
.scrolly { background: radial-gradient(1400px 900px at 65% 55%, #0d1712, #040605 70%); }
.scrolly-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
#mapCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-modes { position: absolute; top: 76px; left: 34%; display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: rgba(5, 8, 6, 0.7); z-index: 2; }
.map-modes button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--muted); }
.map-modes button.on { background: var(--ink); color: #000; }
.map-hint { position: absolute; top: 84px; right: 28px; color: var(--muted); margin: 0; z-index: 2; }
.map-year { position: absolute; left: 34%; bottom: 112px; font-size: clamp(60px, 8vw, 140px); font-weight: 300; letter-spacing: -0.05em; line-height: 0.85; pointer-events: none; z-index: 2; font-variant-numeric: tabular-nums; }
.map-legend { position: absolute; left: 34%; right: 28px; bottom: 22px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; z-index: 2; }
.map-legend .chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(5, 8, 6, 0.75); cursor: pointer; color: var(--ink); }
.map-legend .chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-legend .chip.off { opacity: 0.35; }
.map-legend .chip b { color: var(--muted); font-weight: 400; }
.map-legend .ramp { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.map-legend .ramp i { width: 160px; height: 8px; border-radius: 4px; display: inline-block; }
.map-timeline { position: absolute; left: 34%; bottom: 62px; display: flex; gap: 6px; z-index: 3; }
.map-timeline button { background: rgba(5, 8, 6, 0.8); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; color: var(--muted); }
.map-timeline button.on { background: var(--ink); color: #000; }
.map-timeline button.play { color: var(--mint); border-color: var(--mint); }
.tooltip { position: absolute; z-index: 5; pointer-events: none; min-width: 230px; max-width: 280px; background: rgba(6, 10, 8, 0.94); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.tooltip h4 { margin: 0 0 2px; font-size: 16px; font-weight: 600; line-height: 1.2; }
.tooltip .sub { color: var(--muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.tooltip .tt-row { display: flex; justify-content: space-between; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tooltip svg { display: block; margin-top: 8px; }
.steps { position: relative; z-index: 4; margin-top: -100vh; pointer-events: none; }
.step { min-height: 110vh; display: flex; align-items: center; padding: 0 0 0 28px; }
.step:first-child { min-height: 100vh; }
.step-card { pointer-events: auto; width: min(380px, 30vw); background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; padding: 24px 24px 22px; }
.step-card .k { font-family: var(--mono); font-size: 12px; color: var(--mint); text-transform: uppercase; }
.step-card h3 { font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; margin: 8px 0 12px; font-weight: 600; }
.step-card p { margin: 0 0 12px; font-size: 16px; color: #cfdcd4; }
.step-card p:last-child { margin-bottom: 0; }
.step-card b { color: var(--ink); }
.step-card img { width: 100%; border-radius: 6px; display: block; margin: 6px 0 4px; }
.step-card .imgcap { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 0 0 12px; }
.step-card ol { margin: 0 0 12px; padding-left: 22px; color: #cfdcd4; font-size: 15px; }

/* ---------- explore ---------- */
.explore { padding: 18vh 6vw 12vh; background: var(--bg); }
.explore-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 26px; margin-top: 36px; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.panel h3 { margin: 0 0 18px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.panel label { display: block; color: var(--muted); margin: 14px 0 8px; }
.panel label b { color: var(--mint); font-weight: 500; }
select { width: 100%; background: #050806; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font-size: 16px; }
input[type="range"] { width: 100%; accent-color: var(--mint); }
.row { display: flex; gap: 16px; align-items: center; margin-top: 18px; }
.row.selects { margin-top: 0; }
.swap { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.result { margin-top: 22px; min-height: 40px; }
.result .r-name { font-size: 22px; font-weight: 600; line-height: 1.15; }
.result .r-big { font-size: 64px; font-weight: 400; letter-spacing: -0.04em; line-height: 1; margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.result .r-big small { font-size: 18px; color: var(--muted); letter-spacing: 0; margin-left: 8px; }
.result p { margin: 6px 0; color: #cfdcd4; font-size: 16px; }
.guess-track { position: relative; height: 34px; margin: 14px 0 4px; }
.guess-track .axis { position: absolute; left: 0; right: 0; top: 16px; height: 2px; background: var(--line); }
.guess-track .mark { position: absolute; top: 4px; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.guess-track .mark::after { content: ""; display: block; width: 2px; height: 14px; margin: 2px auto 0; background: currentColor; }
.compare-line { font-size: 18px; margin: 18px 0; min-height: 1.5em; }
.compare-table { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 8px 12px; align-items: center; }
.compare-table .head { font-weight: 600; font-size: 15px; }
.compare-table .metric { text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; }
.compare-table .cell { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-size: 15px; }
.compare-table .cell.left { flex-direction: row-reverse; }
.compare-table .cell i { display: block; height: 12px; border-radius: 3px; background: var(--g3); }
.compare-table .cell.left i { background: var(--ink); opacity: 0.75; }
.compare-table .cell.win { font-weight: 700; }
.sub { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 80px 0 20px; }
.boroughs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.borough { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.borough h4 { margin: 0 0 2px; font-size: 18px; }
.borough .avg { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.borough svg { width: 100%; height: auto; display: block; margin: 8px 0; }
.borough svg path { stroke: #050806; stroke-width: 0.6; vector-effect: non-scaling-stroke; transition: opacity 0.2s; cursor: pointer; }
.borough svg path:hover { opacity: 0.7; }
.borough ol { margin: 0; padding-left: 18px; font-size: 13px; color: #cfdcd4; }
.table-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table.hoods { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.hoods th { position: sticky; top: 0; background: #0e1612; text-align: left; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; padding: 10px 12px; cursor: pointer; white-space: nowrap; }
table.hoods th.sorted { color: var(--mint); }
table.hoods td { padding: 8px 12px; border-top: 1px solid var(--line); }
table.hoods td.n { text-align: right; }
table.hoods tr:hover td { background: rgba(124, 242, 154, 0.05); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }

/* ---------- how ---------- */
.how { padding: 20vh 6vw 10vh; background: #000; }
.cases { display: flex; flex-direction: column; gap: 16vh; }
.case { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 6vw; align-items: center; }
.case:nth-child(even) .case-visual { order: -1; }
.case-index { font-size: clamp(70px, 10vw, 180px); font-weight: 300; line-height: 0.8; letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1px rgba(124, 242, 154, 0.6); }
.case .label { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; display: block; margin: 22px 0 6px; }
.case h3 { font-size: clamp(30px, 3.4vw, 56px); line-height: 1.02; letter-spacing: -0.03em; margin: 0; font-weight: 500; }
.case .info { font-size: 18px; color: #cfdcd4; margin: 0 0 14px; max-width: 52ch; }
.case-visual { position: relative; }
.case-visual img { width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line); }
.case-visual .imgcap { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 10px; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bars .b { display: grid; grid-template-columns: 170px 1fr 58px; gap: 12px; align-items: center; font-size: 15px; }
.bars .b .track { height: 22px; background: rgba(255, 255, 255, 0.04); border-radius: 4px; overflow: hidden; }
.bars .b .fill { height: 100%; background: var(--g2); border-radius: 4px; transform-origin: left; }
.bars .b.best .fill { background: var(--mint); }
.bars .b .v { font-family: var(--mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.bigstats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bigstats div { border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.bigstats b { display: block; font-size: clamp(34px, 3.6vw, 60px); font-weight: 400; letter-spacing: -0.04em; line-height: 1; color: var(--mint); font-variant-numeric: tabular-nums; }
.bigstats b.sand { color: var(--sand); }
.bigstats span { color: var(--muted); font-size: 14px; display: block; margin-top: 8px; }
.pipeline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-family: var(--mono); font-size: 13px; }
.pipeline span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; }
.pipeline em { color: var(--mint); font-style: normal; }

/* ---------- footer ---------- */
.footer { background: #000; padding: 12vh 6vw 40px; border-top: 1px solid var(--line); }
.footer-big { font-size: 17vw; font-weight: 700; letter-spacing: -0.05em; line-height: 0.8; color: var(--mint); margin-bottom: 40px; }
.footer-cols { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 30px; color: var(--muted); }
.footer-cols p { margin: 0; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .nav nav { display: none; }
  .hud { grid-template-columns: auto 1fr; gap: 18px; }
  .hud-info { display: none; }
  .stat-row, .explore-grid, .case, .footer-cols { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; padding-left: 0; }
  .boroughs { grid-template-columns: 1fr 1fr; }
  .step-card { width: calc(100vw - 56px); }
  .map-modes, .map-year, .map-legend, .map-timeline { left: 28px; }
  .year-card { width: 72vw; }
  .case:nth-child(even) .case-visual { order: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .scroll-cue span { animation: none; }
}
