/* Redaction — self-hosted. Drop .woff2 files into /assets/fonts/ and these
   @font-face rules will pick them up. Filenames assumed below; rename here if
   the files you drop in are named differently. */
@font-face {
  font-family: 'Redaction';
  src: url('/assets/fonts/Redaction-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Redaction';
  src: url('/assets/fonts/Redaction-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f1e6;
  --ink: #1a1a1a;
  --purple: #9333EA;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lift: 0 10px 40px rgba(0, 0, 0, 0.18);
  /* Average tone of the (heavily blurred) halo. Used as the canvas
     background so any flicker during a flyTo animation blends with the
     halo instead of flashing the page color through. */
  --halo-bg: #243025;
  --display: 'Redaction', 'Tiempos Headline', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
}

body.is-night {
  --halo-bg: #0e1828;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--body);
  background: #ffffff;
  color: var(--ink);
  overscroll-behavior: none;
}

/* DESKTOP layout: 2-column grid. Left column hosts wordmark + menu so the
   menu can open downward without ever overlapping the map container. The
   right column is the map, which fills its cell — no aspect-ratio gating.
   The map's own zoom is set to "cover" semantics in JS, so the illustration
   fills the container in both axes (no paper gaps inside). */
.page {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 320px 1fr;
  align-items: stretch;
  padding: 24px;
  gap: 20px;
}

.page__topleft {
  grid-column: 1;
  align-self: start;
  position: relative; /* anchor for menu-panel */
  height: 100%;
}

.map-frame {
  grid-column: 2;
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--halo-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
}

#map {
  position: absolute;
  inset: 0;
  background: var(--halo-bg);
  cursor: grab;
}

#map.leaflet-grab { cursor: grab; }
#map.leaflet-dragging .leaflet-grab { cursor: grabbing; }

/* Map title + expand/close affordances are mobile-only. */
.map-title { display: none; }
.map-expand,
.map-close { display: none; }

/* Desktop-only label sitting on the map itself, top-left. White text on a
   translucent dark pill so it's legible over any part of the illustration. */
.map-overlay-title { display: none; }
@media (min-width: 721px) {
  .map-overlay-title {
    display: inline-block;
    position: absolute;
    top: 16px;
    left: 18px;
    z-index: 1100;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.42);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.96);
    font-family: var(--display);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.01em;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  }
}

/* MOBILE: stacked card layout. Wordmark + title sit on the page,
   the map is a tappable card that expands to fullscreen on tap. */
