/* ============================================================
   Giana's Castle — 1st Birthday RSVP
   Palette: deep river night, lantern gold, royal violet
   ============================================================ */

:root {
  --night-900: #070a18;
  --night-800: #0d1228;
  --night-700: #151c3d;
  --violet-600: #3a2a63;
  --violet-400: #6b4fa0;
  --gold-400: #f5c86a;
  --gold-300: #ffdd9e;
  --gold-100: #fff4dd;
  --cream: #f6efe2;
  --ink: #2a2136;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Quicksand", system-ui, -apple-system, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-light: linear-gradient(
    135deg,
    #f4bd78 0%,
    #ffe5ad 24%,
    #fffef8 50%,
    #ffe9bd 76%,
    #f5c379 100%
  );
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--night-900);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body.no-scroll { overflow: hidden; }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  z-index: 9000;
  bottom: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  right: 14px;
  right: calc(14px + env(safe-area-inset-right));
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(10, 14, 32, 0.72);
  border: 1px solid rgba(245, 200, 106, 0.32);
  color: var(--gold-300);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: background 0.25s, border-color 0.25s, opacity 0.4s;
}
.skip-link:hover,
.skip-link:focus-visible {
  background: rgba(245, 200, 106, 0.15);
  border-color: rgba(245, 200, 106, 0.7);
}

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

/* Compact, always-recoverable music button. Browsers may block audible music
   after a refresh, so the icon remains available as the required user gesture. */
.music-control {
  position: fixed;
  left: calc(14px + env(safe-area-inset-left));
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 790;
  width: 46px;
  height: 46px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.music-control.is-active {
  opacity: .94;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.music-control.is-active:hover,
.music-control.is-active:focus-within { opacity: 1; }
body.in-castle .music-control {
  left: auto;
  right: calc(16px + env(safe-area-inset-right));
  top: calc(16px + env(safe-area-inset-top));
  bottom: auto;
}
body.side-panel-open .music-control.is-active,
body.modal-open .music-control.is-active {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.music-mute {
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 200, 106, .48);
  border-radius: 50%;
  background: rgba(12, 9, 28, .78);
  color: var(--gold-300);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .38), inset 0 0 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(10px) saturate(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.music-mute:hover,
.music-mute:focus-visible {
  background: rgba(54, 32, 74, .9);
  border-color: rgba(245, 200, 106, .84);
  transform: scale(1.05);
}
.music-mute:focus-visible {
  outline: 2px solid rgba(255, 239, 204, .95);
  outline-offset: 3px;
}
.music-mute.is-muted { background: rgba(76, 29, 62, .84); }
.sound-icon {
  position: relative;
  display: block;
  width: 27px;
  height: 22px;
  color: currentColor;
}
.sound-speaker {
  position: absolute;
  left: 1px;
  top: 7px;
  width: 7px;
  height: 9px;
  border-radius: 2px 0 0 2px;
  background: currentColor;
}
.sound-speaker::after {
  content: "";
  position: absolute;
  left: 5px;
  top: -4px;
  width: 0;
  height: 0;
  border-top: 8.5px solid transparent;
  border-bottom: 8.5px solid transparent;
  border-left: 10px solid currentColor;
}
.sound-wave {
  position: absolute;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  transform-origin: left center;
}
.sound-wave-near { left: 17px; top: 7px; width: 4px; height: 8px; }
.sound-wave-far { left: 17px; top: 3px; width: 9px; height: 16px; }
.sound-slash {
  position: absolute;
  left: 3px;
  top: 10px;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 0 0 1.5px rgba(12, 9, 28, .72);
  opacity: 0;
  transform: rotate(-45deg);
}
.music-mute.is-muted .sound-wave { opacity: 0; }
.music-mute.is-muted .sound-slash { opacity: 1; }
.music-mute.is-needs-play:not(.is-muted) .sound-wave-far {
  animation: sound-ready 1.5s ease-in-out infinite;
}
@keyframes sound-ready { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (max-width: 480px) {
  .music-control {
    left: calc(10px + env(safe-area-inset-left));
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
  body.in-castle .music-control {
    left: auto;
    right: calc(10px + env(safe-area-inset-right));
    top: calc(10px + env(safe-area-inset-top));
    bottom: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .music-mute.is-needs-play .sound-wave-far { animation: none; opacity: .72; }
}
/* ============================================================
   1. BOOK INTRO
   ============================================================ */
.book-stage {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  gap: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, #221a3d 0%, #0d1228 45%, #05060f 100%);
  perspective: 1800px;
  transition: opacity 1.1s var(--ease-in-out);
}
.book-stage.is-gone { opacity: 0; pointer-events: none; }

.book-stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    ellipse 48% 58% at 50% 50%,
    rgba(255, 224, 153, 0.3),
    rgba(128, 73, 168, 0.15) 38%,
    transparent 72%
  );
}

.book-stage.is-entering::after {
  animation: portal-flare 1.45s var(--ease-in-out) both;
}

@keyframes portal-flare {
  0%   { opacity: 0; transform: scale(0.62); }
  32%  { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.5); }
}

.book-glow {
  position: absolute;
  z-index: 0;
  width: min(72vw, 640px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 200, 106, 0.2) 0%, transparent 66%);
  filter: blur(38px);
  animation: breathe 6.5s var(--ease-in-out) infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.95; transform: scale(1.08); }
}

.intro-linework {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0.9;
}

.book {
  position: relative;
  z-index: 2;
  width: min(78vw, 400px);
  aspect-ratio: 3 / 4;
  transform-style: preserve-3d;
  transform: rotateX(9deg) rotateZ(-1.5deg);
  transition: transform 1.2s var(--ease-out);
}
.book.is-opening { transform: rotateX(4deg) scale(1.12) translateZ(70px); }
.book.is-entering {
  opacity: 0;
  transform: rotateX(0deg) scale(2.08) translateZ(180px);
  transition:
    transform 1.35s var(--ease-in-out),
    opacity 1.05s var(--ease-in-out);
}

.book-portal-page {
  position: absolute;
  z-index: 2;
  inset: 2% 2% 2% 3%;
  overflow: hidden;
  border: 1px solid rgba(255, 219, 139, 0.48);
  border-radius: 4px 9px 9px 4px;
  background:
    radial-gradient(circle at 50% 42%, rgba(245, 200, 106, 0.18), transparent 22%),
    radial-gradient(circle at 28% 20%, rgba(255, 244, 210, 0.14) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 33%, rgba(255, 220, 142, 0.12) 0 1px, transparent 2px),
    linear-gradient(145deg, #19122e, #151b3f 58%, #0a0d20);
  box-shadow:
    inset 7px 0 18px rgba(3, 4, 13, 0.58),
    inset 0 0 30px rgba(88, 57, 142, 0.3),
    0 0 20px rgba(245, 200, 106, 0.14);
  transform: translateZ(-1px);
  transform-origin: left center;
  opacity: 0.72;
  transition: opacity 0.75s var(--ease-in-out), box-shadow 0.75s var(--ease-in-out);
}

.book.is-opening .book-portal-page {
  opacity: 1;
  box-shadow:
    inset 7px 0 18px rgba(3, 4, 13, 0.42),
    inset 0 0 30px rgba(88, 57, 142, 0.2),
    0 0 26px rgba(255, 209, 111, 0.34);
}

.book-portal-page::before,
.book-portal-page::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.book-portal-page::before {
  background:
    linear-gradient(90deg, rgba(4, 3, 12, 0.48), transparent 14%),
    radial-gradient(ellipse at center, transparent 52%, rgba(5, 4, 15, 0.48) 100%);
}

.book-portal-page::after {
  inset: 7px;
  border: 1px solid rgba(255, 222, 146, 0.28);
  border-radius: 2px 7px 7px 2px;
  box-shadow: inset 0 0 18px rgba(255, 203, 99, 0.12);
}

.book-portal-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: brightness(0.76) saturate(0.88) sepia(0.06);
}

.book-cover {
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: 5px 13px 13px 5px;
  background:
    linear-gradient(135deg, #4a2f6b 0%, #33204d 48%, #241638 100%);
  box-shadow:
    0 34px 70px rgba(0, 0, 0, 0.66),
    inset 0 0 0 1px rgba(245, 200, 106, 0.16),
    0 0 var(--book-pulse, 0px) rgba(255, 206, 105, 0.44);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.95s var(--ease-in-out);
  display: grid;
  place-items: center;
  padding: 7%;
  backface-visibility: hidden;
}
.book.is-opening .book-cover { transform: rotateY(-152deg); }

.cover-border {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(245, 200, 106, 0.36);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8% 6%;
  text-align: center;
  position: relative;
}

.cover-border > :not(.cover-linework) {
  position: relative;
  z-index: 2;
}

.cover-linework {
  position: absolute;
  z-index: 1;
  inset: 4%;
  pointer-events: none;
  opacity: var(--cover-opacity, 0.43);
  filter: drop-shadow(0 0 var(--cover-glow, 2px) rgba(255, 214, 118, 0.76));
}

.cover-corner {
  position: absolute;
  width: 34%;
  height: 23%;
  border-top: 1px solid rgba(255, 220, 139, 0.5);
  border-left: 1px solid rgba(255, 220, 139, 0.5);
  border-radius: 18px 0 0;
  box-shadow:
    inset 3px 3px 7px rgba(245, 200, 106, 0.08),
    -2px -2px 7px rgba(245, 200, 106, 0.08);
}

.cover-corner::before {
  content: "";
  position: absolute;
  top: 34%;
  left: -1px;
  width: 48%;
  height: 1px;
  transform: rotate(38deg);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(255, 217, 133, 0.56), transparent);
}

.cover-corner::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 226, 153, 0.66);
  transform: rotate(45deg);
  background: #3d2859;
  box-shadow: 0 0 8px rgba(255, 207, 105, 0.36);
}

.cover-corner-tl { top: 0; left: 0; }
.cover-corner-tr { top: 0; right: 0; transform: scaleX(-1); }
.cover-corner-bl { bottom: 0; left: 0; transform: scaleY(-1); }
.cover-corner-br { right: 0; bottom: 0; transform: scale(-1); }

.cover-channel {
  position: absolute;
  top: 47%;
  width: 22%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 220, 139, 0.12), rgba(255, 220, 139, 0.68));
  box-shadow: 0 0 6px rgba(245, 200, 106, 0.18);
}

.cover-channel::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 229, 165, 0.66);
  transform: rotate(45deg);
  background: #3a2554;
}

.cover-channel-left { left: 0; }
.cover-channel-left::after { right: -2px; }
.cover-channel-right { right: 0; transform: scaleX(-1); }
.cover-channel-right::after { right: -2px; }

