:root {
  color-scheme: light;
  --bg: #f4efe6;
  --bg-accent: #efe4d3;
  --surface: rgba(255, 252, 247, 0.8);
  --surface-strong: #fffaf2;
  --text: #1f2b24;
  --muted: #5f6f66;
  --line: rgba(31, 43, 36, 0.12);
  --brand: #1f6b5c;
  --brand-soft: #d5ece4;
  --shadow: 0 24px 60px rgba(68, 52, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 132, 113, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(201, 129, 73, 0.16), transparent 26%),
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 44%, #f8f4ed 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 80%);
}

.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 560px);
  gap: 2rem;
  align-items: center;
  padding: 2rem 0 2.5rem;
}

.hero-content {
  min-width: 0;
}

.eyebrow,
.section-label {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

h1,
h2 {
  font-family: "Fraunces", serif;
  letter-spacing: -0.03em;
  margin: 0;
}

h1 {
  max-width: 8ch;
  font-size: clamp(3.25rem, 7vw, 6rem);
  line-height: 0.94;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
}

.hero-copy,
.card p,
.status-text,
.source-link,
.button-link,
.map-copy {
  font-size: 1.02rem;
  line-height: 1.75;
}

.hero-copy {
  max-width: 62ch;
  margin: 1.4rem 0 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-media {
  margin: 0;
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: auto 8% -6% auto;
  width: 72%;
  height: 26%;
  border-radius: 999px;
  background: rgba(31, 107, 92, 0.16);
  filter: blur(30px);
  z-index: 0;
}

.hero-image {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 560px;
  height: auto;
  border-radius: 32px;
  border: 1px solid rgba(31, 43, 36, 0.08);
  background: transparent;
  box-shadow: 0 28px 60px rgba(68, 52, 28, 0.16);
}

.layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.2rem;
}

.card {
  grid-column: span 6;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.card-highlight {
  grid-column: span 12;
  background:
    linear-gradient(135deg, rgba(31, 107, 92, 0.08), rgba(255, 250, 242, 0.9)),
    var(--surface-strong);
}

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

.status-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.status-text {
  max-width: 60ch;
  margin: 1rem 0 0;
  color: var(--muted);
}

.spinner {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 3px solid rgba(31, 107, 92, 0.18);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

.spinner.is-hidden {
  visibility: hidden;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
}

.stat {
  padding: 1.1rem 1.2rem;
  border-radius: 22px;
  background: var(--brand-soft);
}

.stat dt {
  font-size: 0.9rem;
  color: rgba(31, 43, 36, 0.75);
}

.stat dd {
  margin: 0.4rem 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.source-link:hover,
.source-link:focus-visible {
  text-decoration: underline;
}

.source-link-secondary {
  margin-left: 1rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: var(--brand);
  color: #f7f4ed;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 36px rgba(31, 107, 92, 0.18);
}

.button-link:hover,
.button-link:focus-visible {
  background: #15584b;
}

.map-page {
  overflow: hidden;
  background: #d8e6df;
}

.map-page::before {
  display: none;
}

.map-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#map {
  width: 100%;
  height: 100%;
  background: #d7e8df;
}

.map-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 500;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1rem 1.05rem;
  border: 1px solid rgba(31, 43, 36, 0.1);
  border-radius: 22px;
  background: rgba(255, 250, 242, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.map-heading {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: none;
}

.map-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0.85rem 0 0;
}

.map-stat {
  padding: 0.82rem 0.9rem;
  border-radius: 18px;
  background: var(--brand-soft);
}

.map-stat dt {
  font-size: 0.88rem;
  color: rgba(31, 43, 36, 0.78);
}

.map-stat dd {
  margin: 0.35rem 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1;
}

.map-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.map-actions .button-link {
  min-height: 2.5rem;
  padding: 0.52rem 0.9rem;
  font-size: 0.92rem;
  line-height: 1.2;
}

.leaflet-marker-icon {
  filter: drop-shadow(0 10px 18px rgba(9, 90, 185, 0.24));
}

.fountain-cluster {
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  color: #ffffff;
  font-family: "Manrope", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(9, 90, 185, 0.22);
}

.fountain-cluster span {
  display: inline-block;
  line-height: 1;
}

.fountain-cluster.cluster-small {
  width: 40px;
  height: 40px;
  background: linear-gradient(180deg, #59a4ff, #0f6ddf);
}

.fountain-cluster.cluster-medium {
  width: 46px;
  height: 46px;
  background: linear-gradient(180deg, #2d89f7, #095ab9);
}

.fountain-cluster.cluster-large {
  width: 52px;
  height: 52px;
  background: linear-gradient(180deg, #0f6ddf, #003f8f);
}

.locate-control {
  margin-bottom: 0.75rem;
}

.locate-control-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: #ffffff;
  color: #0f6ddf;
  cursor: pointer;
}

.locate-control-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.locate-control-button:hover,
.locate-control-button:focus-visible {
  background: #f3f8ff;
}

.locate-control-button:disabled {
  cursor: progress;
}

.locate-control-button.is-loading {
  color: #7aaef0;
}

.leaflet-popup-content {
  margin: 0.85rem 1rem;
}

.map-popup h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.35;
}

.map-popup p {
  margin: 0.28rem 0;
  font-size: 0.94rem;
  line-height: 1.45;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 840px) {
  .page-shell {
    width: min(100% - 1.25rem, 1120px);
    padding: 1.25rem 0 2.5rem;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 1rem 0 1.75rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-media {
    order: -1;
  }

  .hero-image {
    width: min(100%, 32rem);
    max-height: none;
    margin: 0 auto;
  }

  .card,
  .card-highlight {
    grid-column: span 12;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .source-link-secondary {
    display: block;
    margin-left: 0;
  }

  .map-overlay {
    top: auto;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .map-stats {
    grid-template-columns: 1fr;
  }
}
