/* ═══════════════════════════════════════════════════════════
   The Map — photoreal bottle, ocean, chart, galleon course
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #2a1a10;
  --ink-soft: #3a2410;
  --oxblood: #7a1c14;
  --oxblood-deep: #5c100c;
  --muted-warm: #6b5340;
  --text-light: #eef6f8;
  --text-muted: #9ab0b8;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: auto; }

body.journey-page {
  font-family: var(--font-body);
  background: #041018;
  color: var(--text-light);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.is-cinematic { overflow: hidden; }
body.is-modal-open { overflow: hidden; }

/* ── Ocean world (deep, living environment) ── */
.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.world__sky-shift {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 50% at 70% 0%, rgba(255, 210, 140, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(120, 180, 220, 0.12), transparent 50%);
  animation: sky-breathe 18s ease-in-out infinite alternate;
  z-index: 1;
}
@keyframes sky-breathe {
  from { opacity: 0.55; transform: scale(1); }
  to { opacity: 1; transform: scale(1.06); }
}

.world__layer {
  position: absolute;
  inset: -22%;
  background-size: cover;
  background-position: center 42%;
  background-repeat: no-repeat;
  transform-origin: 50% 48%;
  will-change: transform, opacity;
}

/* Hero: open lagoon water (bottle floats here). Map scroll zooms toward island shore. */
.world__far {
  background-image: url('../assets/scene/lagoon-water.jpg');
  filter: saturate(1.15) contrast(1.03) brightness(1.02);
  background-size: cover;
  background-position: center 55%;
  animation: world-sway 28s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes world-sway {
  from { transform: scale(1.02) translate(-1%, 0.3%); }
  to { transform: scale(1.06) translate(1.2%, -0.4%); }
}

.world__near {
  /* Tropical island + beach — fades in as user scrolls the map journey */
  background-image: url('../assets/scene/ocean-island.jpg');
  opacity: 0;
  filter: saturate(1.18) brightness(1.02);
  background-size: cover;
  background-position: center 40%;
  z-index: 0;
}

body.is-map-open .world__far {
  /* Crossfade toward island plate while scrolling */
  background-image: url('../assets/scene/ocean-island.jpg');
  background-position: center 35%;
  background-size: cover;
}

/* Warm god rays through tropical air */
.world__godrays {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    conic-gradient(
      from 200deg at 72% -5%,
      transparent 0deg,
      rgba(255, 230, 170, 0.07) 8deg,
      transparent 16deg,
      transparent 28deg,
      rgba(255, 240, 200, 0.09) 36deg,
      transparent 48deg,
      transparent 60deg,
      rgba(255, 220, 160, 0.06) 70deg,
      transparent 85deg
    );
  mix-blend-mode: screen;
  animation: rays-shift 16s ease-in-out infinite alternate;
  opacity: 0.85;
}
@keyframes rays-shift {
  from { transform: translateX(-2%) rotate(-2deg); opacity: 0.55; }
  to { transform: translateX(3%) rotate(2deg); opacity: 0.95; }
}

.world__haze {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse 50% 30% at 50% 70%, rgba(80, 160, 180, 0.12), transparent 70%),
    radial-gradient(ellipse 40% 25% at 30% 55%, rgba(255, 255, 255, 0.06), transparent 65%);
  animation: haze-drift 12s ease-in-out infinite alternate;
}
@keyframes haze-drift {
  from { transform: translateY(0) scale(1); opacity: 0.7; }
  to { transform: translateY(-2%) scale(1.05); opacity: 1; }
}

.world__water {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.68;
  mix-blend-mode: soft-light;
  z-index: 3;
}