.cover-border::before,
.cover-border::after {
  content: "";
  position: absolute;
  left: 7px; right: 7px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 200, 106, 0.4), transparent);
}
.cover-border::before { top: 7px; }
.cover-border::after  { bottom: 7px; }

.sun-emblem {
  position: relative;
  width: 43%;
  max-width: 146px;
  aspect-ratio: 1;
  margin-bottom: 3.5%;
  transform: scale(var(--crest-scale, 0.985));
  filter:
    drop-shadow(0 0 var(--crest-glow, 7px) rgba(255, 225, 146, 0.7))
    drop-shadow(0 0 var(--crest-aura, 16px) rgba(188, 104, 194, 0.36));
  transition: transform 70ms linear, filter 70ms linear;
}

.crest-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cover-eyebrow {
  font-size: 0.66rem;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(255, 221, 158, 0.62);
  margin: 0 0 6px;
}
.cover-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 8vw, 2.9rem);
  font-weight: 600;
  line-height: 1.02;
  margin: 0;
  color: var(--gold-300);
  text-shadow: 0 0 26px rgba(245, 200, 106, 0.34);
}
.cover-sub {
  font-family: var(--sans);
  font-style: normal;
  font-size: clamp(0.66rem, 2.4vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 221, 158, 0.68);
  margin: 11px 0 0;
}
.cover-rule {
  width: 46%;
  height: 1px;
  margin: 15px 0;
  background: linear-gradient(90deg, transparent, rgba(245, 200, 106, 0.6), transparent);
}
.cover-date {
  font-size: 0.76rem;
  letter-spacing: 0.28em;
  color: rgba(255, 221, 158, 0.78);
  margin: 0;
}

.book-page {
  position: absolute;
  z-index: 1;
  inset: 2% 2% 2% 3%;
  border-radius: 3px 8px 8px 3px;
  background:
    radial-gradient(circle at 58% 44%, rgba(245, 200, 106, 0.16), transparent 28%),
    linear-gradient(112deg, #17112b 0%, #2e2050 48%, #13162f 100%);
  transform-origin: left center;
  box-shadow:
    inset 3px 0 12px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(245, 200, 106, 0.18),
    inset 0 0 24px rgba(114, 75, 159, 0.2);
  transition: opacity 0.7s var(--ease-in-out);
}
.book-page-2 { transform: translateZ(-3px); }
.book-page-3 { transform: translateZ(-6px); inset: 3% 3% 3% 3%; }

.book-spine {
  position: absolute;
  z-index: 4;
  left: -3px; top: 0; bottom: 0;
  width: 13px;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(90deg, #1b1029, #3d2757);
  transform: translateZ(-8px);
}

.open-btn {
  position: absolute;
  z-index: 3;
  bottom: clamp(38px, 11vh, 96px);
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--gold-300);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 26px;
  border-radius: 999px;
  transition: opacity 0.5s, transform 0.35s var(--ease-out);
  animation: float-up 2.6s var(--ease-in-out) infinite;
}
.open-btn:hover { transform: translateY(-3px); }
.open-btn.is-gone { opacity: 0; pointer-events: none; }
.open-btn-text {
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
}
.open-btn-hint {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.84rem;
  color: rgba(246, 239, 226, 0.5);
}
@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ============================================================
   2. 3D SCENE + OVERLAY
   ============================================================ */
.scene-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.4s var(--ease-in-out);
}
.scene-canvas.is-live { opacity: 1; }

.scene-canvas.is-book-portal {
  z-index: 501;
  opacity: 1;
  clip-path: inset(
    var(--portal-top)
    var(--portal-right)
    var(--portal-bottom)
    var(--portal-left)
    round 9px
  );
  filter: brightness(0.76) saturate(0.88) sepia(0.06);
  transition:
    clip-path 0.9s var(--ease-out),
    filter 0.8s var(--ease-out);
}

.scene-canvas.is-book-portal.is-portal-primed {
  transition: none;
}

.scene-canvas.is-book-portal.is-entering-book {
  clip-path: inset(0 0 0 0 round 0);
  filter: brightness(1) saturate(1) sepia(0);
}

/* Native scroll height that drives camera position along the river */
.scroll-track { height: 900vh; pointer-events: none; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) 18px env(safe-area-inset-bottom);
}

.scroll-cue {
  position: fixed;
  bottom: clamp(52px, 9vh, 84px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 221, 158, 0.58);
  opacity: 0;
  transition: opacity 0.8s;
}
.scroll-cue.is-shown { opacity: 1; }
.cue-arrow {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, rgba(245, 200, 106, 0.75), transparent);
  animation: cue-slide 2.1s var(--ease-in-out) infinite;
}
@keyframes cue-slide {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

.progress-rail {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: rgba(245, 200, 106, 0.1);
  opacity: 0;
  transition: opacity 0.6s;
}
.progress-rail.is-shown { opacity: 1; }
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet-400), var(--gold-400));
  box-shadow: 0 0 11px rgba(245, 200, 106, 0.65);
  transition: width 0.16s linear;
}

/* ---------- Panels ---------- */
.panel {
  position: absolute;
  width: min(92vw, 460px);
  max-height: 86vh;
  overflow-y: auto;
  padding: clamp(22px, 5vw, 34px);
  border-radius: 18px;
  background: rgba(11, 15, 34, 0.74);
  border: 1px solid rgba(245, 200, 106, 0.22);
  box-shadow:
    0 26px 64px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(15px) saturate(1.15);
  -webkit-backdrop-filter: blur(15px) saturate(1.15);
  opacity: 0;
  transform: translateY(26px) scale(0.97);
  pointer-events: none;
  transition:
    opacity 0.68s var(--ease-out),
    transform 0.68s var(--ease-out);
}
.panel.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.panel-eyebrow {
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 221, 158, 0.55);
  margin: 0 0 11px;
}
.panel-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 5.4vw, 2rem);
  font-weight: 600;
  line-height: 1.14;
  margin: 0 0 14px;
  color: var(--gold-300);
}
.panel-body {
  font-size: 0.92rem;
  line-height: 1.62;
  color: rgba(246, 239, 226, 0.76);
  margin: 0 0 20px;
}
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Fields ---------- */
.field {
  display: block;
  margin-bottom: 16px;
  border: 0;
  padding: 0;
}
.field-label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 221, 158, 0.72);
  margin-bottom: 7px;
}
.field-label em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0.02em;
  color: rgba(246, 239, 226, 0.4);
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(245, 200, 106, 0.24);
  background: rgba(4, 6, 16, 0.55);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1rem; /* 16px min — stops iOS zoom-on-focus */
  transition: border-color 0.24s, box-shadow 0.24s, background 0.24s;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(246, 239, 226, 0.26); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(245, 200, 106, 0.75);
  background: rgba(4, 6, 16, 0.78);
  box-shadow: 0 0 0 3px rgba(245, 200, 106, 0.13);
}
.field textarea { resize: vertical; min-height: 74px; }
.field input[aria-invalid="true"] { border-color: #e08b7a; }

.field-error {
  display: block;
  min-height: 1em;
  margin-top: 5px;
  font-size: 0.76rem;
  color: #f0a08f;
}

.radio-row { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.radio-row label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.94rem;
}
.radio-row input { accent-color: var(--gold-400); width: 17px; height: 17px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 13px 24px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease-out), box-shadow 0.28s, background 0.28s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-400), #e0a94b);
  color: #2a1c08;
  box-shadow: 0 8px 24px rgba(245, 200, 106, 0.26);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 32px rgba(245, 200, 106, 0.42);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  border-color: rgba(245, 200, 106, 0.32);
  color: rgba(255, 221, 158, 0.85);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(245, 200, 106, 0.1);
  border-color: rgba(245, 200, 106, 0.6);
}
.btn-sm { padding: 10px 17px; font-size: 0.74rem; }

.btn.is-sending { pointer-events: none; opacity: 0.72; }

/* ---------- Summary ---------- */
.summary {
  border-top: 1px solid rgba(245, 200, 106, 0.16);
  border-bottom: 1px solid rgba(245, 200, 106, 0.16);
  padding: 14px 0;
  margin: 6px 0 4px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  font-size: 0.87rem;
}
.summary-row dt {
  color: rgba(255, 221, 158, 0.6);
  margin: 0;
  flex-shrink: 0;
}
.summary-row dd {
  margin: 0;
  text-align: right;
  color: var(--cream);
  word-break: break-word;
}

.send-error {
  min-height: 1.2em;
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: #f0a08f;
}
.send-error.is-ok { color: #8fe0b0; }

/* ============================================================
   3. FLASH + REVEAL
   ============================================================ */
.flash {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: var(--transition-light);
  opacity: 0;
  pointer-events: none;
}
.flash.is-firing {
  animation: flash-burst 2.6s var(--ease-in-out) forwards;
}
@keyframes flash-burst {
  0%   { opacity: 0; }
  32%  { opacity: 1; }
  62%  { opacity: 1; }
  100% { opacity: 0; }
}

.reveal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 40px 20px;
  background: radial-gradient(ellipse 80% 60% at 50% 35%, #2b1f4d 0%, #120e26 52%, #06060f 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s var(--ease-in-out);
}
.reveal.is-shown {
  opacity: 1;
  pointer-events: auto;
  background:
    radial-gradient(ellipse 82% 72% at 50% 42%, rgba(22, 10, 38, 0.06), rgba(8, 5, 18, 0.68) 100%),
    linear-gradient(180deg, rgba(10, 6, 20, 0.16), rgba(10, 5, 18, 0.48)),
    url("../assets/photos/castle-hall.png") center center / cover no-repeat;
}

.reveal-inner {
  width: min(94vw, 560px);
  text-align: center;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(255, 217, 151, 0.28);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(23, 12, 38, 0.68), rgba(10, 7, 24, 0.78));
  box-shadow:
    0 30px 90px rgba(4, 2, 12, 0.5),
    inset 0 1px 0 rgba(255, 239, 204, 0.12);
  backdrop-filter: blur(8px) saturate(1.08);
}

.reveal-photo { margin-bottom: 26px; }
.photo-frame {
  position: relative;
  width: clamp(140px, 42vw, 208px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(245, 200, 106, 0.55);
  box-shadow:
    0 0 0 8px rgba(245, 200, 106, 0.08),
    0 0 52px rgba(245, 200, 106, 0.34);
  background: rgba(255, 255, 255, 0.04);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: rgba(255, 221, 158, 0.55);
  font-size: 0.8rem;
  padding: 10px;
  text-align: center;
}
.photo-fallback small {
  font-size: 0.62rem;
  opacity: 0.55;
  word-break: break-all;
}
.photo-frame.photo-empty .photo-fallback { display: flex; }

.reveal-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 221, 158, 0.58);
  margin: 0 0 12px;
}
.reveal-title {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 9vw, 3.4rem);
  font-weight: 600;
  line-height: 1.06;
  margin: 0 0 14px;
  color: var(--gold-300);
  text-shadow: 0 0 34px rgba(245, 200, 106, 0.38);
}
.reveal-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.06rem;
  color: rgba(246, 239, 226, 0.8);
  margin: 0 0 30px;
  min-height: 1.4em;
}

