/* Custom Wedding Typography: Agatho Caps & Ganisya Script */
@font-face {
  font-family: 'Agatho';
  src: url('assets/fonts/Agatho-RegularCAPS.otf') format('opentype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Ganisya';
  src: url('assets/fonts/Ganisya-FloralMonogram.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'BrittanySignature';
  src: url('assets/fonts/BrittanySignature.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ivory: #fdfaf3;
  --ivory-warm: #f9f2e4;
  --cream-deep: #eddcc0;
  --gold: #b8912f;
  --gold-soft: #d9b969;
  --gold-dark: #8a6a2f;
  --gold-glow: rgba(217, 185, 105, 0.45);
  --maroon: #4a1119;
  --maroon-deep: #2a0a0e;
  --maroon-velvet: #5c1a22;
  --ink: #2b1408;
  --ink-muted: #5e452e;
  --max-w: 480px;
  --aspect-ratio: 845 / 1502;
  -webkit-tap-highlight-color: transparent;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--maroon-deep);
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Cormorant Garamond', serif;
  background-color: var(--maroon-deep);
  background: radial-gradient(circle at 50% 35%, #421219 0%, #2a0a0e 70%, #170407 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* ===================== DESKTOP LUXURY AMBIENT BACKDROP ===================== */
.desktop-ambient {
  position: fixed;
  inset: -30px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: var(--maroon-deep);
}

@media (max-width: 768px) {
  .desktop-ambient {
    display: none;
  }
}

.desktop-ambient::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Pre-baked blur (assets/ambient-blur.jpg) — previously this ran
     filter: blur(40px) brightness(0.35) saturate(1.3) on a full-viewport
     layer every single frame, which is one of the most expensive things a
     GPU compositor can be asked to do. */
  background-image: url('assets/ambient-blur.jpg?v=1');
  background-size: cover;
  background-position: center;
  transform: scale(1.15) translateZ(0);
  -webkit-transform: scale(1.15) translateZ(0);
  will-change: transform;
  opacity: 0.6;
}

.desktop-ambient-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, rgba(85, 20, 30, 0.5) 0%, rgba(42, 10, 14, 0.95) 75%);
}

/* ===================== CURTAIN INTRO ===================== */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
}

.curtain-panel {
  flex: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 35%),
    linear-gradient(180deg, var(--maroon-velvet), var(--maroon-deep) 70%);
  transition: transform 0.95s cubic-bezier(0.76, 0, 0.24, 1);
  position: relative;
}

.curtain-panel.left {
  margin-right: -3px;
}

.curtain-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--gold-soft);
  z-index: 2;
  width: 90%;
  max-width: 380px;
  padding: 0 16px;
}

.curtain-mandala {
  font-size: 1.15rem;
  color: var(--gold-soft);
  margin-bottom: 8px;
  text-shadow: 0 0 12px var(--gold-glow);
  animation: pulseMandala 3s ease-in-out infinite;
}

@keyframes pulseMandala {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

.curtain-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #c9a75d;
  margin: 0 0 10px;
  opacity: 0.9;
}

.curtain-couple {
  font-size: clamp(2.5rem, 8.5vw, 3.4rem);
  color: #f7eedb;
  margin: 0 0 8px;
  line-height: 1.15;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.6);
}

.curtain-sub {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.38em;
  font-size: 0.84rem;
  margin: 0 0 32px;
  color: var(--gold-soft);
  opacity: 0.85;
}

.curtain-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(30, 10, 12, 0.6);
  border: 1.5px solid var(--gold-soft);
  color: #f7eed7;
  padding: 14px 34px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(217, 185, 105, 0.3);
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
}

.curtain-btn:hover, .curtain-btn:focus-visible {
  background: rgba(217, 185, 105, 0.25);
  transform: scale(1.04);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.6), 0 0 28px rgba(217, 185, 105, 0.45);
}

.curtain-btn:active {
  transform: scale(0.97);
}

.curtain.open .curtain-panel.left {
  transform: translateX(-100%);
}

.curtain.open .curtain-panel.right {
  transform: translateX(100%);
}

.curtain.open .curtain-label {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.curtain.hidden {
  display: none;
}

/* ===================== TOP FLOATING CONTROLS: SHARE & MUTE ===================== */
.top-controls {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.royal-control-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  /* Opaque enough that no backdrop blur is needed: backdrop-filter on a fixed
     element forces a full-viewport backdrop re-blur on every single frame. */
  background: rgba(26, 9, 12, 0.94);
  border: 1.2px solid rgba(217, 185, 105, 0.7);
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 0 8px rgba(184, 145, 47, 0.2);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.royal-control-btn:hover,
.royal-control-btn:focus-visible {
  transform: scale(1.08);
  border-color: #ffffff;
  background: rgba(48, 14, 20, 0.95);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(217, 185, 105, 0.4);
  outline: none;
}

.royal-control-btn:active {
  transform: scale(0.96);
}

.royal-control-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--gold-soft);
  transition: stroke 0.2s;
}

.royal-control-btn:hover svg {
  stroke: #ffffff;
}

.royal-control-btn.fab-mute .icon-off { display: none; }
.royal-control-btn.fab-mute.is-muted .icon-on { display: none; }
.royal-control-btn.fab-mute.is-muted .icon-off { display: block; }

/* ===================== PINNED FRAME & 3D PARALLAX SYSTEM ===================== */
main {
  position: relative;
  z-index: 1;
  width: 100%;
}

.wedding-scroll-track {
  position: relative;
  width: 100%;
  height: 750vh;
  margin: 0 auto;
}

