:root {
  /* Relaxing Pastel / Earthy Palette - "Golden Hour" Theme */
  --background-color: #f9f7f2; /* Soft Warm Cream */
  --panel-background: rgba(255, 255, 255, 0.65); /* More translucent for better glass effect */
  --text-primary: #2a2622; /* Rich Charcoal */
  --text-secondary: #6b635b; /* Warm Stone */
  --accent-color: #c87955; /* Soft Terracotta - Darkened for AA Contrast */
  --accent-secondary: #8da88b; /* Muted Sage - Darkened */
  --accent-tertiary: #ebe0d6; /* Warm Sand */
  --accent-quaternary: #b0a08a; /* Taupe - Darkened for UI elements */
  --highlight-color: #f4ddb0; /* Muted Gold */
  --shadow-color: rgba(42, 38, 34, 0.06);

  /* Gradients */
  --gradient-overlay: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(249, 247, 242, 1) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-highlight: rgba(255, 255, 255, 0.8);

  /* Typography - Fluid */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Poppins', sans-serif;
  --h1-size: clamp(3.5rem, 8vw, 9rem);
  --h2-size: clamp(2rem, 4vw, 4rem);
  --p-size: clamp(1rem, 1.5vw, 1.15rem);

  /* Animation Physics */
  --transition-speed: 0.8s;
  --easing-curve: cubic-bezier(0.2, 0.8, 0.2, 1); /* Soft ease-out */
  --bounce-easing: cubic-bezier(0.34, 1.56, 0.64, 1); /* Springy */
  --magnetic-easing: cubic-bezier(0.25, 1, 0.5, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Midnight / Starlit Theme */
    --background-color: #1a1a24;
    --panel-background: rgba(30, 30, 40, 0.75);
    --text-primary: #f0ebe5;
    --text-secondary: #b0a08a;
    --accent-color: #e09f7d; /* Lighter terracotta for contrast against dark */
    --accent-secondary: #a0baa0;
    --accent-tertiary: #3a3a44;
    --accent-quaternary: #4a4a54;
    --highlight-color: #f4ddb0;
    --shadow-color: rgba(0, 0, 0, 0.3);

    --gradient-overlay: linear-gradient(
      to bottom,
      rgba(26, 26, 36, 0) 0%,
      rgba(26, 26, 36, 1) 100%
    );
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.1);
  }
}

::selection {
  background: var(--accent-color);
  color: white;
}

/* Global Grain Texture - Subtler & finer */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* Custom Scrollbar - Minimalist */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--accent-quaternary);
  border-radius: 10px;
  border: 2px solid transparent; /* Padding around thumb */
  background-clip: content-box;
  transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-color);
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--background-color);
  font-family: var(--font-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------------------------------------
   Welcome Overlay - "The Curtain"
   --------------------------------------------------------- */
#welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background-color);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  color: var(--text-primary);
  /* The "Curtain" effect involves clip-path or scale */
  transition: opacity 1.2s var(--easing-curve), visibility 1.2s var(--easing-curve),
    transform 1.2s var(--easing-curve), clip-path 1.5s var(--easing-curve);
  opacity: 1;
  visibility: visible;
  clip-path: circle(150% at 50% 50%); /* Initial full state */
}

/* The Reveal Animation */
#welcome-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Circular reveal effect */
  clip-path: circle(0% at 50% 50%);
}

/* Dust Motes / Fireflies Particle System */
.dust-mote {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--size);
  height: var(--size);
  background: radial-gradient(circle, rgba(255, 230, 200, 0.8) 0%, rgba(255, 230, 200, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(var(--x), var(--y));
  animation: floatMote var(--duration) linear var(--delay) infinite,
    glowMote 4s ease-in-out var(--delay) infinite alternate;
  z-index: 1; /* Behind text, above background */
  mix-blend-mode: screen;
}

@keyframes floatMote {
  0% {
    transform: translate(var(--x), var(--y));
  }
  33% {
    transform: translate(calc(var(--x) + 5vw), calc(var(--y) - 5vh));
  }
  66% {
    transform: translate(calc(var(--x) - 3vw), calc(var(--y) - 10vh));
  }
  100% {
    transform: translate(calc(var(--x) + 2vw), calc(var(--y) - 15vh));
  }
}

@keyframes glowMote {
  0% {
    opacity: 0;
  }
  50% {
    opacity: var(--opacity);
  }
  100% {
    opacity: 0;
  }
}

#welcome-overlay h1 {
  font-family: var(--font-display);
  font-size: var(--h1-size);
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 0.9;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  gap: 0.1em;
  perspective: 1000px;
}