@media (max-width: 720px) {
  .page {
    position: static;
    inset: auto;
    display: flex;
    flex-direction: column;
    padding: 18px 30px 30px;
    gap: 18px;
    /* Intentionally NO min-height: 100vh — iOS Safari treats `vh` as the
       URL-bar-hidden height, which makes the page taller than `body` on
       first paint and triggers an auto-scroll that hides the wordmark. */
  }
  /* Hoist .page__topleft's children (wordmark + menu) into the .page flex
     container so we can re-order them with `order` and place the menu
     under the map title. */
  .page__topleft {
    display: contents;
  }
  .wordmark   { order: 1; }
  .map-frame  { order: 2; }
  .map-title  { order: 3; }
  .menu-panel { order: 4; }

  .map-title {
    display: block;
    margin: 4px 0 0;
    font-family: var(--display);
    font-weight: 400;
    font-size: 19px; /* matches the wordmark on mobile */
    letter-spacing: 0.005em;
    text-align: left;
    color: rgba(26, 26, 26, 0.5);
  }

  .map-frame {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    max-height: 62vh;
    border-radius: 32px;
    /* Softer, more diffuse — feels dreamy rather than carded. */
    box-shadow: 0 24px 60px -18px rgba(40, 30, 20, 0.22),
                0 4px 14px rgba(40, 30, 20, 0.08);
    margin: 0 auto;
    background: var(--halo-bg);
  }

  /* Dreamy edge — a radial fade-to-page-bg overlay sits above the map but
     below the controls and shimmer, so the illustration feathers into the
     page while every interactive layer stays crisp. */
  .map-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    z-index: 800;
    background: radial-gradient(
      ellipse 95% 96% at 50% 50%,
      transparent 50%,
      rgba(255, 255, 255, 0.55) 82%,
      rgba(255, 255, 255, 1) 100%
    );
  }

  /* Full-bleed transparent button — captures every tap on the mini map
     so any touch (marker, control, drag) just expands instead. */
  .map-expand {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1300;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    border-radius: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  /* Sheen strip — sits off-screen left, sweeps across once, pauses
     off-screen right for the rest of the cycle. translateX gives us
     predictable motion (the percentage-based background-position math
     was the source of the earlier "rapid blinking" bug). */
  .map-expand::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 55%;
    background: linear-gradient(
      115deg,
      transparent 30%,
      rgba(255, 255, 255, 0.22) 50%,
      transparent 70%
    );
    transform: translateX(-110%);
    animation: map-shimmer 10s ease-in-out infinite;
    pointer-events: none;
  }
  .map-expand:active::before { background-color: rgba(0, 0, 0, 0.04); }

  @keyframes map-shimmer {
    0%, 6%   { transform: translateX(-110%); opacity: 0; }
    10%      { opacity: 1; }
    20%      { opacity: 1; }
    24%      { transform: translateX(220%); opacity: 0; }
    100%     { transform: translateX(220%); opacity: 0; }
  }

  @media (prefers-reduced-motion: reduce) {
    .map-expand::before { animation: none; }
  }

  /* EXPANDED: pop the map out to fill the viewport.
     The wordmark is hidden in this state. The neighborhood title is styled
     to match the desktop overlay pill — white text on a translucent dark
     blurred badge sitting top-left over the map. */
  body.map-expanded .wordmark { display: none; }

  body.map-expanded .map-title {
    display: inline-block;
    position: fixed;
    top: 16px;
    left: 18px;
    margin: 0;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.42);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.96);
    font-family: var(--display);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.01em;
    text-shadow: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    z-index: 1600;
    pointer-events: none;
    text-align: left;
  }

  body.map-expanded .map-frame {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    background: var(--halo-bg);
  }
  body.map-expanded .map-frame::after { display: none; }

  body.map-expanded .map-expand { display: none; }

  body.map-expanded .map-close {
    display: flex;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1600;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  }
  body.map-expanded .map-close svg { width: 16px; height: 16px; display: block; }
  body.map-expanded .map-close:active { transform: scale(0.94); }
  body.map-expanded .map-close:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
  }
}

/* Plotter HUD */
.plotter-hud {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  width: 280px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  pointer-events: auto;
}

.plotter-readout {
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.02em;
}

.plotter-readout strong {
  font-weight: 600;
  color: var(--purple);
}

.plotter-list {
  background: var(--paper);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.plotter-list:empty::before {
  content: 'click the map to capture coords';
  display: block;
  padding: 8px;
  opacity: 0.5;
  font-style: italic;
}

.plotter-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.plotter-entry:last-child { border-bottom: 0; }

.plotter-entry code {
  flex: 1;
  font-size: 11px;
  word-break: break-all;
}

.plotter-entry button {
  font: inherit;
  font-size: 10px;
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink);
}

.plotter-entry button:hover {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
}