.frame-pin {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  /* translateZ(0) already promotes this to its own layer — a will-change here
     just kept another full-frame layer alive for the whole session. */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.frame-perspective-wrapper {
  perspective: 1200px;
  perspective-origin: 50% 50%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Fullscreen on mobile (zero black bars), luxury aspect-ratio on desktop */
.frame-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  margin: 0 auto;
  pointer-events: auto;
  transform-style: preserve-3d;
}

@media (min-width: 601px) {
  .frame-container {
    aspect-ratio: var(--aspect-ratio);
    max-width: min(var(--max-w), calc((100dvh - 24px) * (845 / 1502)));
    max-height: calc(100dvh - 24px);
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
  }
}

/* ===================== ATMOSPHERIC DYNAMIC SCENERY ===================== */
.arch-scenery {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Only the desktop build animates the scenery (subtle push-in during the zoom),
   so only the desktop build needs it permanently composited. */
@media (min-width: 601px) {
  .arch-scenery {
    will-change: transform;
  }
}

/* Smooth 4-Layer Dynamic Sky */
.scenery-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.sky-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: opacity;
}

.sky-dawn {
  background: radial-gradient(circle at 50% 55%, #fff5e0 0%, #fae5cc 35%, #eed4b8 65%, #d9b898 100%);
  opacity: 1;
}

.sky-sunset {
  background: radial-gradient(circle at 50% 58%, #ffdda6 0%, #fca466 30%, #e0623a 65%, #7a231d 100%);
  opacity: 0;
}

.sky-twilight {
  background: radial-gradient(circle at 50% 60%, #fad1b6 0%, #cb7076 35%, #782947 70%, #381126 100%);
  opacity: 0;
}

.sky-night {
  background: radial-gradient(circle at 50% 45%, #4a1935 0%, #2b0c1e 40%, #15050f 75%, #0d020a 100%);
  opacity: 0;
}

/* Celestial Orb positioned low near horizon */
.scenery-celestial {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  pointer-events: none;
}

.sun-orb {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe8 0%, #ffdf8c 50%, rgba(255, 190, 60, 0.3) 80%, transparent 100%);
  box-shadow: 0 0 24px rgba(255, 220, 130, 0.5);
  animation: sunFloat 6s ease-in-out infinite;
}

.sun-flare {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 245, 215, 0.35) 0%, rgba(255, 210, 110, 0.12) 50%, transparent 75%);
  /* opacity is driven by the scroll engine, size/position by the CSS animation
     (independent `scale`/`translate` properties so the two never fight) */
  animation: flarePulse 4s ease-in-out infinite;
}

/* `translate`/`scale` are animated instead of `transform`, so the scroll engine
   can keep owning `transform` (an animation on `transform` would win and make
   the sun's scroll-driven motion dead code). */
@keyframes sunFloat {
  0%, 100% { translate: 0 0; scale: 0.96; }
  50% { translate: 0 -2px; scale: 1.04; }
}

@keyframes flarePulse {
  0%, 100% { translate: 0 0; scale: 0.9; }
  50% { translate: 0 -1px; scale: 1.1; }
}

.moon-crescent {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: -6px 4px 0 2px #fff3d1;
  opacity: 0;
}

/* Silhouetted Birds */
.scenery-birds {
  position: absolute;
  top: 48%;
  left: 0;
  right: 0;
  height: 60px;
  pointer-events: none;
  opacity: 0.6;
}

.scenery-birds .bird {
  position: absolute;
  color: #5c202a;
  font-size: 0.65rem;
  font-weight: bold;
  transform: rotate(-35deg) scaleX(1.4);
  animation: birdGlide 14s linear infinite;
}

.bird.b1 { left: -10%; top: 10px; animation-delay: 0s; }
.bird.b2 { left: -15%; top: 22px; animation-delay: 2.2s; font-size: 0.55rem; }
.bird.b3 { left: -20%; top: 4px; animation-delay: 4.5s; font-size: 0.5rem; }

@keyframes birdGlide {
  0% { transform: translate(0, 0) rotate(-35deg) scaleX(1.4); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translate(550px, -30px) rotate(-35deg) scaleX(1.4); opacity: 0; }
}

/* Kerala Horizon Landscape (Lush Ghats, Backwaters, Palms, Houseboat & Flora) */
.scenery-horizon {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48%;
  pointer-events: none;
  overflow: hidden;
}

.horizon-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Twilight Fireflies Animation */
.scenery-fireflies-layer {
  opacity: 0.75;
}

.firefly {
  animation: fireflyFloat 3.6s ease-in-out infinite alternate;
}

.firefly.f1 { animation-duration: 2.8s; animation-delay: 0.2s; }
.firefly.f2 { animation-duration: 3.5s; animation-delay: 0.8s; }
.firefly.f3 { animation-duration: 3.1s; animation-delay: 1.2s; }
.firefly.f4 { animation-duration: 4.0s; animation-delay: 0.5s; }
.firefly.f5 { animation-duration: 3.3s; animation-delay: 1.6s; }

@keyframes fireflyFloat {
  0% {
    opacity: 0.3;
    transform: translate(0, 0) scale(0.85);
  }
  50% {
    opacity: 0.95;
    transform: translate(3px, -4px) scale(1.15);
  }
  100% {
    opacity: 0.4;
    transform: translate(-3px, 3px) scale(0.9);
  }
}

/* Twilight Fairy Lights */
.scenery-fairylights {
  position: absolute;
  top: 48%;
  left: 18%;
  right: 18%;
  height: 35px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.scenery-fairylights.is-visible {
  opacity: 1;
  visibility: visible;
}

.light-wire {
  position: absolute;
  inset: 0;
  border-bottom: 1.2px solid rgba(138, 106, 47, 0.5);
  border-radius: 50% / 100%;
  height: 18px;
}

.scenery-fairylights .bulb {
  position: absolute;
  width: 7px;
  height: 10px;
  border-radius: 50%;
  background: #fff8e0;
  box-shadow: 0 0 10px rgba(255, 220, 100, 0.9), 0 0 20px rgba(255, 180, 50, 0.6);
  animation: bulbFlicker 2.5s ease-in-out infinite alternate;
}

.bulb.bl1 { left: 4%; top: 3px; }
.bulb.bl2 { left: 18%; top: 12px; animation-delay: 0.3s; }
.bulb.bl3 { left: 34%; top: 17px; animation-delay: 0.7s; }
.bulb.bl4 { left: 50%; top: 18px; animation-delay: 1.1s; }
.bulb.bl5 { left: 66%; top: 17px; animation-delay: 0.5s; }
.bulb.bl6 { left: 82%; top: 12px; animation-delay: 0.9s; }
.bulb.bl7 { left: 96%; top: 3px; animation-delay: 0.2s; }

@keyframes bulbFlicker {
  0% { opacity: 0.8; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.12); }
}

/* Night Stars */
.scenery-stars {
  position: absolute;
  top: 8%;
  left: 18%;
  right: 18%;
  height: 50%;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.scenery-stars.is-visible {
  opacity: 1;
  visibility: visible;
}

.scenery-stars .star {
  position: absolute;
  color: var(--gold-soft);
  font-size: 0.65rem;
  opacity: 0.8;
  /* Static glow: animating text-shadow forced a glyph re-raster every frame */
  text-shadow: 0 0 8px var(--gold-glow);
  animation: starTwinkle 3s ease-in-out infinite alternate;
}

.star.s1 { left: 15%; top: 20%; animation-delay: 0.2s; font-size: 0.55rem; }
.star.s2 { left: 75%; top: 15%; animation-delay: 0.8s; font-size: 0.75rem; }
.star.s3 { left: 30%; top: 55%; animation-delay: 1.4s; font-size: 0.45rem; }
.star.s4 { left: 82%; top: 60%; animation-delay: 1.9s; font-size: 0.6rem; }
.star.s5 { left: 52%; top: 25%; animation-delay: 2.3s; font-size: 0.5rem; }

@keyframes starTwinkle {
  0% { opacity: 0.3; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1.25); }
}

/* ===================== HANGING GOLDEN PENDANT ===================== */
.arch-pendant {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform-origin: 50% 0;
  animation: pendantSway 5s ease-in-out infinite alternate;
}

.pendant-chain {
  width: 1.2px;
  height: 24px;
  background: linear-gradient(180deg, var(--gold), var(--gold-soft));
  box-shadow: 0 0 4px var(--gold-glow);
}

.pendant-gem {
  margin-top: -2px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
}

@keyframes pendantSway {
  0% { transform: translateX(-50%) rotate(-3.5deg); }
  100% { transform: translateX(-50%) rotate(3.5deg); }
}

/* ===================== ADAPTIVE DYNAMIC CONTENT WINDOW ===================== */
.content-window {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: auto;
  transform: translateZ(30px);
  transform-style: preserve-3d;
}

/* Arch Frame Illustration - Zooms smoothly inside the window during scroll */
.frame-visual {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: 50% 28%;
  transform: translateZ(50px);
  will-change: transform, opacity;
}

/* ===================== NATIVE MULTI-LAYER WEDDING FRAME ===================== */
.stage-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Layer 1: Architecture Base Frame (Arch, Pillars, Spandrels, Outer Border) */
.layer-architecture-base {
  z-index: 1;
}

.frame-layer-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

/* ===================== SCENE COMMON & MOTION STYLES ===================== */
.cover-scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 16px, 0);
  pointer-events: none;
  /* NOTE: will-change is applied per-scene from script.js only while a scene is
     actually on screen. Keeping it here promoted all 8 full-frame scenes to
     their own GPU layers (tens of MB of VRAM) even when hidden. */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cover-scene.scene-0 {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

/* Framing calibration: preserves clear aperture between hanging garlands and bottom couple/sun */
.scene-0, .scene-1, .scene-2 {
  padding: 14% 15% 43% 15%;
}

@media (min-width: 601px) {
  .scene-0, .scene-1, .scene-2 {
    padding: 15% 16% 43% 16%;
  }
}

.scene-3 {
  padding: 8% 8% 6% 8%;
}

@media (min-width: 601px) {
  .scene-3 {
    padding: 10% 12% 6% 12%;
  }
}

.scene-3 .scene-inner-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.scene-4, .scene-5, .scene-6, .scene-7 {
  padding: 14px 14px;
}

.cover-scene.is-active {
  pointer-events: auto;
}

.scene-inner-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.script {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
}

.mandala-accent {
  font-size: 0.95rem;
  color: var(--gold-dark);
  margin-bottom: 6px;
  opacity: 0.9;
  text-shadow: 0 0 6px var(--gold-glow);
}

.ornament-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 200px;
  width: 85%;
  margin: 0 auto 4%;
  color: var(--gold-dark);
}

.ornament-rule span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}

.ornament-rule i {
  font-style: normal;
  font-size: 0.55rem;
}

.ornament-rule.small {
  max-width: 140px;
  margin-bottom: 3.5%;
}

.section-heading {
  font-family: 'Cinzel', serif;
  color: var(--maroon);
  font-size: clamp(1.1rem, 4.8vw, 1.35rem);
  letter-spacing: 0.08em;
  margin: 0 0 3%;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* ===================== SCENE 0: INVITATION ===================== */
.scene-0 .eyebrow {
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: clamp(0.49rem, 2.0vw, 0.60rem);
  color: var(--gold-dark);
  margin: 0 0 3%;
  font-weight: 700;
  white-space: nowrap;
}

.scene-0 .bismillah {
  font-family: 'Amiri', serif;
  color: var(--maroon);
  font-size: clamp(1.15rem, 5.0vw, 1.55rem);
  margin: 0 auto 2%;
  line-height: 1.4;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  max-width: 90%;
  text-wrap: balance;
}

.scene-0 .bismillah-translation {
  font-style: italic;
  color: var(--ink);
  font-size: clamp(0.68rem, 2.9vw, 0.84rem);
  margin: 0 auto 4%;
  line-height: 1.45;
  max-width: 215px;
  width: 88%;
  font-weight: 500;
  text-wrap: balance;
  box-sizing: border-box;
}

/* ===================== SCENE 1: NAMES ===================== */
.scene-1 .cover-names {
  margin: 0 0 2%;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cover-names-line {
  display: block;
  font-family: 'Agatho', 'Cinzel', serif;
  color: #382e14;
  font-size: clamp(2.0rem, 9vw, 2.85rem);
  letter-spacing: 0.12em;
  font-weight: 400;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  line-height: 1.05;
}

.cover-names-weds {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #382e14;
  margin: 1.5% 0;
}

.cover-names-weds .weds-text {
  font-family: 'Ganisya', 'Cormorant Garamond', cursive, serif;
  font-size: clamp(1.2rem, 5.2vw, 1.65rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 0 2px;
}

.weds-swash {
  width: clamp(30px, 7.5vw, 55px);
  height: clamp(8px, 2vw, 14px);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  opacity: 0.9;
  overflow: visible;
}

.names-date-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(184, 145, 47, 0.55);
  border-radius: 999px;
  padding: 4px 14px;
  margin: 1% 0 3%;
  box-shadow: 0 2px 8px rgba(74, 17, 25, 0.06);
}

.cover-date {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.18em;
  font-size: clamp(0.68rem, 3.2vw, 0.84rem);
  color: var(--maroon);
  margin: 0;
  font-weight: 600;
}

/* ===================== SCENE 2: HERO MESSAGE ===================== */
.scene-2 .hero-quote {
  font-style: italic;
  color: var(--maroon);
  font-size: clamp(0.98rem, 4.0vw, 1.25rem);
  line-height: 1.4;
  margin: 0 auto 3%;
  font-weight: 600;
  max-width: 240px;
  width: 90%;
  text-wrap: balance;
}

.scene-2 .hero-warmth {
  font-size: clamp(0.74rem, 2.9vw, 0.88rem);
  color: var(--ink);
  line-height: 1.5;
  margin: 0 auto;
  max-width: 225px;
  width: 88%;
  font-weight: 500;
  text-wrap: balance;
}

/* ===================== SCENE 3: COUNTDOWN (MUGHAL CUSPED PODS) ===================== */
.scene-3 .surah-arabic {
  font-family: 'Amiri', serif;
  font-size: clamp(1.05rem, 4.6vw, 1.3rem);
  color: #3b160e;
  margin: 0 0 3px;
  line-height: 1.35;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.scene-3 .surah-translation {
  font-family: 'Cinzel', 'Agatho', serif;
  font-size: clamp(0.55rem, 2.25vw, 0.68rem);
  letter-spacing: 0.12em;
  line-height: 1.5;
  color: #2b0b10;
  margin: 0 auto 4px;
  text-transform: uppercase;
  font-weight: 700;
  max-width: 320px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35);
}

.scene-3 .ornament-rule.small {
  max-width: 90px;
  margin: 3px auto 5px;
}

.scene-3 .surah-cite {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.44rem, 1.8vw, 0.52rem);
  letter-spacing: 0.18em;
  color: var(--gold-dark);
  margin: 0 0 10px;
  text-transform: uppercase;
  font-weight: 600;
}

.scene-3 .countdown-heading {
  font-family: 'Agatho', 'Cinzel', serif;
  font-size: clamp(1.02rem, 4.2vw, 1.32rem);
  letter-spacing: 0.26em;
  color: #3b2c17;
  text-transform: uppercase;
  font-weight: 400;
  margin: 0 0 4px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.scene-3 .countdown-heading + .ornament-rule {
  max-width: 110px;
  margin: 0 auto 10px;
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  max-width: 310px;
  margin: 0 auto 8px;
}

.cd-arch-pod {
  flex: 1;
  max-width: 68px;
  aspect-ratio: 100 / 140;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 10px rgba(74, 17, 25, 0.08));
}

.cd-pod-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cd-pod-fill {
  fill: rgba(252, 248, 240, 0.78);
  stroke: rgba(194, 159, 104, 0.75);
  stroke-width: 1.2px;
}

.cd-pod-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0 2px;
}

.cd-num {
  font-family: 'Agatho', 'Cinzel', serif;
  font-weight: 400;
  font-size: clamp(1.25rem, 5.6vw, 1.7rem);
  color: #3b160e;
  line-height: 1;
}

.cd-lbl {
  font-family: 'Agatho', 'Cinzel', serif;
  font-size: clamp(0.38rem, 1.6vw, 0.46rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #735939;
  margin-top: 3px;
  font-weight: 400;
}

.cd-sep {
  font-size: 0.58rem;
  color: #b8912f;
  opacity: 0.9;
  flex-shrink: 0;
  padding: 0 1px;
}

.until-forever-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.countdown-tagline {
  font-family: 'BrittanySignature', 'Ganisya', cursive;
  font-size: clamp(0.78rem, 2.7vw, 1.02rem);
  color: #fff6e0;
  margin: 0;
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 12px rgba(217, 185, 105, 0.65);
}

.until-forever-swoop {
  width: clamp(42px, 10vw, 56px);
  height: clamp(3px, 0.8vw, 5px);
  color: var(--gold-soft);
  margin-top: 2px;
  overflow: visible;
  opacity: 0.95;
  filter: drop-shadow(0 0 3px rgba(217, 185, 105, 0.7));
}

/* ===================== ROYAL EVENT CARDS (Scenes 4, 5, 7) ===================== */
.royal-event-card {
  position: relative;
  width: 94%;
  max-width: 380px;
  margin: auto;
  background: linear-gradient(170deg, rgba(255, 253, 248, 0.98) 0%, rgba(252, 246, 235, 0.96) 100%);
  border: 1.5px solid rgba(184, 145, 47, 0.7);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow:
    0 14px 34px rgba(42, 10, 14, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 0 18px rgba(247, 235, 212, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Double hairline inner border */
.royal-event-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 145, 47, 0.35);
  border-radius: 10px;
  pointer-events: none;
}

/* Ornate Corner Accents */
.card-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border-color: var(--gold);
  border-style: solid;
}

.card-corner.corner-tl {
  top: 7px;
  left: 7px;
  border-width: 2px 0 0 2px;
  border-top-left-radius: 4px;
}

.card-corner.corner-tr {
  top: 7px;
  right: 7px;
  border-width: 2px 2px 0 0;
  border-top-right-radius: 4px;
}

.card-corner.corner-bl {
  bottom: 7px;
  left: 7px;
  border-width: 0 0 2px 2px;
  border-bottom-left-radius: 4px;
}

.card-corner.corner-br {
  bottom: 7px;
  right: 7px;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: 4px;
}

/* Royal Arch Crest */
.card-crest {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 3px rgba(184, 145, 47, 0.3));
}

/* Event Date Badge */
.event-date-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 4px 14px;
  margin-bottom: 12px;
  background: rgba(184, 145, 47, 0.09);
  border: 1px solid rgba(184, 145, 47, 0.35);
  border-radius: 999px;
  font-family: 'Cinzel', serif;
  font-size: clamp(0.72rem, 3.2vw, 0.85rem);
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: 0.08em;
}