.world__birds {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
}
.world__bird {
  position: absolute;
  width: 18px;
  height: 6px;
  opacity: 0.35;
  background: transparent;
  border-radius: 50%;
  box-shadow: none;
  /* Simple V-wing via borders */
  filter: drop-shadow(0 0 1px rgba(20, 30, 40, 0.5));
}
.world__bird::before,
.world__bird::after {
  content: '';
  position: absolute;
  top: 0;
  width: 10px;
  height: 2px;
  background: rgba(30, 40, 50, 0.55);
  border-radius: 2px;
}
.world__bird::before {
  left: 0;
  transform-origin: right center;
  transform: rotate(-28deg);
  animation: wing-flap 0.45s ease-in-out infinite alternate;
}
.world__bird::after {
  right: 0;
  transform-origin: left center;
  transform: rotate(28deg);
  animation: wing-flap 0.45s ease-in-out infinite alternate-reverse;
}
@keyframes wing-flap {
  from { transform: rotate(-22deg); }
  to { transform: rotate(-38deg); }
}
.world__bird--1 {
  top: 18%;
  left: -5%;
  animation: bird-path-1 42s linear infinite;
}
.world__bird--2 {
  top: 24%;
  left: -8%;
  animation: bird-path-2 55s linear infinite;
  animation-delay: -12s;
  transform: scale(0.75);
  opacity: 0.28;
}
.world__bird--3 {
  top: 14%;
  left: -10%;
  animation: bird-path-3 48s linear infinite;
  animation-delay: -22s;
  transform: scale(0.9);
  opacity: 0.3;
}
@keyframes bird-path-1 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(110vw, 8vh); }
}
@keyframes bird-path-2 {
  0% { transform: translate(0, 0) scale(0.75); }
  100% { transform: translate(115vw, -6vh) scale(0.75); }
}
@keyframes bird-path-3 {
  0% { transform: translate(0, 4vh) scale(0.9); }
  100% { transform: translate(120vw, 12vh) scale(0.9); }
}

.world__sparkles {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
}
.world__sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 6px rgba(255, 245, 200, 0.8);
  animation: sparkle-twinkle 3.5s ease-in-out infinite;
  opacity: 0;
}
@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  40% { opacity: 0.9; transform: scale(1.2); }
  70% { opacity: 0.2; transform: scale(0.8); }
}

.world__vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  background:
    radial-gradient(ellipse 80% 75% at 50% 48%, transparent 35%, rgba(2, 10, 16, 0.4) 100%),
    linear-gradient(180deg, rgba(2, 12, 18, 0.12) 0%, transparent 28%, rgba(2, 12, 18, 0.32) 100%);
}

body.is-map-open .world__water {
  opacity: 0.45;
}

/* Soft volcanic smoke drift over island */
.world::after {
  content: '';
  position: absolute;
  left: 42%;
  top: 6%;
  width: 30%;
  height: 34%;
  z-index: 2;
  background:
    radial-gradient(ellipse 50% 60% at 50% 80%, rgba(180, 180, 185, 0.28), transparent 70%),
    radial-gradient(ellipse 40% 50% at 55% 50%, rgba(200, 200, 205, 0.14), transparent 70%);
  filter: blur(18px);
  opacity: 0.8;
  animation: smoke-drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes smoke-drift {
  from { transform: translate(0, 0) scale(1); opacity: 0.5; }
  to { transform: translate(5%, -8%) scale(1.15); opacity: 0.9; }
}

/* Pause ambient sway when scroll-driven transforms apply */
body.is-map-open .world__far {
  animation: none;
}

/* ── Nav ── */
.j-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(16px, 3vw, 40px);
  pointer-events: none;
}
.j-nav > * { pointer-events: auto; }

.j-nav__logo {
  display: flex;
  border-radius: 10px;
  transition: transform 0.2s ease, opacity 0.2s;
}
.j-nav__logo img { border-radius: 8px; display: block; }
.j-nav__logo:hover { transform: scale(1.04); opacity: 0.92; }

.j-nav__brand {
  position: relative;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.35s ease, visibility 0.35s, transform 0.35s var(--ease);
}
body.is-map-open .j-nav__brand {
  opacity: 1;
  visibility: visible;
  transform: none;
}
body.is-cinematic .j-nav__brand {
  opacity: 0 !important;
  visibility: hidden !important;
}

.header__trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border: none;
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.header__trigger:hover,
.header__trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
}
.header__tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 14px;
  border: 1px solid rgba(238, 246, 248, 0.16);
  border-radius: 100px;
  background: rgba(4, 20, 28, 0.45);
  backdrop-filter: blur(10px);
}
.header__chevron { color: var(--text-muted); transition: transform 0.2s; }
.header__trigger[aria-expanded="true"] .header__chevron { transform: rotate(180deg); }