.plotter-entry button.copied {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.plotter-clear {
  font: inherit;
  font-size: 11px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  align-self: flex-end;
}

.plotter-clear:hover {
  background: white;
  color: var(--ink);
}

/* While a POI popup is open: hide the wordmark and dim every other
   marker so the focused spot stands alone on the map. */
body.poi-open .wordmark {
  opacity: 0;
  pointer-events: none;
}

.leaflet-marker-icon { transition: opacity 280ms ease; }

body.poi-open .leaflet-marker-icon {
  opacity: 0;
  pointer-events: none;
}

body.poi-open .leaflet-marker-icon.poi-marker--active {
  opacity: 1;
  pointer-events: auto;
}

/* ───── POI markers ───── */

.poi-marker {
  /* divIcon container — its sizing is controlled by Leaflet's iconSize.
     We use a transparent box and absolutely position the dot+ring inside. */
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none; /* clicks land on the dot specifically */
}

.poi-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: rgba(147, 51, 234, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 5px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: auto;
  animation: poi-bob 3s ease-in-out infinite;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.poi-dot::after {
  /* the pulse ring */
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--purple);
  opacity: 0.7;
  animation: poi-pulse 2s ease-out infinite;
  pointer-events: none;
}

.poi-dot:hover {
  transform: scale(1.2);
  background: rgba(147, 51, 234, 0.75);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 4px 12px rgba(147, 51, 234, 0.45);
}

/* Touch devices: invisible 46px hit-target around the visible 11px dot
   so the marker is easy to tap accurately. Pseudo-element clicks route
   to the parent .poi-dot, which keeps the existing handler working. */
@media (hover: none) and (pointer: coarse) {
  .poi-dot::before {
    content: '';
    position: absolute;
    inset: -17.5px;
    border-radius: 50%;
  }
}

.poi-dot:active,
.poi-dot.bouncing {
  animation: poi-bob 3s ease-in-out infinite, poi-bounce 320ms ease;
}

.poi-dot:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 4px;
}

@keyframes poi-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

@keyframes poi-pulse {
  0%   { transform: scale(0.85); opacity: 0.7; }
  80%  { transform: scale(2.1); opacity: 0; }
  100% { transform: scale(2.1); opacity: 0; }
}

@keyframes poi-bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .poi-dot { animation: none; }
  .poi-dot::after { animation: none; opacity: 0.5; }
}

/* ───── POI popup (custom — not a Leaflet popup) ───── */

/* Desktop: POI popup sits flat in the left column on the white page —
   no card background or shadow. Mobile override below restyles it as a
   paper bottom-sheet over the full-viewport map. */
.poi-popup {
  position: absolute;
  z-index: 1200;
  top: 0;
  left: 0;
  right: 0;
  max-height: calc(100vh - 60px);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 4px 8px 24px 6px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.poi-popup.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.poi-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 120ms ease, background 120ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poi-popup__close:hover { opacity: 1; background: rgba(0,0,0,0.05); }
.poi-popup__close:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.poi-popup__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0.005em;
  margin: 0 36px 16px 0;
  color: var(--ink);
}

.poi-popup__body {
  overflow-y: auto;
  margin: 0;
  padding: 0 4px 0 0;
}

.poi-popup__bullets {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}

.poi-popup__bullets li {
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 10px;
  color: rgba(26, 26, 26, 0.85);
}

.poi-popup__bullets li:last-child { margin-bottom: 0; }

/* Word-by-word reveal for POI title and bullets. */
.tw-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(2px);
  filter: blur(2px);
  transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
  will-change: opacity, transform, filter;
}
.tw-word.tw-on {
  opacity: 1;
  transform: none;
  filter: none;
}
@media (prefers-reduced-motion: reduce) {
  .tw-word { opacity: 1; transform: none; filter: none; transition: none; }
}

.poi-popup__footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.poi-popup__directions,
.poi-popup__copylink {
  display: inline-block;
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--purple);
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.poi-popup__directions:hover,
.poi-popup__copylink:hover {
  text-decoration-thickness: 2px;
}

.poi-popup__copylink.copied {
  color: var(--ink);
  text-decoration-style: dotted;
}

.poi-popup__footer-spacer { flex: 1; }

/* Mobile: POI popup is a center-aligned bottom paper sheet over the map. */
@media (max-width: 720px) {
  .poi-popup {
    position: fixed;
    top: auto;
    left: 50%;
    right: auto;
    bottom: 16px;
    transform: translate(-50%, 12px);
    width: min(420px, calc(100vw - 32px));
    max-height: min(70vh, 560px);
    padding: 22px 22px 20px;
    background: var(--paper);
    border-radius: 10px;
    box-shadow: var(--shadow-lift);
  }
  .poi-popup.open {
    transform: translate(-50%, 0);
  }
  .poi-popup__title { font-size: 26px; }
}

/* ───── Day/night image crossfade ───── */

