@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --mint: #b8f6bb;
  --leaf: #46bf73;
  --forest: #07382d;
  --ink: #10221d;
  --muted: #587064;
  --line: rgba(11, 62, 45, 0.16);
  --panel: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --canvas: #e8f4ea;
  --glow: rgba(73, 205, 117, 0.32);
  --button: #0d3b2d;
  --button-text: #ffffff;
  --stage-top: #a8e4d8;
  --stage-bottom: #e8f8d0;
}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 6%, rgba(255, 255, 255, 0.82), transparent 30rem),
    radial-gradient(circle at 95% 30%, rgba(103, 213, 138, 0.18), transparent 34rem),
    var(--canvas);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  transition: color 220ms ease, background 220ms ease;
  -webkit-font-smoothing: antialiased;
}

/* Night palette: the globe's Night lighting (places.js toggles body.is-night) and
   the site-wide dark theme (the header toggle, :root[data-theme="dark"]) share it,
   so the page never shows light panels under a dark header. */
body.is-night, :root[data-theme="dark"] body {
  --mint: #b4ffce;
  --leaf: #80f2a8;
  --forest: #d8ffe5;
  --ink: #f2fff6;
  --muted: #acc9b6;
  --line: rgba(202, 255, 220, 0.18);
  --panel: rgba(11, 28, 31, 0.8);
  --surface-strong: #10282b;
  --canvas: #06131a;
  --glow: rgba(84, 243, 160, 0.34);
  --button: #99f5b5;
  --button-text: #062119;
  --stage-top: #061827;
  --stage-bottom: #120d2d;
  background:
    radial-gradient(circle at 15% 8%, rgba(44, 137, 102, 0.24), transparent 29rem),
    radial-gradient(circle at 85% 24%, rgba(86, 74, 194, 0.23), transparent 30rem),
    var(--canvas);
}

a { color: inherit; }

button, input, select { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--leaf);
  outline-offset: 3px;
}

.page-width {
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
}

.app-link, .reset-button, .load-more, .availability-button, .view-button, .mode-button {
  border: 0;
  font-weight: 760;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.app-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 20px;
  padding: 11px 18px;
  color: var(--button-text);
  background: var(--button);
  border-radius: 999px;
  font-size: 14px;
  text-decoration: none;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 58px 0 26px;
}

.hero-copy { max-width: 800px; }

.eyebrow {
  margin: 0 0 7px;
  color: var(--leaf);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 790px;
  margin-bottom: 14px;
  color: var(--forest);
  font-size: clamp(42px, 6vw, 78px);
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.hero-copy .hero-text {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.catalog-meta {
  min-width: 210px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(6, 49, 34, 0.08);
  text-align: right;
}

.catalog-meta strong, .catalog-meta span { display: block; }
.catalog-meta strong { color: var(--forest); font-size: 17px; }
.catalog-meta span { margin-top: 3px; color: var(--muted); font-size: 12px; }

.world-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(6, 49, 34, 0.16);
}

.world-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.button-group { display: inline-flex; gap: 5px; }

.view-button, .mode-button {
  min-height: 37px;
  padding: 8px 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
}

.view-button.is-active, .mode-button.is-active {
  color: var(--button-text);
  background: var(--button);
}

.app-link:hover, .reset-button:hover, .load-more:hover, .availability-button:hover, .view-button:hover, .mode-button:hover { transform: translateY(-1px); }

.world-stage {
  position: relative;
  /* Own stacking context: the leaflet panes (z 400-1000) and the caption (550)
     stay inside the stage instead of painting over the sticky site header (z 30). */
  isolation: isolate;
  min-height: clamp(440px, 59vw, 720px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 52%, rgba(202, 255, 209, 0.55), transparent 36%),
    linear-gradient(160deg, var(--stage-top), var(--stage-bottom));
}

body.is-night .world-stage {
  background:
    radial-gradient(circle at 16% 20%, rgba(117, 215, 177, 0.16), transparent 1px),
    radial-gradient(circle at 82% 34%, rgba(255, 255, 255, 0.8), transparent 1px),
    radial-gradient(circle at 74% 16%, rgba(255, 255, 255, 0.7), transparent 1px),
    radial-gradient(circle at 30% 48%, rgba(255, 255, 255, 0.76), transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(45, 128, 120, 0.35), transparent 42%),
    linear-gradient(160deg, var(--stage-top), var(--stage-bottom));
}

.globe, .map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.globe canvas { display: block; }

.map { background: #d5ebda; }

.world-caption, .map-status {
  position: absolute;
  z-index: 550;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 87%, transparent);
  box-shadow: 0 8px 20px rgba(6, 30, 22, 0.12);
  font-size: 12px;
  pointer-events: none;
}

.world-caption {
  top: 17px;
  left: 17px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--forest);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 0 var(--glow);
  animation: pulse 1.9s ease-out infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.map-status {
  right: 17px;
  bottom: 17px;
  max-width: calc(100% - 34px);
  color: var(--forest);
}

.directory-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.58fr) minmax(0, 1.42fr);
  gap: 18px;
  margin-top: 18px;
}