.event-date-badge .badge-star {
  font-size: 0.65rem;
  color: var(--gold);
}

/* Event Meta Blocks */
.event-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.event-meta-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.meta-label {
  font-family: 'Cinzel', serif;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 700;
  margin-bottom: 2px;
}

.meta-value {
  font-size: clamp(0.92rem, 3.8vw, 1.05rem);
  font-weight: 700;
  color: var(--maroon-deep);
  margin: 0;
  line-height: 1.3;
}

.meta-value.venue-name {
  color: var(--maroon);
  font-family: 'Cinzel', serif;
  font-size: clamp(0.85rem, 3.6vw, 0.98rem);
  letter-spacing: 0.04em;
}

.meta-city {
  font-size: clamp(0.78rem, 3.2vw, 0.88rem);
  color: var(--ink-muted);
  margin: 2px 0 0;
}

.event-sub {
  font-style: italic;
  font-size: clamp(0.74rem, 3.2vw, 0.86rem);
  color: var(--ink-muted);
  margin: 0 0 12px;
  font-weight: 500;
}

/* Action Buttons */
.event-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0 auto;
}

.cusp-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.2px solid rgba(184, 145, 47, 0.6);
  color: var(--maroon);
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: clamp(0.55rem, 2.3vw, 0.66rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: background 0.2s, border-color 0.2s, transform 0.18s, box-shadow 0.18s;
}