/* Smooth crossfade between day and night on mode toggle. */
.leaflet-image-layer {
  transition: opacity 500ms ease;
}

/* LQIP layers — tiny blurred placeholders shown while the full image loads.
   Opacity is driven by JS; CSS just gives them their soft, dreamy blur. */
.leaflet-image-layer.lqip-layer {
  filter: blur(22px);
  /* slight saturation/brightness lift so the blurred preview feels lively */
  filter: blur(22px) saturate(1.05);
}

/* Halo layers — the LQIP rescaled to a padded canvas, sitting beneath the
   sharp illustration. Only visible past the illustration's edges, where it
   provides a soft, on-theme extension so POIs near the edges can still be
   centered when flown to. */
.leaflet-image-layer.halo-layer {
  filter: blur(36px) saturate(1.05);
}

/* Feather only the very edge of the illustration so it dissolves into the
   halo behind it. Two perpendicular linear gradients intersected give a
   rectangular feather (a radial mask would chop off the corners and creep
   inward, hiding POIs near the edges). 96-100% of the image is fully sharp;
   only the outermost ~4% on each side fades to transparent. */
.leaflet-image-layer.full-layer,
.leaflet-image-layer.lqip-layer {
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 4%, #000 96%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 4%, #000 96%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 4%, #000 96%, transparent 100%);
  mask-composite: intersect;
}

/* ───── Bottom-right toggles (mode + audio) ───── */

