/* ════════════════════════════════════════════════════════════════════
   neon.css — the night-city design layer.

   Additive on top of style.css: nothing here changes the tier-0 (2D)
   experience except subtle component reskins. Everything 3D-dependent
   is scoped to body[data-city-active], which the loader sets only on
   capable devices.
   ════════════════════════════════════════════════════════════════════ */

:root {
  --glow-primary: 0 0 18px rgba(var(--primary-color-rgb), 0.55), 0 0 46px rgba(var(--primary-color-rgb), 0.22);
  --glow-accent: 0 0 18px rgba(var(--accent-color-rgb), 0.55), 0 0 46px rgba(var(--accent-color-rgb), 0.22);
  --glow-secondary: 0 0 18px rgba(var(--secondary-color-rgb), 0.5), 0 0 46px rgba(var(--secondary-color-rgb), 0.2);
  --glass-bg: rgba(var(--surface-color-rgb), 0.55);
  --glass-bg-strong: rgba(var(--surface-color-rgb), 0.78);
  --font-display: 'Unbounded', var(--font-family);
}

/* ── Cross-document view transitions (progressive) ─────────────────── */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation-duration: 0.22s; }
  ::view-transition-new(root) { animation-duration: 0.22s; }
}

/* ── Canvas layering ────────────────────────────────────────────────── */
#city-canvas-mount {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: none;
}
body[data-city-active] #city-canvas-mount { display: block; }
/* The map + district experiences are interactive; empty space reaches
   the canvas, panels above still get their own events. */
body[data-city-mode="fullmap"] #city-canvas-mount,
body[data-city-mode="district"] #city-canvas-mount { pointer-events: auto; }
#city-canvas-mount canvas { display: block; width: 100%; height: 100%; }

body[data-city-active] .container,
body[data-city-active] > .image-modal { position: relative; z-index: 1; }

/* With the live city behind, drop the static photo backdrop and thin
   the dark wash so the scene shines through. */
body[data-city-active] {
  background-image:
    radial-gradient(ellipse 80% 60% at 12% -10%, rgba(239, 68, 68, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 50% at 95% 10%, rgba(56, 189, 248, 0.08), transparent 60%);
}
body[data-city-active]::before { background: rgba(11, 12, 16, 0.48); }
/* Hero/lost keep a lighter wash up top — the scroll-linked canvas fade
   (bindBackdropFade) handles legibility once content scrolls in. The
   map page is lightest: its text all lives in glass panels. */
body[data-city-active][data-city-mode="hero"]::before,
body[data-city-active][data-city-mode="lost"]::before { background: rgba(11, 12, 16, 0.30); }
body[data-city-active][data-city-mode="fullmap"]::before { background: rgba(11, 12, 16, 0.12); }

/* Bare text sections get a readable backing when the city is live
   (tier 0 renders these on the static background, unchanged). */
body[data-city-active] .neighborhood-cloud,
body[data-city-active] .featured-news-section,
body[data-city-active] .welcome-message-section,
body[data-city-active] .az-home-nav {
  background: rgba(var(--background-color-rgb), 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
}
body[data-city-active] .news-card {
  background: rgba(var(--surface-color-rgb), 0.8);
}

/* ── Components: glass + neon ───────────────────────────────────────── */
.glass-panel {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.glass-panel--strong { background: var(--glass-bg-strong); }

.neon-text {
  color: var(--text-primary);
  text-shadow: 0 0 12px rgba(var(--accent-color-rgb), 0.7), 0 0 36px rgba(var(--accent-color-rgb), 0.35);
}
.neon-text--primary {
  text-shadow: 0 0 12px rgba(var(--primary-color-rgb), 0.7), 0 0 36px rgba(var(--primary-color-rgb), 0.35);
}

.neon-edge { position: relative; }
.neon-edge::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(130deg,
    rgba(var(--primary-color-rgb), 0.55),
    rgba(var(--accent-color-rgb), 0.55) 55%,
    rgba(var(--secondary-color-rgb), 0.55));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.display-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
}

/* Card hover lift gets a colored under-glow when the city is live. */
@media (prefers-reduced-motion: no-preference) {
  body[data-city-active] .masonry-item:hover,
  body[data-city-active] .venue-card:hover {
    box-shadow: var(--shadow-lg), 0 6px 30px rgba(var(--accent-color-rgb), 0.16);
  }
}

/* Header: neon hairline under the condensed header. */
body[data-city-active] #siteHeader.is-scrolled {
  border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.35);
  box-shadow: 0 1px 18px rgba(var(--accent-color-rgb), 0.12);
}