.filters-panel, .results-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 20px 55px rgba(6, 49, 34, 0.1);
}

.filters-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 24px;
}

.filters-panel h2, .results-header h2 {
  margin-bottom: 0;
  color: var(--forest);
  font-size: 27px;
  letter-spacing: -0.045em;
}

.control-field { display: block; }

.control-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

input, select {
  width: 100%;
  min-height: 45px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.time-filter {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--leaf) 34%, var(--line));
  border-radius: 15px;
  background: color-mix(in srgb, var(--leaf) 9%, transparent);
}

.availability-button, .reset-button, .load-more {
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 11px;
  font-size: 13px;
}

.availability-button {
  color: var(--forest);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.availability-button.is-active {
  color: var(--button-text);
  background: var(--button);
  border-color: var(--button);
}

.time-note, .location-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.location-note { margin-top: auto; }

.reset-button, .load-more {
  color: var(--button-text);
  background: var(--button);
}

.results-panel {
  display: flex;
  flex-direction: column;
  min-height: 530px;
  max-height: 630px;
}

.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 10px;
}

.result-count {
  color: var(--leaf);
  font-size: 15px;
  font-weight: 850;
}

.result-hint {
  min-height: 21px;
  margin: 0;
  padding: 0 24px 12px;
  color: var(--muted);
  font-size: 12px;
}

.results-list {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow: auto;
  margin: 0;
  padding: 0 16px 16px 38px;
}

.result-item { min-width: 0; }

.result-button {
  width: 100%;
  min-height: 80px;
  padding: 13px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
}

.result-button:hover, .result-button:focus-visible {
  border-color: color-mix(in srgb, var(--leaf) 66%, var(--line));
  background: color-mix(in srgb, var(--leaf) 12%, var(--surface-strong));
}

.result-name, .result-location, .result-meta { display: block; }
.result-name { min-width: 0; overflow: hidden; color: var(--forest); font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.result-location { margin-top: 3px; color: var(--muted); font-size: 11px; }
.result-meta { margin-top: 6px; color: var(--leaf); font-size: 10px; font-weight: 760; letter-spacing: 0.04em; text-transform: uppercase; }

.load-more { align-self: stretch; margin: 0 24px 22px; }

.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-strong); color: var(--ink); }
.leaflet-popup-content { min-width: 180px; }
.popup-name { margin: 0 0 4px; color: var(--forest); font-size: 15px; font-weight: 800; }
.popup-location, .popup-type, .popup-open { margin: 0; color: var(--muted); font-size: 12px; }
.popup-type, .popup-open { margin-top: 4px; }
.popup-open { color: var(--leaf); font-weight: 800; }