.toggles {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(120, 90, 50, 0.14);
  background: linear-gradient(180deg, #fdf8ec 0%, #f1ead7 100%);
  color: #3a2a18;
  cursor: pointer;
  box-shadow:
    0 6px 16px rgba(40, 30, 20, 0.18),
    0 1px 2px rgba(40, 30, 20, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    inset 0 -3px 8px rgba(180, 150, 110, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 140ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.toggle-btn:hover {
  background: linear-gradient(180deg, #fffdf3 0%, #f6efdc 100%);
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(40, 30, 20, 0.22),
    0 1px 2px rgba(40, 30, 20, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    inset 0 -3px 8px rgba(180, 150, 110, 0.18);
}
.toggle-btn:active {
  transform: translateY(0) scale(0.95);
  box-shadow:
    0 2px 6px rgba(40, 30, 20, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    inset 0 2px 4px rgba(160, 130, 90, 0.18);
}
.toggle-btn:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}

.toggle-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Active toggle: an "inverted" paper stamp — dark neutral ink instead of
   the cream gradient, cream-colored icon. Neutral grey (not warm brown)
   so it doesn't clash with the green map underneath. */
.toggle-btn[data-state='on'] {
  background: linear-gradient(180deg, #2a2926 0%, #131312 100%);
  border-color: rgba(0, 0, 0, 0.32);
  color: #fdf8ec;
  box-shadow:
    0 8px 22px rgba(20, 20, 20, 0.36),
    0 1px 2px rgba(10, 10, 10, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    inset 0 -3px 8px rgba(0, 0, 0, 0.42);
}

.toggle-btn[data-state='on']:hover {
  background: linear-gradient(180deg, #3a3935 0%, #1d1d1c 100%);
}

@media (max-width: 720px) {
  .toggles { bottom: 16px; right: 16px; gap: 8px; }
  .toggle-btn { width: 40px; height: 40px; }
  .toggle-btn svg { width: 17px; height: 17px; }
}

/* ───── Zoom controls ───── */

.zoom-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.zoom-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(120, 90, 50, 0.14);
  background: linear-gradient(180deg, #fdf8ec 0%, #f1ead7 100%);
  color: #3a2a18;
  cursor: pointer;
  box-shadow:
    0 6px 16px rgba(40, 30, 20, 0.18),
    0 1px 2px rgba(40, 30, 20, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    inset 0 -3px 8px rgba(180, 150, 110, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 140ms ease, box-shadow 200ms ease, background 200ms ease, opacity 140ms ease;
  -webkit-user-select: none;
  user-select: none;
}

.zoom-btn:hover {
  background: linear-gradient(180deg, #fffdf3 0%, #f6efdc 100%);
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(40, 30, 20, 0.22),
    0 1px 2px rgba(40, 30, 20, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    inset 0 -3px 8px rgba(180, 150, 110, 0.18);
}
.zoom-btn:active {
  transform: translateY(0) scale(0.95);
  box-shadow:
    0 2px 6px rgba(40, 30, 20, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    inset 0 2px 4px rgba(160, 130, 90, 0.18);
}
.zoom-btn:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}
.zoom-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.zoom-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

@media (max-width: 720px) {
  .zoom-controls { bottom: 16px; left: 16px; gap: 8px; }
  .zoom-btn { width: 40px; height: 40px; }
  .zoom-btn svg { width: 17px; height: 17px; }
}

/* ───── Contextual re-center button (visible only while a POI is open) ───── */

.recenter-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 1150;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 14px;
  border: 1px solid rgba(120, 90, 50, 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, #fdf8ec 0%, #f1ead7 100%);
  color: #3a2a18;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 8px 22px rgba(40, 30, 20, 0.22),
    0 1px 2px rgba(40, 30, 20, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    inset 0 -3px 8px rgba(180, 150, 110, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease, background 200ms ease, box-shadow 200ms ease;
  -webkit-user-select: none;
  user-select: none;
}
.recenter-btn svg { width: 16px; height: 16px; display: block; }

body.poi-open .recenter-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.recenter-btn:hover {
  background: linear-gradient(180deg, #fffdf3 0%, #f6efdc 100%);
  transform: translateX(-50%) translateY(-2px);
}
.recenter-btn:active {
  transform: translateX(-50%) translateY(0) scale(0.97);
  box-shadow:
    0 2px 6px rgba(40, 30, 20, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 2px 4px rgba(160, 130, 90, 0.18);
}
.recenter-btn:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  /* On mobile the POI popup is a bottom sheet — float the recenter button
     above the top of the sheet so it stays visible. */
  .recenter-btn {
    bottom: auto;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    padding: 9px 14px 9px 12px;
    font-size: 12.5px;
    transform: translateX(-50%) translateY(-8px);
  }
  body.poi-open .recenter-btn {
    transform: translateX(-50%) translateY(0);
  }
  .recenter-btn:hover {
    transform: translateX(-50%) translateY(-2px);
  }
  .recenter-btn:active {
    transform: translateX(-50%) translateY(0) scale(0.97);
  }
}

/* ───── Wordmark + menu ───── */

.wordmark {
  position: relative;
  z-index: 1100;
  font-family: var(--display);
  font-weight: 400;
  font-size: 25.2px;
  letter-spacing: 0.005em;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 4px 6px;
  margin: 0;
  opacity: 0.85;
  transition: opacity 180ms ease;
  display: inline-block;
}

/* Desktop: menu is permanently visible in the left column. It only fades
   out when a POI popup takes over the same space. */
.menu-panel {
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1099;
  overflow-y: auto;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 4px 8px 24px 6px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity 220ms ease, transform 220ms ease;
}

/* When a POI popup is open, the menu fades out so the popup can take its
   place — they share the same column slot. */
body.poi-open .menu-panel {
  opacity: 0;
  pointer-events: none;
}

.menu-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-panel section + section { margin-top: 18px; }

.menu-panel h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 6px;
  letter-spacing: 0.01em;
  color: rgba(26, 26, 26, 0.5);
}

.menu-panel p {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 8px;
  color: rgba(26, 26, 26, 0.62);
}

.menu-panel p:last-child { margin-bottom: 0; }

.menu-panel a {
  color: var(--purple);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* MOBILE: in mini state the wordmark sits on the page (ink on paper).
   When the map is expanded the wordmark is hidden (see expanded block above). */
@media (max-width: 720px) {
  .wordmark {
    position: static;
    font-size: 19px;
    color: var(--ink);
    text-shadow: none;
  }

  /* Inline menu — sits under "lodhi garden" with a thin divider above. */
  .menu-panel {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    max-height: none;
    padding: 14px 0 0;
    margin-top: 4px;
    background: transparent;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    z-index: auto;
  }
}