.header__menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 200px;
  padding: 8px;
  background: rgba(6, 18, 26, 0.94);
  border: 1px solid rgba(238, 246, 248, 0.12);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 50;
}
.header__menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.header__menu-item {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.header__menu-item:hover,
.header__menu-item[aria-current="page"] {
  background: rgba(255, 255, 255, 0.08);
}

.j-nav__replay {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  background: rgba(4, 24, 32, 0.55);
  border: 1px solid rgba(238, 246, 248, 0.2);
  border-radius: 100px;
  padding: 8px 16px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
body.is-map-open .j-nav__replay:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

/* ── Hero / bottle sitting IN the lagoon water ── */
.hero {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  min-height: 100dvh;
  /* No flex centering — bottle is placed in the water band of the photo */
  cursor: default;
  user-select: none;
  pointer-events: none;
}

.hero > * {
  pointer-events: auto;
}

/*
  Bottle sits LOW in the frame where reframed lagoon water is.
  bottom-based so it stays in water across viewports.
*/
.bottle-wrap {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: 12vh;
  width: min(360px, 72vw);
  transform: translateX(-50%);
  animation: float-drift 11s ease-in-out infinite;
  filter: drop-shadow(0 20px 18px rgba(10, 70, 90, 0.55));
  z-index: 5;
}

/* Local lagoon tint under bottle so it always reads “in water” */
.bottle-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8%;
  width: 170%;
  height: 42%;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 50% at 50% 40%, rgba(70, 170, 190, 0.45), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 70%, rgba(30, 100, 120, 0.35), transparent 75%);
  filter: blur(4px);
}

@keyframes float-drift {
  0%, 100% { transform: translateX(calc(-50% - 8px)) translateY(0); }
  35% { transform: translateX(calc(-50% + 10px)) translateY(-8px); }
  65% { transform: translateX(calc(-50% + 2px)) translateY(3px); }
}

.bottle {
  position: relative;
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  animation: float-bob 4.8s ease-in-out infinite;
  transform-origin: 50% 88%;
  transition: filter 0.35s ease;
  -webkit-tap-highlight-color: transparent;
  z-index: 3;
}

@keyframes float-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  30% { transform: translateY(-12px) rotate(1.2deg); }
  55% { transform: translateY(-3px) rotate(2deg); }
  80% { transform: translateY(-15px) rotate(-1deg); }
}

.bottle:hover,
.bottle:focus-visible {
  filter: brightness(1.05);
  outline: none;
}

.bottle:hover .bottle__tip,
.bottle:focus-visible .bottle__tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.bottle__tip {
  position: absolute;
  left: 50%;
  top: -4%;
  transform: translateX(-50%) translateY(8px);
  z-index: 8;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0a1820;
  background: rgba(244, 246, 240, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 100px;
  padding: 8px 14px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 10, 20, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s var(--ease), visibility 0.25s;
  pointer-events: none;
}

/* Cutout silhouette — mild waterline fade only at the base */
.bottle__photo {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  background: transparent;
  -webkit-mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 72%,
    rgba(0, 0, 0, 0.88) 84%,
    rgba(0, 0, 0, 0.45) 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 72%,
    rgba(0, 0, 0, 0.88) 84%,
    rgba(0, 0, 0, 0.45) 94%,
    transparent 100%
  );
}

/*
  Cream paper collar on bottle-cutout.png sits just under the cork.
  Full-frame PNG: cork ~8–13%, cream collar ~15–21% from top.
  Logo must be large enough to read and fully opaque (no multiply).
*/
.bottle__neck-label {
  position: absolute;
  left: 50%;
  top: 18.5%;
  transform: translate(-50%, -50%);
  z-index: 12;
  width: 23%;
  aspect-ratio: 1;
  height: auto;
  min-width: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  pointer-events: none;
  border-radius: 4px;
  background: #f3ead6;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(80, 55, 30, 0.2);
  overflow: hidden;
  padding: 3px;
  opacity: 1;
  visibility: visible;
}
.bottle__neck-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%; /* prefer icon mark over wordmark for neck */
  display: block;
  mix-blend-mode: normal;
  opacity: 1;
  border-radius: 2px;
}