.cusp-btn:hover, .cusp-btn:focus-visible {
  background: #ffffff;
  border-color: var(--maroon);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(74, 17, 25, 0.12);
  outline: none;
}

.cusp-btn.btn-highlight {
  background: linear-gradient(135deg, #caa44c, #9d7524);
  color: #ffffff;
  border-color: var(--gold-dark);
  box-shadow: 0 3px 10px rgba(184, 145, 47, 0.35);
}

.cusp-btn.btn-highlight:hover, .cusp-btn.btn-highlight:focus-visible {
  background: linear-gradient(135deg, #dfbc65, #b88e2c);
  box-shadow: 0 5px 14px rgba(184, 145, 47, 0.45);
  transform: translateY(-2px);
}

/* ===================== CEREMONY & RECEPTION REFERENCE UI (INSIDE ROYAL EVENT CARD) ===================== */
.royal-event-card .event-info-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  margin: 8px 0 12px;
  gap: 2px;
}

.royal-event-card .event-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 3px;
}

.royal-event-card .event-info-icon {
  color: var(--gold-dark);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
}

.royal-event-card .event-info-col .info-label {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.52rem, 2.1vw, 0.64rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 3px;
}

.royal-event-card .event-info-col .info-val {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(0.78rem, 3.1vw, 0.92rem);
  font-weight: 700;
  color: var(--maroon-deep);
  line-height: 1.2;
  margin: 0;
  letter-spacing: 0.01em;
}

