/* css/style.css */
:root {
  --bg: #0a0d0c;
  --card-bg: #121815;
  --fg: #e7ecea;
  --muted: #8f9997;
  --accent: #10b981;
  --accent-2: #34d399;
  --glass-bg: rgba(8, 8, 18, 0.68);
  --glass-border: rgba(255, 255, 255, 0.14);
  --serif: "Instrument Serif", "Times New Roman", serif;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Manrope", -apple-system, "Geist", system-ui, sans-serif;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
}

.serif-italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

/* ── Search bar (layout matches bengaluru.rent's .search-wrap) ── */
.search-wrap {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 100%;
  max-width: 520px;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(1.6);
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

#search-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#search-input::placeholder { color: var(--muted); }
#search-input:focus { border-color: rgba(16, 185, 129, 0.5); }
#search-input:disabled { opacity: 0.5; cursor: not-allowed; }

.lang-btn {
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.lang-btn:hover { border-color: var(--accent); }

/* ── Chicklet bar under search (layout matches bengaluru.rent's .chicklet-bar) ── */
.chicklet-bar {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 100%;
  max-width: 540px;
  padding: 0 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-sizing: border-box;
}

.chicklet-bar::-webkit-scrollbar { display: none; }

.chicklet {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 18px;
  background: rgba(8, 8, 18, 0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.chicklet:hover { background: rgba(20, 20, 36, 0.85); border-color: rgba(255, 255, 255, 0.24); }
.chicklet:disabled { opacity: 0.5; cursor: not-allowed; }
.chicklet.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chicklet-icon { font-size: 14px; line-height: 1; }

/* ── Right-side vertical control stack (layout matches bengaluru.rent's
   green-btn/sat-btn/tolet-btn/more-tools-btn column) ── */
#map-controls { z-index: 10; }

.map-ctrl-v {
  position: fixed;
  right: 10px;
  z-index: 10;
  width: 38px;
  background: white;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  color: #555;
  padding: 5px 2px;
  border-radius: 2px;
  font-family: inherit;
}

.map-ctrl-v:disabled { opacity: 0.5; cursor: not-allowed; }
.map-ctrl-v.active { background: var(--accent); color: #fff; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.map-ctrl-v-label { font-size: 8px; font-weight: 700; margin-top: 3px; line-height: 1.1; text-align: center; letter-spacing: 0.01em; }

#ctrl-satellite { bottom: calc(138px + env(safe-area-inset-bottom, 0px)); }

/* dvh so the map ends where the viewport actually ends: on mobile 100vh is the
   height with the browser toolbar retracted, so the bottom of the map (and the
   control rail anchored to it) sits under the toolbar until you scroll. */
#map { width: 100%; height: 100vh; height: 100dvh; }

/* ── Pin markers (matches bengaluru.rent's PinOverlay/.pin-label) ── */
.pin-marker {
  position: absolute; left: 0; top: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  user-select: none; transition: transform 0.1s;
}
.pin-marker:hover  { transform: scale(1.12); }
.pin-marker:active { transform: scale(0.95); }
.pin-label {
  padding: 4px 8px; border-radius: 8px;
  font-size: 10px; font-weight: 700; color: white; white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
  background: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.6);
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.45);
}
.pin-label-sep { opacity: 0.5; font-weight: 300; }
.pin-caret { width: 8px; height: 8px; transform: rotate(45deg); margin-top: -4px; background: #d97706; }
.pin-flatmate-tag {
  font-size: 9px; font-weight: 700; color: white; background: #22c55e;
  border-radius: 4px; padding: 2px 5px; margin-bottom: 2px; white-space: nowrap;
}

/* ── Cluster markers (matches bengaluru.rent's ClusterOverlay/.cluster-*) ── */
.cluster-wrap {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; transition: transform 0.1s;
}
.cluster-wrap:hover { transform: translate(-50%, -104%); }
.cluster-marker {
  background: #1e1e35;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 6px 10px 5px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  min-width: 72px;
}
.cluster-row1 { display: flex; align-items: center; gap: 5px; justify-content: center; }
.cluster-count { font-size: 12px; font-weight: 700; color: #e2e8f0; }
.cluster-tags {
  display: flex; align-items: center; gap: 5px; justify-content: center;
  margin-top: 2px; font-size: 10px; color: #cbd5e1; line-height: 1;
}
.cluster-tag-sep { color: rgba(255, 255, 255, 0.2); }
.cluster-caret {
  width: 8px; height: 8px; transform: rotate(45deg); margin-top: -5px;
  background: #1e1e35;
  border-right: 1.5px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

/* ── Same-spot picker sheet rows (rendered inside #info-modal by openSameSpotSheet) ── */
.samespot-hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0 0 12px; }
.samespot-list { display: flex; flex-direction: column; gap: 8px; }
.samespot-row {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border);
  cursor: pointer; font-size: 13.5px; color: var(--fg);
}
.samespot-row:hover { background: rgba(255, 255, 255, 0.09); }
.samespot-badge {
  font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  letter-spacing: 0.3px; flex-shrink: 0; background: #22c55e; color: #052e16;
}
.samespot-rent { font-weight: 700; flex-shrink: 0; }
.samespot-meta { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.samespot-soc { flex: 1; min-width: 0; }
.samespot-chev { color: #64748b; font-size: 16px; margin-left: auto; flex-shrink: 0; }

/* ── Pin detail popup content (matches bengaluru.rent's detail-badges/detail-meta), rendered inside #info-modal ── */
.pin-detail-eyebrow { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.pin-detail-amount { color: var(--fg); font-size: 28px; font-weight: 700; letter-spacing: -1px; margin-bottom: 12px; }
.pin-detail-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.pin-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 14px; font-size: 11px; font-weight: 500;
}
.pin-badge-dot { width: 5px; height: 5px; border-radius: 50%; }
.pin-badge.violet { background: rgba(139, 92, 246, 0.12); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.2); }
.pin-badge.green  { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.pin-badge.amber  { background: rgba(217, 119, 6, 0.12); color: #fbbf24; border: 1px solid rgba(217, 119, 6, 0.2); }
.pin-badge.blue   { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
.pin-badge.gray   { background: rgba(255, 255, 255, 0.06); color: var(--muted); border: 1px solid var(--glass-border); }
.pin-detail-meta { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.pin-meta-item { display: flex; align-items: center; gap: 6px; color: #d97706; font-size: 12px; }
.pin-meta-item a, .pin-meta-item.link { color: #60a5fa; text-decoration: underline; cursor: pointer; background: none; border: none; padding: 0; font-size: 12px; }
.pin-detail-note { margin-top: 10px; }
.pin-detail-note-label { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: #d97706; text-transform: uppercase; }
.pin-detail-note-body { color: #fbbf24; font-style: italic; font-size: 13px; line-height: 1.5; margin-top: 3px; }
.pin-detail-contact {
  margin-top: 12px; padding: 8px 12px; border-radius: 10px;
  background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c4b5fd; font-size: 12px;
}
.pin-detail-contact a { color: #c4b5fd; font-weight: 700; }

.hidden { display: none !important; }

#pin-form-modal {
  position: fixed; top: 6%; left: 50%; transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  padding: 1.5rem;
  z-index: 10;
  width: min(90vw, 380px);
  max-height: 88vh;
  overflow-y: auto;
  color: var(--fg);
}

#pin-form-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  line-height: 1;
}

#pin-form-title { margin: 0 0 1rem; font-size: 1.4rem; }

#pin-form label { display: block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }

.pin-form-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.pin-form-chips-2col { grid-template-columns: repeat(2, 1fr); }

.pin-form-chip {
  display: flex; align-items: center; justify-content: center;
  padding: 0.55rem 0.4rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--fg);
  margin-top: 0 !important;
}
.pin-form-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.pin-form-chip:has(input:checked) {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

#pin-form input, #pin-form select, #pin-form textarea {
  width: 100%; padding: 0.5rem; margin-top: 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font: inherit;
}

#pin-form textarea { resize: vertical; min-height: 3.5rem; }

.pin-form-more {
  margin-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
  padding-top: 0.5rem;
}
.pin-form-more summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  user-select: none;
}
.pin-form-more summary:hover { color: var(--fg); }
.pin-form-more[open] summary { margin-bottom: 0.25rem; }

.pin-form-checkbox-row {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.75rem;
}
.pin-form-checkbox-row input[type="checkbox"] { width: auto; margin-top: 0; }
.pin-form-checkbox-row label { margin-top: 0; }

#pin-form input:focus, #pin-form select:focus, #pin-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

#pin-form button {
  margin-top: 1rem; width: 100%; height: 44px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#pin-form button[type="submit"] {
  background: linear-gradient(to bottom, var(--accent-2), var(--accent));
  color: #022c22;
  box-shadow: 0 10px 15px -3px rgba(6, 78, 59, 0.4);
}

/* Cancel is secondary: same footprint, less weight than the submit button. */
#pin-form-cancel {
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  border: 1px solid var(--glass-border);
}

.info-modal {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

.info-modal-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  padding: 1.25rem;
  width: min(90vw, 420px);
  max-height: 80vh;
  overflow-y: auto;
  color: var(--fg);
}

.info-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.info-modal-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.info-modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0.25rem;
}
.info-modal-body { color: var(--muted); line-height: 1.5; }
.info-modal-body p { margin: 0 0 0.75rem; }

.faq-item { margin-bottom: 1rem; }
.faq-q { color: var(--fg); font-weight: 600; margin-bottom: 0.25rem; }
.faq-a { color: var(--muted); }

.stats-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.4rem 0; border-bottom: 1px solid var(--glass-border);
}
.stats-row-label { color: var(--muted); }
.stats-row-value { color: var(--fg); font-weight: 600; }

#splash {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

#splash-card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  padding: 2rem;
  width: min(90vw, 420px);
  text-align: center;
  color: var(--fg);
}

#splash-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  line-height: 1;
}

#splash-eyebrow {
  display: inline-flex;
  align-items: center;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 9999px;
  padding: 4px 10px;
  margin: 0 0 1.25rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #6ee7b7;
}

#splash-title { margin: 0 0 0.75rem; font-size: 1.5rem; line-height: 1.25; }
#splash-title span { display: block; }
#splash-title .serif-italic { font-size: 1.7rem; color: var(--accent-2); }

#splash-card p { margin: 0 0 1.5rem; color: var(--muted); line-height: 1.5; }

#splash-stats {
  display: grid;
  /* minmax(0, 1fr) not 1fr: the values are white-space: nowrap, and a plain 1fr
     floors at min-content, so the wider tiles ("฿377,000") steal width from the
     narrow ones and the columns come out uneven. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.65rem 0.3rem;
  /* Labels run to two lines, values to one — without this the row's tiles come
     out at different heights depending on which label wrapped. */
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
}

.stat-highlight {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-2);
  /* "฿7k–฿40k" is the widest value and would otherwise break across lines. */
  white-space: nowrap;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.25;
}

#splash-actions {
  display: flex;
  gap: 0.6rem;
}