/* Gentle white-capped waves at waterline around bottle base */
.bottle-sea {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 160%;
  height: 22%;
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.bottle-sea__foam {
  position: absolute;
  left: 50%;
  bottom: 10%;
  height: 55%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 55%,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(160, 210, 220, 0.28) 45%,
    transparent 72%
  );
  filter: blur(2.5px);
  transform: translateX(-50%);
  animation: foam-sway 5s ease-in-out infinite;
}
.bottle-sea__foam--1 {
  width: 92%;
  opacity: 0.75;
  animation-duration: 4.6s;
}
.bottle-sea__foam--2 {
  width: 120%;
  bottom: 0;
  height: 60%;
  opacity: 0.4;
  animation-duration: 5.4s;
  animation-delay: -1.2s;
}
.bottle-sea__foam--3 {
  width: 72%;
  bottom: 22%;
  height: 36%;
  opacity: 0.55;
  animation-duration: 3.8s;
  animation-delay: -0.6s;
}

@keyframes foam-sway {
  0%, 100% { transform: translateX(-50%) scaleX(1) scaleY(1); opacity: 0.7; }
  50% { transform: translateX(-48%) scaleX(1.08) scaleY(1.12); opacity: 0.95; }
}

/* White caps — small cresting peaks left / right / center */
.bottle-sea__cap {
  position: absolute;
  bottom: 22%;
  width: 28px;
  height: 14px;
  background:
    radial-gradient(ellipse 70% 80% at 50% 80%, rgba(255, 255, 255, 0.95), transparent 70%);
  border-radius: 50% 50% 40% 40%;
  filter: blur(0.4px);
  animation: cap-bob 3.2s ease-in-out infinite;
  opacity: 0.85;
}
.bottle-sea__cap--l {
  left: 12%;
  animation-delay: 0s;
}
.bottle-sea__cap--r {
  right: 12%;
  left: auto;
  animation-delay: -1.1s;
  width: 34px;
}
.bottle-sea__cap--c {
  left: 50%;
  transform: translateX(-50%);
  bottom: 30%;
  width: 40px;
  height: 16px;
  animation-delay: -0.5s;
  animation-name: cap-bob-c;
}

@keyframes cap-bob {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.7; }
  50% { transform: translateY(-5px) scale(1.15); opacity: 1; }
}
@keyframes cap-bob-c {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 0.75; }
  50% { transform: translateX(-50%) translateY(-6px) scale(1.12); opacity: 1; }
}

@media (max-width: 600px) {
  .bottle-wrap {
    width: min(300px, 80vw);
    bottom: 10vh;
    top: auto;
  }
  .bottle__neck-label {
    width: 24%;
    min-width: 44px;
    min-height: 44px;
    top: 18.5%;
  }
}

.hero__hint {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  transition: opacity 0.4s;
}
.hero__hint--touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .hero__hint--desk { display: none; }
  .hero__hint--touch { display: inline; }
}

.hero__skip {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(4, 20, 28, 0.5);
  border: 1px solid rgba(238, 246, 248, 0.2);
  border-radius: 100px;
  padding: 10px 20px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s, color 0.2s;
}
.hero__skip.is-visible { opacity: 1; visibility: visible; }
.hero__skip:hover { color: var(--text-light); }

/* ── Map exits bottle → rises → unfurls (smooth continuous flow) ── */
.map-scroll {
  position: absolute;
  left: 50%;
  top: 18%;
  width: 16%;
  height: 8%;
  transform: translate(-50%, 0) scale(0.2);
  opacity: 0;
  visibility: hidden;
  z-index: 20;
  pointer-events: none;
  transform-origin: 50% 100%;
  will-change: transform, width, height, top, opacity;
}

.map-scroll__tube {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 12px 40px rgba(0, 15, 25, 0.5),
    inset 0 0 0 1px rgba(90, 55, 25, 0.25);
  background: #c4a882;
}