.reveal-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 26px;
}
.detail {
  flex: 1 1 190px;
  padding: 18px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 200, 106, 0.18);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.detail-label {
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 221, 158, 0.55);
}
.detail-value {
  font-family: var(--serif);
  font-size: 1.14rem;
  color: var(--gold-300);
}
.detail-note {
  font-size: 0.78rem;
  color: rgba(246, 239, 226, 0.5);
}

.reveal-footer {
  font-size: 0.83rem;
  line-height: 1.6;
  color: rgba(246, 239, 226, 0.52);
  margin: 0;
}

/* ============================================================
   4. SIMPLE FALLBACK FORM
   ============================================================ */
.simple {
  position: relative;
  z-index: 200;
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
  padding:
    calc(54px + env(safe-area-inset-top))
    20px
    calc(80px + env(safe-area-inset-bottom));
  overflow: hidden;
  background: #090617;
}
.simple.is-shown { display: block; }

.simple::before,
.simple::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.simple::before {
  z-index: 0;
  background:
    url("../assets/photos/castle-hall.png") 34% center / cover no-repeat;
  filter: saturate(.92) brightness(.82);
  transform: scale(1.01);
}
.simple-video {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  filter: saturate(.94) brightness(.8);
  transform: scale(1.01);
}
.simple::after {
  z-index: 2;
  background:
    radial-gradient(circle at 18% 18%, rgba(250, 156, 84, .13), transparent 30%),
    linear-gradient(180deg, rgba(14, 7, 30, .28), rgba(8, 4, 20, .68));
}
.simple-fireworks {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .76;
  transition: opacity .5s ease;
}
.simple.is-celebrating .simple-fireworks {
  z-index: 5;
  opacity: 1;
}

.simple-inner {
  position: relative;
  z-index: 4;
  width: min(94vw, 500px);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 36px);
  border: 1px solid rgba(255, 222, 158, .24);
  border-radius: 26px;
  background:
    radial-gradient(circle at 14% 0%, rgba(250, 156, 84, .1), transparent 33%),
    rgba(24, 13, 43, .48);
  box-shadow:
    0 28px 80px rgba(2, 1, 10, .56),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(9px) saturate(1.06);
  -webkit-backdrop-filter: blur(9px) saturate(1.06);
  transition: opacity .58s ease, transform .58s var(--ease-out);
}
.simple.is-celebrating .simple-inner {
  opacity: 0;
  transform: translateY(-14px) scale(.975);
  pointer-events: none;
}
.simple-eyebrow {
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 221, 158, 0.5);
  margin: 0 0 10px;
}
.simple-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--gold-300);
}
.simple-meta {
  font-size: 0.9rem;
  color: rgba(246, 239, 226, 0.6);
  margin: 0 0 30px;
}

.simple .field {
  position: relative;
  margin-bottom: 14px;
  padding: 13px 14px 14px;
  border: 1px solid rgba(255, 221, 158, .13);
  border-radius: 15px;
  background: rgba(14, 8, 31, .36);
  box-shadow:
    0 9px 24px rgba(0, 0, 0, .16),
    inset 0 1px 0 rgba(255, 255, 255, .035);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  will-change: transform;
  animation:
    simple-field-float var(--float-duration, 8s) ease-in-out
    var(--float-delay, 0s) infinite;
}
.simple .field:focus-within,
.simple .field:hover {
  animation-play-state: paused;
}
.simple .field input,
.simple .field textarea {
  background: rgba(4, 5, 15, .58);
}
.simple .btn-primary {
  width: 100%;
  margin-top: 5px;
}
.simple .send-error {
  text-align: center;
}
@keyframes simple-field-float {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform:
      translate3d(var(--float-x, 2px), var(--float-y, -3px), 0)
      rotate(var(--float-rotate, .08deg));
  }
}

