:root {
  --ink: #10231c;
  --cream: #f3efe4;
  --sand: #e4d6b8;
  --gold: #c4a35a;
  --gold-soft: #e8d7a8;
  --sea: #0b3d4a;
  --deep: #06151a;
  --pine: #1f4d3a;
  --glow: rgba(196, 163, 90, 0.45);
  --panel: rgba(8, 24, 22, 0.72);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --nav-h: 3.4rem;
  /* Starts almost still, ends at full whip: the orbit reads as accelerating. */
  --atom-ease: cubic-bezier(0.62, 0, 0.9, 0.35);
  --heart-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 29'%3E%3Cpath d='M16 27.2S1.5 18.1 1.5 9.4C1.5 4.7 5 1.5 9.3 1.5c2.7 0 5 1.4 6.7 3.5C17.7 2.9 20 1.5 22.7 1.5 27 1.5 30.5 4.7 30.5 9.4c0 8.7-14.5 17.8-14.5 17.8z' fill='%23000'/%3E%3C/svg%3E");
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--deep);
  color: var(--cream);
  font-family: var(--font-body);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  min-height: 100dvh;
  min-height: 100svh;
}

.sky {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(45, 90, 78, 0.55), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(11, 61, 74, 0.5), transparent 55%),
    radial-gradient(ellipse 40% 35% at 15% 70%, rgba(196, 163, 90, 0.12), transparent 50%),
    linear-gradient(165deg, #071318 0%, #0a1f1c 45%, #061015 100%);
  z-index: 0;
  pointer-events: none;
}

.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 28% 42%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 67% 22%, rgba(232, 215, 168, 0.8), transparent),
    radial-gradient(1px 1px at 82% 58%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 45% 12%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 91% 14%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 8% 72%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 55% 78%, rgba(232, 215, 168, 0.55), transparent);
  opacity: 0.85;
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 0.95;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lock-stage {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.85rem;
  padding:
    max(2rem, var(--safe-top))
    max(1.25rem, var(--safe-left))
    max(2rem, var(--safe-bottom))
    max(1.25rem, var(--safe-right));
  text-align: center;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.lock-stage.is-leaving {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.lock-title {
  margin: 0.1em 0 0.15em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 11vw, 4.8rem);
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--cream);
  text-shadow: 0 0 40px rgba(196, 163, 90, 0.25);
}

.lock-form {
  display: grid;
  gap: 0.75rem;
  width: min(20rem, 100%);
  margin-top: 0.85rem;
}

.lock-input {
  width: 100%;
  border: 1px solid rgba(232, 215, 168, 0.28);
  border-radius: 0.35rem;
  background: rgba(6, 18, 20, 0.72);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.06em;
  padding: 0.95rem 1rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.lock-input::placeholder {
  color: rgba(243, 239, 228, 0.4);
}

.lock-input:focus {
  border-color: rgba(196, 163, 90, 0.7);
  box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.18);
}