/* ── Lights toggle ──────────────────────────────────────────────────── */
.lights-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--secondary-color);
  width: 2.1rem;
  height: 2.1rem;
  line-height: 1;
  font-size: 1rem;
  cursor: pointer;
  transition: box-shadow 0.25s var(--ease-out), color 0.25s, transform 0.25s var(--ease-out);
  box-shadow: 0 0 10px rgba(var(--secondary-color-rgb), 0.35);
  flex-shrink: 0;
}
.lights-toggle:hover { transform: scale(1.08); }
.lights-toggle.is-off {
  color: var(--text-tertiary);
  box-shadow: none;
}

/* ── Category constellation (homepage) ──────────────────────────────── */
.constellation-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}
.constellation-layer.is-visible { opacity: 1; }
.constellation-label {
  position: absolute;
  top: 0; left: 0;
  pointer-events: auto;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  text-shadow: 0 0 10px var(--node-color, var(--accent-color)), 0 1px 8px rgba(0, 0, 0, 0.8);
  transition: opacity 0.3s;
  will-change: transform;
}
.constellation-label:hover { text-decoration: underline; color: #fff; }
#category-constellation {
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1rem;
}
#category-constellation .constellation-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* Without the 3D layer the section collapses; the A-Z + masonry grids
   below keep category discovery available on tier 0. */
body:not([data-city-active]) #category-constellation { display: none; }

/* ── Map page (fullmap mode) ────────────────────────────────────────── */
.map-experience { position: relative; min-height: 72vh; }

/* The canvas must receive drags/clicks everywhere except on real UI:
   the content wrapper goes transparent to the pointer and each
   interactive surface re-enables itself. Same for district flyovers. */
body[data-city-active][data-city-mode="fullmap"] .container,
body[data-city-active][data-city-mode="district"] .container { pointer-events: none; }
body[data-city-active][data-city-mode="fullmap"] :is(#siteHeader, .site-footer, .map-ui > *, .venue-info-card, .map-fallback),
body[data-city-active][data-city-mode="district"] :is(#siteHeader, .site-footer, .page-title, .district-hero-panel, .venue-grid, .venue-grid ~ div) {
  pointer-events: auto;
}

.map-hint {
  position: fixed;
  top: 5.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
  background: rgba(11, 12, 16, 0.7);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  display: none;
  transition: opacity 0.6s var(--ease-out);
  pointer-events: none;
}
body[data-city-active] .map-hint { display: block; }
.map-hint.is-hidden { opacity: 0; }

.map-ui {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 3;
  padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom));
  display: none;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}
body[data-city-active] .map-ui { display: flex; }
.map-ui > * { pointer-events: auto; }

.map-search-row { display: flex; gap: 0.5rem; max-width: 560px; }
#city-search {
  flex: 1;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  padding: 0.6rem 1.1rem;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}
#city-search:focus { border-color: rgba(var(--accent-color-rgb), 0.7); box-shadow: var(--glow-accent); }

.map-chip-row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.2rem;
}
.map-chip-row::-webkit-scrollbar { display: none; }
.map-chip {
  appearance: none;
  white-space: nowrap;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  padding: 0.42rem 0.95rem;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.map-chip:hover { color: var(--text-primary); border-color: var(--border-strong); }
.map-chip.is-active {
  color: #fff;
  border-color: rgba(var(--accent-color-rgb), 0.8);
  box-shadow: var(--glow-accent);
  background: rgba(var(--accent-color-rgb), 0.18);
}

/* Venue info card */
.venue-info-card {
  position: fixed;
  z-index: 4;
  right: 1rem;
  top: 5.4rem;
  width: min(330px, calc(100vw - 2rem));
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--vic-accent, var(--accent-color));
}
.venue-info-card .vic-head { display: flex; align-items: center; gap: 0.7rem; }
.venue-info-card .vic-logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.venue-info-card .vic-name { margin: 0; font-size: 1.05rem; font-weight: 700; }
.venue-info-card .vic-meta { color: var(--text-secondary); font-size: 0.85rem; margin: 0.35rem 0 0; }
.venue-info-card .vic-tags { color: var(--secondary-color); font-size: 0.82rem; margin: 0.45rem 0 0; min-height: 1em; }
.venue-info-card .vic-link {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--vic-accent, var(--accent-color));
  color: #0b0c10;
  font-weight: 600;
  font-size: 0.88rem;
}
.venue-info-card .vic-close {
  position: absolute;
  top: 0.4rem; right: 0.6rem;
  appearance: none; background: none; border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
}

/* Crawlable fallback list: the 2D map page for tier 0 + crawlers.
   When the 3D city is live it stays in the DOM (search results reuse
   it) but visually condenses to a slide-up sheet. */