@media (max-width: 520px) {
  .simple {
    padding:
      calc(28px + env(safe-area-inset-top))
      12px
      calc(72px + env(safe-area-inset-bottom));
  }
  .simple::before {
    background-position: 31% center;
  }
  .simple-inner {
    width: 100%;
    padding: 23px 15px 25px;
    border-radius: 21px;
  }
  .simple-meta { margin-bottom: 22px; }
  .simple .field {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .simple-video {
    transform: none;
  }
  .simple .field {
    animation: none;
    will-change: auto;
  }
}

.noscript-note {
  padding: 30px 22px;
  text-align: center;
  color: var(--gold-300);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================================
   ACCESSIBILITY / MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .book-glow,
  .open-btn,
  .cue-arrow { animation: none !important; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 480px) {
  .intro-linework { opacity: 0.78; }
  .panel { width: calc(100vw - 28px); padding: 22px 20px; }
  .panel-actions .btn { flex: 1 1 100%; }
  .skip-link {
    bottom: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    right: 10px;
    right: calc(10px + env(safe-area-inset-right));
    font-size: 0.68rem;
    padding: 8px 13px;
  }
}

/* ============================================================
   JOURNEY — scroll-scrubbed video background
   Replaces the WebGL river. js/scene.js is retired but kept.
   ============================================================ */
.journey {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 60%, #241a4d 0%, #0b0720 72%);
  /* Quick: it reveals behind the still-bright flash, so it must reach full
     opacity before the flash clears — a slow fade would show dark underneath. */
  transition: opacity 0.4s var(--ease-in-out);
}
.journey.is-live { opacity: 1; }

/* Explicit stacking: journey.js appends the video after the tint, so
   without this the footage would paint straight over the grade. */
.journey-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.journey-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(9, 6, 26, 0.62) 0%,
      rgba(9, 6, 26, 0.12) 38%,
      rgba(9, 6, 26, 0.30) 62%,
      rgba(9, 6, 26, 0.78) 100%);
}
.journey-effects {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* If the video never loads, the gradient behind it still carries the page. */
.journey.is-video-failed .journey-video { display: none; }

/* Book portal — same treatment the WebGL canvas had, so Codex's
   cover-turn transition keeps working against the video. */
.journey.is-book-portal {
  z-index: 501;
  opacity: 1;
  clip-path: inset(
    var(--portal-top) var(--portal-right)
    var(--portal-bottom) var(--portal-left) round 9px
  );
  filter: brightness(0.76) saturate(0.88) sepia(0.06);
  transition:
    clip-path 0.9s var(--ease-out),
    filter 0.8s var(--ease-out);
}
.journey.is-book-portal.is-portal-primed { transition: none; }
.journey.is-book-portal.is-entering-book {
  clip-path: inset(0 0 0 0 round 0);
  filter: brightness(1) saturate(1) sepia(0);
}

/* ============================================================
   THE ROOM — banners and photo wall inside the reveal
   ============================================================ */
.bunting {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 6px 0 22px;
  padding: 0 4px;
}
.bunting span {
  width: 26px;
  height: 34px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  animation: bunting-sway 4.2s var(--ease-in-out) infinite;
}
.bunting span:nth-child(odd)  { background: linear-gradient(180deg, #f5c86a, #d98a3c); }
.bunting span:nth-child(even) { background: linear-gradient(180deg, #8f6ac4, #5b3f92); }
.bunting span:nth-child(3n)   { background: linear-gradient(180deg, #f0efe4, #cbbfa4); }
.bunting span:nth-child(1) { animation-delay: 0s; }
.bunting span:nth-child(2) { animation-delay: .18s; }
.bunting span:nth-child(3) { animation-delay: .36s; }
.bunting span:nth-child(4) { animation-delay: .54s; }
.bunting span:nth-child(5) { animation-delay: .72s; }
.bunting span:nth-child(6) { animation-delay: .9s; }
.bunting span:nth-child(7) { animation-delay: 1.08s; }
.bunting span:nth-child(8) { animation-delay: 1.26s; }
.bunting span:nth-child(9) { animation-delay: 1.44s; }
.bunting span:nth-child(10){ animation-delay: 1.62s; }
@keyframes bunting-sway {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}

.room-banner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 34px;
  margin-bottom: 26px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(93, 62, 146, 0.55), rgba(38, 24, 70, 0.55));
  border: 1px solid rgba(245, 200, 106, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}
.room-banner-small {
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 221, 158, 0.82);
}
.room-banner-name {
  font-family: var(--serif);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 600;
  line-height: 1;
  color: var(--gold-300);
  text-shadow: 0 0 28px rgba(245, 200, 106, 0.45);
}

.photo-wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.wall-frame {
  position: relative;
  margin: 0;
  min-height: 92px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(245, 200, 106, 0.28);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  background-size: cover;
  background-position: center;
  transform: rotate(-0.6deg);
}
.wall-frame:nth-child(even) { transform: rotate(0.7deg); }
.wall-frame-tall { grid-row: span 2; }
.wall-frame-wide { grid-column: span 2; }

/* Empty state names the file to drop in, so the gap is self-documenting. */
.wall-frame:not(.has-photo)::after {
  content: attr(data-src);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  font-size: 0.58rem;
  line-height: 1.4;
  color: rgba(255, 221, 158, 0.45);
  word-break: break-all;
}

@media (max-width: 480px) {
  .photo-wall { grid-template-columns: repeat(2, 1fr); }
  .bunting span { width: 18px; height: 24px; }
  .room-banner { padding: 12px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .bunting span { animation: none; }
}

/* ============================================================
   BOOK OPEN — flash cut (no zoom)
   The cover opens, the screen flashes bright, then the whole book-stage
   fades out behind the held flash to reveal the full-screen journey.
   A magical page-turn into light rather than a zoom into the page.
   ============================================================ */
.book-stage.is-flashing::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 510;
  pointer-events: none;
  background: var(--transition-light);
  animation: book-flash 1.4s var(--ease-in-out) forwards;
}
@keyframes book-flash {
  0%   { opacity: 0; }
  28%  { opacity: 1; }
  100% { opacity: 1; }   /* hold; the stage fade clears it */
}
@media (prefers-reduced-motion: reduce) {
  .book-stage.is-flashing::after { animation-duration: 0.4s; }
}

/* Inside the opening book is light only — no live page mirrored in. */
.book.is-opening .book-portal-canvas { opacity: 0; }
.book.is-opening .book-portal-page {
  opacity: 1;
  background: radial-gradient(circle at 50% 46%, #fffef8 0%, #ffeac0 52%, #ffd48f 100%);
  box-shadow: 0 0 46px 12px rgba(255, 214, 133, 0.6);
}

/* YouTube background: fill the viewport, crop the 16:9 to cover, no pointer. */
.journey-yt {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0b0720;   /* any brief gap reads as night, never black */
}
.journey-yt iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Oversize by 1.4x beyond cover, so the YouTube title bar (top) and logo
     (bottom) overflow past the viewport and are cropped away. */
  width: calc(max(100vw, 177.78vh) * 1.4);
  height: calc(max(100vh, 56.25vw) * 1.4);
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

/* ============================================================
   SCROLL GATE — magical parchment welcome over the video
   ============================================================ */
.scroll-gate {
  position: fixed;
  inset: 0;
  z-index: 480;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(6,4,20,0.35), rgba(6,4,20,0.72));
  transition: opacity 0.9s var(--ease-in-out);
}
.scroll-gate.is-shown { opacity: 1; pointer-events: auto; }

.parchment {
  position: relative;
  width: min(90vw, 430px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,0.55));
}

/* Rolled ends */
.roll {
  height: 26px;
  border-radius: 20px;
  background: linear-gradient(180deg, #caa46a, #7d5a2c 55%, #543a17);
  box-shadow: inset 0 2px 3px rgba(255,231,182,0.5), inset 0 -3px 6px rgba(0,0,0,0.4);
  z-index: 2;
}
.roll-top { margin-bottom: -6px; }
.roll-bottom { margin-top: -6px; }

/* Aged parchment sheet — collapsed until opened */
.parchment-sheet {
  max-height: 66px;
  overflow: hidden;
  transition: max-height 1.15s var(--ease-in-out);
  background:
    radial-gradient(ellipse at 28% 18%, rgba(120,80,30,0.10), transparent 55%),
    radial-gradient(ellipse at 74% 82%, rgba(120,80,30,0.13), transparent 55%),
    linear-gradient(160deg, #f5e6c4, #ecd3a2 60%, #e2c58c);
  border-left: 1px solid rgba(120,80,30,0.25);
  border-right: 1px solid rgba(120,80,30,0.25);
}
.parchment.is-open .parchment-sheet { max-height: 620px; }

.parchment-inner {
  padding: 30px 26px 28px;
  text-align: center;
  color: #4a3410;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.75s ease 0.4s, transform 0.75s ease 0.4s;
}
.parchment.is-open .parchment-inner { opacity: 1; transform: none; }

.scroll-eyebrow {
  font-family: "MedievalSharp", serif;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a5a24;
  margin: 0 0 14px;
}
.scroll-invite {
  font-family: "MedievalSharp", serif;
  font-size: 1.12rem;
  color: #5c421c;
  margin: 0 0 6px;
}
.scroll-kingdom {
  font-family: "Cinzel Decorative", serif;
  font-weight: 900;
  font-size: clamp(2rem, 9vw, 2.9rem);
  line-height: 1.02;
  margin: 0;
  color: #7a4f16;
  text-shadow: 0 1px 0 rgba(255,244,214,0.6);
}
.scroll-rule {
  width: 55%;
  height: 2px;
  margin: 18px auto;
  background: linear-gradient(90deg, transparent, #a9803e, transparent);
}
.scroll-sub {
  font-family: "MedievalSharp", serif;
  font-size: 0.95rem;
  color: #6a4c22;
  margin: 0 0 24px;
}
.scroll-enter {
  background: linear-gradient(135deg, #b9862f, #8a5f1e);
  color: #fff4dd;
  box-shadow: 0 8px 22px rgba(120,80,30,0.4);
}

/* Closed-state reveal button, sits over the rolled scroll */
.scroll-open-btn {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: 0;
  cursor: pointer;
  transition: opacity 0.5s var(--ease-out);
  animation: scroll-bob 2.6s var(--ease-in-out) infinite;
}
.parchment.is-open .scroll-open-btn { opacity: 0; pointer-events: none; }
.scroll-open-label {
  font-family: "MedievalSharp", serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: #f3e2bd;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.wax {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #d0574e, #8f2018 70%);
  box-shadow: 0 3px 8px rgba(0,0,0,0.45), inset 0 -3px 5px rgba(0,0,0,0.35);
}
@keyframes scroll-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-open-btn { animation: none; }
}

/* ============================================================
   THE LETTER — wax-sealed welcome (replaces the parchment)
   ============================================================ */
.letter {
  position: relative;
  width: min(92vw, 540px);
  padding: 46px 34px 40px;
  border-radius: 12px;
  text-align: center;
  color: #6b3f2a;
  background: linear-gradient(180deg, #f8f1e5, #efe3d1);
  box-shadow: 0 30px 70px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(150,110,70,0.18);
  overflow: hidden;
}
.letter-band {
  position: absolute; left: 7%; right: 7%; top: 50%;
  transform: translateY(-50%);
  border-top: 1px solid rgba(150,110,70,0.22);
  box-shadow: 0 7px 0 -6px rgba(150,110,70,0.14);
}
.letter-eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: #a97e4a; margin: 0 0 16px;
}
.letter-title {
  font-family: "Cormorant Garamond", serif; font-weight: 600;
  font-size: clamp(2.1rem, 8vw, 3.1rem); line-height: 1.04;
  margin: 0; color: #5e3620;
}
.letter-rule {
  width: 54px; height: 2px; margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, #b98a4a, transparent);
}
.wax-seal {
  position: relative; z-index: 2; display: block;
  width: 80px; height: 80px; margin: 28px auto;
  border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 38% 32%, #a9603a, #7a3f22 62%, #582b15);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 -4px 8px rgba(0,0,0,0.35),
              inset 0 3px 6px rgba(255,200,150,0.4);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
  animation: seal-bob 2.8s var(--ease-in-out) infinite;
}
.wax-seal::after {
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  border: 1px dashed rgba(255,220,180,0.5);
}
.wax-seal::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(255, 222, 185, 0.68);
  border-radius: 5px;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 3px rgba(87, 38, 18, 0.2);
}
.wax-seal:hover, .wax-seal:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 10px 24px rgba(0,0,0,0.45), 0 0 26px rgba(210,130,80,0.55),
              inset 0 -4px 8px rgba(0,0,0,0.35);
}
@keyframes seal-bob { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-4px);} }

.scroll-gate.is-broken { opacity: 0; pointer-events: none; }

/* ============================================================
   FLOW — vertical pop-ups joined by the glowing heartbeat line
   ============================================================ */
.flow {
  position: relative;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 26vh 18px 55vh;
}
.flow.is-shown { display: flex; }

.flow-line {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: rgba(255, 224, 160, 0.12);
  border-radius: 3px;
  overflow: hidden;
  pointer-events: none;
}
.flow-line-fill {
  position: absolute;
  top: 0; left: 0; right: 0; height: 0;
  background: linear-gradient(180deg, #fff0c4, #f5c86a 60%, #e0913c);
  transition: height 1.1s var(--ease-in-out);
  animation: line-heartbeat 1.5s ease-in-out infinite;
}
@keyframes line-heartbeat {
  0%, 100% { box-shadow: 0 0 8px 1px rgba(245,200,106,0.45); filter: brightness(1); }
  18%      { box-shadow: 0 0 20px 4px rgba(255,214,120,0.95); filter: brightness(1.25); }
  32%      { box-shadow: 0 0 10px 2px rgba(245,200,106,0.55); filter: brightness(1); }
  50%      { box-shadow: 0 0 24px 6px rgba(255,220,130,1);    filter: brightness(1.35); }
  70%      { box-shadow: 0 0 8px 1px rgba(245,200,106,0.45); filter: brightness(1); }
}

/* Panels become in-flow cards, revealed one at a time. Their glassy look
   (background, blur, border) still comes from the base .panel rule. */
.flow .panel {
  position: relative;
  inset: auto;
  width: min(92vw, 460px);
  margin: 0 0 30vh;
  opacity: 1;
  transform: none;
  transition: none;
  display: none;
  pointer-events: auto;
}
.flow .panel.is-active {
  display: block;
  animation: card-in 0.7s var(--ease-out) both;
}
@keyframes card-in {
  0%   { opacity: 0; transform: translateY(26px) scale(0.97); }
  100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wax-seal, .flow-line-fill { animation: none; }
  .flow .panel.is-active { animation: none; }
}

/* Letter: sealed by default, opens to the invitation + "Do you accept?" */
.letter-closed {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; min-height: 136px; max-height: 200px;
  transition: max-height 0.6s var(--ease-in-out), opacity 0.4s;
}
.letter-closed::before,
.letter-closed::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 48px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(137, 86, 43, 0.28));
}
.letter-closed::before { left: 0; }
.letter-closed::after { right: 0; transform: scaleX(-1); }
.letter.is-open .letter-closed { min-height: 0; max-height: 0; opacity: 0; }
.letter-content {
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.95s var(--ease-in-out), opacity 0.8s ease 0.2s;
}
.letter.is-open .letter-content { max-height: 540px; opacity: 1; }
.letter-ask {
  font-family: "Cormorant Garamond", serif; font-style: italic;
  font-size: clamp(1.2rem, 5vw, 1.6rem); color: #7a4a2c; margin: 18px 0 22px;
}
.letter-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.letter-content .btn-primary { background: linear-gradient(135deg, #b9862f, #8a5f1e); color: #fff4dd; }
.letter-content .btn-ghost { border-color: rgba(120,80,30,0.4); color: #8a5f2a; }

/* ============================================================
   ENVELOPE LETTER — splits open (overrides all earlier .letter rules)
   ============================================================ */
.letter {
  position: relative;
  width: min(92vw, 560px);
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #f2e8d5;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}
.letter-content {
  position: relative;
  z-index: 1;
  max-height: none;
  overflow: visible;
  padding: 52px 34px 46px;
  text-align: center;
  color: #6b3f2a;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .7s ease .5s, transform .7s ease .5s, visibility 0s .5s;
}
.letter.is-open .letter-content {
  max-height: none;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .7s ease .5s, transform .7s ease .5s;
}

/* The sealed face: two cream flaps that split apart on open. */
.letter-cover { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.flap {
  position: absolute; left: 0; right: 0; height: 50%;
  background:
    repeating-linear-gradient(90deg, rgba(150,110,70,0.045) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #f7efde, #ede1cc);
  transition: transform 0.95s var(--ease-in-out);
  backface-visibility: hidden;
}
.flap-top    { top: 0;    box-shadow: inset 0 -16px 22px -12px rgba(120,80,40,0.32);
               border-bottom: 1px solid rgba(150,110,70,0.16); }
.flap-bottom { bottom: 0; box-shadow: inset 0 16px 22px -12px rgba(120,80,40,0.26); }
.letter.is-open .flap-top    { transform: translateY(-102%); }
.letter.is-open .flap-bottom { transform: translateY(102%); }

/* Wax seal, centred on the seam. */
.letter-cover .wax-seal {
  position: absolute; top: 50%; left: 50%; z-index: 4; margin: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  animation: seal-pulse 2.8s ease-in-out infinite;
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
}
.letter-cover .wax-seal::before { display: none; }        /* drop the diamond */
.letter-cover .wax-seal:hover,
.letter-cover .wax-seal:focus-visible { transform: translate(-50%,-50%) scale(1.07); }
.letter.is-open .wax-seal {
  opacity: 0; pointer-events: none;
  transform: translate(-50%,-50%) scale(0.35);
}
.wax-monogram {
  font-family: "Pinyon Script", cursive; font-size: 2rem; line-height: 1;
  color: #f4dcc0; text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
@keyframes seal-pulse {
  0%,100% { box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 -4px 8px rgba(0,0,0,0.35),
                        inset 0 3px 6px rgba(255,200,150,0.4), 0 0 0 0 rgba(210,140,80,0); }
  50%     { box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 -4px 8px rgba(0,0,0,0.35),
                        inset 0 3px 6px rgba(255,200,150,0.4), 0 0 20px 5px rgba(210,140,80,0.4); }
}
@media (prefers-reduced-motion: reduce) { .letter-cover .wax-seal { animation: none; } }

/* ============================================================
   HOUSE TOUR — hallway hub + room pages (inside #reveal)
   ============================================================ */
.reveal {
  padding: 0;
  overflow: hidden;
  overflow: clip;
}

.hall, .room {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  place-self: stretch;
  background-size: cover; background-position: center;
}
.hall { background-image: url("../assets/photos/rooms/hallway.jpg"); }
#room-party { background-image: url("../assets/photos/rooms/party.jpg"); }
#room-giana { background-image: url("../assets/photos/rooms/giana-room.jpg"); }
#room-study { background-image: url("../assets/photos/rooms/study.jpg"); }

.hall::before, .room::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,5,20,0.58) 0%, rgba(8,5,20,0.25) 42%, rgba(8,5,20,0.78) 100%);
}

.hall-inner {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 22px; overflow-y: auto;
}
.hall-eyebrow {
  font-size: 0.7rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(255,221,158,0.72); margin: 0 0 10px;
}
.hall-title {
  font-family: var(--serif); font-weight: 600; line-height: 1.05;
  font-size: clamp(2.2rem, 8vw, 3.4rem); margin: 0;
  color: var(--gold-300); text-shadow: 0 2px 30px rgba(0,0,0,0.65);
}
.hall-name {
  font-family: var(--serif); font-style: italic; font-size: 1.05rem;
  color: rgba(246,239,226,0.92); margin: 12px 0 0; min-height: 1.3em;
  text-shadow: 0 1px 10px rgba(0,0,0,0.75);
}
.hall-hint {
  font-size: 0.82rem; letter-spacing: 0.06em;
  color: rgba(246,239,226,0.72); margin: 6px 0 30px;
}
.hall-doors { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.door {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 150px; padding: 18px 22px; cursor: pointer; border-radius: 14px;
  background: rgba(12,10,28,0.5); border: 1px solid rgba(245,200,106,0.4);
  backdrop-filter: blur(6px); color: var(--gold-300);
  transition: transform .25s var(--ease-out), box-shadow .3s, background .3s, border-color .3s;
}
.door-tag { font-size: 0.62rem; letter-spacing: 0.26em; text-transform: uppercase; color: rgba(255,221,158,0.6); }
.door-label { font-family: var(--serif); font-size: 1.3rem; }
.door:hover, .door:focus-visible {
  transform: translateY(-4px); background: rgba(245,200,106,0.14);
  border-color: rgba(245,200,106,0.85);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5), 0 0 26px rgba(245,200,106,0.35);
}

.room {
  z-index: 2; opacity: 0; pointer-events: none; transform: scale(1.04);
  transition: opacity .7s var(--ease-in-out), transform .7s var(--ease-in-out);
}
.room.is-open { opacity: 1; pointer-events: auto; transform: none; }
.room-inner {
  position: relative; z-index: 1; height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 68px 24px 48px;
}
.room-back {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: calc(16px + env(safe-area-inset-left));
  z-index: 3;
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(12,10,28,0.62);
  border: 1px solid rgba(245,200,106,0.48);
  color: var(--gold-300);
  font-family: var(--sans);
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 7px 20px rgba(0,0,0,.34);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .25s, border-color .25s, transform .2s;
}
.room-back:hover, .room-back:focus-visible {
  background: rgba(245,200,106,0.18);
  border-color: rgba(245,200,106,0.84);
  transform: scale(1.05);
}
.room-back:focus-visible { outline: 2px solid rgba(255,239,204,.95); outline-offset: 3px; }
.room-eyebrow {
  font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,221,158,0.72); margin: 0 0 8px;
}
.room-title {
  font-family: var(--serif); font-weight: 600; line-height: 1.05;
  font-size: clamp(2.2rem, 8vw, 3.4rem); margin: 0 0 18px;
  color: var(--gold-300); text-shadow: 0 2px 30px rgba(0,0,0,0.7);
}
.room-copy {
  max-width: 560px; color: rgba(246,239,226,0.92); line-height: 1.7;
  font-size: 1rem; text-shadow: 0 1px 8px rgba(0,0,0,0.65);
}
@media (prefers-reduced-motion: reduce) { .room { transition-duration: .2s; } }

/* ============================================================
   HOTSPOT ARROWS — clean scenes, hover reveals the destination
   ============================================================ */
.hall-greeting {
  position: relative; z-index: 4;
  text-align: center; padding: 7vh 20px 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.hs-dot {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10, 8, 24, 0.38);
  border: 1.5px solid rgba(255, 242, 214, 0.85);
  backdrop-filter: blur(3px);
  color: rgba(255, 246, 224, 0.96);
  transition: transform .3s var(--ease-out), background .3s, box-shadow .3s;
  animation: hs-pulse 2.6s ease-in-out infinite;
}
.hs-dot svg { width: 22px; height: 22px; transform: rotate(var(--rot, 0deg)); }
.hs-label {
  font-family: var(--serif); font-size: 1.05rem; white-space: nowrap;
  color: var(--gold-300);
  padding: 4px 14px; border-radius: 999px;
  background: rgba(10, 8, 24, 0.55);
  border: 1px solid rgba(245, 200, 106, 0.35);
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  opacity: 0; transform: translateY(6px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
  pointer-events: none;
}
.hotspot:hover .hs-dot,
.hotspot:focus-visible .hs-dot {
  transform: scale(1.16);
  background: rgba(245, 200, 106, 0.28);
  box-shadow: 0 0 24px rgba(245, 200, 106, 0.65);
  animation: none;
}
.hotspot:hover .hs-label,
.hotspot:focus-visible .hs-label { opacity: 1; transform: none; }

@keyframes hs-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,0.5), 0 0 0 0 rgba(255,240,210,0.45); }
  50%      { box-shadow: 0 4px 14px rgba(0,0,0,0.5), 0 0 0 12px rgba(255,240,210,0); }
}
@media (prefers-reduced-motion: reduce) { .hs-dot { animation: none; } }
@media (max-width: 600px) { .hs-dot { width: 46px; height: 46px; } .hs-label { font-size: 0.92rem; } }

/* Hall must form its own stacking context, or its greeting (z4) and hotspots
   (z5) render above an open room (z2) and bleed through the scene. */
.hall { z-index: 1; }

/* Subtler markers that sit in the scene's perspective (tilted like floor
   decals) rather than floating stickers. --tilt lays them onto the surface. */
.hotspot { perspective: 420px; gap: 8px; }
.hs-dot {
  width: 38px; height: 38px;
  background: rgba(10, 8, 24, 0.26);
  border: 1px solid rgba(255, 242, 214, 0.62);
  transform: rotateX(var(--tilt, 0deg));
  animation: hs-pulse 3.2s ease-in-out infinite;
}
.hs-dot svg { width: 15px; height: 15px; stroke-width: 2; }
.hotspot:hover .hs-dot,
.hotspot:focus-visible .hs-dot {
  transform: rotateX(var(--tilt, 0deg)) scale(1.22);
  background: rgba(245, 200, 106, 0.26);
  box-shadow: 0 0 18px rgba(245, 200, 106, 0.55);
}
.hs-label { font-size: 0.92rem; padding: 3px 11px; }
@keyframes hs-pulse {
  0%, 100% { box-shadow: 0 3px 10px rgba(0,0,0,0.45), 0 0 0 0 rgba(255,240,210,0.3); }
  50%      { box-shadow: 0 3px 10px rgba(0,0,0,0.45), 0 0 0 9px rgba(255,240,210,0); }
}
@media (max-width: 600px) { .hs-dot { width: 34px; height: 34px; } }

/* Flat circular markers at full size — the tilt squashed them into ellipses.
   Only the arrow's rotation conveys direction. */
.hs-dot {
  width: 54px; height: 54px;
  background: rgba(10, 8, 24, 0.38);
  border: 1.5px solid rgba(255, 242, 214, 0.85);
  transform: none;
}
.hs-dot svg { width: 22px; height: 22px; stroke-width: 2.2; }
.hotspot:hover .hs-dot,
.hotspot:focus-visible .hs-dot { transform: scale(1.16); }
.hs-label { font-size: 1.05rem; padding: 4px 14px; }
@media (max-width: 600px) { .hs-dot { width: 48px; height: 48px; } }

/* FINAL marker style — matches the reference: small, thin-ringed, understated.
   Flat circle (no tilt/squash); only the arrow's rotation shows direction. */
.hs-dot {
  width: 30px; height: 30px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
  color: rgba(255, 255, 255, 0.92);
  transform: none;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  animation: hs-pulse 3.4s ease-in-out infinite;
}
.hs-dot svg { width: 13px; height: 13px; stroke-width: 1.8; }
.hotspot:hover .hs-dot,
.hotspot:focus-visible .hs-dot {
  transform: scale(1.18);
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 14px rgba(255, 244, 214, 0.45);
}
.hs-label {
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-family: var(--sans); padding: 3px 10px;
  background: rgba(0, 0, 0, 0.45); border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 248, 232, 0.95);
  opacity: 1;
  transform: none;
}
@keyframes hs-pulse {
  0%, 100% { box-shadow: 0 1px 6px rgba(0,0,0,0.35), 0 0 0 0 rgba(255,255,255,0.22); }
  50%      { box-shadow: 0 1px 6px rgba(0,0,0,0.35), 0 0 0 7px rgba(255,255,255,0); }
}
@media (max-width: 600px) { .hs-dot { width: 28px; height: 28px; } }

/* ============================================================
   PANNABLE STAGE — drag to look around; markers pinned to the image
   The stage keeps the photo's 16:9 and is sized to at least cover the
   viewport, so % positions on hotspots always map to the same point in
   the photo at any screen size. Overflow is what you drag into view.
   ============================================================ */
.hall, .room { background-image: none !important; }

.stage {
  position: absolute;
  top: 50%; left: 50%;
  width: max(100vw, calc(100vh * 16 / 9));
  height: max(100vh, calc(100vw * 9 / 16));
  transform: translate(calc(-50% + var(--px, 0px)), calc(-50% + var(--py, 0px)));
  background-size: 100% 100%;
  background-position: center;
  touch-action: none;          /* we own the drag gesture */
  cursor: grab;
  will-change: transform;
}
/* The hallway source is 3:2; the rooms are 16:9. Keep each image at its
   native ratio so hotspots stay aligned and faces/architecture do not stretch. */
.hall .stage {
  width: max(100vw, calc(100vh * 3 / 2));
  height: max(100vh, calc(100vw * 2 / 3));
}
.stage.is-dragging { cursor: grabbing; }

.hall .stage      { background-image: url("../assets/photos/rooms/hallway.jpg"); }
#room-party .stage { background-image: url("../assets/photos/rooms/party.jpg"); }
#room-giana .stage { background-image: url("../assets/photos/rooms/giana-room.jpg"); }
#room-study .stage { background-image: url("../assets/photos/rooms/study.jpg"); }

/* One lightweight canvas follows the active room. It sits above the artwork
   but below every interactive marker, and can never intercept a tap or drag. */
.stage > .fairy-dust {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}
@media (prefers-reduced-motion: reduce) {
  .stage > .fairy-dust { opacity: 0.58; }
}

/* Viewport-anchored chrome must sit above the panning stage. */
.hall-greeting, .room-back { z-index: 6; }

/* A quiet hint that the scene can be dragged. */
.drag-hint {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 6; pointer-events: none;
  font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255, 248, 232, 0.6); text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  transition: opacity .5s;
}
.drag-hint.is-hidden { opacity: 0; }

/* The simple-form escape hatch belongs to the RSVP stage. Once the guest is
   inside the castle the tour should be uninterrupted. */
body.finale-running .skip-link,
body.in-castle .skip-link { display: none; }

/* Drag hint sits above the scenes, clear of the corner buttons. */
.drag-hint {
  position: fixed;
  bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 720;
  pointer-events: none;
  font-family: var(--sans);
  font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255, 248, 232, 0.55);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity .6s;
}
body.in-castle .drag-hint { opacity: 1; }
body.in-castle .drag-hint.is-hidden { opacity: 0; }

