/* UrbanPulse — site styles
   White pages, one green brand, hairline "drawn" lines (after the sketched-skyline slide template),
   research-paper typography. Data colours match figures/: BrBG for scores, blue<->red for surface heat. */

:root {
  --green: #1f7a52;
  --green-2: #3fa171;
  --green-3: #8cc9a8;
  --green-soft: #eef6f1;
  --ink: #111a15;
  --ink-2: #4a524d;
  --muted: #8a918c;
  --rule: #e1e7e3;
  --rule-2: #c9d3cc;
  --paper: #ffffff;
  --brown: #8c510a;
  --teal: #01665e;
  --p-heat: #eb6834; --p-shade: #1baf7a; --p-green: #008300; --p-community: #e87ba4; --p-access: #2a78d6; --p-flood: #4a3aa7;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 62px; scroll-snap-type: y proximity; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.62; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.12; margin: 0 0 0.5em; }
h2 { font-size: clamp(30px, 4vw, 50px); }
h3 { font-size: clamp(21px, 2.1vw, 26px); }
h2 em, h1 em { font-style: italic; color: var(--green); }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }
.tiny { font-size: 12.5px; line-height: 1.5; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ nav */
.nav { position: sticky; top: 0; z-index: 50; height: 62px; display: flex; align-items: center; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.nav .wrap { display: flex; align-items: center; gap: 26px; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand svg { width: 40px; height: 27px; flex-shrink: 0; }
.brand b { font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; display: block; line-height: 1.1; }
.brand small { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.nav ul { list-style: none; display: flex; gap: 22px; margin: 0 0 0 auto; padding: 0; font-size: 14px; }
.nav ul a { color: var(--ink-2); text-decoration: none; padding: 20px 0; border-bottom: 1.5px solid transparent; }
.nav ul a:hover, .nav ul a.active { color: var(--ink); border-bottom-color: var(--green); }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--sans); padding: 10px 16px; border-radius: 2px; text-decoration: none; border: 1px solid var(--ink); color: var(--ink); background: #fff; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.solid { background: var(--green); border-color: var(--green); color: #fff; }
.btn.solid:hover { background: var(--ink); border-color: var(--ink); }
@media (max-width: 1080px) { .nav ul { display: none; } .nav .btn { margin-left: auto; } }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; padding: clamp(56px, 8vw, 92px) 0 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 40px; align-items: end; }
.eyebrow { display: flex; align-items: center; gap: 12px; font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--green); margin-bottom: 22px; }
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--green); }
.hero h1 { font-size: clamp(46px, 7vw, 92px); margin-bottom: 18px; line-height: 1.02; }
.hero .lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); max-width: 40ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-art img { width: 100%; max-width: 600px; margin-left: auto; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-art img { max-width: 420px; margin: 0 auto; } }

