#map-story {
  --map-earth: var(--marrom, #572c08);
  --map-paper: var(--off-white, #fdfaF5);
  --map-ink: var(--text-body, #4a3520);
  --map-muted: var(--text-muted, #8a7060);
  color: var(--map-ink);
  background: var(--map-paper);
  font-family: var(--font-sans, "Manrope", system-ui, sans-serif);
  line-height: 1.5;
}

#map-story,
#map-story *,
#map-story *::before,
#map-story *::after {
  box-sizing: border-box;
}

.map-story__intro {
  min-height: 250px;
  display: grid;
  align-content: center;
  padding: 44px 24px;
  background: var(--map-paper);
}

.map-story__intro-inner {
  width: min(100%, 1160px);
  margin: 0 auto;
}

.map-story__eyebrow {
  margin: 0 0 12px;
  color: var(--caramelo, #b58850);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.18em;
}

.map-story__intro h1,
.map-story__intro h2 {
  max-width: 920px;
  margin: 0;
  color: var(--map-earth);
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-size: clamp(2.1rem, 2.35vw, 2.65rem);
  font-weight: 600;
  line-height: 1.18;
}

.map-story__lead {
  margin: 14px 0 0;
  max-width: 560px;
  color: var(--map-muted);
  font-size: var(--text-md, 1.125rem);
  font-weight: 300;
  line-height: 1.75;
}

.map-story__note {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--map-muted);
  font-size: 0.75rem;
}

.map-story__stage {
  position: relative;
  height: 620vh;
  background: var(--map-paper);
}

.map-scene {
  position: sticky;
  top: var(--header-h, 0px);
  height: calc(100vh - var(--header-h, 0px));
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--map-paper);
}

.map-scene__canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--map-paper);
}

.map-scene__canvas .leaflet-tile {
  filter: saturate(0.52) contrast(0.91) brightness(1.035);
}

.map-scene__topline {
  position: absolute;
  z-index: 500;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.map-scene__brand,
.map-scene__counter {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(87, 44, 8, 0.12);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 22px rgba(41, 37, 31, 0.08);
  color: var(--map-earth);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.map-scene__counter {
  min-width: 82px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.map-scene__cards {
  position: absolute;
  z-index: 650;
  bottom: 32px;
  left: max(24px, calc((100vw - 1160px) / 2));
  width: min(342px, calc(100vw - 48px));
  height: 280px;
  pointer-events: none;
}

.map-destination-card {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid rgba(87, 44, 8, 0.1);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 52px rgba(38, 34, 28, 0.2);
  opacity: 0;
  transform: translateY(14px);
  will-change: opacity, transform;
}

.map-destination-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.map-destination-card__image {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: cover;
  background: var(--map-paper);
}

.map-destination-card__body {
  padding: 14px 18px 17px;
}

.map-destination-card__eyebrow {
  margin: 0 0 3px;
  color: var(--map-earth);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.map-destination-card h3 {
  margin: 0;
  color: var(--map-earth);
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-size: var(--text-lg, 1.25rem);
  font-weight: 600;
  line-height: 1.3;
}

.map-destination-card__distance {
  margin: 6px 0 0;
  color: var(--map-muted);
  font-size: 0.78rem;
}

.map-destination-card__distance strong {
  color: var(--map-earth);
  font-weight: 700;
}

.map-photo-icon,
.map-home-icon {
  border: 0;
  background: transparent;
}

.map-photo-marker {
  display: grid;
  width: 70px;
  height: 70px;
  padding: 4px;
  overflow: hidden;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(34, 28, 20, 0.28);
  opacity: 0;
  transform: scale(0);
  transform-origin: center;
  will-change: transform, opacity;
}

.leaflet-container .leaflet-marker-pane .map-photo-marker img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 50%;
  object-fit: cover;
}

.map-home-marker {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
}

.map-home-marker__pulse,
.map-home-marker__core {
  position: absolute;
  border-radius: 50%;
}

.map-home-marker__pulse {
  inset: 0;
  border: 1px solid rgba(87, 44, 8, 0.45);
  background: rgba(87, 44, 8, 0.09);
  animation: map-home-pulse 2.8s ease-out infinite;
}

.map-home-marker__core {
  display: grid;
  width: 48px;
  height: 48px;
  overflow: hidden;
  place-items: center;
  border: 3px solid #fff;
  box-shadow: 0 5px 18px rgba(34, 28, 20, 0.32);
}

.leaflet-container .leaflet-marker-pane .map-home-marker__core img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 50%;
  object-fit: cover;
}

.map-scene__canvas .leaflet-control-attribution {
  margin: 0 8px 8px 0;
  padding: 3px 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--map-muted);
  font-size: 9px;
}

.map-scene__canvas .leaflet-control-attribution a {
  color: var(--map-earth);
}

.map-scene__canvas .leaflet-interactive {
  cursor: default;
}

.map-story__stage.is-static .map-destination-card {
  display: none;
}

.map-story__stage.is-static .map-destination-card.is-visible {
  display: block;
}

@keyframes map-home-pulse {
  0% { transform: scale(0.78); opacity: 0.7; }
  75%, 100% { transform: scale(1.25); opacity: 0; }
}

@media (max-width: 700px) {
  .map-story__intro {
    min-height: 226px;
    padding: 34px 22px;
  }

  .map-story__intro h1,
  .map-story__intro h2 {
    max-width: 100%;
    font-size: clamp(1.65rem, 4.2vw, 2.1rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
  }

  .map-story__lead {
    max-width: 330px;
    font-size: 1rem;
    line-height: 1.65;
  }

  .map-story__note {
    max-width: 340px;
    font-size: 0.68rem;
  }

  .map-story__stage {
    height: 560vh;
  }

  .map-scene {
    height: 100vh;
    height: 100svh;
    min-height: 480px;
  }

  .map-scene__topline {
    top: 14px;
    left: 14px;
    right: 14px;
  }

  .map-scene__brand,
  .map-scene__counter {
    min-height: 36px;
    padding: 0 11px;
    font-size: 0.6rem;
  }

  .map-scene__cards {
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 50%;
    right: auto;
    width: min(290px, calc(100vw - 24px));
    height: 206px;
    transform: translateX(-50%);
  }

  .map-destination-card {
    border-radius: 14px;
  }

  .map-destination-card__image {
    height: 98px;
  }

  .map-destination-card__body {
    padding: 10px 13px 12px;
  }

  .map-destination-card h3 {
    font-size: 1.15rem;
  }

  .map-destination-card__distance {
    font-size: 0.7rem;
  }

  .map-photo-marker {
    width: 50px;
    height: 50px;
    padding: 3px;
  }

  .map-home-marker {
    width: 66px;
    height: 66px;
  }

  .map-home-marker__core {
    width: 42px;
    height: 42px;
  }

}

@media (max-width: 768px) {
  .map-scene {
    top: 0;
    height: 100vh;
    height: 100svh;
  }
}

@media (max-width: 560px) {
  .map-story__intro h1,
  .map-story__intro h2 {
    font-size: clamp(1.44rem, 6.1vw, 1.65rem);
    line-height: 1.22;
    letter-spacing: -0.015em;
  }

  .map-story__lead {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .map-destination-card h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 360px) {
  .map-story__intro h1,
  .map-story__intro h2 {
    font-size: 1.38rem;
  }

  .map-story__lead {
    font-size: 0.875rem;
    line-height: 1.55;
  }

  .map-destination-card h3 {
    font-size: 1.05rem;
  }
}

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