.royal-event-card .event-info-col .info-val.venue-title {
  font-size: clamp(0.72rem, 2.7vw, 0.84rem);
  line-height: 1.2;
}

.royal-event-card .event-info-col .info-sub {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(0.66rem, 2.5vw, 0.78rem);
  color: var(--ink-muted);
  margin: 2px 0 0;
  line-height: 1.18;
}

.royal-event-card .event-col-divider {
  width: 1px;
  height: 52px;
  align-self: center;
  background: linear-gradient(to bottom, rgba(184, 145, 47, 0.1), rgba(184, 145, 47, 0.55) 30%, rgba(184, 145, 47, 0.55) 70%, rgba(184, 145, 47, 0.1));
  flex-shrink: 0;
}

/* 3 Ornate Action Cards */
.royal-event-card .event-actions-grid {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-bottom: 8px;
}

.royal-event-card .action-card-btn {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 8px 3px 6px;
  min-height: 68px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.royal-event-card .action-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.royal-event-card .action-card-shape {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(184, 145, 47, 0.75);
  stroke-width: 1.15px;
  filter: drop-shadow(0 2px 5px rgba(42, 10, 14, 0.06));
  transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

.royal-event-card .action-card-btn:hover .action-card-shape,
.royal-event-card .action-card-btn:focus-visible .action-card-shape {
  fill: #ffffff;
  stroke: var(--maroon);
  filter: drop-shadow(0 3px 8px rgba(74, 17, 25, 0.14));
}

.royal-event-card .action-card-btn:hover,
.royal-event-card .action-card-btn:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.royal-event-card .action-card-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  pointer-events: none;
  gap: 2px;
}

.royal-event-card .action-card-inner .action-icon {
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.royal-event-card .action-card-inner .action-label {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.48rem, 1.9vw, 0.58rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--maroon-deep);
  text-align: center;
  line-height: 1.15;
}

.royal-event-card .action-card-inner .action-arrow {
  color: var(--maroon);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  margin-top: 1px;
  transition: transform 0.2s ease;
}

.royal-event-card .action-card-btn:hover .action-arrow {
  transform: translateX(3px);
}

.royal-event-card .event-divider-bottom {
  width: 75%;
  margin: 2px auto 0;
  opacity: 0.8;
}

/* Thank You Section Logo */
.thank-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px auto 14px;
}

.thank-logo {
  max-width: 165px;
  width: 56%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
  opacity: 0.94;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.thank-logo:hover {
  opacity: 1;
  transform: scale(1.03);
}



/* ===================== SCENE 6: RSVP FORM CARD ===================== */
.scene-6 {
  padding: 0;
  align-items: center;
  justify-content: center;
}

.rsvp-card {
  position: relative;
  width: 94%;
  max-width: 410px;
  height: auto;
  margin: auto;
  background: linear-gradient(170deg, rgba(255, 253, 248, 0.98) 0%, rgba(252, 246, 235, 0.96) 100%);
  border: 1.5px solid rgba(184, 145, 47, 0.7);
  border-radius: 14px;
  padding: 12px 14px 10px;
  box-shadow:
    0 14px 34px rgba(42, 10, 14, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 0 18px rgba(247, 235, 212, 0.6);
  display: flex;
  flex-direction: column;
}

.rsvp-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 145, 47, 0.35);
  border-radius: 10px;
  pointer-events: none;
}

.rsvp-card-header {
  flex-shrink: 0;
  text-align: center;
  padding-bottom: 2px;
}

.rsvp-header {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 4vw, 1.55rem);
  color: #3b0e14;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.rsvp-deadline {
  font-style: italic;
  font-size: clamp(0.74rem, 2.6vw, 0.82rem);
  color: #4a1119;
  margin: 2px 0 4px;
  font-weight: 600;
}

.rsvp-fields-body {
  overflow: visible; /* Avoid inside the box scrolling */
  padding: 2px 0 0;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.rsvp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  width: 100%;
}

@media (max-width: 340px) {
  .rsvp-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  color: #2e0b10;
  font-weight: 700;
  letter-spacing: 0.025em;
  min-width: 0;
  width: 100%;
}

