.globe-intro {
  position: fixed;
  z-index: 5000;
  inset: 0;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 50% 45%, rgba(52, 88, 105, .22), transparent 36%),
    #030608;
  opacity: 1;
  visibility: visible;
}

.globe-intro[hidden] {
  display: none;
}

/* Viñeta cinematográfica sobre el planeta (no bloquea la interacción). */
.globe-intro::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(0, 0, 0, .58) 100%);
  content: "";
  pointer-events: none;
}

/* ================================================================
   MAPA SATELITAL DE ALGARROBO
   El JS cruza del globo 3D a estas capas al descender. Las imágenes
   son reales (satélite ArcGIS) y se sirven localmente para no
   depender de tiles en vivo. El JS anima opacidad/escala.
   ================================================================ */
.globe-map {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.globe-map-layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.globe-map-town {
  background-image: url("../images/intro/algarrobo_town.jpg");
}

.globe-map-block {
  background-image: url("../images/intro/algarrobo_block.jpg");
}

/* Gradación cálida sobre el mapa para ligarlo a la marca. */
.globe-map::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 40%, rgba(20, 12, 8, .5) 100%),
    linear-gradient(180deg, rgba(20, 12, 8, .18), transparent 30%);
  content: "";
  pointer-events: none;
}

/* Pin "Pueblo Viejo" que cae sobre el punto exacto del mapa. */
.globe-map-pin {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
}

.globe-map-pin-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  will-change: transform, opacity;
}

.globe-map-pin-label {
  margin-bottom: 8px;
  padding: 7px 15px;
  border: 1px solid rgba(239, 198, 134, .65);
  border-radius: 999px;
  color: #fff;
  background: rgba(19, 12, 9, .82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  backdrop-filter: blur(8px);
  font-family: var(--serif);
  font-size: 1.12rem;
  white-space: nowrap;
}

.globe-map-pin-stem {
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, #efc686, rgba(239, 198, 134, .1));
}

.globe-map-pin-dot {
  position: relative;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #efb354;
  box-shadow: 0 0 0 4px rgba(239, 179, 84, .35), 0 6px 16px rgba(0, 0, 0, .5);
}

/* Onda expansiva que late bajo el pin al aterrizar. */
.globe-map-pin.is-pulsing .globe-map-pin-dot::after {
  position: absolute;
  inset: -3px;
  border: 2px solid rgba(239, 198, 134, .9);
  border-radius: 50%;
  content: "";
  animation: globe-pin-pulse 1.4s ease-out infinite;
}

@keyframes globe-pin-pulse {
  0% {
    opacity: .9;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(4.2);
  }
}

.globe-intro-seen .globe-intro {
  display: none;
}

.globe-intro canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  cursor: grab;
  touch-action: none;
}

.globe-intro.is-travelling canvas {
  cursor: progress;
}

.globe-intro-ui {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vw, 58px);
  pointer-events: none;
}

.globe-intro-brand {
  width: clamp(88px, 10vw, 132px);
  filter: brightness(0) invert(1) drop-shadow(0 5px 15px rgba(0, 0, 0, .4));
}

.globe-intro-copy {
  max-width: 620px;
  padding-bottom: clamp(20px, 5vh, 60px);
  text-shadow: 0 3px 24px rgba(0, 0, 0, .65);
}

.globe-intro-kicker {
  margin: 0 0 12px;
  color: #efc686;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.globe-intro-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.7rem, 6vw, 6rem);
  line-height: .95;
  perspective: 700px;
}

/* Palabras y letras del titular para la coreografía de entrada.
   Las palabras son indivisibles para que el texto corte bien de línea. */
.globe-intro-title .globe-word {
  display: inline-block;
  white-space: nowrap;
}

.globe-intro-title .globe-char {
  display: inline-block;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

.globe-intro-instruction {
  max-width: 470px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, .75);
  font-size: clamp(.92rem, 1.4vw, 1.08rem);
}

.globe-intro-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.globe-intro-status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #efc686;
  box-shadow: 0 0 0 6px rgba(239, 198, 134, .13);
  content: "";
  animation: globe-status-pulse 2.2s ease-in-out infinite;
}

@keyframes globe-status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(239, 198, 134, .16);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(239, 198, 134, .05);
  }
}

.globe-skip {
  position: absolute;
  z-index: 4;
  top: clamp(22px, 4vw, 50px);
  right: clamp(22px, 4vw, 50px);
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .24);
  backdrop-filter: blur(10px);
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

.globe-skip:hover,
.globe-skip:focus-visible {
  border-color: #fff;
  background: rgba(255, 255, 255, .12);
}

.globe-location-label {
  position: absolute;
  z-index: 3;
  display: grid;
  min-width: 190px;
  padding: 13px 16px;
  border: 1px solid rgba(239, 198, 134, .5);
  border-radius: 12px;
  color: #fff;
  background: rgba(19, 12, 9, .76);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 20px));
}

.globe-location-label strong {
  font-family: var(--serif);
  font-size: 1.08rem;
}

.globe-location-label span {
  color: rgba(255, 255, 255, .66);
  font-size: .72rem;
}

body.globe-active {
  overflow: hidden;
}

@media (max-width: 640px) {
  .globe-intro-ui {
    justify-content: flex-end;
    padding: 24px 22px 80px;
  }

  .globe-intro-brand {
    position: absolute;
    top: 23px;
    left: 22px;
    width: 82px;
  }

  .globe-intro-copy {
    max-width: 330px;
    padding: 0;
  }

  .globe-intro-title {
    font-size: clamp(2.65rem, 14vw, 4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .globe-intro-instruction {
    display: none;
  }

  .globe-intro-status::before {
    animation: none;
  }

  .globe-map-pin.is-pulsing .globe-map-pin-dot::after {
    animation: none;
  }
}