#splash-share {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600; cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
}

#splash-start {
  flex: 1;
  height: 44px;
  border: none; border-radius: 12px;
  font-size: 14px;
  font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: linear-gradient(to bottom, var(--accent-2), var(--accent));
  color: #022c22;
  box-shadow: 0 10px 15px -3px rgba(6, 78, 59, 0.4);
}

.ad-slot {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
}

.ad-label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0.4rem 0.6rem 0;
}

.ad-slot-splash {
  margin: 0 0 1rem;
  min-height: 50px;
}

#ad-sidebar {
  position: fixed;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  z-index: 5;
  width: 160px;
  min-height: 120px;
  backdrop-filter: blur(28px) saturate(1.6);
}

@media (max-width: 700px) {
  /* No room for the 160px side floater on a 390px screen — drop it to a
     slim bar above the "explore" hint at the bottom of the map instead. */
  #ad-sidebar {
    top: auto;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 320px;
    min-height: 50px;
    max-height: 100px;
  }

  /* min-height was reserving 50px on top of the ad's own 50px. */
  .ad-slot-splash { min-height: 0; margin-bottom: 0.75rem; }
  .ad-label { font-size: 0.65rem; padding: 0.25rem 0.5rem 0; }

  /* iOS Safari zooms in on any input smaller than 16px and does not zoom back
     out on blur, which leaves the fixed search bar and chicklets sitting
     off-screen for the rest of the session. */
  #search-input { font-size: 16px; }
}