.field > span,
.field-radio legend {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #2e0b10;
  letter-spacing: 0.02em;
}

.optional-tag {
  font-weight: 500;
  font-style: italic;
  color: #6d4b32;
  font-size: 0.75rem;
  margin-left: 4px;
}

.field input[type="text"],
.field input[type="tel"],
.field select {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.96rem;
  font-weight: 600;
  padding: 5px 9px;
  height: 36px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 6px;
  border: 1.2px solid rgba(184, 145, 47, 0.65);
  background: #ffffff;
  color: #1a0507;
  outline: none;
  box-sizing: border-box;
  text-overflow: ellipsis;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.38;
  padding: 7px 9px;
  height: 54px;
  min-height: 50px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 6px;
  border: 1.2px solid rgba(184, 145, 47, 0.65);
  background: #ffffff;
  color: #1a0507;
  outline: none;
  box-sizing: border-box;
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(70, 32, 20, 0.62);
  font-size: 0.88rem;
  font-style: normal;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--maroon);
  box-shadow: 0 0 0 2px rgba(74, 17, 25, 0.16);
}

.field-radio {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
  width: 100%;
}

.radio-row {
  display: flex;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

#rsvpAttendingGroup .radio-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.radio-pill, .checkbox-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.2px solid rgba(184, 145, 47, 0.65);
  border-radius: 7px;
  padding: 4px 10px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: #28090d;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  justify-content: center;
  user-select: none;
  height: 40px;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.radio-pill span, .checkbox-pill span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: #28090d;
}

.radio-pill:hover, .checkbox-pill:hover {
  border-color: var(--gold-dark);
  background: #fffdf9;
}

.radio-pill:has(input:checked),
.checkbox-pill:has(input:checked) {
  border-color: var(--maroon);
  background: rgba(74, 17, 25, 0.06);
  color: var(--maroon);
  font-weight: 700;
}

.radio-pill input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border: 1.8px solid #757575;
  border-radius: 50%;
  outline: none;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  background-color: #ffffff;
  margin: 0;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}

.radio-pill input[type="radio"]::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: scale(0);
  transition: 0.12s transform ease-in-out;
  background-color: var(--maroon, #4a1119);
}

.radio-pill input[type="radio"]:checked {
  border-color: var(--maroon, #4a1119);
}

.radio-pill input[type="radio"]:checked::before {
  transform: scale(1);
}

.checkbox-pill input[type="checkbox"] {
  accent-color: var(--maroon);
  margin: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: 'Cinzel', serif;
  font-size: 0.70rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-dark));
  color: #fff;
  border: 1px solid var(--gold-dark);
  box-shadow: 0 4px 14px rgba(184, 145, 47, 0.38);
}

.btn-block {
  width: 100%;
}

.btn-rsvp {
  margin-top: 3px;
  height: 38px;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
}

.rsvp-hint {
  font-size: 0.62rem;
  color: var(--ink-muted);
  text-align: center;
  margin: 2px 0 0;
  line-height: 1.3;
}

.rsvp-success {
  max-width: 275px;
  margin: 10px auto 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--gold-dark);
  color: var(--maroon);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(74, 17, 25, 0.1);
}

.rsvp-error {
  max-width: 275px;
  margin: 8px auto 4px;
  background: #fff5f5;
  border: 1.2px solid #e53e3e;
  color: #c53030;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 3px 10px rgba(229, 62, 62, 0.15);
  animation: rsvpShake 0.3s ease;
}

@keyframes rsvpShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
  border-color: #e53e3e !important;
  background: #fffafa !important;
  box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.2) !important;
}

.field-radio.is-invalid {
  outline: 1.5px dashed #e53e3e;
  outline-offset: 4px;
  border-radius: 6px;
  background: rgba(229, 62, 62, 0.04);
  padding: 2px 4px;
}

/* ===================== SCENE 7: THANK YOU ===================== */
.scene-7 .thank-heading {
  margin-bottom: 2%;
}

.thank-msg {
  font-size: clamp(0.78rem, 3.4vw, 0.92rem);
  color: var(--ink);
  line-height: 1.5;
  margin: 0 0 3%;
  max-width: 290px;
  font-weight: 500;
}

.thank-sign {
  font-style: italic;
  font-size: clamp(0.72rem, 3.2vw, 0.86rem);
  color: var(--ink-muted);
  margin: 0 0 1%;
}

.thank-couple {
  font-size: clamp(1.4rem, 6.5vw, 1.85rem);
  color: var(--maroon);
  margin: 0 0 4%;
  font-weight: 600;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #31150c;
  border: 1.5px solid var(--gold-soft);
  border-radius: 999px;
  color: #f7eedb;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: clamp(0.58rem, 2.5vw, 0.7rem);
  letter-spacing: 0.1em;
  padding: 9px 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, transform 0.15s;
}

.contact-btn:hover, .contact-btn:focus-visible {
  background: #4a1f12;
  border-color: #fff;
  transform: translateY(-2px);
  outline: none;
}

.contact-btn em {
  font-style: normal;
}

.thank-credit {
  font-family: 'Cinzel', serif;
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 12px 0 2px;
  opacity: 0.85;
  text-align: center;
}

.thank-by {
  font-family: 'Cinzel', serif;
  font-size: 0.48rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin: 2px 0 4px;
  font-weight: 700;
  opacity: 0.9;
  text-align: center;
}

/* Event Contact Badges (Wedding Ceremony & Reception) */
.event-contact-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px auto 4px;
  width: 100%;
}

.event-contact-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(247, 241, 230, 0.92);
  border: 1px solid rgba(184, 145, 47, 0.45);
  border-radius: 999px;
  color: #3b1910;
  font-family: 'Cinzel', serif;
  font-size: 0.70rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(36, 16, 12, 0.08);
  transition: all 0.22s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
}