/* ============================================================
   DETAIL DOTS — pinned to the scene; hover / tap reveals a card
   Slightly bolder than Drake's so guests actually spot them.
   ============================================================ */
.dot {
  position: absolute;
  left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  z-index: 5;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.dot-mark {
  display: block; width: 15px; height: 15px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff6dc, #f5c86a 60%, #d69327);
  border: 1.5px solid rgba(255, 248, 224, 0.9);
  box-shadow: 0 0 0 0 rgba(245, 200, 106, 0.55), 0 2px 6px rgba(0,0,0,0.5);
  animation: dot-pulse 2s ease-in-out infinite;
}
.dot-label {
  position: absolute;
  top: calc(50% + 17px);
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  padding: 4px 10px;
  border: 1px solid rgba(255, 225, 164, .4);
  border-radius: 999px;
  background: rgba(10, 7, 25, .64);
  color: rgba(255, 244, 218, .96);
  box-shadow: 0 5px 15px rgba(0, 0, 0, .32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-family: var(--sans);
  font-size: .64rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .84);
  white-space: nowrap;
  pointer-events: none;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,200,106,0.6), 0 2px 6px rgba(0,0,0,0.5); }
  50%      { box-shadow: 0 0 0 9px rgba(245,200,106,0), 0 2px 6px rgba(0,0,0,0.5); }
}

