/* ───────────── Tokens ─────────────
   HalleluHere: "sunrise" palette. Gold → coral → rose over deep plum (dark) or warm cream (light).
   Theme follows the device unless the visitor picks one with the toggle (html[data-theme]). */
:root {
  --bg: #0f0a14;
  --bg-2: #150e1b;
  --surface: #1b1323;
  --surface-2: #241a2e;
  --line: rgba(255, 240, 230, 0.08);
  --line-strong: rgba(255, 240, 230, 0.16);
  --text: #fff4ea;
  --muted: #b3a2b4;
  --gold: #ffc14d;
  --ember: #ff6a3d;
  --rose: #ff4f8b;
  --violet: #9b7bff;
  --accent: var(--gold);
  --on-accent: #241005;
  --ok: #5fd4a0;
  --warn: #ffc14d;
  --glow-a: rgba(255, 193, 77, 0.42);
  --glow-b: rgba(255, 79, 139, 0.32);
  --glow-c: rgba(255, 106, 61, 0.36);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --sunrise: linear-gradient(120deg, var(--gold) 0%, var(--ember) 55%, var(--rose) 100%);
  --tiles-filter: invert(1) hue-rotate(200deg) brightness(.85) contrast(.9) saturate(.35);
  --radius: 20px;
  --radius-sm: 12px;
  --gutter: 16px;
  --maxw: 1180px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --font-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-accent: 'Instrument Serif', Georgia, serif;
  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fff8ef;
    --bg-2: #fbefe0;
    --surface: #ffffff;
    --surface-2: #fdf3e6;
    --line: rgba(42, 20, 40, 0.09);
    --line-strong: rgba(42, 20, 40, 0.18);
    --text: #22121f;
    --muted: #6e5a6a;
    --gold: #b36b00;
    --ember: #e04a2a;
    --rose: #d42f6c;
    --violet: #6b45d9;
    --on-accent: #ffffff;
    --ok: #12825a;
    --warn: #995c00;
    --glow-a: rgba(255, 187, 72, 0.55);
    --glow-b: rgba(255, 79, 139, 0.22);
    --glow-c: rgba(255, 106, 61, 0.30);
    --shadow: 0 20px 40px -24px rgba(90, 40, 20, 0.35);
    --tiles-filter: none;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #fff8ef;
  --bg-2: #fbefe0;
  --surface: #ffffff;
  --surface-2: #fdf3e6;
  --line: rgba(42, 20, 40, 0.09);
  --line-strong: rgba(42, 20, 40, 0.18);
  --text: #22121f;
  --muted: #6e5a6a;
  --gold: #b36b00;
  --ember: #e04a2a;
  --rose: #d42f6c;
  --violet: #6b45d9;
  --on-accent: #ffffff;
  --ok: #12825a;
  --warn: #995c00;
  --glow-a: rgba(255, 187, 72, 0.55);
  --glow-b: rgba(255, 79, 139, 0.22);
  --glow-c: rgba(255, 106, 61, 0.30);
  --shadow: 0 20px 40px -24px rgba(90, 40, 20, 0.35);
  --tiles-filter: none;
  color-scheme: light;
}

/* ───────────── Base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* ───────────── Buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease-out), background .25s, border-color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-ghost { background: transparent; }
.btn-primary {
  border: 0; color: var(--on-accent);
  background: var(--sunrise);
  box-shadow: 0 10px 30px -10px var(--glow-c);
}
.btn-primary:hover { box-shadow: 0 14px 36px -10px var(--glow-c); }

/* ───────────── Top bar ───────────── */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px var(--gutter);
  padding-top: max(14px, env(safe-area-inset-top));
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 30px; height: 30px; filter: drop-shadow(0 4px 12px var(--glow-c)); animation: bob 4s ease-in-out infinite; }
.brand-name { font-family: var(--font-display); font-weight: 750; font-size: 22px; letter-spacing: -0.035em; line-height: 1; }
.brand-name em {
  font-family: var(--font-accent); font-style: italic; font-weight: 400; font-size: 1.12em; letter-spacing: -0.01em;
  background: var(--sunrise); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.mark-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

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

/* Theme toggle */
.theme-toggle {
  position: relative; width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text);
  backdrop-filter: blur(8px);
  transition: transform .3s var(--ease-out), border-color .3s;
}
.theme-toggle:hover { transform: rotate(-12deg); border-color: var(--accent); }
.theme-toggle .i { position: absolute; width: 20px; height: 20px; transition: transform .5s var(--ease-out), opacity .3s; }
.theme-toggle .sun { color: var(--gold); }
.theme-toggle .moon { color: var(--violet); }
:root[data-active-theme="dark"] .theme-toggle .moon,
:root[data-active-theme="light"] .theme-toggle .sun { opacity: 0; transform: rotate(-90deg) scale(.4); }