#welcome-overlay h1 .char {
  opacity: 0;
  display: inline-block;
  transform: translateY(40px) rotateX(20deg);
  transform-origin: bottom center;
  animation: titleReveal 1.6s var(--easing-curve) forwards;
  /* Subtle gradient on text */
  background: linear-gradient(135deg, var(--text-primary) 30%, #5c534b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#welcome-overlay h1 .char:nth-child(1) {
  animation-delay: 0.1s;
}
#welcome-overlay h1 .char:nth-child(2) {
  animation-delay: 0.2s;
}
#welcome-overlay h1 .char:nth-child(3) {
  animation-delay: 0.3s;
}
#welcome-overlay h1 .char:nth-child(4) {
  animation-delay: 0.4s;
}
#welcome-overlay h1 .char:nth-child(5) {
  animation-delay: 0.5s;
}
#welcome-overlay h1 .char:nth-child(6) {
  animation-delay: 0.6s;
}

#welcome-overlay p {
  font-family: var(--font-body);
  font-size: var(--p-size);
  line-height: 1.8;
  margin-top: 2rem;
  max-width: 500px;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInText 1.4s var(--easing-curve) 1s forwards;
  padding: 0 20px;
}

/* Start Button - Magnetic & Ripple */
.start-button {
  margin-top: 5vh;
  padding: 24px 56px;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid rgba(42, 38, 34, 0.2);
  border-radius: 300px;
  cursor: pointer;
  transition: all 0.5s var(--magnetic-easing);
  opacity: 0;
  transform: translateY(20px);
  translate: var(--tx, 0px) var(--ty, 0px);
  animation: fadeInText 1.4s var(--easing-curve) 1.3s forwards;
  /* FIX: UX-004 - Added transition for smooth return to center */
  transition: translate 0.4s ease-out, transform 0.4s ease-out, color 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Button Fill Animation */
.start-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--text-primary);
  border-radius: 300px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--magnetic-easing);
  z-index: -1;
}

.start-button:hover {
  color: var(--background-color);
  border-color: var(--text-primary);
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(42, 38, 34, 0.15);
}

.start-button:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.start-button:active {
  transform: scale(0.95);
}

.start-button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 4px;
}

#start-journey-btn {
  position: relative;
  overflow: hidden;
}

#start-journey-btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 800ms cubic-bezier(0.4, 0, 0.2, 1);
  background-color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.8;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes titleReveal {
  0% {
    opacity: 0;
    transform: translateY(80px) rotateX(45deg);
    filter: blur(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0);
    filter: blur(0);
  }
}

@keyframes fadeInText {
  from {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ---------------------------------------------------------
   Map & Markers
   --------------------------------------------------------- */
#map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  background-color: var(--background-color);
  /* Vintage Filter - significantly refined for 'earthy golden hour' */
  filter: sepia(0.4) contrast(1.1) saturate(1.2) hue-rotate(-10deg) brightness(0.95);
}

@media (prefers-color-scheme: dark) {
  #map {
    filter: invert(100%) hue-rotate(180deg) sepia(0.3) brightness(85%) contrast(1.1) saturate(0.8);
  }
}

/* FIX: UX-00X - Removed display:none to allow attribution to be visible */
/* .leaflet-control-container { display: none !important; } */
.leaflet-popup-pane {
  display: none;
}

.leaflet-bottom.leaflet-left {
  bottom: 24px;
  left: 24px;
  opacity: 0.5;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.05em;
  transition: opacity 0.3s ease;
}
.leaflet-bottom.leaflet-left:hover {
  opacity: 1;
}
.leaflet-bottom.leaflet-left a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}

/* Organic Marker - "Water Drop" Pulse */
.custom-marker {
  width: 16px;
  height: 16px;
  background-color: var(--accent-color);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 4px 15px rgba(200, 121, 85, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.5); /* Improved depth */
  transition: all 0.6s var(--bounce-easing);
  opacity: 0;
  position: relative;
  animation: scaleInMarker 0.8s var(--easing-curve) forwards;
  /* animation-delay is now set via classes below */
  cursor: pointer;
  z-index: 10;
}

