/* ============================================================
   RED DOT MAP — DeliverFund Landing Page
   Branding: Navy #003d6b, Dark #001D33, Gold #bc9854, Red #C52126
   Fonts: Montserrat (display), Open Sans (body)
   ============================================================ */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  min-height: 100dvh;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #FFFFFF;
  background: #0a0c10;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; height: auto; }

/* --- HEADER --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  padding: 0 24px;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.header-logo { display: flex; align-items: center; }
.header-logo-img { height: 40px; width: auto; }

.header-nav { display: flex; align-items: center; gap: 32px; }

.nav-link {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}
.nav-link:hover { color: #FFFFFF; }

.nav-cta {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: #C52126;
  padding: 10px 24px;
  border-radius: 4px;
  transition: background 0.2s ease;
}
.nav-cta:hover { background: #A51B20; }

/* --- MAP HERO --- */
.map-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 600px;
  background: #0a0c10;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Hide Leaflet attribution for cleaner look */
.leaflet-control-attribution { display: none !important; }
.leaflet-control-zoom { display: none !important; }

/* --- MAP TITLE OVERLAY --- */
.map-overlay-title {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 800;
  text-align: center;
  pointer-events: none;
  padding: 0 24px;
}

/* --- WATERMARK --- */
.map-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 799;
  pointer-events: none;
  opacity: 0.04;
}

.watermark-img {
  width: clamp(500px, 120vw, 1800px);
  height: auto;
  filter: grayscale(1) brightness(2);
}

.map-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  color: #FFFFFF;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.01em;
}

/* --- MAP OVERLAYS --- */
.map-overlay-day {
  position: absolute;
  bottom: 100px;
  left: 32px;
  z-index: 800;
  pointer-events: none;
}

.day-text {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(20px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #FFFFFF;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7), 0 1px 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.day-text.visible {
  opacity: 1;
  transform: translateY(0);
}

.map-overlay-logo {
  position: absolute;
  bottom: 80px;
  right: 32px;
  z-index: 800;
  pointer-events: none;
}

.overlay-logo-img {
  height: clamp(60px, 10vw, 120px);
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* --- MAP CONTROLS --- */
.map-controls {
  position: absolute;
  bottom: 24px;
  left: 32px;
  right: 32px;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 20px;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.control-btn:hover { background: rgba(255, 255, 255, 0.2); }

.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.progress-track:hover { height: 8px; }

.progress-fill {
  height: 100%;
  width: 0%;
  background: #C52126;
  border-radius: 3px;
  transition: width 0.15s ease;
  pointer-events: none;
  position: relative;
}

.progress-thumb {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border: 2px solid #C52126;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.progress-track:hover .progress-thumb,
.progress-track.dragging .progress-thumb {
  opacity: 1;
}

.progress-track.dragging .progress-fill {
  transition: none;
}

.control-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- ZOOM CONTROLS --- */
.zoom-controls {
  position: absolute;
  top: 88px;
  right: 20px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  transition: background 0.2s ease;
  cursor: pointer;
}

.zoom-btn:first-child { border-radius: 6px 6px 0 0; }
.zoom-btn:last-child { border-radius: 0 0 6px 6px; }
.zoom-btn:hover { background: rgba(255, 255, 255, 0.15); }
.zoom-btn:active { background: rgba(255, 255, 255, 0.25); }

/* --- SCROLL INDICATOR --- */
.scroll-indicator {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.35);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
  animation: scrollBounce 2s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.scroll-indicator.visible { opacity: 1; }

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* --- CONTEXT SECTION --- */
.context-section {
  background: #0d1117;
  padding: clamp(64px, 10vw, 120px) 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.context-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.context-eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #bc9854;
  margin-bottom: 20px;
}

.context-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  color: #FFFFFF;
  margin-bottom: 32px;
}

.context-body {
  font-size: 16px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 20px;
  max-width: 100%;
}

.context-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat-number {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  color: #C52126;
  line-height: 1;
}

.stat-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

/* --- FOOTER --- */
.site-footer {
  background: #000000;
  padding: 48px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer-logo { height: 48px; width: auto; }

.footer-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  max-width: 400px;
}

.footer-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: #FFFFFF; }

.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-legal p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  max-width: 100%;
}

.footer-disclaimer {
  font-style: italic;
  max-width: 500px;
}

/* --- RED DOT MARKERS --- */
.red-dot {
  width: 7px;
  height: 7px;
  background: #E02828;
  border-radius: 50%;
  box-shadow: 0 0 3px 1px rgba(224, 40, 40, 0.4);
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.4s ease, transform 0.4s ease;
  position: relative;
}

.red-dot.visible {
  opacity: 0.92;
  transform: scale(1);
}

/* Arrival pulse ring: draws the eye to newly added dots */
.red-dot.visible::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  pointer-events: none;
}

.red-dot.pulse::after {
  animation: dotPulse 1.1s ease-out forwards;
}

@keyframes dotPulse {
  0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
  50%  { opacity: 0.5; transform: translate(-50%, -50%) scale(3.5); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(5); }
}

/* Slight size variation for visual interest */
.red-dot.size-sm { width: 6px; height: 6px; }
.red-dot.size-lg { width: 9px; height: 9px; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .header-inner { height: 60px; }
  .header-logo-img { height: 32px; }

  .header-nav { gap: 16px; }
  .nav-link { font-size: 11px; display: none; }
  .nav-cta { font-size: 12px; padding: 8px 16px; }

  .map-overlay-day { bottom: 90px; left: 16px; }
  .day-text { font-size: 28px; padding: 8px 20px; }

  .map-overlay-logo { bottom: 70px; right: 16px; }
  .overlay-logo-img { height: 50px; }

  .map-controls {
    left: 16px;
    right: 16px;
    padding: 10px 14px;
    gap: 8px;
  }

  .control-label { display: none; }

  .scroll-indicator { display: none; }

  .context-stats {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-links { gap: 20px; }
}

@media (max-width: 480px) {
  .map-overlay-day { bottom: 80px; left: 12px; }
  .day-text { font-size: 24px; padding: 6px 16px; }

  .map-overlay-logo { bottom: 65px; right: 12px; }
  .overlay-logo-img { height: 40px; }

  .map-controls {
    left: 12px;
    right: 12px;
    bottom: 16px;
  }
}

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