.you-are-here {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #1769e0;
  box-shadow: 0 0 0 5px rgba(23, 105, 224, 0.2);
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 42px;
  color: var(--muted);
  font-size: 12px;
}

.page-footer p { max-width: 620px; margin-bottom: 0; }

.world-toolbar { flex-wrap: wrap; row-gap: 8px; }

.region-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-right: auto;
}

.region-chip {
  min-height: 33px;
  padding: 6px 12px;
  color: var(--forest);
  background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.region-chip:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--leaf) 60%, var(--line)); }

.region-chip.is-near { border-color: color-mix(in srgb, #1769e0 46%, transparent); }

.region-chip.is-near.is-active {
  color: #ffffff;
  background: #1769e0;
  border-color: #1769e0;
}

.region-chip.is-near:disabled {
  opacity: 0.6;
  cursor: default;
}

.region-chip.is-near:disabled:hover { transform: none; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 11px 13px;
  border-top: 1px solid var(--line);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.legend-item:hover { color: var(--forest); border-color: color-mix(in srgb, var(--leaf) 60%, var(--line)); }

.legend-item.is-active {
  color: var(--button-text);
  background: var(--button);
  border-color: var(--button);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.legend-count { color: inherit; font-size: 11px; font-weight: 800; opacity: 0.72; }

.pin {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #53e58a;
  box-shadow: 0 1px 4px rgba(6, 30, 22, 0.45);
}

.pin-dispensary { background: #53e58a; }
.pin-cafe { background: #58c8ff; }
.pin-cannabis_social_club { background: #f2b84b; }
.pin-cbd_shop { background: #c88aff; }

body.is-night .pin { border-color: rgba(10, 26, 30, 0.85); }

.float-tooltip-kap { pointer-events: none; }

.globe-tip {
  display: grid;
  gap: 2px;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--tip-color, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  box-shadow: 0 14px 34px rgba(6, 30, 22, 0.3);
  color: var(--ink);
  font-size: 12px;
  text-align: left;
}

.globe-tip-name { color: var(--forest); font-size: 14px; font-weight: 820; }
.globe-tip-line { color: var(--muted); font-size: 11px; }

.globe-tip-state {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.globe-tip-state.is-open { color: var(--leaf); }

.popup-time { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.result-heading { display: flex; align-items: center; gap: 7px; min-width: 0; }

.result-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.result-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

.result-time { color: var(--muted); font-size: 10px; font-weight: 700; }

.result-pill {
  padding: 2px 7px;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-pill.is-open {
  color: var(--button-text);
  background: var(--leaf);
}

.noscript-note {
  margin: 24px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
}

.noscript-note p { margin: 0; }

@media (max-width: 960px) {
  .hero { align-items: start; flex-direction: column; padding-top: 40px; }
  .catalog-meta { width: 100%; text-align: left; }
  .directory-layout { grid-template-columns: 1fr; }
  .results-panel { min-height: 440px; max-height: 550px; }
}

@media (max-width: 620px) {
  .page-width { width: min(100% - 24px, 1400px); }
  .app-link { margin-top: 16px; padding: 10px 16px; font-size: 13px; }
  .hero { gap: 20px; padding: 34px 0 20px; }
  h1 { font-size: 45px; }
  .hero-copy .hero-text { font-size: 16px; }
  .world-shell { border-radius: 20px; }
  .region-chips { order: 3; width: 100%; margin-right: 0; }
  .legend { padding: 9px 11px; }
  .legend-item { padding: 5px 9px; font-size: 11px; }
  .world-stage { min-height: 480px; }
  .world-caption { top: 13px; left: 13px; }
  .map-status { right: 13px; bottom: 13px; }
  .filters-panel { padding: 19px; }
  .results-panel { min-height: 450px; }
  .results-list { grid-template-columns: 1fr; padding-left: 32px; }
  .page-footer { flex-direction: column; gap: 10px; }
}