.dot-card {
  position: absolute;
  left: 50%; bottom: calc(50% + 24px);
  transform: translate(-50%, 6px);
  width: max-content; max-width: 240px;
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 15px; border-radius: 12px;
  text-align: left;
  background: rgba(14, 10, 30, 0.9);
  border: 1px solid rgba(245, 200, 106, 0.42);
  box-shadow: 0 14px 34px rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out);
}
.dot-card::after {                       /* little pointer down to the dot */
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: rgba(14,10,30,0.9);
}
.dot-title {
  font-family: var(--serif); font-size: 1.1rem; color: var(--gold-300);
  line-height: 1.15;
}
.dot-text {
  font-family: var(--sans); font-size: 0.82rem; line-height: 1.5;
  color: rgba(246, 239, 226, 0.85);
}
.dot:hover .dot-card,
.dot:focus-visible .dot-card,
.dot.is-open .dot-card {
  opacity: 1; transform: translate(-50%, 0); pointer-events: auto;
}
.dot:hover .dot-mark,
.dot.is-open .dot-mark { animation: none; transform: scale(1.15); }

@media (prefers-reduced-motion: reduce) { .dot-mark { animation: none; } }

/* Parents' wish — sans font (same family as the eyebrow), small and readable. */
.hall-wish {
  display: block;
  font-family: var(--sans);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  line-height: 1.75;
  letter-spacing: 0.015em;
  color: rgba(246, 239, 226, 0.94);
  max-width: 600px;
  margin: 14px auto 0;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.75);
}
.hall-wish-last { margin-top: 16px; color: var(--gold-300); }

/* ============================================================
   GLASS MODAL — frosted, blurs the scene behind but keeps it visible
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 740;
  display: grid; place-items: center; padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .4s var(--ease-in-out);
}
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-scrim {
  position: absolute; inset: 0;
  background: rgba(10, 6, 24, 0.34);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
}
.modal-card {
  position: relative; z-index: 1;
  width: min(92vw, 540px); max-height: 82vh; overflow-y: auto;
  padding: 36px 30px 32px; border-radius: 18px;
  background: rgba(32, 24, 58, 0.5);
  border: 1px solid rgba(245, 200, 106, 0.42);
  box-shadow: 0 30px 70px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  color: rgba(246, 239, 226, 0.94);
  transform: translateY(16px) scale(0.98);
  transition: transform .45s var(--ease-out);
}
.modal.is-open .modal-card { transform: none; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(245,200,106,0.4);
  color: var(--gold-300); font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: background .25s, border-color .25s, transform .2s;
}
.modal-close:hover, .modal-close:focus-visible {
  background: rgba(245,200,106,0.22); border-color: rgba(245,200,106,0.85); transform: scale(1.08);
}
.modal-eyebrow {
  font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,221,158,0.72); margin: 0 0 6px; text-align: center;
}
.modal-title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 7vw, 2.6rem);
  color: var(--gold-300); text-align: center; margin: 0 0 20px;
  text-shadow: 0 0 24px rgba(245,200,106,0.3);
}
.modal-body p {
  font-family: var(--sans); font-size: 0.92rem; line-height: 1.75;
  margin: 0 0 14px; color: rgba(246,239,226,0.9);
}
.modal-body p:last-child { margin-bottom: 0; }

/* ============================================================
   FAMILY GALLERY — top-center launch, glass drop-down, borderless photos.
   The room remains visible through the softly blurred glass.
   ============================================================ */
.family-gallery-launch {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  z-index: 8;
  min-height: 44px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  border: 1px solid rgba(255, 225, 164, .58);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 238, 200, .22), transparent 58%),
    rgba(48, 24, 64, .58);
  color: rgba(255, 240, 205, .98);
  box-shadow:
    0 0 0 5px rgba(245, 200, 106, .08),
    0 0 28px rgba(245, 200, 106, .48),
    0 8px 22px rgba(0, 0, 0, .38);
  backdrop-filter: blur(7px) saturate(1.08);
  -webkit-backdrop-filter: blur(7px) saturate(1.08);
  font-family: var(--sans);
  font-size: .76rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  animation: family-launch-glow 2.2s ease-in-out infinite;
  transition: opacity .25s, transform .25s, background .25s, border-color .25s;
}
.family-gallery-launch:hover,
.family-gallery-launch:focus-visible {
  transform: translateX(-50%) translateY(-2px) scale(1.02);
  background: rgba(78, 38, 86, .72);
  border-color: rgba(255, 225, 164, .9);
}
body.modal-open .family-gallery-launch {
  opacity: 0;
  pointer-events: none;
}
@keyframes family-launch-glow {
  0%, 100% {
    box-shadow:
      0 0 0 5px rgba(245, 200, 106, .07),
      0 0 23px rgba(245, 200, 106, .38),
      0 8px 22px rgba(0, 0, 0, .38);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(245, 200, 106, .04),
      0 0 35px rgba(245, 200, 106, .62),
      0 8px 22px rgba(0, 0, 0, .38);
  }
}