/* product window (Felt-like, quieter) */
.window { position: relative; margin: clamp(36px, 5vw, 56px) auto 0; border: 1px solid var(--rule-2); border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 24px 60px -32px rgba(17, 26, 21, 0.3); }
.window-bar { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--ink-2); }
.window-bar i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--rule-2); display: inline-block; }
.window-bar b { font-weight: 600; color: var(--ink); margin-left: 6px; }
.window-bar .sp { margin-left: auto; display: flex; gap: 8px; }
.window-bar .chip { font-size: 11.5px; border: 1px solid var(--rule); padding: 1px 9px; border-radius: 20px; }
.window-body { position: relative; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.window-legend { border-right: 1px solid var(--rule); padding: 16px; font-size: 12.5px; color: var(--ink-2); }
.window-legend h6 { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.window-legend .big { font-family: var(--serif); font-size: 30px; color: var(--ink); line-height: 1.1; margin: 0 0 14px; }
.window-legend .row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.window-legend .row i { width: 9px; height: 9px; border-radius: 50%; }
.window-map { position: relative; }
.window-map img { width: 100%; }
.pin-card { position: absolute; transform: translate(-50%, calc(-100% - 14px)); background: #fff; border: 1px solid var(--rule-2); border-radius: 4px; padding: 7px 10px 8px; font-size: 12px; line-height: 1.35; box-shadow: 0 8px 20px -10px rgba(17, 26, 21, 0.35); white-space: nowrap; }
.pin-card::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 1px; height: 14px; background: var(--ink); }
.pin-card::before { content: ""; position: absolute; left: calc(50% - 3px); bottom: -17px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.pin-card b { display: block; font-size: 12.5px; color: var(--ink); }
.pin-card .g { color: var(--teal); font-weight: 600; }
.pin-card .w { color: var(--brown); font-weight: 600; }
@media (max-width: 860px) { .window-body { grid-template-columns: 1fr; } .window-legend { border-right: none; border-bottom: 1px solid var(--rule); } .pin-card { display: none; } }

.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 40px 0 0; border-top: 1px solid var(--ink); }
.hero-stats div { padding: 16px 16px 30px 0; }
.hero-stats div + div { border-left: 1px solid var(--rule); padding-left: 18px; }
.hero-stats b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.05; }
.hero-stats span { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .hero-stats { grid-template-columns: 1fr 1fr; } .hero-stats div:nth-child(3) { border-left: none; padding-left: 0; } }

/* ------------------------------------------------------------------ sections */
section.chapter, header.hero { scroll-snap-align: start; }
section.chapter { padding: clamp(76px, 10vw, 124px) 0; border-top: 1px solid var(--rule); }
.kicker { display: flex; gap: 12px; align-items: center; font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--green); margin-bottom: 20px; }
.kicker .n { font-family: var(--mono); color: var(--muted); letter-spacing: 0; font-weight: 500; }
.kicker::after { content: ""; flex: 0 0 42px; height: 1px; background: var(--rule-2); }
.intro { font-size: clamp(18px, 1.6vw, 20.5px); color: var(--ink-2); max-width: 62ch; }
.cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); }
.c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; } .c-6 { grid-column: span 6; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-12 { grid-column: span 12; }
@media (max-width: 900px) { .cols > * { grid-column: 1 / -1 !important; } }
.figure { margin: 0; }
.figure img { width: 100%; }
.figure figcaption { font-size: 13.5px; color: var(--ink-2); margin-top: 12px; line-height: 1.55; border-top: 1px solid var(--rule); padding-top: 10px; }
.figure figcaption b { color: var(--ink); }
.photo { position: relative; overflow: hidden; margin: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .credit { position: absolute; right: 0; bottom: 0; font-size: 10.5px; color: #fff; background: rgba(17, 26, 21, 0.5); padding: 3px 7px; }
.photo .credit a { color: #fff; }

/* abstract / hook */
.abstract { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); }
.abstract .label { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--green); border-top: 1px solid var(--green); padding-top: 10px; align-self: start; }
.abstract .body { font-family: var(--serif); font-size: clamp(19px, 1.8vw, 22.5px); line-height: 1.56; color: var(--ink); }
.abstract .body p { margin-bottom: 0.85em; }
.abstract .body b { font-weight: 600; }

@media (max-width: 760px) { .abstract { grid-template-columns: 1fr; } }
.sells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); margin-top: 44px; }
.sell { padding: 18px 20px 6px 0; }
.sell + .sell { border-left: 1px solid var(--rule); padding-left: 20px; }
.sell .who { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sell b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.05; margin: 8px 0 10px; color: var(--green); }
.sell p { font-size: 14.5px; color: var(--ink-2); }
@media (max-width: 900px) { .sells { grid-template-columns: 1fr 1fr; } .sell:nth-child(3) { border-left: none; padding-left: 0; } }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); margin: 36px 0 10px; }
.stat { padding: 20px 20px 18px 0; }
.stat + .stat { border-left: 1px solid var(--rule); padding-left: 20px; }
.stat b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 4vw, 52px); line-height: 1; margin-bottom: 10px; }
.stat p { font-size: 15px; color: var(--ink-2); margin: 0 0 6px; }
.stat .src { font-size: 12px; color: var(--muted); }
.stats.two { grid-template-columns: 1fr 1fr; }
.stats.two .stat { border-bottom: 1px solid var(--rule); padding: 18px 16px 16px 0; border-left: none; }
.stats.two .stat:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
.stats.two .stat b { font-size: clamp(28px, 3vw, 40px); color: var(--green); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } .stat + .stat { border-left: none; padding-left: 0; border-top: 1px solid var(--rule); } }

