/* Layout: full-bleed map, floating frosted panel (bottom sheet on phones). */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --glass: rgba(250, 250, 252, .78);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, .14);
  --fill: rgba(118, 118, 128, .12);
  --seg-on: #ffffff;
  --blue: #0071e3;
  --shadow: 0 0 0 .5px rgba(0, 0, 0, .06), 0 10px 40px rgba(0, 0, 0, .16);
  --soft: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1c1c1e; --glass: rgba(28, 28, 30, .74); --ink: #f5f5f7; --muted: #98989f;
    --line: rgba(255, 255, 255, .12); --fill: rgba(118, 118, 128, .28); --seg-on: #636366; --blue: #2997ff;
    --shadow: 0 0 0 .5px rgba(255, 255, 255, .08), 0 10px 40px rgba(0, 0, 0, .55);
    --soft: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.app { position: relative; height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden; scroll-margin-top: 0; }
#map { position: absolute; inset: 0; z-index: 0; background: var(--bg); }

/* ---------- segmented control ---------- */
.seg { display: flex; gap: 2px; padding: 2px; background: var(--fill); border-radius: 10px; }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.seg button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--seg-on); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); font-weight: 600; }
.viewswitch { position: absolute; z-index: 6; top: 12px; right: 12px; width: 280px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: var(--shadow); border-radius: 12px; padding: 3px; }
.viewswitch button { padding: 7px 10px; }

/* ---------- panel ---------- */
.panel { position: absolute; z-index: 5; top: 12px; left: 12px; bottom: 12px; width: 392px; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: var(--glass); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%); box-shadow: var(--shadow); }
.nav { padding: 18px 20px 6px; }
.navrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--blue); font-size: 15px; padding: 2px 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back::before { content: ""; width: 9px; height: 9px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); margin-right: 3px; border-radius: 1px; }
.sort { appearance: none; -webkit-appearance: none; border: 0; background: var(--fill); border-radius: 999px; padding: 5px 26px 5px 12px; font-size: 12.5px; font-weight: 500; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 52%, calc(100% - 10px) 52%; background-size: 4px 4px; background-repeat: no-repeat; }
.title { margin: 6px 0 0; font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; text-wrap: balance; }
.sub { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }

.controls { display: grid; gap: 10px; padding: 12px 16px 10px; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; border: 0; background: var(--fill); border-radius: 10px; padding: 9px 12px 9px 34px; font-size: 15px; outline-offset: 0; }
.search input::placeholder { color: var(--muted); }