.lock-submit {
  border: 0;
  border-radius: 0.35rem;
  background: linear-gradient(160deg, #2a7a5f, #1a5342);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.95rem 1rem;
  min-height: 3rem;
  cursor: pointer;
}

.lock-submit:active {
  transform: scale(0.98);
}

.lock-error {
  margin: 0;
  font-size: 0.84rem;
  color: #e8a0a5;
}

.gift-stage {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2.5rem;
  padding:
    calc(1.5rem + var(--safe-top))
    calc(1.25rem + var(--safe-right))
    calc(2rem + var(--safe-bottom))
    calc(1.25rem + var(--safe-left));
  text-align: center;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.gift-stage[hidden] {
  display: none;
}

.gift-stage.is-leaving {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.gift-copy h1 {
  margin: 0.15em 0 0.2em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.2rem, 14vw, 6.5rem);
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--cream);
  text-shadow: 0 0 40px rgba(196, 163, 90, 0.25);
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.lede {
  margin: 0 auto;
  max-width: 22rem;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(243, 239, 228, 0.78);
}

.gift {
  position: relative;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 1.5rem 1rem 0.5rem;
  min-width: 9rem;
  min-height: 11rem;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.gift:focus-visible .gift__box {
  box-shadow: 0 0 0 2px var(--deep), 0 0 0 4px var(--gold);
}

.gift__shadow {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  width: 9rem;
  height: 1.2rem;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.45), transparent 70%);
  filter: blur(2px);
}

.gift__box {
  position: relative;
  display: block;
  width: 9.2rem;
  height: 8.2rem;
  margin: 0 auto;
  transform-style: preserve-3d;
  perspective: 600px;
  animation: float-gift 3.2s ease-in-out infinite;
}

@keyframes float-gift {
  0%,
  100% {
    transform: translateY(0) rotateX(14deg) rotateY(-18deg);
  }
  50% {
    transform: translateY(-12px) rotateX(16deg) rotateY(-12deg);
  }
}

.gift__body {
  position: absolute;
  inset: 1.75rem 0.15rem 0.2rem;
  border-radius: 0.35rem 0.35rem 0.55rem 0.55rem;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 18%),
    linear-gradient(145deg, #2a7a5c 0%, #1a5340 42%, #0f3328 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset -10px 0 18px rgba(0, 0, 0, 0.18),
    0 22px 44px rgba(0, 0, 0, 0.4);
  transform: translateZ(8px);
}

.gift__lid {
  position: absolute;
  left: -0.15rem;
  right: -0.15rem;
  top: 0.15rem;
  height: 2.25rem;
  border-radius: 0.45rem;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 20%),
    linear-gradient(160deg, #3a9170 0%, #22634d 55%, #174536 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 20px rgba(0, 0, 0, 0.28);
  transform-origin: 12% 80%;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.gift.is-opening .gift__lid {
  transform: translateY(-22px) translateX(-10px) rotateZ(-32deg) rotateX(-18deg);
}

.gift.is-opening .gift__box {
  animation: none;
  transform: translateY(0) rotateX(10deg) rotateY(-10deg) scale(1.06);
}

.gift__ribbon-v,
.gift__ribbon-h {
  position: absolute;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 55%, #9a7a35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.gift__ribbon-v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1.05rem;
  transform: translateX(-50%);
}

.gift__ribbon-h {
  top: 42%;
  left: 0;
  right: 0;
  height: 1.05rem;
}

.gift__bow {
  position: absolute;
  left: 50%;
  top: -0.85rem;
  width: 2.4rem;
  height: 1.4rem;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 30% 50%, var(--gold-soft) 0 38%, transparent 40%),
    radial-gradient(circle at 70% 50%, var(--gold-soft) 0 38%, transparent 40%),
    radial-gradient(circle at 50% 55%, var(--gold) 0 28%, transparent 30%);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.gift__hint {
  display: inline-block;
  margin-top: 1.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.gift.is-opening .gift__hint {
  opacity: 0;
}

.meet-stage {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.35rem;
  padding:
    max(1.5rem, var(--safe-top))
    max(1rem, var(--safe-left))
    max(1.5rem, var(--safe-bottom))
    max(1rem, var(--safe-right));
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s ease;
}

.meet-stage.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.meet-stage.is-leaving {
  opacity: 0;
  pointer-events: none;
  transition-duration: 0.7s;
}

.meet-scene {
  position: relative;
  z-index: 1;
  width: min(94vw, 44rem);
  height: min(58vh, 27rem);
  perspective: 1200px;
  perspective-origin: 50% 50%;
  transition: width 0.45s ease, height 0.45s ease;
}

/* During the orbit the scene becomes the full stage, so the shared centre is
   the screen centre and the X radius can reach the left and right edges. */
.meet-stage.phase-orbit .meet-scene,
.meet-stage.phase-flash .meet-scene {
  width: 100vw;
  height: min(72vh, 36rem);
  perspective: 1400px;
}

.meet-orbit {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform-style: preserve-3d;
}

.meet-orbit__ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  /* No desktop pullback: shrinking the ring cancelled the wide X travel. */
  --orbit-pullback: 1;
}

.meet-photo {
  position: absolute;
  left: 50%;
  top: 50%;
  /* Half a photo width, minus a sliver, so the pair rests shoulder to shoulder
     and the orbit radius matches where they already sit. */
  --r: calc(min(38vw, 16rem) * 0.46);
  width: min(38vw, 16rem);
  margin: 0;
  /* Two-sided card: the spin turns it edge-on and round to its back, so it
     needs a real reverse rather than a mirrored copy of the photo. */
  transform-style: preserve-3d;
  opacity: 0;
}

.meet-photo__front,
.meet-photo__back {
  padding: 0.55rem 0.55rem 1.35rem;
  background: linear-gradient(165deg, #f4efe4, #e7dcc4);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.meet-photo__front {
  position: relative;
}

.meet-photo__back {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, #f6f1e6, #e4d9c0 70%, #d9cbad);
  transform: rotateY(180deg);
}

.meet-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  background: #1a1a1a;
}

.meet-photo--him {
  --x: calc(var(--r) * -1);
  --tilt: -6deg;
  transform: translate(-50%, -50%) translateX(var(--x)) rotate(var(--tilt));
}

.meet-photo--her {
  --x: var(--r);
  --tilt: 6deg;
  transform: translate(-50%, -50%) translateX(var(--x)) rotate(var(--tilt));
}

/* Phase 1: fly in from off-screen and meet in the middle */
.meet-stage.phase-enter .meet-photo {
  opacity: 1;
}

.meet-stage.phase-enter .meet-photo--him {
  animation: fly-in-left 1.5s cubic-bezier(0.18, 0.9, 0.3, 1) both;
}

.meet-stage.phase-enter .meet-photo--her {
  animation: fly-in-right 1.5s cubic-bezier(0.18, 0.9, 0.3, 1) both;
}

/* Phase 2: float together */
.meet-stage.phase-float .meet-photo {
  opacity: 1;
}

.meet-stage.phase-float .meet-photo--him {
  animation: float-him 3.4s ease-in-out infinite;
}

.meet-stage.phase-float .meet-photo--her {
  animation: float-her 3.4s ease-in-out 0.4s infinite;
}

/* Phase 3: hearts revolve while the photos twirl around each other */
.meet-stage.phase-orbit .meet-photo {
  opacity: 1;
}

/* These carry on unchanged into the flash: dropping them there would snap the
   ring upright underneath the light. */
.meet-stage.phase-orbit .meet-orbit,
.meet-stage.phase-flash .meet-orbit {
  animation: orbit-tilt 3.2s ease-out both;
}

/* Phone only: tuck the ring a little so a spinning card stays on-screen. */
@media (max-width: 480px) {
  .meet-stage.phase-orbit .meet-orbit__ring,
  .meet-stage.phase-flash .meet-orbit__ring {
    animation: orbit-pullback 3.2s ease-out both;
  }
}

/* The orbit path itself is driven from JS (runBinaryOrbit). */
.meet-stage.phase-orbit .meet-photo {
  will-change: transform;
}

.meet-stage.phase-flash .meet-photo {
  opacity: 1;
}

.meet-hearts {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

.meet-stage.phase-orbit .meet-hearts,
.meet-stage.phase-flash .meet-hearts {
  animation: hearts-fade 3.4s ease-in-out both;
}

.meet-hearts__ring {
  position: relative;
  width: min(92vw, 40rem);
  aspect-ratio: 1;
}

.meet-stage.phase-orbit .meet-hearts__ring,
.meet-stage.phase-flash .meet-hearts__ring {
  animation: ring-spin 3.2s var(--atom-ease) both;
}

.orbit-heart {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.1rem;
  height: 1.9rem;
  margin: -0.95rem 0 0 -1.05rem;
  background-color: #e0464f;
  filter: drop-shadow(0 0 12px rgba(224, 70, 79, 0.7));
  transform: rotate(var(--a)) translateY(calc(min(92vw, 40rem) / -2)) rotate(calc(var(--a) * -1));
  -webkit-mask: var(--heart-mask) center / contain no-repeat;
  mask: var(--heart-mask) center / contain no-repeat;
  animation: heart-pulse 1.6s ease-in-out infinite;
}

.orbit-heart:nth-child(even) {
  animation-delay: 0.35s;
  opacity: 0.78;
  width: 1.4rem;
  height: 1.25rem;
  margin: -0.63rem 0 0 -0.7rem;
}

.meet-caption {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 4.5vw, 1.65rem);
  color: var(--gold-soft);
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
}

.meet-stage.phase-float .meet-caption,
.meet-stage.phase-orbit .meet-caption,
.meet-stage.phase-flash .meet-caption {
  animation: meet-caption 1.1s ease 0.35s both;
}

.meet-flash {
  position: fixed;
  inset: 0;
  z-index: 9;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0%, #fbf4e4 45%, #efe0bd 100%);
  opacity: 0;
  pointer-events: none;
}

.meet-stage.phase-flash .meet-flash {
  animation: slow-flash 1.4s ease-in both;
}

@keyframes fly-in-left {
  0% {
    transform: translate(-50%, -50%) translateX(-165vw) rotate(-22deg);
  }
  70% {
    transform: translate(-50%, -50%) translateX(calc(var(--x) + 2.4rem)) rotate(-3deg);
  }
  100% {
    transform: translate(-50%, -50%) translateX(var(--x)) rotate(-6deg);
  }
}

@keyframes fly-in-right {
  0% {
    transform: translate(-50%, -50%) translateX(165vw) rotate(22deg);
  }
  70% {
    transform: translate(-50%, -50%) translateX(calc(var(--x) - 2.4rem)) rotate(3deg);
  }
  100% {
    transform: translate(-50%, -50%) translateX(var(--x)) rotate(6deg);
  }
}

@keyframes float-him {
  0%,
  100% {
    transform: translate(-50%, -50%) translateX(var(--x)) rotate(-6deg);
  }
  50% {
    transform: translate(-50%, -50%) translateX(var(--x)) translateY(-14px) rotate(-4deg);
  }
}

@keyframes float-her {
  0%,
  100% {
    transform: translate(-50%, -50%) translateX(var(--x)) rotate(6deg);
  }
  50% {
    transform: translate(-50%, -50%) translateX(var(--x)) translateY(-14px) rotate(4deg);
  }
}

/* A slight lean so the helix axis reads as 3D without tipping so far that it
   turns back into a flat carousel. */
@keyframes orbit-tilt {
  0% {
    transform: rotateX(0deg) rotateZ(0deg);
  }
  30%,
  100% {
    transform: rotateX(-15deg) rotateZ(4deg);
  }
}

@keyframes orbit-pullback {
  0% {
    transform: scale(1);
  }
  35%,
  100% {
    transform: scale(var(--orbit-pullback, 0.88));
  }
}

@keyframes ring-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(1080deg);
  }
}