/* ───────────── Hero ───────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 40px 0 0;
  margin-top: -72px; padding-top: 112px;
  isolation: isolate;
}
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 500;
  backdrop-filter: blur(8px);
  animation: fadeUp .8s var(--ease-out) both;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok); animation: ping 2s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  80%, 100% { box-shadow: 0 0 0 8px transparent; }
}

h1 {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: clamp(46px, 11.5vw, 116px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  margin: 0;
  max-width: 11ch;
}
h1 em {
  font-family: var(--font-accent); font-style: italic; font-weight: 400; letter-spacing: -0.02em;
  background: var(--sunrise); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .08em;
}

/* Word-by-word mask reveal */
.reveal .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.reveal .w > span {
  display: inline-block;
  transform: translateY(105%);
  animation: rise 1s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0) * 90ms + 120ms);
}
@keyframes rise { to { transform: translateY(0); } }

.hero-sub {
  max-width: 46ch; margin: 22px 0 0;
  color: var(--muted); font-size: clamp(16px, 2.2vw, 19px);
  animation: fadeUp 1s var(--ease-out) .6s both;
}

/* Ambient light blobs */
.glow { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .9; pointer-events: none; }
.glow-1 { width: 60vmax; height: 60vmax; left: -20vmax; top: -25vmax; background: radial-gradient(closest-side, var(--glow-a), transparent); animation: drift1 18s ease-in-out infinite alternate; }
.glow-2 { width: 50vmax; height: 50vmax; right: -18vmax; top: -10vmax; background: radial-gradient(closest-side, var(--glow-b), transparent); animation: drift2 22s ease-in-out infinite alternate; }
.glow-3 { width: 36vmax; height: 36vmax; left: 30%; top: 30%; background: radial-gradient(closest-side, var(--glow-c), transparent); animation: drift3 26s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vmax, 8vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vmax, 12vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(-12vmax, -6vmax) scale(1.2); } }