.event-contact-badge svg {
  color: #b8912f;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.event-contact-badge:hover,
.event-contact-badge:focus-visible {
  background: #3b1910;
  color: #f7f1e6;
  border-color: #b8912f;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(36, 16, 12, 0.25);
}

.event-contact-badge:hover svg,
.event-contact-badge:focus-visible svg {
  color: #ffd276;
  transform: scale(1.1);
}

@media (max-width: 480px) {
  .event-contact-badge {
    font-size: 0.64rem;
    padding: 5px 12px;
  }
}

/* ===================== AMBIENT LIGHTING & PARTICLES ===================== */
.ambient-flames {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.deco-flame {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  /* No mix-blend-mode: isolating a blending element forces the compositor to
     read back whatever is underneath it on every frame. The gradient already
     reads as a warm additive glow. */
  box-shadow: 0 0 10px rgba(255, 190, 60, 0.7);
  will-change: transform, opacity;
}

/* Left & Right Pillar Flame Glows - Disabled since no lanterns exist on top pillars */
.flame-pillar-left,
.flame-pillar-right {
  display: none !important;
}

/* Primary Table Lamp Flame (inside taller lantern on book stack)
   Measured hot-core centre of assets/frame-cover-original.webp (941x1672):
   left 6.62% / top 71.19% */
.flame-table-main {
  left: 6.62%;
  top: 71.2%;
  width: 14px;
  height: 20px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center, rgba(255, 255, 245, 1) 0%, rgba(255, 215, 120, 0.9) 25%, rgba(255, 140, 35, 0.5) 55%, rgba(240, 90, 10, 0.1) 75%, transparent 85%);
  animation: flameFlicker 2.1s ease-in-out infinite 0.3s;
}

/* Secondary Table Lamp Flame (inside smaller lantern on table)
   Measured hot-core centre: left 14.03% / top 72.73% */
.flame-table-sub {
  left: 14.03%;
  top: 72.73%;
  width: 12px;
  height: 16px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center, rgba(255, 255, 240, 0.95) 0%, rgba(255, 210, 110, 0.85) 25%, rgba(255, 135, 30, 0.45) 55%, rgba(240, 85, 10, 0.08) 75%, transparent 85%);
  animation: flameFlicker 2.6s ease-in-out infinite 1.2s;
}

@keyframes lanternPulse {
  0%, 100% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.92);
  }
  35% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.16);
  }
  65% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.98);
  }
  85% {
    opacity: 1.05;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes flameFlicker {
  0%, 100% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(0.9) translateY(0);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12) translateY(-1px);
  }
  50% {
    opacity: 0.84;
    transform: translate(-50%, -50%) scale(0.95) translateY(0.5px);
  }
  75% {
    opacity: 1.08;
    transform: translate(-50%, -50%) scale(1.08) translateY(-0.6px);
  }
}

.particles-3d-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
  transform: translateZ(40px);
}

.cover-sparkle {
  position: absolute;
  inset: 0;
}

.cover-sparkle span {
  position: absolute;
  color: var(--gold-soft);
  font-size: 0.75rem;
  opacity: 0;
  animation: sparkleDrift 5s ease-in-out infinite;
  text-shadow: 0 0 8px var(--gold-glow);
  will-change: transform, opacity;
}

.cover-sparkle span:nth-child(1) { left: 16%; top: 60%; animation-delay: 0s; }
.cover-sparkle span:nth-child(2) { left: 80%; top: 52%; animation-delay: 1.3s; }
.cover-sparkle span:nth-child(3) { left: 26%; top: 22%; animation-delay: 2.5s; }
.cover-sparkle span:nth-child(4) { left: 74%; top: 16%; animation-delay: 3.6s; }

@keyframes sparkleDrift {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.5) rotate(0deg); }
  18% { opacity: 0.95; }
  82% { opacity: 0.25; }
  100% { opacity: 0; transform: translate3d(0, -70px, 0) scale(1.15) rotate(110deg); }
}

.jasmine-petal {
  position: absolute;
  top: 0;
  display: block;
  color: #fff9ee;
  text-shadow: 0 1px 4px rgba(74, 17, 25, 0.25);
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  animation-name: jasmineFall;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

@keyframes jasmineFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0deg) rotateY(0deg);
  }
  12% {
    opacity: 0.95;
  }
  85% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 30px), 105vh, 0) rotate(360deg) rotateY(180deg);
  }
}

/* ===================== ROYAL SCROLL CUE INDICATOR ===================== */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: max(22px, calc(env(safe-area-inset-bottom, 0px) + 18px));
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.35s ease, transform 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
  transform: translateX(-50%) translateY(-2px);
  outline: none;
}

.scroll-cue:active {
  transform: translateX(-50%) translateY(1px);
}

.scroll-cue-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 7px 16px 7px 12px;
  width: 144px;
  height: 36px;
  border-radius: 999px;
  background: rgba(28, 8, 12, 0.94);
  border: 1.2px solid rgba(217, 185, 105, 0.85);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.6),
    inset 0 0 10px rgba(184, 145, 47, 0.25);
  color: var(--gold-soft);
  transition:
    width 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    gap 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
  box-sizing: border-box;
}

/* Glow pulse moved onto a compositable pseudo-element.
   Animating box-shadow directly on the pill repainted it every frame forever. */
.scroll-cue-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 14px rgba(217, 185, 105, 0.45);
  opacity: 0.55;
  pointer-events: none;
  will-change: opacity;
  animation: cueGentlePulse 2.4s ease-in-out infinite;
}

.scroll-cue:hover .scroll-cue-pill {
  border-color: #ffffff;
  background: rgba(45, 14, 20, 0.95);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.65),
    0 0 16px rgba(217, 185, 105, 0.45);
}

/* Phone Swipe-Up Icon */
.scroll-phone-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  overflow: hidden;
  color: var(--gold-soft);
  opacity: 1;
  transform: scale(1);
  transition:
    width 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-swipe-svg {
  display: block;
}

.phone-swipe-motion {
  animation: phoneSwipeUp 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes phoneSwipeUp {
  0% {
    opacity: 0.2;
    transform: translateY(3px);
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
    transform: translateY(-3px);
  }
  100% {
    opacity: 0.2;
    transform: translateY(-5px);
  }
}

.scroll-cue-label {
  font-family: 'Cinzel', 'Amiri', serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #f7eed7;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  line-height: 1;
  white-space: nowrap;
  max-width: 85px;
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  transition:
    max-width 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-cue-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-soft);
  flex-shrink: 0;
  animation: swipeChevronBounce 1.5s ease-in-out infinite;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-cue-arrow svg {
  display: block;
  margin: 0 auto;
}

@keyframes swipeChevronBounce {
  0%, 100% { transform: translateY(1.5px); }
  50% { transform: translateY(-1.5px); }
}

@keyframes cueGentlePulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}

