:root {
  color-scheme: light;
  --ink: #15251e;
  --paper: #f5f3ea;
  --glass: rgba(246, 245, 238, 0.88);
  --glass-border: rgba(255, 255, 255, 0.72);
  --active: #143b2b;
  --active-text: #f8f6ef;
  --shadow: rgba(17, 37, 28, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #d8e2dc;
}

body {
  font-family: "Avenir Next", Avenir, "Century Gothic", Futura, sans-serif;
  color: var(--ink);
}

button {
  font: inherit;
}

.app,
.map,
.map-shade {
  position: fixed;
  inset: 0;
}

.app {
  min-height: 100dvh;
  isolation: isolate;
  background: #d8e2dc;
}

.map {
  z-index: 0;
}

.map-shade {
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(15, 34, 26, 0.3) 0, transparent 22%),
    linear-gradient(0deg, rgba(15, 34, 26, 0.2) 0, transparent 25%),
    radial-gradient(circle at 50% 42%, transparent 36%, rgba(22, 40, 31, 0.08) 100%);
}

.title-wrap {
  position: fixed;
  z-index: 2;
  top: max(22px, env(safe-area-inset-top));
  left: 50%;
  width: min(92vw, 760px);
  transform: translateX(-50%);
  color: #f7f5ee;
  text-align: center;
  text-shadow: 0 2px 18px rgba(8, 24, 17, 0.42);
  pointer-events: none;
}

.title-kicker {
  margin: 0 0 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5.5vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.view-switcher {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 14px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(calc(100vw - 32px), 310px);
  padding: 5px;
  transform: translateX(-50%);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  box-shadow:
    0 14px 36px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.view-button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #284137;
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    color 220ms ease,
    background-color 220ms ease,
    transform 120ms ease;
}

.view-button:hover {
  background: rgba(20, 59, 43, 0.08);
}

.view-button:active {
  transform: scale(0.97);
}

.view-button:focus-visible {
  outline: 3px solid #f7f5ee;
  outline-offset: 3px;
}

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

.view-button.is-active:hover {
  background: #0f3224;
}

.map-error {
  position: fixed;
  z-index: 5;
  inset: 50% auto auto 50%;
  margin: 0;
  padding: 14px 18px;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 30px var(--shadow);
  color: var(--ink);
  text-align: center;
}

.maplibregl-control-container {
  position: relative;
  z-index: 2;
}

.maplibregl-ctrl-bottom-left {
  left: max(8px, env(safe-area-inset-left));
  bottom: max(6px, env(safe-area-inset-bottom));
}

.maplibregl-ctrl-attrib {
  max-width: calc(100vw - 16px);
  border-radius: 5px;
  background: rgba(247, 246, 240, 0.76) !important;
  color: #253c32;
  font-size: 9px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.maplibregl-ctrl-attrib a {
  color: inherit;
}

.maplibregl-ctrl-attrib.maplibregl-compact {
  min-height: 24px;
}

.maplibregl-ctrl-attrib.maplibregl-compact-show {
  max-width: min(88vw, 760px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .title-wrap {
    top: max(18px, env(safe-area-inset-top));
  }

  .title-kicker {
    font-size: 0.6rem;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 3.15rem);
  }

  .view-switcher {
    width: min(calc(100vw - 28px), 292px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .view-button {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .view-switcher,
  .maplibregl-ctrl-attrib {
    background: #f4f2e9 !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