.grain {
  position: absolute; inset: -50%; z-index: -1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* City marquee */
.marquee {
  margin-top: 44px; padding: 16px 0;
  border-block: 1px solid var(--line);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee-track span {
  font-family: var(--font-accent); font-style: italic; font-size: clamp(24px, 4.4vw, 38px);
  padding: 0 22px; color: var(--muted); white-space: nowrap;
}
.marquee-track span::after { content: '✦'; font-style: normal; font-size: .5em; color: var(--gold); margin-left: 44px; vertical-align: middle; }
@keyframes marquee { to { transform: translateX(-50%); } }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ───────────── Controls (sticky) ───────────── */
.controls {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.controls-inner { max-width: var(--maxw); margin: 0 auto; padding: 12px var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }

.search {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.search > .i { position: absolute; left: 14px; color: var(--muted); }
.search input {
  width: 100%; min-height: 50px; padding: 0 48px 0 44px;
  background: transparent; border: 0; outline: 0; font-size: 16px;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 4px; width: 44px; height: 44px;
  display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 12px;
}

/* City chips with sliding indicator */
.chips-wrap { margin: 0 calc(var(--gutter) * -1); }
.chips {
  position: relative; display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  padding: 2px var(--gutter);
  scroll-padding-inline: var(--gutter);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  position: relative; z-index: 1; flex: none;
  min-height: 40px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color .3s, border-color .3s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-selected="true"] { color: var(--on-accent); border-color: transparent; }
.chip .n { font-size: 11px; font-weight: 600; opacity: .7; font-variant-numeric: tabular-nums; }
.chip-indicator {
  position: absolute; z-index: 0; top: 2px; left: 0; height: 40px; width: 0;
  border-radius: 999px;
  background: var(--sunrise);
  box-shadow: 0 6px 20px -6px var(--glow-c);
  transition: transform .45s var(--ease-out), width .45s var(--ease-out);
}

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }

.seg, .view-toggle {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.seg { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.row-end { display: flex; gap: 8px; align-items: center; min-width: 0; max-width: 100%; }
.row-end .seg { flex: 1 1 auto; min-width: 0; }
.row-end .view-toggle { flex: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .view-toggle button, .date-pick {
  flex: none; position: relative;
  min-height: 36px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background .25s, color .25s;
}
.seg button:hover, .view-toggle button:hover, .date-pick:hover { color: var(--text); }
.seg [aria-pressed="true"], .view-toggle [aria-pressed="true"], .date-pick.active {
  background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.date-pick { cursor: pointer; }
.date-pick input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%;
}
.date-pick .i { width: 16px; height: 16px; }
.view-toggle .i { width: 16px; height: 16px; }

/* ───────────── Results ───────────── */
.results { max-width: var(--maxw); margin: 0 auto; padding: 18px var(--gutter) 64px; min-height: 60vh; }
.result-count { margin: 0 0 6px; color: var(--muted); font-size: 14px; }

.day { margin-top: 26px; }
.day-head {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.03em;
}
.day-head::after { content: ''; flex: 1; height: 1px; background: var(--line); transform: translateY(-6px); }
.day-head small { font-family: var(--font-ui); font-size: 13px; color: var(--muted); font-weight: 500; }

.grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }

/* Event card */
.card {
  position: relative;
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 20px; gap: 14px; align-items: start;
  padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: inherit;
  opacity: 0; animation: fadeUp .6s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .35s var(--ease-out), border-color .35s, box-shadow .35s;
}
.card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, var(--gold), transparent 40%, transparent 60%, var(--rose));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card:hover::before, .card:focus-visible::before { opacity: 1; }
.card:hover .arrow, .card:focus-visible .arrow { transform: translateX(4px); color: var(--accent); }

.ticket {
  display: grid; place-items: center; align-content: center; gap: 0;
  height: 76px; border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 22%, var(--surface-2)), var(--surface-2));
  border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent);
  text-align: center; line-height: 1;
}
.ticket .t-mon { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.ticket .t-day { font-family: var(--font-display); font-size: 30px; font-weight: 750; letter-spacing: -0.04em; margin: 4px 0 2px; }
.ticket .t-wd { font-size: 11px; color: var(--muted); font-weight: 500; }
.ticket.tbc .t-day { font-size: 18px; margin: 6px 0; }

.card-body { min-width: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.card h3 {
  margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.2; letter-spacing: -0.025em;
}
.card p { margin: 0; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.card p .i { width: 14px; height: 14px; }
.card p span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .venue { color: var(--text); font-weight: 500; }
.arrow { align-self: center; color: var(--muted); transition: transform .3s var(--ease-out), color .3s; }
.arrow .i { width: 20px; height: 20px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.tag.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.tag.type { color: var(--text); border-color: transparent; }
.tag.type-worship-night { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.tag.type-concert { background: color-mix(in srgb, var(--rose) 20%, transparent); }
.tag.type-prayer-worship { background: color-mix(in srgb, var(--violet) 22%, transparent); }
.tag.type-conference, .tag.type-service, .tag.type-other { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.type-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.type-dot.type-worship-night { background: var(--gold); }
.type-dot.type-concert { background: var(--rose); }
.type-dot.type-prayer-worship { background: var(--violet); }
.tag.rec { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 35%, transparent); background: color-mix(in srgb, var(--violet) 10%, transparent); }

/* Skeleton */
.skeletons { display: grid; gap: 12px; margin-top: 26px; }
.skeleton {
  height: 106px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 5%, transparent), transparent);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Empty state */
.empty {
  margin-top: 26px; padding: 44px 20px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  animation: fadeUp .6s var(--ease-out) both;
}
.empty .mark { width: 52px; height: 52px; margin: 0 auto 12px; filter: drop-shadow(0 6px 16px var(--glow-c)); animation: bob 4s ease-in-out infinite; }
.empty h2 { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.03em; margin: 0 0 6px; }
.empty p { color: var(--muted); margin: 0 auto 18px; max-width: 40ch; }
.empty .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ───────────── Ads ───────────── */
.ad {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  padding: 26px 12px 12px; min-height: 106px;
}
.ad-label {
  position: absolute; top: 8px; left: 12px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.ad ins { min-height: 68px; }
.ad-preview {
  display: grid; place-items: center; color: var(--muted); font-size: 13px;
  border-style: dashed; border-color: var(--line-strong);
  background: repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in srgb, var(--text) 3%, transparent) 12px 24px);
}
.ad-footer { margin: 0 0 28px; min-height: 120px; }
.ad-detail { margin-top: 22px; }

/* ───────────── Map view ───────────── */
.map-view { margin-top: 14px; }
.map-frame {
  position: relative; height: 70vh; min-height: 380px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  animation: fadeUp .5s var(--ease-out) both;
}
#map { position: absolute; inset: 0; background: var(--surface); }
.map-back {
  position: absolute; z-index: 500; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); border: 0; box-shadow: var(--shadow);
}
.map-back:hover { transform: translateX(-50%) translateY(-2px); }
.map-note { color: var(--muted); font-size: 13.5px; margin: 10px 2px 0; }

.pin { position: relative; }
.pin-dot {
  position: absolute; inset: 6px; border-radius: 50%;
  background: var(--sunrise);
  border: 2px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  display: grid; place-items: center;
  color: #1a1206; font: 700 11px/1 var(--font-ui);
}
.pin-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--glow-c); animation: pulse 2.2s var(--ease-out) infinite;
}
.pin.approx .pin-dot { border-style: dashed; }
@keyframes pulse {
  0% { transform: scale(.6); opacity: .9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.leaflet-container { font-family: var(--font-ui); background: var(--surface); }
/* Night-mode map: dark theme inverts the standard OSM tiles (see --tiles-filter). */
.leaflet-tile-pane { filter: var(--tiles-filter); }
.leaflet-popup-content-wrapper {
  background: var(--surface); color: var(--text);
  border-radius: 16px; border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 14px 16px; min-width: 210px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.pop + .pop { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pop strong { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 2px; }
.pop span { display: block; color: var(--muted); font-size: 13px; }
.pop a { display: inline-flex; margin-top: 8px; font-weight: 600; font-size: 13px; color: var(--gold); text-decoration: none; }
.pop a:hover { text-decoration: underline; }

/* ───────────── Detail sheet ───────────── */
.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(5, 4, 10, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .4s;
}
.scrim.show { opacity: 1; }

.sheet {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  max-height: 92dvh; height: 92dvh;
  background: var(--bg-2); border-top: 1px solid var(--line-strong);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .6);
  transform: translateY(100%);
  transition: transform .55s var(--ease-sheet);
  display: flex; flex-direction: column;
}
.sheet.open { transform: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 10px auto 0; flex: none; }
.sheet-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: transform .3s var(--ease-out);
}
.sheet-close:hover { transform: rotate(90deg); }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 14px var(--gutter) calc(32px + env(safe-area-inset-bottom));
}
.sheet-body > * { animation: fadeUp .6s var(--ease-out) both; }
.sheet-body > *:nth-child(2) { animation-delay: .05s; }
.sheet-body > *:nth-child(3) { animation-delay: .1s; }
.sheet-body > *:nth-child(4) { animation-delay: .15s; }
.sheet-body > *:nth-child(n+5) { animation-delay: .2s; }

.d-tags { display: flex; flex-wrap: wrap; gap: 6px; padding-right: 52px; margin-top: 8px; }
.d-title {
  font-family: var(--font-display); font-weight: 750;
  font-size: clamp(30px, 7vw, 40px); line-height: 1.02; letter-spacing: -0.04em;
  margin: 12px 0 4px;
}
.d-host { margin: 0; color: var(--muted); }

.facts { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 2px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 14px; background: var(--surface); }
.facts .i { color: var(--gold); margin-top: 2px; }
.facts b { display: block; font-weight: 600; }
.facts small { display: block; color: var(--muted); font-size: 14px; }

.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions-row .btn-primary { grid-column: 1 / -1; }
.actions-row .btn { width: 100%; min-width: 0; padding: 0 12px; }

.mapbox {
  margin-top: 20px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); position: relative;
}
.mapbox iframe { width: 100%; height: 240px; border: 0; }
.mapbox .note { margin: 0; padding: 10px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

.d-section { margin-top: 24px; }
.d-section h3 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.d-section p { margin: 0; }
.contact { display: grid; gap: 8px; }
.contact > * {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; overflow: hidden;
  transition: border-color .25s;
}
.contact a:hover { border-color: var(--accent); }
.contact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact .i { color: var(--gold); }

.d-disclaimer {
  margin-top: 24px; padding: 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
  font-size: 13.5px; color: var(--muted);
  display: grid; grid-template-columns: 20px 1fr; gap: 10px;
}
.d-disclaimer .i { color: var(--warn); width: 18px; height: 18px; margin-top: 1px; }
.d-disclaimer p { margin: 0; }
.d-disclaimer a { color: var(--text); font-weight: 600; }

/* ───────────── Footer ───────────── */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 48px var(--gutter) calc(32px + env(safe-area-inset-bottom)); }
.footer-cta { margin-bottom: 36px; }
.footer-cta h2 { font-family: var(--font-display); font-weight: 750; font-size: clamp(28px, 6vw, 48px); letter-spacing: -0.045em; line-height: 1.05; margin: 0 0 10px; max-width: 18ch; }
.footer-cta p { color: var(--muted); margin: 0 0 20px; max-width: 48ch; }
.disclaimer { font-size: 13px; color: var(--muted); max-width: 80ch; margin: 0 0 24px; }
.disclaimer strong { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ───────────── Toast ───────────── */
.toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 12px 18px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn .4s var(--ease-out);
  max-width: calc(100vw - 32px); text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ───────────── View transitions ───────────── */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
/* Theme switch: the new theme grows out of the toggle as a circle (driven from app.js). */
:root.theme-vt::view-transition-old(root),
:root.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root.theme-vt::view-transition-new(root) { z-index: 1; }

/* ───────────── Breakpoints ───────────── */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skeletons { grid-template-columns: repeat(2, 1fr); }
  .controls-inner { gap: 12px; }
  .mapbox iframe { height: 280px; }
}

@media (min-width: 1024px) {
  :root { --gutter: 32px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .skeletons { grid-template-columns: repeat(3, 1fr); }
  .hero { padding-top: 140px; }
  .hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; align-items: end; gap: 40px; }
  .hero-inner .eyebrow { grid-column: 1 / -1; justify-self: start; }
  .hero-sub { margin-bottom: 10px; }
  .map-frame { height: 72vh; }
  .map-back { display: none; }

  .sheet {
    left: auto; top: 0; bottom: 0; right: 0;
    width: min(520px, 92vw); height: 100dvh; max-height: none;
    border-radius: 24px 0 0 24px; border-top: 0; border-left: 1px solid var(--line-strong);
    transform: translateX(100%);
  }
  .sheet-handle { display: none; }
  .sheet-body { padding: 28px 32px 40px; }
}

/* ───────────── Reduced motion ───────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal .w > span { transform: none; }
  .card { opacity: 1; }
  .grain, .glow { animation: none !important; }
  .marquee-track { animation: none !important; }
}
