/* Cinematic Earth-to-map transition, contained inside the map window. */
.location-map {
  position: relative;
  isolation: isolate;
}

.location-map-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  filter: saturate(.82) contrast(1.08) brightness(.78) !important;
  transform: scale(1.11);
  transform-origin: 52% 56%;
  transition:
    opacity 1.15s cubic-bezier(.22, 1, .36, 1),
    transform 1.65s cubic-bezier(.22, 1, .36, 1);
}

.location-map.is-map-ready .location-map-frame {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.earth-journey {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  background:
    radial-gradient(circle at 36% 30%, rgba(37, 76, 122, .25), transparent 34%),
    radial-gradient(circle at 72% 72%, rgba(229, 189, 103, .13), transparent 34%),
    #010205;
  opacity: 1;
  pointer-events: none;
  transform: scale(1);
  transition:
    opacity 1.05s cubic-bezier(.22, 1, .36, 1),
    transform 1.4s cubic-bezier(.22, 1, .36, 1);
}

.earth-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.earth-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 48%,
    transparent 28%,
    rgba(0, 0, 0, .18) 58%,
    rgba(0, 0, 0, .78) 100%
  );
}

.earth-orbit-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(62vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 226, 160, .2);
  border-radius: 50%;
  opacity: .38;
  transform: translate(-50%, -50%) rotateX(68deg) rotateZ(-18deg);
  box-shadow: 0 0 34px rgba(229, 189, 103, .09);
}

.earth-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.35);
  transition:
    opacity .55s ease,
    transform .8s cubic-bezier(.2, 1.7, .35, 1);
}

.earth-pin-dot {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #f7cf77;
  box-shadow: 0 0 18px rgba(247, 207, 119, .95);
}

.earth-pin-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 226, 160, .92);
  border-radius: 50%;
  animation: earthPinPulse 1.25s ease-out infinite;
}

.earth-location-label {
  position: absolute;
  left: 50%;
  bottom: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: min(86%, 520px);
  opacity: 0;
  color: #fff;
  text-align: center;
  transform: translate(-50%, 16px);
  transition:
    opacity .65s ease,
    transform .85s cubic-bezier(.22, 1, .36, 1);
}

.earth-location-label span {
  color: #e5bd67;
  font: 600 .7rem/1 Montserrat, Arial, sans-serif;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.earth-location-label strong {
  font: 500 clamp(1rem, 2vw, 1.45rem)/1.2 "Cinzel", Georgia, serif;
  letter-spacing: .02em;
}

.earth-journey.is-pin-visible .earth-pin {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.earth-journey.is-pin-visible .earth-location-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.earth-journey.is-map-reveal {
  opacity: 0;
  transform: scale(1.08);
}

.location-map.is-earth-running .location-map-frame {
  opacity: .01;
}

.location-map.is-map-ready .location-map-frame {
  opacity: 1;
}

@keyframes earthPinPulse {
  0% {
    opacity: .9;
    transform: scale(.72);
  }
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

@media (max-width: 760px) {
  .earth-location-label {
    bottom: 24px;
  }
  .earth-orbit-line {
    width: 470px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .earth-journey {
    display: none;
  }
  .location-map-frame {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: none;
  }
}