.family-modal {
  place-items: start center;
  padding:
    calc(64px + env(safe-area-inset-top))
    18px
    calc(18px + env(safe-area-inset-bottom));
}
.family-modal .modal-scrim {
  background: rgba(9, 5, 21, .16);
  backdrop-filter: blur(4px) saturate(1.02);
  -webkit-backdrop-filter: blur(4px) saturate(1.02);
}
.family-modal-card {
  width: min(88vw, 900px);
  height: calc(100vh - 92px);
  height: calc(100dvh - 92px);
  max-height: 760px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 24px 22px 20px;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 16% 0%, rgba(250, 156, 84, .1), transparent 35%),
    rgba(34, 20, 52, .3);
  border: 1px solid rgba(255, 229, 180, .24);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px) saturate(1.06);
  -webkit-backdrop-filter: blur(8px) saturate(1.06);
  opacity: .7;
  transform: translateY(calc(-100% - 90px));
  transition:
    transform .78s cubic-bezier(.18, .84, .22, 1),
    opacity .45s ease;
}
.family-modal.is-open .family-modal-card {
  opacity: 1;
  transform: translateY(0);
}
.family-modal-close {
  width: 44px;
  height: 44px;
  z-index: 3;
}
.family-modal-head {
  position: relative;
  z-index: 2;
  padding: 0 52px 2px;
  text-align: center;
}
.family-modal-title {
  font-size: clamp(1.9rem, 4.5vw, 2.65rem);
  margin-bottom: 12px;
}
.family-gallery-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 7px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 200, 106, .45) transparent;
}
.family-gallery-scroll::-webkit-scrollbar { width: 6px; }
.family-gallery-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(245, 200, 106, .45);
}
.family-collage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}
.family-collage-column {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}
.family-photo {
  width: 100%;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 0;
  border-radius: 9px;
  background: none;
  box-shadow: none;
  break-inside: avoid;
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(-82px) scale(.985);
}
.family-modal.is-open .family-photo {
  animation: family-photo-fall .64s cubic-bezier(.18, .78, .24, 1.12) both;
  animation-delay: calc(420ms + var(--drop-delay, 0ms));
}
.family-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 9px;
  background: rgba(20, 12, 34, .4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
  transition: transform .24s ease, filter .24s ease;
}
.family-photo:hover img,
.family-photo:focus-visible img {
  transform: translateY(-2px) scale(1.012);
  filter: brightness(1.04);
}
@keyframes family-photo-fall {
  0% {
    opacity: 0;
    transform: translateY(-82px) scale(.985);
  }
  76% {
    opacity: 1;
    transform: translateY(7px) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* A focused photo viewer layered inside the still-open gallery dialog. */
.family-lightbox {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility .28s;
}
.family-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.family-lightbox-scrim {
  position: absolute;
  inset: 0;
  background: rgba(7, 4, 17, .62);
  backdrop-filter: blur(7px) saturate(1.04);
  -webkit-backdrop-filter: blur(7px) saturate(1.04);
}
.family-lightbox-viewer {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding:
    calc(58px + env(safe-area-inset-top))
    clamp(58px, 8vw, 112px)
    calc(42px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.family-lightbox-figure {
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  pointer-events: auto;
}
.family-lightbox-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(72vw, 980px);
  max-height: 70vh;
  max-height: 70dvh;
  border: 0;
  border-radius: 9px;
  object-fit: contain;
  box-shadow: 0 22px 62px rgba(0, 0, 0, .62);
  opacity: 0;
  transform: scale(.97);
  transition: opacity .25s ease, transform .25s ease;
}
.family-lightbox.is-open .family-lightbox-figure img {
  opacity: 1;
  transform: none;
}
.family-lightbox.is-open .family-lightbox-figure img.is-changing {
  opacity: 0;
  transform: scale(.985);
}
.family-lightbox-count {
  min-height: 1.2em;
  color: rgba(255, 239, 209, .84);
  font-family: var(--sans);
  font-size: .76rem;
  letter-spacing: .12em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}
.family-lightbox-close,
.family-lightbox-arrow {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 225, 164, .5);
  border-radius: 50%;
  background: rgba(30, 17, 47, .58);
  color: rgba(255, 235, 194, .98);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  pointer-events: auto;
  transition: background .2s, transform .2s;
}
.family-lightbox-close:hover,
.family-lightbox-close:focus-visible,
.family-lightbox-arrow:hover,
.family-lightbox-arrow:focus-visible {
  background: rgba(117, 46, 76, .76);
}
.family-lightbox-close {
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  font-size: 1.55rem;
}
.family-lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}
.family-lightbox-arrow:hover,
.family-lightbox-arrow:focus-visible {
  transform: translateY(-50%) scale(1.06);
}
.family-lightbox-prev { left: calc(10px + env(safe-area-inset-left)); }
.family-lightbox-next { right: calc(10px + env(safe-area-inset-right)); }

@media (max-width: 760px) {
  .family-modal {
    padding:
      calc(62px + env(safe-area-inset-top))
      10px
      calc(10px + env(safe-area-inset-bottom));
  }
  .family-modal-card {
    width: calc(100vw - 32px);
    height: calc(100vh - 82px);
    height: calc(100dvh - 82px);
    padding: 22px 12px 12px;
    border-radius: 17px;
  }
  .family-modal-head { padding: 0 44px 2px; }
  .family-modal-title {
    font-size: clamp(1.65rem, 7.5vw, 2.1rem);
    margin-bottom: 9px;
  }
  .family-gallery-scroll { padding: 3px 3px 12px; }
  .family-collage {
    display: block;
    columns: 2;
    column-gap: 8px;
  }
  .family-collage-column { display: contents; }
  .family-photo { margin: 0 0 8px; }
  .family-photo img { border-radius: 7px; }
  .family-lightbox-viewer {
    padding:
      calc(60px + env(safe-area-inset-top))
      10px
      calc(38px + env(safe-area-inset-bottom));
  }
  .family-lightbox-figure img {
    max-width: calc(100vw - 48px);
    max-height: 68vh;
    max-height: 68dvh;
  }
  .family-lightbox-close,
  .family-lightbox-arrow {
    width: 44px;
    height: 44px;
  }
}
@media (max-width: 520px) {
  .family-gallery-launch {
    top: calc(64px + env(safe-area-inset-top));
    padding: 11px 18px;
    font-size: .68rem;
    letter-spacing: .1em;
  }
}
@media (prefers-reduced-motion: reduce) {
  .family-gallery-launch { animation: none; }
  .family-modal,
  .family-modal-card,
  .family-photo,
  .family-lightbox,
  .family-lightbox-figure img {
    transition: none;
  }
  .family-modal .family-modal-card,
  .family-modal.is-open .family-modal-card {
    opacity: 1;
    transform: none;
  }
  .family-modal .family-photo,
  .family-modal.is-open .family-photo {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ============================================================
   DOT PANEL — a glass popover that grows out of the circle.
   Scene behind stays fully visible (no backdrop blur).
   Click-only: hover would be jarring for a long read.
   ============================================================ */
.dot:hover .dot-panel,
.dot:focus-visible .dot-panel {
  opacity: 0; pointer-events: none; transform: translate(-50%, 6px);
}
.dot.is-open .dot-panel {
  opacity: 1; pointer-events: auto; transform: translate(-50%, 0);
}
.dot-panel {
  width: min(340px, 78vw);
  max-width: none;
  max-height: min(56vh, 400px);
  overflow-y: auto;
  padding: 20px 20px 18px;
  gap: 2px;
  text-align: left;
  /* Glass, but translucent enough that the room reads through it. */
  background: rgba(28, 20, 52, 0.52);
  border: 1px solid rgba(245, 200, 106, 0.45);
  box-shadow: 0 18px 44px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.09);
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  transform-origin: bottom center;
}
.dot-panel::after { border-top-color: rgba(28, 20, 52, 0.52); }
.dot-eyebrow {
  font-family: var(--sans);
  font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255, 221, 158, 0.72);
}
.dot-title-lg {
  font-family: var(--serif); font-size: 1.8rem; line-height: 1.05;
  color: var(--gold-300); margin-bottom: 8px;
}
.dot-para {
  display: block;
  font-family: var(--sans); font-size: 0.8rem; line-height: 1.65;
  color: rgba(246, 239, 226, 0.9);
  margin-bottom: 10px;
}
.dot-para:last-child { margin-bottom: 0; }

/* Anchor the About panel to the right of the circle instead of above it —
   the book dot sits low-left, so an upward panel ran off the viewport. */
#room-study .dot-panel {
  left: calc(100% + 16px);
  bottom: auto;
  top: 50%;
  transform: translate(0, calc(-50% + 6px));
}
#room-study .dot.is-open .dot-panel { transform: translate(0, -50%); }
#room-study .dot:not(.is-open):hover .dot-panel,
#room-study .dot:not(.is-open):focus-visible .dot-panel {
  opacity: 0; transform: translate(0, calc(-50% + 6px));
}
/* tail now points left, at the circle */
#room-study .dot-panel::after {
  top: 50%; left: -12px;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: rgba(28, 20, 52, 0.52);
}
/* quieter scrollbar */
.dot-panel { scrollbar-width: thin; scrollbar-color: rgba(245,200,106,0.4) transparent; }
.dot-panel::-webkit-scrollbar { width: 5px; }
.dot-panel::-webkit-scrollbar-thumb { background: rgba(245,200,106,0.4); border-radius: 3px; }
.dot-panel::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   SPEECH-BUBBLE PANEL — sizes to its content (no scrolling),
   with a tail at the bottom-left pointing back at the circle.
   ============================================================ */
.dot-panel {
  max-height: none;
  overflow: visible;
  width: min(360px, 86vw);
  border-radius: 16px;
}
.dot-panel::after { display: none; }        /* replaced by the angled tail */

/* Bubble sits above the dot, its bottom-left corner beside it. */
#room-study .dot-panel,
#room-giana .dot-panel {
  left: -8px; right: auto; top: auto;
  bottom: calc(50% + 24px);
  transform: translate(0, 6px);
}
#room-study .dot.is-open .dot-panel,
#room-giana .dot.is-open .dot-panel { transform: translate(0, 0); }
#room-study .dot:not(.is-open):hover .dot-panel,
#room-study .dot:not(.is-open):focus-visible .dot-panel {
  opacity: 0;
  transform: translate(0, 6px);
}

#room-study .dot-panel::before,
#room-giana .dot-panel::before {
  content: "";
  position: absolute;
  left: 16px; bottom: -9px;
  width: 18px; height: 18px;
  background: rgba(28, 20, 52, 0.52);
  border-left: 1px solid rgba(245, 200, 106, 0.45);
  border-bottom: 1px solid rgba(245, 200, 106, 0.45);
  border-bottom-left-radius: 3px;
  transform: rotate(-45deg);
}

#room-study .dot-panel {
  padding: 0;
}
#room-study .dot-panel-scroll {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(62vh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 20px 20px 18px;
  border-radius: inherit;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 200, 106, .42) transparent;
}

#room-giana .dot-panel {
  width: min(440px, 88vw);
  padding: 26px 26px 24px;
}
#room-giana .dot-title-lg {
  font-size: 2.1rem;
  margin-bottom: 12px;
}
#room-giana .dot-mark {
  width: 25px;
  height: 25px;
  border-width: 2px;
  box-shadow:
    0 0 0 4px rgba(32, 20, 54, 0.5),
    0 0 20px 7px rgba(245, 200, 106, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.58);
  animation: wish-dot-pulse 1.7s ease-in-out infinite;
}
@keyframes wish-dot-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(32, 20, 54, 0.5),
      0 0 16px 4px rgba(245, 200, 106, 0.42),
      0 3px 8px rgba(0, 0, 0, 0.58);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(255, 244, 214, 0.18),
      0 0 28px 11px rgba(245, 200, 106, 0.68),
      0 3px 8px rgba(0, 0, 0, 0.58);
  }
}
#room-giana .dot:hover .dot-mark,
#room-giana .dot.is-open .dot-mark {
  animation: none;
  transform: scale(1.12);
}
@media (prefers-reduced-motion: reduce) {
  #room-giana .dot-mark { animation: none; }
}