.map-scroll__tex {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: 50% 50%;
  will-change: transform;
}

/* Phase 1: emerge from bottle mouth (rolled scroll) */
.hero.is-opening .map-scroll {
  visibility: visible;
  animation: map-emerge 1.2s cubic-bezier(0.33, 1, 0.32, 1) forwards;
}
@keyframes map-emerge {
  0% {
    top: 20%;
    width: 12%;
    height: 5%;
    opacity: 0;
    transform: translate(-50%, 30%) scale(0.25) rotate(-6deg);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    top: 2%;
    width: 20%;
    height: 22%;
    transform: translate(-50%, -30%) scale(0.9) rotate(0deg);
  }
}

/* Phase 2: glide to center + unfurl to chart size */
.hero.is-opening.is-unfurling .map-scroll {
  animation: map-unfurl 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes map-unfurl {
  0% {
    top: 2%;
    left: 50%;
    width: 20%;
    height: 22%;
    opacity: 1;
    transform: translate(-50%, -30%) scale(0.9);
  }
  40% {
    top: 45%;
    width: 55vw;
    height: 50vh;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    top: 50%;
    left: 50%;
    width: min(560px, 90vw);
    height: min(82vh, 760px);
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.hero.is-opening.is-unfurling .map-scroll__tube {
  border-radius: 6px;
  transition: border-radius 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero.is-opening.is-unfurling .map-scroll__tex {
  animation: map-sheet-reveal 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes map-sheet-reveal {
  0% {
    transform: scale(1.15, 0.2);
    filter: brightness(0.88) saturate(0.9);
  }
  50% {
    transform: scale(1.04, 0.7);
    filter: brightness(0.95);
  }
  100% {
    transform: scale(1, 1);
    filter: brightness(1) saturate(1);
  }
}

/* Phase 3: crossfade — scroll fades as live chart is ready underneath */
.hero.is-opening.is-handoff .map-scroll {
  animation: map-handoff-fade 0.4s ease forwards;
}
@keyframes map-handoff-fade {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}

/* Cinematic open — bottle sinks as map leaves */
.hero.is-opening { cursor: default; pointer-events: none; }
.hero.is-opening .bottle__tip { opacity: 0 !important; visibility: hidden !important; }
.hero.is-opening .bottle-wrap {
  animation: none !important;
  transform: translateX(-50%);
}
.hero.is-opening .bottle {
  animation: bottle-release 1.2s cubic-bezier(0.33, 1, 0.32, 1) forwards;
}
@keyframes bottle-release {
  0% { transform: translateY(0) rotate(-2deg) scale(1); opacity: 1; }
  35% { transform: translateY(-8px) rotate(2deg) scale(1.02); opacity: 1; }
  100% { transform: translateY(10px) rotate(-3deg) scale(0.97); opacity: 0.9; }
}
.hero.is-opening.is-unfurling .bottle-wrap {
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), filter 1s ease, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0;
  filter: blur(10px);
  transform: translateX(-50%) translateY(28%) scale(0.7);
}
.hero.is-opening:not(.is-unfurling) .bottle__neck-label {
  opacity: 1;
}
.hero.is-opening.is-unfurling .bottle__neck-label {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.hero.is-opening .bottle-sea {
  opacity: 0;
  transition: opacity 0.55s ease 0.15s;
}

.hero.is-done {
  position: fixed;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.55s ease, visibility 0.55s;
}

/* Chart under scroll during handoff — crossfade, no hard cut */
body.is-map-handoff .map-pin {
  /* Chart already in place while scroll still visible on top */
}
body.is-map-handoff .chart:not(.is-crossfading) {
  opacity: 0 !important;
  transform: none !important;
}
body.is-map-handoff .chart.is-crossfading {
  transform: none !important;
  animation: chart-crossfade-in 0.4s ease forwards;
}
@keyframes chart-crossfade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
body.is-map-open .chart.is-settling {
  animation: chart-settle 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes chart-settle {
  from {
    opacity: 1;
    transform: scale(0.992);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Map guide: compact, off to the right of the chart ── */
.map-guide {
  position: fixed;
  left: auto;
  right: max(12px, 2vw);
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) translateX(10px);
  z-index: 250;
  width: min(168px, 22vw);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.4s;
}
.map-guide.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}
.map-guide.is-leaving {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(12px);
  pointer-events: none;
}
.map-guide__card {
  padding: 10px 11px 9px;
  border-radius: 12px;
  background: rgba(8, 22, 30, 0.78);
  border: 1px solid rgba(255, 240, 220, 0.14);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  color: #f2f6f8;
  cursor: pointer;
}
.map-guide__title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  font-style: italic;
  margin-bottom: 8px;
  color: #f7efe2;
  text-align: left;
  line-height: 1.2;
}
.map-guide__steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
}
.map-guide__steps li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.68rem;
  line-height: 1.3;
  color: rgba(235, 242, 245, 0.88);
}
.map-guide__steps strong {
  color: #fff;
  font-weight: 600;
}
.map-guide__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.58rem;
  font-weight: 700;
  background: rgba(122, 28, 20, 0.85);
  color: #f5e8d8;
  border: 1px solid rgba(255, 200, 180, 0.18);
  margin-top: 1px;
}
.map-guide__nudge {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(200, 220, 230, 0.8);
  padding-top: 2px;
}
.map-guide__chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  animation: guide-bounce 1.2s ease-in-out infinite;
}
@keyframes guide-bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.7; }
  50% { transform: rotate(45deg) translateY(3px); opacity: 1; }
}