@keyframes hearts-fade {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  25% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes heart-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(224, 70, 79, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(224, 70, 79, 0.95));
  }
}

/* Spikes to a blinding white as the orbit hits top speed, then holds so the
   map can be built up underneath it. */
@keyframes slow-flash {
  0% {
    opacity: 0;
  }
  30%,
  100% {
    opacity: 1;
  }
}

@keyframes meet-caption {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.map-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  height: 100svh;
  opacity: 0;
  transition: opacity 1s ease;
  overflow: hidden;
}

.map-stage.is-visible {
  opacity: 1;
}

.map-stage[hidden] {
  display: block;
  visibility: hidden;
  pointer-events: none;
}

.globe-mount {
  position: absolute;
  inset: 0;
  touch-action: none;
  opacity: 0;
  transition: opacity 1.6s ease;
}

.globe-mount.is-ready {
  opacity: 1;
}

.globe-mount canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

.topbar {
  position: absolute;
  top: max(0.75rem, var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: min(92vw, 28rem);
  text-align: center;
  pointer-events: none;
  opacity: 0;
}

.map-stage.is-globe-ready .topbar {
  animation: rise-in-x 1.1s 0.15s ease both;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.brand-sub {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.note-panel {
  position: absolute;
  z-index: 3;
  left: max(1rem, var(--safe-left));
  bottom: calc(var(--nav-h) + 0.85rem + var(--safe-bottom));
  width: min(22.5rem, calc(100vw - 2rem - var(--safe-left) - var(--safe-right)));
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid rgba(232, 215, 168, 0.18);
  background:
    linear-gradient(160deg, rgba(16, 42, 38, 0.88), rgba(6, 18, 20, 0.82));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  opacity: 0;
  max-height: min(48vh, 26rem);
  display: flex;
  flex-direction: column;
}

.map-stage.is-globe-ready .note-panel {
  animation: rise-in 1.15s 0.35s ease both;
}

.note-panel.is-centered {
  left: 50%;
  transform: translateX(-50%);
}

.map-stage.is-globe-ready .note-panel.is-centered {
  animation-name: rise-in-x;
}

.note-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.note-toggle {
  flex: 0 0 auto;
  min-height: 2.75rem;
  min-width: 3.5rem;
  margin: -0.2rem -0.2rem 0 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(232, 215, 168, 0.22);
  background: rgba(6, 18, 20, 0.45);
  color: var(--gold-soft);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.note-panel__body {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.65rem;
}

.note-panel:not(.is-expanded) .note-panel__body {
  display: none;
}

.note-panel:not(.is-expanded) {
  max-height: none;
  padding-bottom: 0.95rem;
}

.note-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.note-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
}

.note-body {
  margin: 0 0 0.7rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(243, 239, 228, 0.86);
}

.note-sign {
  margin: 0.85rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold-soft);
}

.city-nav {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: max(0.7rem, var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 0.3rem;
  width: min(34rem, calc(100vw - 1.25rem - var(--safe-left) - var(--safe-right)));
  padding: 0.3rem;
  border: 1px solid rgba(232, 215, 168, 0.16);
  background: rgba(6, 18, 20, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
}

.map-stage.is-globe-ready .city-nav {
  animation: rise-in-x 1.1s 0.45s ease both;
}

.city-nav button {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(243, 239, 228, 0.75);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  min-height: 2.75rem;
  padding: 0.65rem 0.45rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.city-nav button:hover {
  color: var(--cream);
}

.city-nav button.is-active {
  background: rgba(196, 163, 90, 0.2);
  color: var(--gold-soft);
}

.hint-drag {
  position: absolute;
  z-index: 3;
  right: max(1rem, var(--safe-right));
  bottom: calc(var(--nav-h) + 0.85rem + var(--safe-bottom));
  margin: 0;
  max-width: 10rem;
  text-align: right;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 239, 228, 0.45);
  opacity: 0;
  pointer-events: none;
}

.map-stage.is-globe-ready .hint-drag {
  animation: rise-in 1.1s 0.55s ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise-in-x {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* iPhone / compact phones (incl. 15 Pro logical width ~393) */
@media (max-width: 480px) {
  .hint-drag {
    display: none;
  }

  .topbar {
    top: max(0.85rem, calc(var(--safe-top) + 0.35rem));
  }

  .brand {
    font-size: 1.85rem;
  }

  .brand-sub {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
  }

  .meet-scene {
    width: 96vw;
    height: 52vh;
  }

  .meet-scene {
    /* The orbit is physically smaller on a phone, so the camera has to sit
       closer for the depth to read as strongly as it does on a desktop. */
    perspective: 320px;
  }

  .meet-stage.phase-orbit .meet-scene,
  .meet-stage.phase-flash .meet-scene {
    width: 100vw;
    height: 62vh;
    perspective: 480px;
  }

  .meet-orbit__ring {
    --orbit-pullback: 0.82;
  }

  .meet-photo {
    --r: calc(min(43vw, 11.5rem) * 0.46);
    width: min(43vw, 11.5rem);
    padding: 0.4rem 0.4rem 1rem;
  }

  .meet-hearts__ring {
    width: 94vw;
  }

  .orbit-heart {
    width: 1.5rem;
    height: 1.35rem;
    margin: -0.68rem 0 0 -0.75rem;
    transform: rotate(var(--a)) translateY(-47vw) rotate(calc(var(--a) * -1));
  }

  .orbit-heart:nth-child(even) {
    width: 1.05rem;
    height: 0.95rem;
    margin: -0.48rem 0 0 -0.53rem;
  }

  .gift-stage {
    gap: 1.75rem;
  }

  .gift-copy h1 {
    font-size: clamp(3rem, 16vw, 4.2rem);
  }

  .note-panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100vw - 1.25rem - var(--safe-left) - var(--safe-right));
    bottom: calc(var(--nav-h) + 0.55rem + var(--safe-bottom));
    max-height: 34vh;
    padding: 0.9rem 1rem 1rem;
  }

  .map-stage.is-globe-ready .note-panel {
    animation-name: rise-in-x;
  }

  .note-panel h2 {
    font-size: 1.35rem;
  }

  .note-body {
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .note-sign {
    font-size: 1rem;
  }

  .city-nav {
    width: calc(100vw - 1rem - var(--safe-left) - var(--safe-right));
    bottom: max(0.45rem, var(--safe-bottom));
  }

  .city-nav button {
    font-size: 0.7rem;
    min-height: 2.85rem;
    padding: 0.55rem 0.2rem;
  }
}

@media (max-width: 720px) and (min-width: 481px) {
  .hint-drag {
    display: none;
  }

  .note-panel {
    left: 50%;
    transform: translateX(-50%);
    animation-name: rise-in-x;
    width: min(24rem, calc(100vw - 1.5rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Gift site defaults to data-motion="full". Only when that is explicitly
     set to "reduce" do we flatten motion. */
  html[data-motion="reduce"] *,
  html[data-motion="reduce"] *::before,
  html[data-motion="reduce"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html[data-motion="reduce"] .meet-stage,
  html[data-motion="reduce"] .meet-stage .meet-photo,
  html[data-motion="reduce"] .meet-stage .meet-caption,
  html[data-motion="reduce"] .meet-stage .meet-hearts,
  html[data-motion="reduce"] .meet-stage .meet-flash {
    animation-duration: 0.9s !important;
    transition-duration: 0.6s !important;
  }
}