.pbody { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 16px; overscroll-behavior: contain; }
.list { background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--soft); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: .5px; background: var(--line); }
.row.hasico + .row.hasico::before { left: 64px; }
.row:hover { background: var(--fill); }
.rtext { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rname { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rsub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcount { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.chev { width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); opacity: .6; flex: none; }
.mix { display: flex; gap: 2px; height: 5px; border-radius: 3px; overflow: hidden; margin-top: 5px; max-width: 260px; }
.mix i { display: block; min-width: 4px; }
.ico { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--c); }
.ico svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.lg { width: 44px; height: 44px; }
.ico.lg svg { width: 23px; height: 23px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- place card ---------- */
.detail { padding: 4px 8px 8px; }
.detail .kind { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.detail .kind span.k { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.detail h2 { margin: 10px 0 2px; font-size: 28px; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; text-wrap: balance; }
.detail .where { margin: 0; color: var(--muted); font-size: 14px; }
.detail .story { margin: 18px 0 0; padding: 16px; background: var(--card); border-radius: 14px; box-shadow: var(--soft); }
.detail .story p { margin: 0 0 .8em; font-size: 15.5px; line-height: 1.5; max-width: 62ch; }
.detail .story p:last-child { margin-bottom: 0; }
.facts { margin-top: 16px; display: grid; gap: 12px; }
.closed { justify-self: start; background: #ff453a; color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.toprow { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.toprow .rate { color: var(--ink); font-weight: 600; }
.toprow .rate small { color: var(--muted); font-weight: 400; font-size: 13px; }
.summary { margin: 0; font-size: 14px; color: var(--muted); }
.frow { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 11px 14px; font-size: 14.5px; position: relative; }
.frow + .frow::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: .5px; background: var(--line); }
.flabel { color: var(--muted); }
.frow a { color: var(--blue); text-decoration: none; overflow-wrap: anywhere; }
.hours { display: grid; gap: 3px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.btn { display: block; text-align: center; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }

/* ---------- map furniture ---------- */
.pin-cluster { display: grid; place-items: center; background: var(--card); color: var(--ink); border-radius: 50%; font-weight: 700; font-size: 13px; box-shadow: 0 0 0 .5px rgba(0,0,0,.15), 0 3px 12px rgba(0, 0, 0, .25); }
.leaflet-tooltip.tip { background: var(--card); color: var(--ink); border: 0; border-radius: 8px; padding: 5px 9px; font: 600 12.5px var(--font); box-shadow: var(--shadow); }
.leaflet-tooltip-top.tip::before { border-top-color: var(--card); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; margin: 0 12px 12px 0 !important; }
.leaflet-control-zoom a { background: var(--glass) !important; color: var(--ink) !important; border: 0 !important; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.leaflet-control-attribution { background: var(--glass) !important; color: var(--muted) !important; border-radius: 8px 0 0 0; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }

/* ---------- journal ---------- */
.journal { position: absolute; inset: 0; z-index: 4; overflow-y: auto; background: var(--bg); }
.jwrap { max-width: 1180px; margin: 0 auto; padding: 64px 24px 64px; }
.jhead h1 { margin: 0; font-size: clamp(34px, 6vw, 56px); line-height: 1.04; font-weight: 700; letter-spacing: -.035em; }
.jhead p { margin: 8px 0 22px; color: var(--muted); font-size: 17px; }
.jhead .controls { padding: 0 0 24px; max-width: 520px; }
.jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.post { background: var(--card); border-radius: 20px; padding: 22px; box-shadow: var(--soft); }
.post .kind { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.post h2 { margin: 14px 0 8px; font-size: 22px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.post p { margin: 0 0 .7em; font-size: 15px; line-height: 1.5; }
.post .links { display: flex; gap: 16px; margin-top: 14px; font-size: 14px; font-weight: 500; }
.post .links a, .post .links button { color: var(--blue); background: none; border: 0; padding: 0; text-decoration: none; }
.post .links a:hover, .post .links button:hover { text-decoration: underline; }

/* ---------- intro page ---------- */
.hero { min-height: min(100vh, 760px); display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top, 0px)) 24px 40px; }
.herobar { display: flex; justify-content: space-between; align-items: center; max-width: 1080px; width: 100%; margin: 0 auto; font-size: 14px; }
.herobar .mark { font-weight: 700; letter-spacing: -.02em; }
.herobar a { color: var(--blue); text-decoration: none; font-weight: 500; }
.herobody { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 36px 0 28px; }
.eyebrow { margin: 0 0 14px; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero h1 { margin: 0; font-size: clamp(44px, 7.5vw, 88px); line-height: 1; font-weight: 700; letter-spacing: -.04em; text-wrap: balance; }
.lede { margin: 16px 0 0; max-width: 36ch; font-size: clamp(18px, 2vw, 22px); line-height: 1.35; color: var(--muted); letter-spacing: -.015em; text-wrap: balance; }
.ctas { display: flex; align-items: center; gap: 22px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.cta { display: inline-block; border: 0; background: var(--blue); color: #fff; padding: 13px 24px; border-radius: 999px; font-size: 16px; font-weight: 600; text-decoration: none; }
.cta:hover { filter: brightness(1.08); }
.textlink { color: var(--blue); font-size: 16px; font-weight: 500; text-decoration: none; }
.textlink:hover, .textbtn:hover { text-decoration: underline; }
.textlink::after { content: " \203A"; }

.nearform { display: flex; align-items: center; gap: 8px; width: min(500px, 100%); margin-top: 26px; padding: 6px; background: var(--card); border-radius: 999px; box-shadow: var(--shadow); }
.nearform input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 6px 9px 16px; font-size: 16px; outline: none; }
.nearform input::placeholder { color: var(--muted); }
.nearform .cta { white-space: nowrap; padding: 10px 20px; font-size: 15px; }
.nearform, .nearrow { position: relative; }
.ac { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; text-align: left; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; }
.ac li { display: flex; flex-direction: column; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.ac li b { font-weight: 600; }
.ac li span { color: var(--muted); font-size: 12.5px; }
.ac li b .star { color: #ff9f0a; font-size: inherit; }
.ac li:hover, .ac li[aria-selected="true"] { background: var(--fill); }
.nearmsg { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.nearmsg.err { color: #ff453a; }
.nearrow { display: flex; gap: 8px; }
.nearrow input { flex: 1; min-width: 0; border: 0; background: var(--fill); border-radius: 10px; padding: 9px 12px; font-size: 15px; outline-offset: 0; }
.nearrow input::placeholder { color: var(--muted); }
.nearrow button { flex: none; width: 38px; border: 0; border-radius: 10px; background: var(--fill); display: grid; place-items: center; }
.nearrow svg { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; }
.controls .nearmsg { margin: -2px 2px 0; font-size: 12.5px; }
.ctas .textbtn { font-size: 16px; font-weight: 500; }
.heromix { max-width: 720px; width: 100%; margin: 0 auto; }
.bigmix { display: flex; gap: 4px; height: 14px; border-radius: 7px; overflow: hidden; }
.bigmix i { display: block; }
.legend { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

.band { padding: clamp(64px, 10vw, 132px) 24px; }
.band.alt { background: var(--card); }
.inner { max-width: 1080px; margin: 0 auto; }
.inner.narrow { max-width: 720px; }
.inner.two { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 7vw, 96px); align-items: start; }
.kicker { margin: 0 0 16px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bigline { margin: 0; font-size: clamp(28px, 4.4vw, 48px); line-height: 1.1; font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.bigline.wide { max-width: 20ch; }
.soon { text-align: center; }
.soon .bigline { font-size: clamp(40px, 8vw, 88px); letter-spacing: -.045em; color: var(--muted); }
.prose p { margin: 0 0 1.1em; font-size: 19px; line-height: 1.55; max-width: 60ch; }
.prose p:first-child::first-line { font-weight: 600; }

.nowcard { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: clamp(24px, 4vw, 44px); background: var(--card); border-radius: 28px; box-shadow: var(--soft); }
.nowplace { margin: 0; font-size: clamp(40px, 7vw, 80px); line-height: 1; font-weight: 700; letter-spacing: -.045em; }
.nowsub { margin: 10px 0 0; color: var(--muted); font-size: 17px; }
.nowlabel { margin: 28px 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--card); box-shadow: var(--soft); border-radius: 999px; padding: 9px 16px; font-size: 15px; font-weight: 500; }
.pill:hover { background: var(--fill); }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.pill small { color: var(--muted); font-size: 13px; }

.essay { background: var(--card); border-radius: 28px; padding: clamp(24px, 5vw, 52px); box-shadow: var(--soft); }
.essaymeta { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.essay h3 { margin: 10px 0 22px; font-size: clamp(32px, 5vw, 46px); line-height: 1.05; font-weight: 700; letter-spacing: -.035em; text-wrap: balance; }
.essaybody p { margin: 0 0 1.1em; font-size: 19px; line-height: 1.6; }
.essaybody p:first-child::first-letter { float: left; font-size: 3.6em; line-height: .85; font-weight: 700; padding: .06em .1em 0 0; }
.essaybody p.quote { font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.textbtn { border: 0; background: none; padding: 0; color: var(--blue); font-size: 16px; font-weight: 500; }
.textbtn::after { content: " \203A"; }

.hitgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 40px; }
.hit { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; text-align: left; border: 0; background: var(--bg); border-radius: 24px; padding: 24px; }
.hit:hover { box-shadow: var(--shadow); }
.hit q { quotes: none; font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.band.railband { padding-left: 0; padding-right: 0; }
.railhead { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.railhead .kicker { margin: 0; }
.railnav { display: flex; gap: 8px; }
.railnav button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--fill); font-size: 24px; line-height: 1; padding: 0 0 3px; }
.railnav button:hover { background: var(--line); }
.rail { display: flex; gap: 16px; margin-top: 22px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 6px max(24px, calc((100% - 1080px) / 2)) 24px; scroll-padding-inline: max(24px, calc((100% - 1080px) / 2)); }
.rail::-webkit-scrollbar { display: none; }
.rail .hit { flex: 0 0 min(340px, 80vw); min-height: 250px; scroll-snap-align: start; background: var(--card); box-shadow: var(--soft); }
.rail .hit { opacity: calc(1 - var(--t, 0) * .65); filter: blur(calc(var(--t, 0) * 7px)); transform: scale(calc(1 - var(--t, 0) * .05)); transform-origin: center; will-change: opacity, filter, transform; }
.hit .excerpt { margin: 0; font-size: 16px; line-height: 1.45; color: var(--ink); }
.hit .who { margin-top: auto; display: grid; gap: 1px; }
.hit .who b { font-size: 15px; }
.hit .who span { font-size: 13.5px; color: var(--muted); }

.numbers { display: flex; gap: 32px; margin-top: 36px; flex-wrap: wrap; }
.numbers div { display: grid; gap: 2px; }
.numbers b { font-size: clamp(44px, 7vw, 72px); line-height: 1; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.numbers span { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cities { display: grid; gap: 6px; }
.crow { display: grid; grid-template-columns: minmax(0, 150px) 1fr 28px; align-items: center; gap: 14px; border: 0; background: none; text-align: left; padding: 9px 0; border-radius: 10px; }
.crow:hover { background: var(--fill); }
.cname { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn { color: var(--muted); font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.ctrack { display: block; min-width: 0; }
.ctrack .mix { height: 12px; max-width: none; margin: 0; }

.bridge { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; padding: clamp(56px, 9vw, 110px) 24px; }
.bridge p { margin: 0; font-size: clamp(26px, 4vw, 40px); font-weight: 700; letter-spacing: -.03em; }

/* ---------- phones: panel becomes a bottom sheet ---------- */
@media (max-width: 800px) {
  .panel { top: auto; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; height: 52vh; border-radius: 22px; }
  .viewswitch { top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; left: 10px; width: auto; }
  .leaflet-control-zoom { display: none; }
  .title { font-size: 26px; }
  .inner.two { grid-template-columns: minmax(0, 1fr); }
  .crow { grid-template-columns: minmax(0, 110px) 1fr 24px; }
  .railhead { padding: 0 max(16px, env(safe-area-inset-left, 0px)); }
  .rail { padding-left: 16px; padding-right: 16px; scroll-padding-inline: 16px; }
  .railnav { display: none; }
  .hero, .band:not(.railband), .bridge { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .jwrap { padding: 72px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