/* Wide screens: sit clearly to the right of the centered map */
@media (min-width: 1100px) {
  .map-guide {
    right: max(24px, calc(50% - 280px - 12px - 168px));
    /* fallback if calc collapses oddly */
    left: calc(50% + min(280px, 45vw) + 16px);
    right: auto;
    width: 160px;
  }
}

/* Narrow: compact strip bottom-right so it stays off the chart */
@media (max-width: 900px) {
  .map-guide {
    top: auto;
    bottom: max(12px, 2vh);
    right: 10px;
    left: auto;
    width: min(150px, 42vw);
    transform: translateY(8px);
  }
  .map-guide.is-visible {
    transform: translateY(0);
  }
  .map-guide.is-leaving {
    transform: translateY(10px);
  }
  .map-guide__title {
    font-size: 0.8rem;
  }
  .map-guide__steps li {
    font-size: 0.62rem;
  }
}

/* ── Map journey ── */
.map-journey {
  position: relative;
  z-index: 20;
}
.map-journey:not([hidden]) { display: block; }

.map-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 4px) clamp(10px, 2.5vw, 28px) 20px;
  overflow: hidden;
}

.chart {
  width: min(580px, 96vw);
  height: min(88vh, 800px);
  max-height: calc(100dvh - var(--nav-h) - 24px);
  opacity: 0;
  transform: scale(0.94) translateY(20px);
  transition: opacity 0.85s var(--ease), transform 0.95s var(--ease);
  /* Soft blend into ocean — no hard card shadow */
  filter: drop-shadow(0 12px 28px rgba(0, 15, 25, 0.25));
}
body.is-map-open .chart.is-unfurled {
  opacity: 1;
  transform: none;
}
body.is-map-open .chart.is-settling.is-unfurled {
  /* settle animation handles opacity/transform */
}

.chart__frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: visible;
  transform-origin: 50% 0%;
  /* Dissolve map edges into ocean */
  -webkit-mask-image: radial-gradient(ellipse 78% 82% at 50% 48%, #000 42%, rgba(0,0,0,0.75) 62%, transparent 88%);
  mask-image: radial-gradient(ellipse 78% 82% at 50% 48%, #000 42%, rgba(0,0,0,0.75) 62%, transparent 88%);
}
body.is-map-open .chart.is-unfurling .chart__frame {
  animation: unfurl 1.35s var(--ease) forwards;
}
@keyframes unfurl {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.chart__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0.88;
  mix-blend-mode: multiply;
  filter: contrast(1.05) saturate(0.95);
}

.chart__shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 70% at 50% 48%, transparent 30%, rgba(4, 18, 26, 0.15) 100%);
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.chart__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.chart__path {
  opacity: 0.92;
}