/* Hidden state on the last section */
.scroll-cue.is-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(8px) !important;
}

/* Apple-style morph: smoothly collapse phone icon & label, keep single centered arrow */
.scroll-cue.past-first .scroll-phone-icon {
  width: 0;
  opacity: 0;
  transform: scale(0.65);
  pointer-events: none;
}

.scroll-cue.past-first .scroll-cue-label {
  max-width: 0;
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
}

.scroll-cue.past-first .scroll-cue-pill {
  width: 44px;
  height: 28px;
  padding: 0;
  gap: 0;
  justify-content: center;
  align-items: center;
}

.scroll-cue.past-first .scroll-cue-arrow {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  transform: translateX(-50%) translateY(8px);
  background: rgba(36, 16, 12, 0.96);
  border: 1.2px solid var(--gold-soft);
  color: var(--ivory);
  padding: 10px 22px;
  border-radius: 999px;
  font-family: 'Cinzel', serif;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 48px);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ===================== MOBILE PERFORMANCE & OVERFLOW OPTIMIZATIONS ===================== */
@media (max-width: 600px) {
  /* GPU compositing hints — only keep what matters on mobile */
  .arch-scenery,
  .cover-scene {
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  /* Disable 3D transforms that cause repaints on mobile GPU */
  .frame-perspective-wrapper {
    perspective: none;
  }

  .frame-container {
    transform-style: flat;
  }

  .content-window {
    transform: none;
    transform-style: flat;
  }

  .particles-3d-layer {
    transform: none;
  }

  /* Reduce particle count / animation overhead on mobile */
  .cover-sparkle span:nth-child(3),
  .cover-sparkle span:nth-child(4) {
    display: none;
  }

  .jasmine-petal:nth-child(n+5) {
    display: none;
  }

  /* Disable bird animations — saves continuous repaints */
  .scenery-birds .bird {
    animation: none;
    display: none;
  }

  /* Simpler sun animation on mobile */
  .sun-orb {
    animation: none;
  }

  .sun-flare {
    animation: none;
    opacity: 0.65;
  }

  /* Disable pendant sway animation on mobile */
  .arch-pendant {
    animation: none;
  }

  /* Contain all scene content to prevent horizontal overflow */
  .cover-scene {
    overflow: hidden;
    max-width: 100vw;
  }

  /* Safe interior text framing on mobile phone screens */
  .scene-0, .scene-1, .scene-2 {
    padding: 13% 14% 43% 14%;
  }

  .scene-2 .hero-quote {
    max-width: 215px;
    font-size: clamp(0.92rem, 3.9vw, 1.15rem);
    line-height: 1.38;
    margin: 0 auto 3%;
  }

  .scene-2 .hero-warmth {
    max-width: 200px;
    font-size: clamp(0.72rem, 2.9vw, 0.84rem);
    line-height: 1.48;
    margin: 0 auto;
  }

  /* Prevent event card from overflowing */
  .royal-event-card {
    width: 92%;
    max-width: 100%;
    padding: 14px 12px;
    overflow: hidden;
  }

  .royal-event-card .event-actions-grid {
    gap: 4px;
  }

  .royal-event-card .action-card-btn {
    min-height: 60px;
    padding: 6px 2px 4px;
  }

  /* Tighter event info on mobile */
  .royal-event-card .event-info-grid {
    gap: 0;
  }

  .royal-event-card .event-info-col {
    padding: 0 2px;
  }

  /* RSVP card overflow fix */
  .rsvp-card {
    width: 92%;
    max-width: 100%;
    padding: 10px 10px 8px;
    overflow: hidden;
  }

  .rsvp-form {
    gap: 5px;
  }

  /* Ensure inputs don't cause horizontal overflow */
  .field input[type="text"],
  .field input[type="tel"],
  .field select,
  .field textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    max-width: 100%;
  }

  /* Tighter scene padding for mobile */
  .scene-4, .scene-5, .scene-6, .scene-7 {
    padding: 10px 8px;
  }

  /* Prevent text overflow in thank you section */
  .thank-couple {
    font-size: clamp(1.2rem, 5.5vw, 1.6rem);
    word-break: break-word;
  }

  .thank-msg {
    max-width: 100%;
    padding: 0 4px;
  }

  /* Calmer flame flicker on mobile (purely cosmetic) */
  .deco-flame {
    animation-duration: 4s !important;
  }

  /* Ensure contact badges don't overflow */
  .event-contact-wrap {
    width: 100%;
    overflow: hidden;
  }

  /* Countdown grid mobile tightening */
  .countdown-grid {
    max-width: 100%;
    gap: 2px;
  }

  .cd-arch-pod {
    max-width: 60px;
  }

  /* Nav menu mobile overflow */
  .nav-menu {
    max-width: 100vw;
  }

  /* Toast mobile overflow */
  .toast {
    max-width: calc(100vw - 32px);
    font-size: 0.7rem;
  }
}

/* Extra small screens (320px and below) */
@media (max-width: 360px) {
  .scene-0, .scene-1, .scene-2 {
    padding: 11% 10% 42% 10%;
  }

  .scene-2 .hero-quote {
    max-width: 190px;
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .scene-2 .hero-warmth {
    max-width: 180px;
    font-size: 0.70rem;
    line-height: 1.42;
  }

  .scene-3 {
    padding: 6% 6% 4% 6%;
  }

  .royal-event-card {
    padding: 10px 8px;
  }

  .royal-event-card .event-actions-grid {
    flex-wrap: wrap;
    gap: 4px;
  }

  .royal-event-card .action-card-btn {
    min-height: 54px;
  }

  .rsvp-card {
    padding: 8px 8px 6px;
  }

  .countdown-grid {
    gap: 1px;
  }

  .cd-arch-pod {
    max-width: 52px;
  }

  .event-contact-badge {
    font-size: 0.58rem;
    padding: 4px 10px;
  }
}

/* ===================== ACCESSIBILITY & PREFERS-REDUCED-MOTION ===================== */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .curtain-panel, .curtain-label, .nav-menu, .toast { transition: none !important; }
  .deco-flame, .cover-sparkle span, .scroll-cue-badge, .arch-pendant, .scenery-birds .bird, .sun-orb, .sun-flare { animation: none !important; }
  .cover-scene { transform: none !important; }
  .frame-container { transform: none !important; }
}