/* Marker Delays - CSP Compliant */
.delay-0 {
  animation-delay: 0.2s;
}
.delay-1 {
  animation-delay: 0.3s;
}
.delay-2 {
  animation-delay: 0.4s;
}
.delay-3 {
  animation-delay: 0.5s;
}
.delay-4 {
  animation-delay: 0.6s;
}
.delay-5 {
  animation-delay: 0.7s;
}
.delay-6 {
  animation-delay: 0.8s;
}
.delay-7 {
  animation-delay: 0.9s;
}
.delay-8 {
  animation-delay: 1s;
}
.delay-9 {
  animation-delay: 1.1s;
}
.delay-10 {
  animation-delay: 1.2s;
}
.delay-11 {
  animation-delay: 1.3s;
}
.delay-12 {
  animation-delay: 1.4s;
}
.delay-13 {
  animation-delay: 1.5s;
}
.delay-14 {
  animation-delay: 1.6s;
}
.delay-15 {
  animation-delay: 1.7s;
}
.delay-16 {
  animation-delay: 1.8s;
}
.delay-17 {
  animation-delay: 1.9s;
}
.delay-18 {
  animation-delay: 2s;
}
.delay-19 {
  animation-delay: 2.1s;
}
.delay-20 {
  animation-delay: 2.2s;
}
.delay-21 {
  animation-delay: 2.3s;
}
.delay-22 {
  animation-delay: 2.4s;
}
.delay-23 {
  animation-delay: 2.5s;
}
.delay-24 {
  animation-delay: 2.6s;
}
.delay-25 {
  animation-delay: 2.7s;
}
.delay-26 {
  animation-delay: 2.8s;
}
.delay-27 {
  animation-delay: 2.9s;
}
.delay-28 {
  animation-delay: 3s;
}
.delay-29 {
  animation-delay: 3.1s;
}
/* Fallback for anything beyond 29 */
.delay-fallback {
  animation-delay: 3.2s;
}

/* Inner Pulse (Always Active) */
.custom-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-color) 0%, rgba(200, 121, 85, 0) 70%);
  opacity: 0.8;
  z-index: -1;
  animation: pulseInner 3s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Outer Ripple (Expansion) */
.custom-marker::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400%;
  height: 400%;
  border-radius: 50%;
  border: 1.5px solid var(--accent-color);
  opacity: 0;
  z-index: -2;
  animation: pulseOuter 4s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.custom-marker:hover {
  transform: scale(1.3);
  background-color: #fff;
  border-color: var(--accent-color);
  z-index: 1000;
}

/* When Active (Clicked) */
.custom-marker.active {
  transform: scale(1.5);
  background-color: #fff;
  border-width: 4px;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 10px rgba(224, 159, 125, 0.2);
  z-index: 1001;
}
.custom-marker.active::before,
.custom-marker.active::after {
  animation: none;
  opacity: 0;
}

/* Dimmed State */
.custom-marker.dimmed {
  opacity: 0.4;
  transform: scale(0.8);
  filter: grayscale(1);
}

@keyframes pulseInner {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0.2;
  }
}

@keyframes pulseOuter {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.6;
    border-width: 1.5px;
  }
  100% {
    transform: translate(-50%, -50%) scale(4);
    opacity: 0;
    border-width: 0px;
  }
}

@keyframes scaleInMarker {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------------------------------------------------------
   Info Panel - High-End Glassmorphism
   --------------------------------------------------------- */
#info-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 550px; /* Slightly wider */
  height: 100%;
  color: var(--text-primary);
  z-index: 1000;

  /* Initial State (Off-screen) */
  transform: translateX(105%) rotateY(-5deg) scale(0.95);
  transform-origin: right center;
  transition: transform 1s var(--easing-curve), opacity 0.8s ease;

  /* Glass Effect */
  background-color: var(--panel-background);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-left: 1px solid var(--glass-border);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.1);
}

/* Glass Highlight/Noise Overlay */
#info-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(120deg, var(--glass-highlight) 0%, transparent 40%);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

#info-panel.active {
  transform: translateX(0) rotateY(0) scale(1);
}

#info-panel-content {
  position: relative;
  height: 100%;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 0.5s ease 0.3s;
  z-index: 2; /* Above the highlight */
}

#info-panel.active #info-panel-content {
  opacity: 1;
}

.panel-image-container {
  width: 100%;
  height: 55vh;
  min-height: 400px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.panel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
  transition: opacity 0.5s ease, transform 4s var(--easing-curve); /* Slower, Ken Burns feel */
  opacity: 0;
}
/* When panel is active, image settles slightly but keeps some scale for the Ken Burns effect */
#info-panel.active .panel-image {
  transform: scale(1.05); /* Stops zooming at a slight scale */
}
.panel-image.loaded {
  opacity: 1;
}

.panel-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%; /* Taller gradient */
  background: linear-gradient(to top, var(--background-color) 0%, rgba(249, 247, 242, 0) 100%);
  z-index: 1;
}

.panel-text-content {
  padding: 0 60px 60px 60px;
  position: relative;
  z-index: 2;
  margin-top: -120px; /* Strong overlap with image */
}