.chart__ship {
  position: absolute;
  z-index: 5;
  width: clamp(56px, 13vw, 92px);
  height: auto;
  left: 50%;
  top: 6%;
  transform: translate(-50%, -55%);
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: left, top, transform;
}
.chart__ship.is-active { opacity: 1; }

.chart__nodes {
  position: absolute;
  inset: 0;
  z-index: 6;
}

.map-node {
  position: absolute;
  transform: translate(-50%, -50%) scale(1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  transition: transform 0.25s var(--ease), filter 0.25s ease;
  padding: 0;
  font: inherit;
  color: var(--ink);
  z-index: 7;
}
.map-node.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.map-node:focus-visible { outline: none; }
.map-node:hover .map-node__seal,
.map-node:focus-visible .map-node__seal,
.map-node.is-active .map-node__seal,
.map-node.is-ship-here .map-node__seal {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(122, 28, 20, 0.3), 0 6px 14px rgba(40, 10, 5, 0.4);
}
.map-node.is-ship-here .map-node__seal {
  box-shadow: 0 0 0 4px rgba(122, 28, 20, 0.4), 0 0 18px rgba(160, 40, 30, 0.45);
}

.map-node__seal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #a83028, var(--oxblood) 55%, var(--oxblood-deep));
  color: #f5e8d8;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  border: 2px solid rgba(60, 15, 10, 0.45);
  box-shadow: 0 3px 10px rgba(40, 10, 5, 0.4), inset 0 1px 2px rgba(255, 200, 180, 0.25);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.map-node__label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  font-style: italic;
  color: #1e120a;
  text-shadow: 0 1px 0 rgba(255, 245, 230, 0.65), 0 0 6px rgba(232, 220, 190, 0.8);
  white-space: nowrap;
  background: rgba(240, 228, 200, 0.72);
  padding: 1px 8px;
  border-radius: 4px;
}

/* X marks the spot */
.chart-x {
  position: absolute;
  left: 50%;
  top: 88%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 8;
  width: 64px;
  height: 64px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.55;
  pointer-events: auto;
  transition: opacity 0.35s ease, transform 0.35s var(--ease), filter 0.35s ease;
  padding: 0;
}
.chart-x.is-visible {
  opacity: 0.55;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.chart-x.is-near {
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(122, 28, 20, 0.45));
  transform: translate(-50%, -50%) scale(1.06);
}
.chart-x__glyph {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--oxblood-deep);
  text-shadow:
    0 0 1px #3a0a08,
    1px 1px 0 rgba(255, 240, 220, 0.35),
    0 4px 12px rgba(80, 15, 10, 0.45);
  line-height: 1;
  transition: color 0.25s, transform 0.25s var(--ease);
}
.chart-x__ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px dashed rgba(122, 28, 20, 0.45);
  opacity: 0.7;
  transition: transform 0.35s var(--ease), border-color 0.25s, opacity 0.25s;
}
.chart-x:hover .chart-x__glyph,
.chart-x:focus-visible .chart-x__glyph,
.chart-x.is-selected .chart-x__glyph {
  color: #9a2018;
  transform: scale(1.08);
}
.chart-x:hover .chart-x__ring,
.chart-x:focus-visible .chart-x__ring,
.chart-x.is-selected .chart-x__ring {
  transform: scale(1.2) rotate(12deg);
  border-color: var(--oxblood);
  opacity: 1;
}
.chart-x:focus-visible { outline: none; }