.dot-wish-list {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(246, 239, 226, 0.9);
}
.dot-wish-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 3px;
}
.dot-wish-item::before {
  content: "•";
  color: var(--gold-300);
}

@media (max-width: 600px) {
  .dot-panel { width: min(320px, 88vw); padding: 16px 16px 14px; }
  .dot-title-lg { font-size: 1.5rem; }
  .dot-para { font-size: 0.76rem; line-height: 1.6; margin-bottom: 8px; }
  #room-study .dot-panel {
    left: 50%;
    padding: 0;
    transform: translate(-50%, 6px);
  }
  #room-study .dot.is-open .dot-panel {
    transform: translate(-50%, 0);
  }
  #room-study .dot:not(.is-open):hover .dot-panel,
  #room-study .dot:not(.is-open):focus-visible .dot-panel {
    transform: translate(-50%, 6px);
  }
  #room-study .dot-panel::before {
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
  }
  #room-study .dot-panel-scroll {
    max-height: min(60vh, 360px);
    padding: 16px 16px 14px;
  }
  #room-giana .dot-panel {
    left: -50px;
    width: min(350px, 90vw);
    padding: 19px 18px 17px;
  }
  #room-giana .dot-panel::before { left: 58px; }
  #room-giana .dot-title-lg { font-size: 1.7rem; margin-bottom: 9px; }
  .dot-wish-list { font-size: 0.78rem; gap: 6px; }
}

/* Hallway wish trigger — the message stays tucked behind a clear, tappable
   circle while the small label removes any guesswork for guests. */
.hall-wish-dot {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: max-content;
  margin: clamp(24px, 5vh, 52px) auto 0;
  pointer-events: auto;
}
.hall-wish-mark {
  width: 25px;
  height: 25px;
  border-width: 2px;
  box-shadow:
    0 0 0 6px rgba(255, 244, 214, 0.12),
    0 0 22px 8px rgba(245, 200, 106, 0.58),
    0 3px 8px rgba(0, 0, 0, 0.55);
  animation: hall-wish-pulse 1.9s ease-in-out infinite;
}
.hall-wish-hint {
  font-family: var(--sans);
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 232, 184, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
.hall-wish-panel {
  left: 50%;
  right: auto;
  top: calc(100% + 14px);
  bottom: auto;
  width: min(620px, calc(100vw - 32px));
  padding: 24px 28px 22px;
  text-align: center;
  transform-origin: top center;
}
.hall-wish-panel::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 18px;
  height: 18px;
  background: rgba(28, 20, 52, 0.52);
  border-top: 1px solid rgba(245, 200, 106, 0.45);
  border-left: 1px solid rgba(245, 200, 106, 0.45);
  border-top-left-radius: 3px;
  transform: translateX(-50%) rotate(45deg);
}
.hall-wish-panel .hall-wish {
  max-width: 560px;
  margin-top: 13px;
}
.hall-wish-panel .hall-wish-last {
  margin-top: 14px;
}
.hall-wish-dot:hover .hall-wish-mark,
.hall-wish-dot.is-open .hall-wish-mark {
  animation: none;
  transform: scale(1.12);
}
@keyframes hall-wish-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(255, 244, 214, 0.1),
      0 0 18px 6px rgba(245, 200, 106, 0.5),
      0 3px 8px rgba(0, 0, 0, 0.55);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(255, 244, 214, 0.16),
      0 0 28px 11px rgba(245, 200, 106, 0.72),
      0 3px 8px rgba(0, 0, 0, 0.55);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hall-wish-mark { animation: none; }
}
@media (max-width: 600px) {
  .hall-wish-dot { margin-top: clamp(22px, 4vh, 36px); }
  .hall-wish-panel {
    width: calc(100vw - 28px);
    padding: 19px 18px 17px;
  }
  .hall-wish-panel .hall-wish {
    font-size: 0.84rem;
    line-height: 1.62;
  }
}

/* ============================================================
   TRIGGER — a deliberately noticeable circle + left arrow
   ============================================================ */
.trigger {
  position: absolute;
  left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.trigger-row { display: flex; align-items: center; gap: 9px; }
.trigger-arrow { width: 22px; height: 22px; color: var(--gold-300); }
.trigger-arrow svg { width: 100%; height: 100%; transform: rotate(-90deg); }  /* points left */
.trigger-ring {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,246,220,.95), rgba(245,200,106,.9) 62%, rgba(214,147,39,.9));
  border: 2px solid rgba(255, 248, 224, .95);
  box-shadow: 0 0 0 0 rgba(245,200,106,.7), 0 4px 14px rgba(0,0,0,.55);
  animation: trigger-pulse 1.9s ease-in-out infinite;
}
@keyframes trigger-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,200,106,.7), 0 4px 14px rgba(0,0,0,.55); }
  50%     { box-shadow: 0 0 0 16px rgba(245,200,106,0), 0 4px 14px rgba(0,0,0,.55); }
}
.trigger-label {
  font-family: var(--sans); font-size: .68rem; letter-spacing: .22em;
  text-transform: uppercase; color: rgba(255,248,232,.95);
  background: rgba(10,8,24,.55); border: 1px solid rgba(245,200,106,.45);
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0,0,0,.9);
}
.trigger:hover .trigger-ring, .trigger:focus-visible .trigger-ring {
  transform: scale(1.12); animation: none;
  box-shadow: 0 0 26px rgba(245,200,106,.85), 0 4px 14px rgba(0,0,0,.55);
}
.trigger:hover .trigger-arrow { transform: translateX(-4px); }
.trigger-arrow { transition: transform .25s var(--ease-out); }
.trigger-ring { transition: transform .25s var(--ease-out), box-shadow .25s; }

/* ============================================================
   SIDE PANEL — glass, docked right, pulls in toward the left
   ============================================================ */
.side-panel {
  position: fixed; top: 0; right: 0; z-index: 730;
  width: min(620px, 100vw);
  height: 100%;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto minmax(190px, 1fr) auto auto;
  align-content: stretch;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding:
    calc(50px + env(safe-area-inset-top))
    calc(36px + env(safe-area-inset-right))
    calc(26px + env(safe-area-inset-bottom))
    calc(36px + env(safe-area-inset-left));
  background:
    radial-gradient(circle at 86% 18%, rgba(117, 46, 76, .3), transparent 36%),
    linear-gradient(155deg, rgba(39, 18, 51, .86), rgba(24, 12, 39, .9));
  border-left: 1px solid rgba(245, 200, 106, .42);
  box-shadow: -24px 0 60px rgba(0,0,0,.6);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  color: rgba(246,239,226,.94);
  text-align: center;
  transform: translateX(100%);
  transition: transform .55s var(--ease-in-out), opacity .4s;
  opacity: 0; pointer-events: none;
}
.side-panel.is-open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.side-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,.3); border: 1px solid rgba(245,200,106,.4);
  color: var(--gold-300); font-size: 1.45rem; line-height: 1; cursor: pointer;
  transition: background .25s, transform .2s;
}
.side-close:hover { background: rgba(245,200,106,.22); transform: scale(1.08); }
.side-eyebrow {
  font-size: .76rem; letter-spacing: .34em; text-transform: uppercase;
  color: rgba(255,221,158,.82); margin: 0 0 7px;
}
.side-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.5rem, 4.5vw, 3rem); line-height: 1;
  color: var(--gold-300); margin: 0 0 18px;
}
.side-list { margin: 0 0 18px; }
.side-row {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(245,200,106,.2);
}
.side-row dt {
  font-family: var(--sans); font-size: .8rem; letter-spacing: .24em;
  text-transform: uppercase; color: rgba(255,221,158,.8); padding: 0;
}
.side-row dd {
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 1.8rem);
  color: rgba(246,239,226,.98);
  line-height: 1.16;
}
.side-row dd .side-subvalue {
  display: block;
  font-family: var(--sans);
  font-size: .9rem;
  color: rgba(246,239,226,.68);
  margin-top: 5px;
}
.side-row-colors { display: grid; }
.side-row-colors dt { padding-top: 0; }
.side-palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 3px auto 0 !important;
  text-align: center !important;
}
.side-color {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.side-swatch {
  display: block;
  height: 50px;
  border-radius: 7px;
  background: var(--swatch);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 5px 12px rgba(0,0,0,.18);
}
.side-color-code {
  font-family: var(--sans);
  font-size: .58rem;
  line-height: 1;
  letter-spacing: .04em;
  color: rgba(246,239,226,.68);
}
.side-map {
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(245,200,106,.3);
  height: auto;
  min-height: 190px;
  background: rgba(0,0,0,.3);
}
.side-map iframe { width: 100%; height: 100%; border: 0; display: block; filter: saturate(.9); }
.side-maplink {
  display: inline-block;
  justify-self: center;
  margin-top: 11px;
  font-family: var(--sans); font-size: .84rem; letter-spacing: .05em;
  color: var(--gold-300); text-decoration: none;
  border-bottom: 1px solid rgba(245,200,106,.4); padding-bottom: 2px;
}
.side-maplink:hover { border-bottom-color: var(--gold-300); }
.side-note {
  margin: 17px 0 0; padding-top: 14px;
  border-top: 1px solid rgba(245,200,106,.16);
  font-family: var(--sans); font-size: .76rem; line-height: 1.55;
  color: rgba(246,239,226,.68);
}
.side-note em {
  font-style: italic;
}
@media (max-width: 600px) {
  .side-panel {
    width: 100vw;
    grid-template-rows: auto auto auto minmax(165px, 1fr) auto auto;
    padding:
      calc(50px + env(safe-area-inset-top))
      calc(20px + env(safe-area-inset-right))
      calc(20px + env(safe-area-inset-bottom))
      calc(20px + env(safe-area-inset-left));
  }
  .side-eyebrow { font-size: .7rem; margin-bottom: 5px; }
  .side-title { font-size: 2.2rem; margin-bottom: 14px; }
  .side-list { margin-bottom: 14px; }
  .side-row { padding: 10px 0; }
  .side-row dt { font-size: .72rem; }
  .side-row dd { font-size: clamp(1.4rem, 6vw, 1.65rem); }
  .side-row dd .side-subvalue { font-size: .78rem; margin-top: 4px; }
  .side-swatch { height: 42px; }
  .side-map { min-height: 165px; }
  .side-note { margin-top: 14px; padding-top: 12px; font-size: .7rem; }
}