.map-fallback { padding-top: 1rem; }
body[data-city-active] .map-fallback {
  position: fixed;
  z-index: 3;
  left: 1rem;
  top: 5.4rem;
  width: min(300px, calc(100vw - 2rem));
  max-height: 46vh;
  overflow-y: auto;
  padding: 0.8rem 1rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  display: none;
}
body[data-city-active] .map-fallback.is-open { display: block; }
.map-fallback h2 { font-size: 0.95rem; margin: 0.8rem 0 0.3rem; color: var(--text-secondary); }
.map-fallback ul { list-style: none; margin: 0; padding: 0; }
.map-fallback li a { display: block; padding: 0.22rem 0; color: var(--text-primary); font-size: 0.9rem; }
.map-fallback li a:hover { color: var(--accent-color); }
.map-fallback li[hidden] { display: none; }
body[data-city-active] .map-intro { display: none; }

#map-list-toggle { display: none; }
body[data-city-active] #map-list-toggle { display: inline-block; }

/* ── Venue page: 3D block card ──────────────────────────────────────── */
.venue-block-3d {
  position: relative;
  height: 232px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-default);
  background:
    radial-gradient(ellipse at 50% 80%, rgba(var(--accent-color-rgb), 0.12), transparent 70%),
    var(--surface-color);
}
.venue-block-3d .vb3d-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}
.venue-block-3d.city-ready .vb3d-fallback { display: none; }
.venue-block-3d canvas { position: absolute; inset: 0; }
.venue-block-3d .vb3d-open {
  position: absolute;
  right: 0.6rem; bottom: 0.6rem;
  z-index: 2;
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  background: rgba(11, 12, 16, 0.72);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}
.venue-block-3d .vb3d-open:hover { border-color: rgba(var(--accent-color-rgb), 0.7); }

/* ── Neighborhood (district) pages ──────────────────────────────────── */
.district-hero { margin-bottom: 2rem; }
.district-hero-panel {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.2rem 1.6rem;
  text-align: center;
}
.district-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 0.7rem;
}
.district-map-link { font-size: 0.9rem; color: var(--accent-color); }
/* When the flyover is live, open up sky for the camera to play in and
   let the panel settle at the bottom of the viewport section. */
body[data-city-active][data-city-mode="district"] .district-hero {
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* District-page click feedback on venue cards. */
@keyframes city-flash-kf {
  0% { box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.9), var(--glow-accent); }
  100% { box-shadow: none; }
}
.city-flash { animation: city-flash-kf 1.6s var(--ease-out) 1; }

/* ── 404 “lost in the city” ─────────────────────────────────────────── */
.lost-page {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.2rem;
}
.lost-page h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 3.4rem);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
@media (prefers-reduced-motion: no-preference) {
  .lost-page h1 { animation: neon-flicker 4.2s infinite; }
}
@keyframes neon-flicker {
  0%, 100% { text-shadow: 0 0 14px rgba(var(--primary-color-rgb), 0.8), 0 0 52px rgba(var(--primary-color-rgb), 0.4); opacity: 1; }
  7% { opacity: 0.86; }
  9% { opacity: 1; }
  54% { text-shadow: 0 0 14px rgba(var(--primary-color-rgb), 0.8), 0 0 52px rgba(var(--primary-color-rgb), 0.4); }
  56% { text-shadow: 0 0 6px rgba(var(--primary-color-rgb), 0.4); opacity: 0.8; }
  58% { text-shadow: 0 0 14px rgba(var(--primary-color-rgb), 0.8), 0 0 52px rgba(var(--primary-color-rgb), 0.4); opacity: 1; }
}
.lost-page .lost-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center; }
.lost-page .lost-actions a {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: all 0.25s var(--ease-out);
}
.lost-page .lost-actions a:hover { border-color: rgba(var(--accent-color-rgb), 0.8); box-shadow: var(--glow-accent); }

/* ── Homepage: the city is a cinematic backdrop, not the map — this
      pill is the bridge to the real interactive experience. ─────────── */
.city-explore-pill {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 3;
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(var(--accent-color-rgb), 0.55);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--glow-accent);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.city-explore-pill:hover { transform: translateY(-2px); color: #fff; }
body[data-city-active][data-city-mode="hero"] .city-explore-pill { display: inline-flex; }

/* ── Tonight hero treatment when the city is live ───────────────────── */
body[data-city-active][data-city-mode="hero"] .tonight-count {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}
body[data-city-active][data-city-mode="hero"] .tonight-count-num {
  text-shadow: 0 0 14px rgba(var(--primary-color-rgb), 0.75), 0 0 44px rgba(var(--primary-color-rgb), 0.35);
}
body[data-city-active][data-city-mode="hero"] .tonight-hero {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* Mobile: tuck the info card above the bottom UI rather than the top. */
@media (max-width: 640px) {
  .venue-info-card { top: auto; bottom: 9.5rem; right: 1rem; }
  body[data-city-active] .map-fallback { top: auto; bottom: 9.5rem; max-height: 38vh; }
}