/* Arrival / logo after X */
.chart-arrival {
  position: absolute;
  left: 50%;
  bottom: 3%;
  transform: translateX(-50%);
  z-index: 9;
  width: min(92%, 300px);
  text-align: center;
  padding: 14px 16px 16px;
  background: rgba(18, 12, 8, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 230, 200, 0.18);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  animation: arrival-in 0.45s var(--ease);
}
.chart-arrival[hidden] { display: none; }
@keyframes arrival-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.chart-arrival__logo {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  margin: 0 auto 10px;
  display: block;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.chart-arrival__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  font-style: italic;
  color: #f4ebe0;
  margin-bottom: 4px;
}
.chart-arrival__sub {
  font-size: 0.78rem;
  color: rgba(230, 220, 200, 0.75);
  margin-bottom: 14px;
  line-height: 1.35;
}
.chart-arrival__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #f5e8d8;
  background: linear-gradient(180deg, #9a2820, var(--oxblood-deep));
  border: 1px solid rgba(40, 8, 6, 0.45);
  border-radius: 100px;
  padding: 11px 24px;
  box-shadow: 0 6px 18px rgba(60, 10, 8, 0.4);
  transition: transform 0.2s, filter 0.2s;
}
.chart-arrival__cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.chart-arrival__cta:focus-visible {
  outline: 2px solid #f5e8d8;
  outline-offset: 3px;
}

.map-scroll-space {
  height: 300vh;
  pointer-events: none;
}

/* Mobile stage list */
.stage-list {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 0 clamp(16px, 4vw, 28px) 48px;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  z-index: 15;
}
.stage-list__btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 240, 220, 0.12);
  border-radius: 12px;
  background: rgba(12, 24, 32, 0.72);
  backdrop-filter: blur(12px);
  color: var(--text-light);
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0.35;
  transform: translateY(8px);
  transition: opacity 0.4s, transform 0.4s, box-shadow 0.2s;
}
.stage-list__btn.is-visible {
  opacity: 1;
  transform: none;
}
.stage-list__num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--oxblood);
  color: #f5e8d8;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
}
.stage-list__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  font-style: italic;
  display: block;
}
.stage-list__title {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

@media (max-width: 720px) {
  .map-pin {
    height: auto;
    min-height: 72vh;
    position: relative;
  }
  .chart {
    height: min(72vh, 580px);
    width: min(100%, 420px);
  }
  .map-node__seal { width: 34px; height: 34px; font-size: 0.72rem; }
  .map-node__label { font-size: 0.68rem; }
  .chart__ship { width: 56px; }
  .stage-list { display: flex; }
  .map-scroll-space { height: 180vh; }
  .chart-x { width: 52px; height: 52px; }
  .chart-x__glyph { font-size: 2rem; }
}

/* Modal */
.stage-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
}
.stage-modal[hidden] { display: none; }
.stage-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 12, 18, 0.62);
  backdrop-filter: blur(5px);
  cursor: pointer;
}
.stage-modal__card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  padding: clamp(20px, 4vw, 32px);
  background: linear-gradient(165deg, #f7f0e0, #e8dcc4 60%, #dfd0b0);
  border-radius: 16px;
  border: 1px solid rgba(90, 60, 30, 0.15);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  animation: modal-in 0.35s var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.stage-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(42, 26, 16, 0.06);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.stage-modal__close:hover { background: rgba(122, 28, 20, 0.12); }
.stage-modal__step {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 6px;
}
.stage-modal__title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 8px;
  padding-right: 28px;
}
.stage-modal__lead {
  font-size: 0.9rem;
  color: var(--muted-warm);
  margin-bottom: 16px;
}
.stage-modal__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.stage-block {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 250, 240, 0.55);
  border: 1px solid rgba(90, 60, 30, 0.08);
}
.stage-block p {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.stage-block__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--oxblood);
}
.stage-block--approach .stage-block__label { color: #3d5a40; }
.stage-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
.stage-modal__stats,
.stage-modal__value {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stage-modal__stats li,
.stage-modal__value li {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-soft);
}
.stage-modal__stats li strong,
.stage-modal__value li strong {
  color: var(--ink);
  font-weight: 600;
}
.stage-modal__example {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-soft);
  padding-top: 10px;
  border-top: 1px solid rgba(90, 60, 30, 0.12);
}
@media (max-width: 560px) {
  .stage-modal__cols,
  .stage-modal__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bottle { animation: none; }
  .bottle__wake { animation: none; }
  body.is-map-open .chart.is-unfurling .chart__frame { animation: none; }
  .chart-arrival { animation: none; }
  .stage-modal__card { animation: none; }
}