/* Staggered Animations for Text */
.info-title {
  font-family: var(--font-display);
  font-size: var(--h2-size);
  font-weight: 400;
  margin: 0;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;

  opacity: 0;
  transform: translateY(40px);
  /* Animation handled by class toggling or simple delays if content reloads */
  animation: slideUpFade 0.9s var(--easing-curve) 0.3s forwards;
}

.info-subtitle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-color);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 12px;

  opacity: 0;
  transform: translateY(30px);
  animation: slideUpFade 0.9s var(--easing-curve) 0.4s forwards;
}

.info-body {
  font-size: var(--p-size);
  line-height: 1.8;
  color: var(--text-secondary);
  font-weight: 400; /* Slightly heavier for readability */
  margin-bottom: 2rem;

  opacity: 0;
  transform: translateY(30px);
  animation: slideUpFade 0.9s var(--easing-curve) 0.5s forwards;
}

/* Wikipedia Link */
.info-wiki-link,
.tour-wiki-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-color);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: opacity 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.9s var(--easing-curve) 0.6s forwards;
}
.tour-wiki-link {
  margin-bottom: 1rem;
  font-size: 0.85rem;
  opacity: 1;
  transform: none;
  animation: none;
}
.info-wiki-link:hover,
.tour-wiki-link:hover {
  text-decoration: underline;
}

/* Decorative Corner */
.decorative-svg-corner {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  z-index: 5;
  opacity: 0;
  animation: fadeIn 1s ease 1s forwards;
}

@keyframes slideUpFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Close Button */
#panel-close-btn {
  position: absolute;
  top: 40px;
  left: -80px; /* Further out */
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.4s var(--bounce-easing);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  z-index: 1002;
  color: var(--text-primary);
}

#panel-close-btn:hover {
  transform: scale(1.15) rotate(90deg);
  background: #fff;
  color: var(--accent-color);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}
#panel-close-btn:active {
  transform: scale(0.95) rotate(90deg);
}

/* ---------------------------------------------------------
   Controls & UI
   --------------------------------------------------------- */
.custom-zoom-controls {
  position: fixed;
  bottom: 50px;
  right: 50px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 900;
}

.zoom-btn {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 24px;
  transition: all 0.4s var(--bounce-easing);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.zoom-btn:hover {
  transform: translateY(-5px) scale(1.05);
  background: #fff;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  color: var(--accent-color);
}
.zoom-btn:active {
  transform: scale(0.95);
}

/* Audio Toggle Button */
#audio-toggle-btn {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.4s var(--bounce-easing);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

#audio-toggle-btn:hover {
  transform: translateY(-5px) scale(1.05);
  background: #fff;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  color: var(--accent-color);
}

#audio-toggle-btn:active {
  transform: scale(0.95);
}

/* Tooltips - Floating Tag */
.custom-leaflet-tooltip {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
  padding: 10px 18px;
  transform-origin: bottom center;
  /* Spring animation on appearance handled by Leaflet fade, but we add scale */
  animation: tooltipPop 0.4s var(--bounce-easing);
}
.custom-leaflet-tooltip::before {
  display: none;
}

@keyframes tooltipPop {
  0% {
    transform: scale(0.5) translateY(10px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ---------------------------------------------------------
   Utilities (Loader, Toast, Reset)
   --------------------------------------------------------- */
.reset-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: inherit;
}

/* Skeleton Loading Shimmer */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(224, 159, 125, 0.1); /* Accent faint */
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s linear infinite;
  z-index: 2;
}
@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.panel-image-container.loading {
  background: #f0ebe5;
  position: relative;
  overflow: hidden;
}

.panel-image-container.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeletonShimmer 2s infinite linear;
  z-index: 1;
}

@keyframes skeletonShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(50%);
  }
}

/* Toast Notification */
.custom-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #fff;
  border-radius: 100px;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  z-index: 11000;
  opacity: 0;
  transition: all 0.5s var(--bounce-easing);
  pointer-events: none;
}
.custom-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.custom-toast.toast-error {
  background: #d9534f; /* Soft red */
}
.custom-toast.toast-info {
  background: var(--accent-color); /* Soft Terracotta */
}

/* ---------------------------------------------------------
   Mobile Responsive
   --------------------------------------------------------- */
