.journey {
  background: var(--ocean);
}

.map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 23% 18%, rgba(255, 255, 255, 0.2), transparent 24%),
    radial-gradient(circle at 78% 68%, rgba(82, 121, 105, 0.13), transparent 38%),
    linear-gradient(155deg, var(--ocean) 0%, var(--ocean-deep) 100%);
  touch-action: none;
  user-select: none;
}

.map::after {
  position: absolute;
  inset: 0;
  z-index: 8;
  border: 8px solid rgba(247, 240, 225, 0.2);
  border-radius: 1px;
  box-shadow: inset 0 0 70px rgba(62, 73, 61, 0.12);
  content: "";
  pointer-events: none;
}

.map__accessible-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.map__stage,
.map__scene,
.map__effects,
.chapter-icon-layer,
.pin-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map__stage {
  z-index: 1;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
}

/* Each scene is a viewport-sized, already-painted map. Camera moves only
   transform this flat bitmap, so WebKit never has to re-rasterise coastlines. */
.map__scene {
  z-index: 1;
  display: block;
  max-width: none;
  opacity: 0;
  transform-origin: 0 0;
  backface-visibility: hidden;
  image-rendering: auto;
  pointer-events: none;
}

.map__scene.is-active,
.map__scene[data-active="true"] {
  opacity: 1;
}

.is-camera-moving .map__scene {
  will-change: transform, opacity;
}

.map__effects {
  z-index: 3;
  display: block;
  max-width: none;
  pointer-events: none;
}

.chapter-icon-layer {
  z-index: 4;
  pointer-events: none;
}

.chapter-icon-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.chapter-icon-anchor.is-offscreen,
.pin-anchor.is-offscreen {
  visibility: hidden;
}

.chapter-icon {
  position: absolute;
  display: grid;
  width: var(--icon-size, 46px);
  height: var(--icon-size, 46px);
  place-items: center;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 220ms ease;
  pointer-events: none;
}

.chapter-icon.is-visible,
.chapter-icon-anchor.is-visible .chapter-icon {
  opacity: 0.98;
}

.chapter-icon__art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

img.chapter-icon {
  max-width: none;
  object-fit: contain;
  image-rendering: auto;
}

.pin-layer {
  z-index: 6;
  pointer-events: none;
}

.pin-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pin {
  position: absolute;
  top: -34px;
  left: -24px;
  width: 48px;
  height: 58px;
  border: 0;
  padding: 0;
  cursor: default;
  opacity: 0.64;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.pin__hit {
  position: absolute;
  inset: 0;
}

.pin__halo {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(247, 240, 225, 0.8);
}

.pin__stem {
  position: absolute;
  top: 14px;
  left: 17px;
  width: 15px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  background: var(--ink-faint);
  box-shadow: inset 0 0 0 2px var(--paper);
  transform: rotate(-45deg);
}

.pin__head {
  position: absolute;
  top: 15px;
  left: 17px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--ink-faint);
}

.pin__dot {
  position: absolute;
  top: 20px;
  left: 22px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--paper);
}

.pin__number {
  position: absolute;
  top: 40px;
  right: 0;
  left: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-shadow:
    -1px -1px 0 var(--paper),
    1px -1px 0 var(--paper),
    -1px 1px 0 var(--paper),
    1px 1px 0 var(--paper);
}

.pin.is-active,
.pin.is-visited {
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
}

.map:not(.is-interactive) .pin {
  pointer-events: none;
}

.pin.is-active .pin__head,
.pin.is-active .pin__stem {
  background: var(--rose-deep);
}

.pin.is-active .pin__halo {
  animation: pin-breathe 1.9s ease-in-out infinite;
}

.pin.is-visited .pin__head,
.pin.is-visited .pin__stem {
  background: var(--ink);
}

.pin.is-visited .pin__dot {
  background: var(--ochre-soft);
}

.pin.is-concealed,
.pin-anchor.is-concealed {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.pin:focus {
  outline: none;
}

.pin:focus-visible {
  border-radius: 18px;
  outline: 3px solid var(--ochre);
  outline-offset: 1px;
}

.flight-plane {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  width: 56px;
  height: 56px;
  max-width: none;
  margin: -28px 0 0 -28px;
  visibility: hidden;
  opacity: 0;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

.flight-plane.is-flying {
  visibility: visible;
  opacity: 1;
  will-change: transform;
}

@keyframes pin-breathe {
  0%,
  100% {
    opacity: 0.76;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.96;
    transform: scale(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pin.is-active .pin__halo {
    animation: none;
  }

  .chapter-icon,
  .pin {
    transition: none;
  }
}
