/* ─── Journey Screen ─── */
#journey-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

#journey-screen.visible {
  opacity: 1;
  pointer-events: all;
}

/* Leaflet map fills the screen */
#map {
  width: 100%;
  height: 100%;
  background: #000;
}

/* Keep the map quiet while preserving the tile provider attribution. */
.leaflet-control-zoom {
  display: none !important;
}

.leaflet-tile-pane {
  filter: grayscale(1) brightness(0.82) contrast(1.15);
  opacity: 1;
}

.leaflet-control-attribution {
  padding: 2px 5px !important;
  background: rgba(0, 0, 0, 0.5) !important;
  color: rgba(255, 255, 255, 0.38) !important;
  font: 9px/1.2 Inter, sans-serif !important;
}

.leaflet-control-attribution a {
  color: rgba(255, 255, 255, 0.52) !important;
}

/* Skip slider — top-right */
#skip-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.8rem;
  z-index: 1000;
  color: rgba(255,255,255,0.28);
  width: 160px;
  user-select: none;
  touch-action: none;
}

.skip-slider-track {
  position: relative;
  height: 24px;
}

.skip-slider-track::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1px;
  background: rgba(255,255,255,0.18);
  transform: translateY(-50%);
}

.skip-slider-fill {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 0;
  height: 1px;
  background: rgba(255,255,255,0.62);
  transform: translateY(-50%);
}

.skip-slider-dot {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.48);
  transform: translate(-50%, -50%);
}

.skip-slider-dot.start {
  left: 8px;
}

.skip-slider-dot.end {
  left: calc(100% - 8px);
}

.skip-slider-handle {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 18px rgba(255,255,255,0.22);
  cursor: grab;
  transform: translate(-50%, -50%);
}

.skip-slider-handle:active {
  cursor: grabbing;
}

.skip-slider-label {
  margin: 0.35rem 0 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: color 0.25s ease;
  text-align: center;
}

#skip-btn:hover {
  color: rgba(255,255,255,0.65);
}

/* Location card — bottom-left */
#location-card {
  position: absolute;
  bottom: clamp(2rem, 5vh, 4rem);
  left: clamp(1.5rem, 5vw, 4rem);
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: none;
  max-width: 320px;
}

#location-card.visible {
  opacity: 1;
  transform: translateY(0);
}

#loc-number {
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0.4rem;
}

#loc-city {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1;
}

#loc-sub {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  margin-top: 0.3rem;
  margin-bottom: 0.35rem;
}

#loc-tag {
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  color: rgba(212,201,176,0.52);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  opacity: 0;
  transform: translateY(5px);
}

#location-card.visible #loc-tag {
  animation: loc-tag-pulse 1.4s ease forwards;
}

#loc-message {
  font-size: 0.9rem;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  border-left: 1px solid rgba(255,255,255,0.18);
  padding-left: 1rem;
}

/* ─── Dim overlay (for final messages) ─── */
#journey-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 500;
  pointer-events: none;
  transition: background 1.2s ease;
}

#journey-overlay.dimmed {
  background: rgba(0,0,0,0.78);
}

/* ─── Final messages (over dimmed map) ─── */
.final-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.final-msg.visible {
  opacity: 1;
}

.final-copy {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 980px);
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

/* Message 1 — "Every dot is data." */
#final-msg-1 .final-copy {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.04em;
  line-height: 1.75;
}

.fm-line {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.8vw, 1.65rem);
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.03em;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.75s ease;
}

.fm-line.visible {
  opacity: 1;
}

/* Message 3 — "Faith + Consistency" */
.fc-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(3rem, 9vw, 7rem);
  letter-spacing: 0.1em;
  color: #fff;
  line-height: 1;
}

.fc-plus {
  color: rgba(255,255,255,0.35);
}

/* Custom Leaflet markers */
.journey-country-label {
  color: #858585;
  font: 9px/16px Inter, sans-serif;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
}
.journey-dot-icon {
  background: transparent;
  border-radius: 50%;
  z-index: 700 !important;
}

.journey-dot-core {
  display: block;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.62), 0 0 0 4px rgba(255,255,255,0.12);
  opacity: 0.95;
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.5s ease;
}

.journey-dot-icon.settled .journey-dot-core {
  opacity: 0.42;
  transform: scale(0.86);
  box-shadow: 0 0 6px rgba(255,255,255,0.24), 0 0 0 3px rgba(255,255,255,0.05);
}

.journey-dot-icon.active .journey-dot-core {
  opacity: 1;
  animation: active-journey-dot 1.15s ease-in-out infinite;
}

@keyframes active-journey-dot {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255,255,255,0.62), 0 0 0 4px rgba(255,255,255,0.12);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(255,255,255,0.75), 0 0 0 9px rgba(255,255,255,0.08);
    transform: scale(1.2);
  }
}

@keyframes loc-tag-pulse {
  0% { opacity: 0; transform: translateY(5px); }
  35% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0.72; transform: translateY(0); }
}

/* ─── Tablet ─── */
@media (max-width: 1024px) {
  #location-card {
    bottom: clamp(1.5rem, 4vh, 3rem);
    left: clamp(1.2rem, 4vw, 3rem);
    max-width: 280px;
  }

  #loc-city {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
  }
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  #skip-btn {
    top: max(0.9rem, env(safe-area-inset-top));
    right: 1rem;
    width: min(190px, 48vw);
  }

  .skip-slider-track {
    height: 52px;
  }

  .skip-slider-dot {
    width: 10px;
    height: 10px;
  }

  .skip-slider-handle {
    width: 30px;
    height: 30px;
  }

  .skip-slider-label {
    margin-top: 0.15rem;
    font-size: 0.52rem;
    letter-spacing: 0.16em;
  }

  #location-card {
    bottom: 1.4rem;
    left: 1.2rem;
    right: 1.2rem;
    max-width: none;
  }

  #loc-city {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
  }

  #loc-sub {
    font-size: 0.6rem;
  }

  #loc-tag {
    font-size: 0.52rem;
  }

  #loc-message {
    font-size: 0.82rem;
  }

  #final-msg-1 .final-copy {
    font-size: clamp(1rem, 5vw, 1.4rem);
    padding: 1.5rem;
    line-height: 1.65;
  }

  .final-copy {
    width: 94vw;
  }

  .fm-line {
    font-size: clamp(0.95rem, 4.5vw, 1.3rem);
  }

  .fc-text {
    font-size: clamp(2.2rem, 12vw, 4rem);
    letter-spacing: 0.06em;
  }
}

/* ─── Small phones ─── */
@media (max-width: 480px) {
  #skip-btn {
    width: min(176px, 54vw);
  }

  #location-card {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
  }

  #loc-number {
    font-size: 0.55rem;
  }

  #loc-city {
    font-size: clamp(1.3rem, 8vw, 1.9rem);
  }

  #loc-sub {
    font-size: 0.55rem;
    margin-bottom: 0.5rem;
  }

  #loc-tag {
    font-size: 0.48rem;
  }

  #loc-message {
    font-size: 0.78rem;
    line-height: 1.55;
  }

  #final-msg-1 .final-copy {
    font-size: clamp(0.9rem, 6vw, 1.2rem);
    padding: 1.2rem;
  }

  .fm-line {
    font-size: clamp(0.82rem, 5vw, 1rem);
  }

  .fc-text {
    font-size: clamp(1.7rem, 11vw, 2.8rem);
    letter-spacing: 0.04em;
  }
}