#about {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8rem 1.5rem 4rem;
  color: var(--fg);
}

#about h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 1rem; font-weight: 700; }
#about h1 em { font-family: var(--serif); font-style: italic; color: var(--accent-2); font-weight: 400; }
#about h3 { font-size: 1.4rem; margin: 0; font-weight: 700; }
#about p { color: var(--muted); line-height: 1.6; }
#about-footer { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }

/* ── The Story: copy + city-wide median card ── */
.story-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: start;
}

.story-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.story-stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--fg);
  margin: 0.25rem 0;
}

.story-stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

/* ── Rents by area ── */
.areas-section { margin-top: 4rem; }

.areas-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.areas-link {
  color: var(--accent-2);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.areas-link:hover { text-decoration: underline; }

.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.area-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s ease;
}
.area-card:hover { border-color: rgba(16, 185, 129, 0.4); }

.area-card-name { font-weight: 600; font-size: 0.95rem; }
.area-card-arrow { position: absolute; top: 0.9rem; right: 0.9rem; color: var(--muted); }
.area-card-median { font-size: 1.3rem; font-weight: 800; margin-top: 0.4rem; }
.area-card-median-label { font-size: 0.7rem; font-weight: 500; color: var(--muted); text-transform: uppercase; }
.area-card-pins { color: var(--muted); font-size: 0.78rem; }