/* tables */
.tbl, .matrix { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th, .matrix th { text-align: left; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--ink); }
.tbl td, .matrix td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.fail td { color: var(--brown); }
.tbl .pass { color: var(--green); font-weight: 600; }
.tbl .x { color: var(--brown); font-weight: 700; }
.matrix { font-size: 15px; margin-top: 30px; }
.matrix td:first-child { font-weight: 600; width: 16%; }
.matrix td:last-child { color: var(--green); }
.vs th:last-child, .vs td:last-child { border-left: 1.5px solid var(--green); padding-left: 16px; }
.vs th:last-child { color: var(--green); }
.vs td:last-child { color: var(--ink); }
.vs td:first-child { font-weight: 600; width: 20%; }
.scroll-x { overflow-x: auto; }
@media (max-width: 760px) { .matrix, .matrix tbody, .matrix tr, .matrix td { display: block; width: 100% !important; } .matrix thead { display: none; } .matrix td { border: none; padding: 4px 0; } .matrix tr { border-bottom: 1px solid var(--rule); padding: 14px 0; } }

/* rails: native horizontal scroll, no scroll hijacking */
.rail-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.rail-ctrl { display: flex; gap: 8px; flex-shrink: 0; }
.rail-ctrl button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ink); background: #fff; cursor: pointer; font-size: 16px; color: var(--ink); }
.rail-ctrl button:hover { background: var(--green); border-color: var(--green); color: #fff; }
.rail { display: flex; gap: 18px; overflow-x: auto; padding: 24px var(--gutter) 26px; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
.card { flex: 0 0 clamp(270px, 30vw, 350px); background: #fff; border: 1px solid var(--rule-2); border-radius: 2px; padding: 22px 22px 20px; display: flex; flex-direction: column; min-height: 280px; transition: border-color 0.15s; }
.card:hover { border-color: var(--green); }
.card .tag { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 14px; font-family: var(--mono); }
.card h4 { font-family: var(--serif); font-size: 21px; font-weight: 500; margin: 0 0 10px; line-height: 1.22; }
.card p { font-size: 15px; color: var(--ink-2); }
.card .foot { margin-top: auto; font-size: 13px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; }
.card.pillar { border-top: 3px solid var(--pc); }
.card.pillar .w { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--ink); }
.card.pillar .w small { font-size: 14px; color: var(--muted); font-family: var(--sans); }
.card.pillar ul { margin: 6px 0 14px; padding-left: 18px; font-size: 14.5px; color: var(--ink-2); }
.card.step { min-height: 300px; }
.card.step .out { margin-top: auto; font-size: 13.5px; color: var(--ink); border-top: 1px solid var(--rule); padding-top: 12px; }
.card.step.new { border-color: var(--green); border-width: 1.5px; }
.badge { align-self: flex-start; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; background: var(--green); color: #fff; padding: 3px 8px; border-radius: 2px; margin-bottom: 10px; }
.conf { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px; border: 1px solid currentColor; white-space: nowrap; }
.conf.high { color: var(--green); } .conf.medium { color: #9a6a10; } .conf.low { color: var(--brown); }
.photo-card { margin: 0; padding: 0; min-height: 0; overflow: hidden; flex-basis: clamp(280px, 32vw, 380px); }
.photo-card .photo { height: 220px; }
.photo-card figcaption { padding: 14px 18px 18px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.photo-card figcaption b { color: var(--ink); }
.photo-card figcaption .muted { display: block; font-size: 11.5px; margin-top: 6px; }

.flow svg { width: 100%; height: auto; }
.flow text { font-family: var(--sans); }

/* atlas + tweaks */
.atlas, .tweaks { display: grid; border: 1px solid var(--rule-2); border-radius: 4px; overflow: hidden; background: #fff; margin-top: 30px; }
.atlas { grid-template-columns: minmax(0, 1fr) 350px; }
.tweaks { grid-template-columns: minmax(0, 1fr) 420px; }
.atlas-map { position: relative; min-height: 620px; }
#map, #tmap { position: absolute; inset: 0; }
.atlas-side { border-left: 1px solid var(--rule); padding: 20px; display: flex; flex-direction: column; gap: 18px; max-height: 620px; overflow-y: auto; }
.atlas-side h5 { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: 500 13px var(--sans); border: 1px solid var(--rule-2); background: #fff; color: var(--ink-2); padding: 6px 11px; border-radius: 20px; cursor: pointer; }
.seg button:hover { border-color: var(--green); color: var(--green); }
.seg button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.slider { display: grid; grid-template-columns: 12px 1fr 30px; gap: 8px; align-items: center; font-size: 13.5px; margin-bottom: 4px; }
.slider .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); }
.slider label { display: flex; flex-direction: column; }
.slider input { width: 100%; accent-color: var(--green); }
.slider output { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.legend-bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #8c510a, #d8b365, #f2f1ec, #7fc8b8, #01665e); }
.legend-bar.heat { background: linear-gradient(90deg, #0d366b, #256abf, #86b6ef, #f2f1ec, #f6b1a8, #e34948, #9a1d22); }
.legend-bar.green { background: linear-gradient(90deg, #f2f1ec, #cfe8d9, #8cc9a8, #3fa171, #1f7a52); }
.legend-lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.lens { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lens button { font: 500 12px var(--sans); border: 1px dashed var(--rule-2); background: #fff; color: var(--ink-2); padding: 4px 9px; border-radius: 20px; cursor: pointer; }
.lens button:hover { border-style: solid; color: var(--green); border-color: var(--green); }
.blockcard { font-size: 13.5px; border-top: 1px solid var(--rule); padding-top: 12px; }
.blockcard .t { font-weight: 600; font-size: 15px; }
.pbar { display: grid; grid-template-columns: 86px 1fr 28px; gap: 8px; align-items: center; font-size: 12.5px; margin: 3px 0; }
.pbar i { display: block; height: 6px; background: #fff; box-shadow: inset 0 0 0 1px var(--rule); border-radius: 3px; position: relative; overflow: hidden; }
.pbar i b { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--pc); }
.pbar span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tweaks .atlas-map { min-height: 600px; }
.tlist { border-left: 1px solid var(--rule); max-height: 600px; overflow-y: auto; }
.tsum { position: sticky; top: 0; background: #fff; z-index: 2; padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.tsum .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tsum b { display: block; font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.1; }
.tsum span { font-size: 12px; color: var(--muted); }
.titem { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--rule); cursor: pointer; align-items: start; font-size: 13.5px; }
.titem:hover { box-shadow: inset 2px 0 0 var(--green); }
.titem input { margin-top: 3px; accent-color: var(--green); width: 15px; height: 15px; }
.titem .ty { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.titem .g { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.titem .g small { display: block; font-weight: 400; color: var(--muted); }
@media (max-width: 980px) { .atlas, .tweaks { grid-template-columns: 1fr; } .atlas-side, .tlist { border-left: none; border-top: 1px solid var(--rule); max-height: none; } .atlas-map, .tweaks .atlas-map { min-height: 440px; } }
.maplibregl-popup-content { font: 13px/1.45 var(--sans); padding: 9px 11px; border-radius: 3px; box-shadow: 0 6px 22px rgba(17, 26, 21, 0.18); }
.maplibregl-ctrl-attrib { font-size: 10.5px; }

.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 11.5px; fill: var(--ink-2); }
.tip { position: fixed; z-index: 80; pointer-events: none; background: #fff; border: 1px solid var(--rule-2); border-radius: 3px; box-shadow: 0 6px 22px rgba(17, 26, 21, 0.12); padding: 9px 11px; font-size: 12.5px; line-height: 1.45; max-width: 270px; opacity: 0; transition: opacity 0.1s; }

/* compare slider */
.compare { position: relative; aspect-ratio: 1800 / 1067; overflow: hidden; user-select: none; background: #fff; border: 1px solid var(--rule); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .top { clip-path: inset(0 0 0 50%); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--ink); pointer-events: none; }
.compare .handle::after { content: "↔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 1px solid var(--ink); display: grid; place-items: center; font-size: 15px; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare .lab { position: absolute; top: 12px; font-size: 12px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--rule-2); padding: 3px 8px; pointer-events: none; }
.compare .lab.l { left: 12px; } .compare .lab.r { right: 12px; }

.callout { border-left: 2px solid var(--green); padding: 4px 0 4px 18px; margin: 24px 0; font-size: 16px; color: var(--ink-2); }
.callout b { color: var(--ink); }
.formula { font-family: var(--mono); font-size: 13.5px; border: 1px solid var(--rule-2); border-radius: 2px; padding: 16px 18px; line-height: 1.8; overflow-x: auto; white-space: pre-wrap; background: #fff; }
.sdg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.sdg div { border: 1px solid var(--rule-2); padding: 16px; font-size: 15px; color: var(--ink-2); }
.sdg b { display: block; color: var(--green); font-family: var(--serif); font-weight: 500; font-size: 22px; }
.strip { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-top: 30px; height: 290px; }
.note { border: 1px solid var(--rule-2); padding: 18px 20px; font-size: 14px; color: var(--ink-2); margin-top: 30px; }
.note b { color: var(--ink); }
@media (max-width: 760px) { .sdg { grid-template-columns: 1fr; } .strip { grid-template-columns: 1fr; height: auto; } .strip .photo { height: 220px; } }

footer { border-top: 1px solid var(--ink); padding: 54px 0 46px; font-size: 13.5px; color: var(--ink-2); position: relative; overflow: hidden; }
footer h6 { color: var(--ink); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 12px; }
footer ul { list-style: none; padding: 0; margin: 0; } footer li { margin-bottom: 6px; }
footer .sky { position: absolute; right: -20px; bottom: -8px; width: 340px; opacity: 0.3; pointer-events: none; }
@media (max-width: 760px) { footer .sky { display: none; } }
@media (max-width: 640px) { .window-bar > span, .window-bar .sp { display: none; } }


/* ================================================================== motion & premium layer */
/* reading progress + chapter rail */
.progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: var(--green); pointer-events: none; }
.rail-nav { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 12px; }
.rail-nav a { position: relative; display: block; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--rule-2); background: #fff; transition: transform 0.25s, background 0.25s, border-color 0.25s; }
.rail-nav a.on { background: var(--green); border-color: var(--green); transform: scale(1.35); }
.rail-nav a span { position: absolute; right: 18px; top: 50%; transform: translate(6px, -50%); opacity: 0; white-space: nowrap; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); background: #fff; padding: 2px 8px; border: 1px solid var(--rule); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.rail-nav:hover a span { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 1320px) { .rail-nav { display: none; } }

/* chapter entrance: kicker rule draws, headline rises */
.js .chapter .kicker::after { flex-basis: 0; transition: flex-basis 0.9s cubic-bezier(.2,.7,.2,1) 0.15s; }
.js .chapter.in .kicker::after { flex-basis: 42px; }
.js .chapter h2, .js .chapter .intro, .js .chapter .stats, .js .chapter .figure, .js .chapter .rail { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity 0.8s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1); }
.js .chapter .intro { transition-delay: 0.12s; }
.js .chapter .stats, .js .chapter .rail { transition-delay: 0.2s; }
.js .chapter.in h2, .js .chapter.in .intro, .js .chapter.in .stats, .js .chapter.in .figure, .js .chapter.in .rail { opacity: 1; transform: none; }

/* native horizontal rails snap card by card */
.rail { scroll-snap-type: x mandatory; scroll-padding-left: var(--gutter); scroll-behavior: smooth; }
.rail > * { scroll-snap-align: start; }

/* pinned horizontal sequences (highlights, 7 steps): one vertical px moves the track one px */
.hpin { position: relative; border-top: 1px solid var(--rule); }
.hpin-sticky { position: sticky; top: 62px; height: calc(100vh - 62px); overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.hpin-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: clamp(14px, 3vh, 34px); }
.hpin-head h2 { margin: 0; font-size: clamp(28px, 3.4vw, 44px); }
.hpin-count { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.hpin-count b { color: var(--ink); font-weight: 500; }
.hpin-track { display: flex; gap: clamp(18px, 2.4vw, 32px); padding: 0 max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))); will-change: transform; }
.hpin-bar { position: relative; height: 1px; background: var(--rule); margin-top: clamp(16px, 3vh, 34px); }
.hpin-bar i { position: absolute; left: 0; top: -0.5px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--ink); }
.snapmark { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; pointer-events: none; }
.hpin .card.step { flex: 0 0 clamp(290px, 31vw, 400px); min-height: min(52vh, 380px); transition: border-color 0.4s; }
.hpin .card.step.on { border-color: var(--ink); }
.hpin .card.step.new.on { border-color: var(--green); }

/* highlight panels */
.panel { flex: 0 0 min(1080px, calc(100vw - 2 * var(--gutter) - 40px)); display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding: clamp(22px, 3vw, 40px); border: 1px solid var(--rule-2); background: #fff; min-height: min(60vh, 520px); transition: border-color 0.5s; }
.panel.on { border-color: var(--ink); }
.p-tag { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--green); text-transform: uppercase; }
.p-big { font-family: var(--serif); font-weight: 400; font-size: clamp(60px, 8.4vw, 124px); line-height: 0.95; letter-spacing: -0.03em; margin: 14px 0 12px; color: var(--ink); white-space: nowrap; }
.p-big small { font-size: 0.3em; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.panel h3 { font-size: clamp(22px, 2.2vw, 29px); margin: 0 0 14px; }
.panel h3 em { font-style: italic; color: var(--green); }
.panel p { font-size: 15.5px; color: var(--ink-2); max-width: 44ch; margin: 0; }
.panel .p-src { margin-top: 16px; font-size: 12px; color: var(--muted); }
.p-chart svg { width: 100%; height: auto; overflow: visible; }
.p-chart text { font-family: var(--sans); font-size: 11.5px; fill: var(--ink-2); }
.p-chart .ttl { font-size: 12px; fill: var(--ink); font-weight: 600; }
.js .panel .draw { stroke-dasharray: 1600; stroke-dashoffset: 1600; transition: stroke-dashoffset 1.6s cubic-bezier(.3,.6,.2,1) 0.15s; }
.js .panel.on .draw { stroke-dashoffset: 0; }
.js .panel .grow { transform: scaleX(0); transform-box: fill-box; transform-origin: 0 50%; transition: transform 0.9s cubic-bezier(.2,.7,.2,1); }
.js .panel .grow.up { transform: scaleY(0); transform-origin: 50% 100%; }
.js .panel.on .grow { transform: none; }
.js .panel .fade { opacity: 0; transition: opacity 0.6s 0.8s; }
.js .panel.on .fade { opacity: 1; }
@media (max-width: 900px) { .panel { grid-template-columns: 1fr; min-height: 0; } }

/* phones and reduced motion: no pinning, native swipe with snap */
@media (max-width: 760px), (prefers-reduced-motion: reduce) {
  .hpin { height: auto !important; }
  .hpin-sticky { position: static; height: auto; padding: 64px 0 40px; }
  .hpin-track { overflow-x: auto; scroll-snap-type: x mandatory; transform: none !important; padding: 0 var(--gutter) 10px; scroll-padding-left: var(--gutter); }
  .hpin-track > * { scroll-snap-align: start; }
  .snapmark, .hpin-bar { display: none; }
  .panel { flex-basis: 86vw; }
}
@media (prefers-reduced-motion: reduce) {
  .js .chapter h2, .js .chapter .intro, .js .chapter .stats, .js .chapter .figure, .js .chapter .rail { opacity: 1; transform: none; transition: none; }
  .js .panel .draw { stroke-dashoffset: 0; transition: none; } .js .panel .grow { transform: none; transition: none; } .js .panel .fade { opacity: 1; }
}

/* hero entrance */
.js .hero h1, .js .hero .lede, .js .hero .cta, .js .hero .eyebrow { opacity: 0; transform: translate3d(0, 22px, 0); animation: rise 1s cubic-bezier(.2,.7,.2,1) forwards; }
.js .hero .lede { animation-delay: 0.12s; } .js .hero .cta { animation-delay: 0.22s; }
.js .hero-art img { opacity: 0; animation: fadein 1.6s ease 0.2s forwards; }
.js .pin-card { opacity: 0; animation: fadein 0.6s ease 0.6s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fadein { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .js .hero *, .js .pin-card { animation: none !important; opacity: 1 !important; transform: none !important; } }

/* figure zoom */
.figure img { cursor: zoom-in; }
dialog.zoom { border: none; padding: 0; max-width: min(1500px, 96vw); max-height: 94vh; background: #fff; box-shadow: 0 30px 90px -30px rgba(17, 26, 21, 0.45); }
dialog.zoom::backdrop { background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(4px); }
dialog.zoom img { max-height: 86vh; width: auto; margin: 0 auto; cursor: zoom-out; }
dialog.zoom p { margin: 0; padding: 10px 16px 14px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--rule); }
.hpin-sticky > .wrap { width: 100%; }
.hpin-track { position: relative; }
.rail-nav { transition: opacity 0.3s; }
body.in-pin .rail-nav { opacity: 0; pointer-events: none; }