@media (max-width: 768px) {
  #welcome-overlay {
    padding: 20px;
  }

  #info-panel {
    width: 100%;
    max-width: 100%;
    height: 80vh; /* Taller on mobile */
    top: auto;
    bottom: 0;
    transform: translateY(105%); /* Slide up */
    border-left: none;
    border-top: 1px solid var(--glass-border);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.1);
  }

  #info-panel.active {
    transform: translateY(0);
  }

  .panel-image-container {
    height: 35vh;
    min-height: 250px;
  }

  .panel-text-content {
    padding: 0 32px 40px 32px;
    margin-top: -60px;
  }

  #panel-close-btn {
    top: -30px;
    left: 50%;
    margin-left: -30px;
    transform: rotate(90deg); /* Down arrow */
  }
  #panel-close-btn:hover {
    transform: rotate(90deg) scale(1.1);
  }

  .custom-zoom-controls {
    bottom: 30px;
    right: 20px;
    gap: 16px;
    transition: transform 0.6s var(--easing-curve);
  }
  /* Hide zoom controls when panel is active on mobile to prevent overlap */
  body.panel-active .custom-zoom-controls {
    transform: translateY(200%);
  }
}
/* ---------------------------------------------------------
   Reduced Motion
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Specific overrides where we might want to disable transforms completely */
  .custom-marker:hover,
  .custom-marker.active,
  #info-panel,
  .panel-image,
  .info-title,
  .info-subtitle,
  .info-body,
  .zoom-btn:hover,
  #audio-toggle-btn:hover,
  .dust-mote {
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* Ensure panel is visible/hidden correctly without transform */
  #info-panel {
    transform: none !important;
    display: none;
    opacity: 0;
  }

  #info-panel.active {
    display: block !important;
    opacity: 1 !important;
  }
}

/* ---------------------------------------------------------
   Guided Tour UI
   --------------------------------------------------------- */
/* Tour FAB */
.tour-fab {
  position: fixed;
  bottom: 130px; /* Above zoom controls */
  right: 50px;
  width: 56px;
  height: 56px;
  background: var(--accent-color);
  border-radius: 50%;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 25px rgba(200, 121, 85, 0.4);
  z-index: 900;
  transition: all 0.4s var(--bounce-easing);
}
.tour-fab:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 35px rgba(200, 121, 85, 0.6);
}
.tour-fab.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}
.tour-fab .tooltip {
  position: absolute;
  right: 70px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.tour-fab:hover .tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Tour Card */
.tour-card {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 90%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  opacity: 0;
  animation: slideUpTour 0.6s var(--easing-curve) forwards;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@keyframes slideUpTour {
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.tour-progress {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 600;
}
.tour-close-btn {
  opacity: 0.5;
  transition: opacity 0.3s;
}
.tour-close-btn:hover {
  opacity: 1;
}

.tour-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 0 0 8px 0;
  color: var(--text-primary);
  line-height: 1.1;
}

.tour-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.tour-snippet {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* Expanded Content */
.tour-expanded-content {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.4s ease;
}
.tour-expanded-content.hidden {
  display: none;
}
.tour-expanded-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.tour-image-preview img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
}

.tour-more-btn {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.3s;
}
.tour-more-btn:hover {
  gap: 10px;
}

/* Controls */
.tour-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.tour-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
}
.tour-nav-btn.prev {
  color: var(--text-secondary);
}
.tour-nav-btn.prev:hover:not([disabled]) {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}
.tour-nav-btn.prev[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.tour-nav-btn.next {
  background: var(--text-primary);
  color: #fff;
}
.tour-nav-btn.next:hover {
  background: var(--accent-color);
  transform: translateX(4px);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .tour-fab {
    bottom: 100px;
    right: 20px;
  }
  .tour-card {
    width: 94%;
    bottom: 20px;
    padding: 20px;
  }
}

/* Info Panel Staggered Animations */
.panel-text-content > * {
  opacity: 0;
  transform: translateY(20px);
}

#info-panel.active .panel-text-content > *:nth-child(1) {
  animation: fadeUp 0.6s var(--easing-curve) forwards;
  animation-delay: 0.1s;
}

#info-panel.active .panel-text-content > *:nth-child(2) {
  animation: fadeUp 0.6s var(--easing-curve) forwards;
  animation-delay: 0.2s;
}

#info-panel.active .panel-text-content > *:nth-child(3) {
  animation: fadeUp 0.6s var(--easing-curve) forwards;
  animation-delay: 0.3s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Info Panel Image Parallax */
.panel-image-container {
  overflow: hidden;
  position: relative;
}

.panel-image {
  /* Increase size slightly to allow for parallax movement without clipping */
  width: 110%;
  height: 110%;
  left: -5%;
  top: -5%;
  position: relative;
  transition: transform 0.1s linear; /* Smooth micro-movements */
}

/* Hide Controls During Tour */
body.tour-active .custom-zoom-controls {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(20px) !important;
  transition: all 0.3s ease-out;
}