/* ── Free forever + FAQ ── */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--glass-border);
}

.footer-tagline { font-size: 1.4rem; color: var(--accent-2); margin: 0 0 1rem; }

.faq-block details {
  border-top: 1px solid var(--glass-border);
  padding: 1rem 0;
}
.faq-block details:last-child { border-bottom: 1px solid var(--glass-border); }

.faq-block summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-block summary::-webkit-details-marker { display: none; }
.faq-block summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1.2rem;
  margin-left: 1rem;
}
.faq-block details[open] summary::after { content: "–"; }
.faq-block details p { margin: 0.75rem 0 0; }

#about-bottom-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  color: var(--muted);
  font-size: 0.85rem;
}
#about-logo-icon { margin-right: 0.3rem; }

@media (max-width: 720px) {
  .story-grid, .footer-grid { grid-template-columns: 1fr; }
  #about h1 { font-size: 1.6rem; }
}

/* ── Reference map experience ─────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

#map-hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 580px;
  overflow: hidden;
  background: #050807;
}

#map-hero #map {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  filter: saturate(.52) brightness(.7) contrast(1.12);
}

.map-vignette {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 44%, transparent 0 25%, rgba(2, 6, 5, .2) 55%, rgba(2, 6, 5, .72) 100%);
}

.site-header {
  position: absolute;
  z-index: 10;
  inset: 0 0 auto;
  height: 128px;
  pointer-events: none;
}

.brand {
  position: absolute;
  top: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f5f7f6;
  text-decoration: none;
  pointer-events: auto;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #69e3ad, #2cab78);
  box-shadow: 0 8px 20px rgba(16, 185, 129, .3);
  color: #073326;
}

.brand-mark svg { width: 23px; height: 23px; }
.brand strong { display: block; font-size: 16px; font-weight: 800; line-height: 1; letter-spacing: -.045em; }
.brand strong em { color: #55d99c; font-style: normal; }
.brand small { display: block; margin-top: 4px; color: rgba(255, 255, 255, .58); font-size: 8px; font-weight: 700; letter-spacing: .18em; line-height: 1; text-transform: uppercase; }

.site-header .search-wrap {
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 1;
  box-sizing: border-box;
  width: min(56vw, 720px);
  max-width: none;
  height: 50px;
  padding: 0 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  align-items: center;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(20, 26, 24, .88), rgba(14, 18, 17, .88));
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5);
  backdrop-filter: blur(24px);
}

.search-icon {
  display: block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  box-sizing: border-box;
  position: relative;
  border: 2px solid rgba(255, 255, 255, .48);
  border-radius: 50%;
}

.search-icon::after { content: ''; position: absolute; width: 7px; height: 2px; right: -5px; bottom: -3px; background: rgba(255, 255, 255, .48); transform: rotate(45deg); border-radius: 2px; }
.site-header #search-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--fg); font: inherit; font-size: 14px; outline: 0; }
.site-header #search-input::placeholder { color: rgba(255, 255, 255, .43); }
.site-header #search-input:focus { border-color: transparent; }

.site-header .lang-btn { flex-shrink: 0; height: 34px; padding: 0 11px; border-radius: 10px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .85); border: 1px solid rgba(255, 255, 255, .08); font-size: 12px; }

.site-header .chicklet-bar {
  position: absolute;
  top: 78px;
  left: 50%;
  z-index: 1;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 0;
  transform: translateX(-50%);
  pointer-events: auto;
}

.site-header .chicklet { min-height: 32px; padding: 0 12px; border-radius: 12px; background: rgba(14, 18, 17, .78); border: 1px solid rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .78); font-size: 11px; font-weight: 600; backdrop-filter: blur(16px); }
.site-header .chicklet:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .17); }
.site-header .chicklet-icon { width: 14px; height: 14px; position: relative; display: inline-block; box-sizing: border-box; border: 1.5px solid currentColor; border-radius: 50%; }
.site-header .icon-help::after { content: '?'; position: absolute; inset: -1px 0 0; text-align: center; font-size: 10px; line-height: 13px; font-weight: 800; }
.site-header .icon-building { border-radius: 2px; }
.site-header .icon-building::before { content: ''; position: absolute; top: 3px; left: 3px; width: 2px; height: 2px; background: currentColor; box-shadow: 4px 0 currentColor, 0 4px currentColor, 4px 4px currentColor; }
.site-header .icon-chart { border: 0; border-radius: 0; border-bottom: 1.5px solid currentColor; }
.site-header .icon-chart::after { content: ''; position: absolute; inset: 2px 1px 1px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; box-shadow: 4px -4px 0 -1px currentColor; }

#map-controls { position: absolute; top: 20px; right: 20px; z-index: 10; }
#map-controls .map-ctrl-v { position: static; right: auto; bottom: auto; width: auto; height: 36px; padding: 0 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; box-shadow: none; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; color: rgba(255, 255, 255, .75); }
#map-controls .map-ctrl-v:hover { background: rgba(255, 255, 255, .08); }
#map-controls .map-ctrl-v.active { background: var(--accent); color: #052e16; box-shadow: 0 0 18px rgba(16, 185, 129, .35); }
#map-controls .map-ctrl-v-label { margin: 0; font-size: 12px; font-weight: 600; line-height: 1; }
.control-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }

.map-hint { position: absolute; z-index: 5; top: 138px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 15px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 999px; background: rgba(10, 14, 13, .78); box-shadow: 0 12px 32px rgba(0, 0, 0, .3); backdrop-filter: blur(12px); color: rgba(255, 255, 255, .62); font-size: 12px; white-space: nowrap; }
.map-hint > span:first-child { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--accent-2); }
#map-hero:has(#splash:not(.hidden)) .map-hint { visibility: hidden; }
.explore-map { position: absolute; z-index: 5; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; color: rgba(255, 255, 255, .48); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-decoration: none; text-transform: uppercase; }
.explore-map b { font-size: 18px; font-weight: 400; line-height: .7; }
.explore-map:hover { color: #fff; }

.pin-label { padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #062018; background: linear-gradient(180deg, #5de3a5, #22a970); border: 1.5px solid rgba(255, 255, 255, .32); box-shadow: 0 6px 14px -4px rgba(16, 185, 129, .72), 0 2px 4px rgba(0, 0, 0, .35); }
.pin-label::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.pin-caret { display: none; }

#splash { z-index: 20; justify-content: center; align-items: center; padding: 24px; box-sizing: border-box; pointer-events: none; background: rgba(0, 0, 0, 0.55); }
#splash-card { width: min(92vw, 470px); padding: 32px; text-align: left; pointer-events: auto; background: linear-gradient(135deg, rgba(21, 39, 32, .93), rgba(10, 18, 15, .94)); border: 1px solid rgba(147, 225, 184, .17); border-radius: 24px; box-shadow: 0 24px 80px rgba(0, 0, 0, .42); backdrop-filter: blur(20px); }
#splash-close { top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .48); }
#splash-eyebrow { padding: 5px 11px; margin: 0 0 16px; font-size: 10px; letter-spacing: .15em; color: #82e7b6; background: rgba(52, 211, 153, .08); border-color: rgba(92, 225, 164, .22); }
#splash-eyebrow::before { content: '✧'; margin-right: 6px; font-size: 14px; line-height: 0; }
#splash-title { margin-bottom: 12px; font-size: clamp(34px, 3.7vw, 50px); line-height: .98; letter-spacing: -.055em; }
#splash-title .serif-italic { margin-top: 4px; font-size: 1.1em; color: #71dfaa; letter-spacing: -.035em; }
#splash-card > p { max-width: 400px; margin-bottom: 22px; font-size: 15px; line-height: 1.55; color: rgba(231, 236, 234, .64); }
#splash-stats { gap: 8px; margin-bottom: 20px; }
.stat { min-height: 70px; padding: 10px 11px; align-items: flex-start; gap: 4px; border-color: rgba(255, 255, 255, .08); border-radius: 12px; background: rgba(255, 255, 255, .025); }
.stat-highlight { background: rgba(29, 155, 105, .12); border-color: rgba(91, 225, 166, .4); }
.stat-value { font-size: 19px; color: #f2f7f4; letter-spacing: -.04em; }
.stat-highlight .stat-value { color: #dcfff0; }
.stat-label { font-size: 9px; font-weight: 700; line-height: 1.35; letter-spacing: .06em; text-transform: uppercase; }
#splash-actions { gap: 10px; }
#splash-share, #splash-start { height: 44px; border-radius: 12px; }
#splash-share { padding: 0 18px; background: rgba(255, 255, 255, .05); }
#splash-start { background: linear-gradient(180deg, #70e9b2, #31b87c); color: #053121; box-shadow: 0 10px 18px rgba(16, 185, 129, .2); }

#about { box-sizing: border-box; max-width: 1216px; margin: 0 auto; padding: 96px 32px 64px; color: var(--fg); }
#about h1 { max-width: 630px; font-size: clamp(36px, 3.5vw, 52px); line-height: 1.04; letter-spacing: -.055em; }
#about h3 { font-size: 30px; letter-spacing: -.045em; }
#about p { color: rgba(231, 236, 234, .6); }
.eyebrow { margin-bottom: 14px; font-size: 10px; letter-spacing: .18em; color: #64d7a1; }
.story-grid { grid-template-columns: 1.2fr .8fr; gap: 64px; }
.story-copy > p:last-child { max-width: 550px; margin-top: 24px; font-size: 15px; line-height: 1.75; }
.story-stat-card { min-height: 142px; padding: 24px; border-color: rgba(255, 255, 255, .07); border-radius: 18px; background: linear-gradient(135deg, #141b18, #0f1412); }
.story-stat-card::before { content: '↗'; display: block; margin-bottom: 16px; color: #58d99e; font-size: 26px; font-weight: 700; line-height: .5; }
.story-stat-card .eyebrow { margin-bottom: 8px; color: rgba(231, 236, 234, .45); letter-spacing: .12em; }
.story-stat-value { margin: 0; font-size: 38px; letter-spacing: -.055em; }
.story-stat-value::after { content: '/mo'; margin-left: 7px; color: rgba(231, 236, 234, .45); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.story-stat-label { margin-top: 4px; font-size: 11px; }
.areas-section { margin-top: 64px; }
.areas-header { margin-bottom: 28px; }
.areas-link { font-size: 12px; font-weight: 700; color: #5fd89d; }
.areas-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.area-card { min-height: 80px; gap: 4px; padding: 16px; border-color: rgba(255, 255, 255, .07); border-radius: 14px; background: #0e1211; }
.area-card:hover { background: #121916; border-color: rgba(94, 224, 162, .3); }
.area-card-name { font-size: 12px; }
.area-card-arrow { top: 13px; right: 13px; font-size: 12px; }
.area-card-median { margin-top: 5px; font-size: 18px; letter-spacing: -.04em; }
.area-card-median-label { font-size: 9px; text-transform: lowercase; }
.area-card-pins { font-size: 10px; }
.footer-grid { gap: 90px; margin-top: 64px; padding-top: 0; border-top: 0; }
.footer-copy h3 { max-width: 320px; font-size: 34px !important; line-height: 1.05; }
.footer-tagline { margin-top: 4px; font-size: 34px; line-height: 1; }
#about-footer { max-width: 430px; margin-top: 20px; font-size: 14px; line-height: 1.7; }
.faq-block details { padding: 18px 0; border-color: rgba(255, 255, 255, .07); }
.faq-block summary { font-size: 14px; }
.faq-block details p { max-width: 640px; margin: 14px 0 0; font-size: 13px; }
.faq-block summary::after { content: '⌄'; font-size: 16px; }
.faq-block details[open] summary::after { content: '⌃'; }
#about-bottom-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 80px; padding-top: 28px; border-color: rgba(255, 255, 255, .07); font-size: 11px; }
#about-logo-icon { display: inline-grid; width: 28px; height: 28px; place-items: center; margin-right: 8px; border-radius: 50%; background: #5ad99f; color: #073326; font-size: 14px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: #fff; }

@media (max-width: 720px) {
  #map-hero { min-height: 640px; }
  .brand { top: 20px; left: 20px; }
  .site-header .search-wrap, .site-header .chicklet-bar { display: none; }
  #map-controls { top: 20px; right: 20px; }
  .map-hint { top: 104px; max-width: calc(100vw - 40px); overflow: hidden; text-overflow: ellipsis; }
  #splash { align-items: center; justify-content: center; padding: 20px; }
  #splash-card { width: min(100%, 350px); padding: 28px; border-radius: 22px; }
  #splash-title { font-size: 34px; }
  #splash-card > p { margin-bottom: 18px; font-size: 14px; }
  .stat { min-height: 64px; padding: 10px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 8px; }
  #about { padding: 80px 20px 40px; }
  #about h1 { font-size: 34px; }
  .story-grid, .footer-grid { grid-template-columns: 1fr; }
  .story-grid { gap: 32px; }
  .story-stat-card { min-height: 116px; }
  .areas-section { margin-top: 56px; }
  .areas-header { align-items: flex-start; }
  .areas-link { display: none; }
  #about h3 { font-size: 26px; }
  .areas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .area-card { min-height: 72px; padding: 15px; }
  .footer-grid { gap: 48px; margin-top: 56px; }
  .footer-copy h3, .footer-tagline { font-size: 32px !important; }
  #about-bottom-footer { flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 64px; }
}
