/* ============================================================
   PRIYANSH & SHIRISTY — ROYAL WEDDING E-INVITE
   Theme: Handcrafted Linen Paper & Watercolor Caricatures
   ============================================================ */


:root {
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-cinzel: 'Cinzel', serif;
  --font-script: 'Great Vibes', cursive;
  --font-script-alt: 'Alex Brush', cursive;
  --font-display: 'Playfair Display', Georgia, serif;
  /* Royal Palette - Graceful, Regal & Balanced Contrast */
  --color-crimson: #781424;
  --color-crimson-dark: #520c17;
  --color-gold: #cba135;
  --color-gold-light: #fef08a;
  --color-gold-deep: #8e5606;
  --color-ivory: #fffdf9;
  --color-linen: #f4eee2;
  --color-charcoal: #221a18;
  --color-muted: #4e433f;
  
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.25);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.16);
  --stage-max-width: 440px;
  --stage-scale: 1;
  --stage-ratio-width: 9;
  --stage-ratio-height: 16;
  --linen-texture: url('assets/optimized/linen.webp');
  --linen-tile-size: 420px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-linen);
  background-image: var(--linen-texture);
  background-size: var(--linen-tile-size) auto;
  background-repeat: repeat;
  color: var(--color-charcoal);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader {
  position: fixed;
  top: 50%;
  left: 50%;
  width: var(--stage-max-width);
  height: auto;
  aspect-ratio: var(--stage-ratio-width) / var(--stage-ratio-height);
  transform: translate(-50%, -50%) scale(var(--stage-scale));
  z-index: 9999;
  background: radial-gradient(circle at center, #2e1216 0%, #15090b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-gold-light);
  border: 2px solid rgba(212, 175, 55, 0.45);
  border-radius: clamp(12px, 3vw, 36px);
  overflow: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-inner {
  width: 85%;
  max-width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preloader-emblem {
  width: 68px;
  height: 68px;
  margin-bottom: 1.2rem;
  filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.5));
}

.ganesh-pulse {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: pulseGold 2.4s ease-in-out infinite alternate;
}

.preloader-invocations {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--color-gold);
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.preloader-names {
  font-family: var(--font-script);
  font-size: 2.5rem;
  color: var(--color-gold-light);
  line-height: 1.1;
  margin-bottom: 0.35rem;
  font-weight: normal;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  overflow-wrap: anywhere;
}

.preloader-dates {
  font-family: var(--font-serif);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: rgba(243, 229, 171, 0.85);
  margin-bottom: 1.8rem;
}

.preloader-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(212, 175, 55, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.preloader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #fef08a, #d4af37);
  transition: width 0.2s ease-out;
}

.preloader-pct {
  font-family: var(--font-cinzel);
  font-size: 0.7rem;
  color: var(--color-gold);
  letter-spacing: 0.1em;
}

/* ============================================================
   DESKTOP / MOBILE STAGE CONTAINER
   ============================================================ */
.viewport-backdrop {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-linen);
  background-image: var(--linen-texture);
  background-size: var(--linen-tile-size) auto;
  background-repeat: repeat;
  position: relative;
  overflow: hidden;
}

/* Centered Mobile Device Frame */
.mobile-frame {
  flex: none;
  transform: scale(var(--stage-scale));
  width: var(--stage-max-width);
  height: auto;
  aspect-ratio: var(--stage-ratio-width) / var(--stage-ratio-height);
  position: relative;
  background-color: var(--color-ivory);
  border: 2px solid rgba(212, 175, 55, 0.45);
  border-radius: clamp(12px, 3vw, 36px);
  box-shadow: 0 8px 30px rgba(67, 47, 26, 0.2), 0 0 0 1px rgba(212, 175, 55, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  container-type: size;
}

/* ============================================================
   SCREEN 0: REALISTIC 3D WAX SEAL ENVELOPE UNBOXING
   ============================================================ */
.envelope-screen {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #2e1216 0%, #1a080b 100%);
  padding: 1.5rem;
  transition: opacity 1.1s ease, transform 1.1s ease, visibility 1.1s ease;
}

.envelope-screen.opened {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.08);
  pointer-events: none;
}

.envelope-scene {
  width: 100%;
  max-width: 340px;
  perspective: 1200px;
  overflow: visible;
  transform: translateY(18px);
}

.envelope-box {
  width: 100%;
  height: min(230px, 64cqh);
  position: relative;
  background: #f7f2e7;
  border-radius: 8px;
  box-sizing: border-box;
  border: 1px solid rgba(212, 175, 55, 0.95);
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 247, 196, 0.9),
    inset 0 0 0 4px rgba(142, 86, 6, 0.18),
    inset 0 0 0 5px rgba(212, 175, 55, 0.72);
  transform-style: preserve-3d;
  overflow: visible;
}

/* Background Linen Texture on Envelope */
.envelope-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(126, 91, 39, 0.07) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px 5px),
    url('assets/optimized/linen.webp') center / cover;
  opacity: 0.72;
  border-radius: 8px;
  pointer-events: none;
}

/* Envelope Back */
.envelope-back {
  position: absolute;
  inset: 0;
  background: #ede4d1;
  border-radius: 8px;
  transform: translateZ(0);
}

/* Letter inside envelope */
.envelope-letter {
  position: absolute;
  width: 90%;
  height: 90%;
  top: 5%;
  left: 5%;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  transition: transform 2.4s cubic-bezier(0.2, 0.75, 0.25, 1);
  z-index: 2;
  transform: translateZ(1px);
  will-change: transform;
}

.mini-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mini-ganesh {
  width: auto;
  height: 26px;
  margin-bottom: 0.25rem;
}

.mini-invocation {
  font-family: var(--font-serif);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--color-crimson);
  margin-bottom: 0.35rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.mini-monogram {
  width: auto;
  height: 36px;
  margin-bottom: 0.25rem;
}

.mini-couple-title {
  font-family: var(--font-script);
  font-size: 1.55rem;
  color: var(--color-crimson);
  line-height: 1;
}

.mini-date {
  font-family: var(--font-serif);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--color-gold-deep);
  margin-top: 0.2rem;
}

/* Pocket Flap Triangles */
.envelope-pocket {
  position: absolute;
  inset: 0;
  z-index: 3;
  clip-path: polygon(0% 0%, 50% 55%, 100% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(135deg, #d4af37 0%, #a16207 100%);
  border-radius: 0 0 8px 8px;
  transform: translateZ(2px);
  pointer-events: none;
}

.envelope-pocket::after {
  content: '';
  position: absolute;
  inset: 2px;
  background:
    repeating-linear-gradient(0deg, rgba(126, 91, 39, 0.06) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 5px),
    linear-gradient(135deg, rgba(243, 236, 221, 0.9), rgba(235, 226, 206, 0.9)),
    url('assets/optimized/linen.webp') center / cover;
  border-radius: 0 0 6px 6px;
}

/* 3D Top Flap */
.envelope-top-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 58%;
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  background: linear-gradient(180deg, #d4af37 0%, #a16207 100%);
  transform-origin: top center;
  transition: transform 1.65s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.12));
  transform: translateZ(3px);
  backface-visibility: visible;
}

.envelope-top-flap::after {
  content: '';
  position: absolute;
  inset: 2px 2px 0;
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  background:
    repeating-linear-gradient(0deg, rgba(126, 91, 39, 0.06) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, rgba(239, 230, 213, 0.9), rgba(226, 214, 193, 0.9)),
    url('assets/optimized/linen.webp') center / cover;
}

.envelope-top-flap.flap-open {
  transform: rotateX(180deg) translateZ(-1px);
  z-index: 1;
  filter: none;
}

/* Wax Seal Centered on Top Flap Tip */
.wax-seal-wrapper {
  position: absolute;
  top: 54%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(4px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.8s ease;
}

.wax-seal-wrapper.opened {
  opacity: 0;
  pointer-events: none;
}

.wax-seal-wrapper.opened .wax-glow-ring {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.wax-seal {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a82037 0%, #822030 55%, #4a0c16 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.25), inset 0 -3px 6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.25s ease, filter 0.25s ease;
  user-select: none;
}

.wax-seal:hover {
  transform: scale(1.05);
}

.wax-seal:active {
  transform: scale(0.96);
}

.wax-seal-rim {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1.5px dashed rgba(243, 229, 171, 0.5);
}

.wax-seal-inner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #6b1725 0%, #480a14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.wax-monogram {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.wax-glow-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.4);
  animation: pulseRing 2s ease-out infinite;
  pointer-events: none;
}

.wax-seal.broken {
  animation: crackSeal 1.1s forwards;
}

/* ============================================================
   ACTIVE STORY VIEWPORT (REEL EXPERIENCE)
   ============================================================ */
.story-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity 0.8s ease;
}

/* Story Header with Segmented Progress Bar */
.story-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.65rem 0.85rem 0.5rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 75%, transparent 100%);
}

.story-progress-bar {
  display: flex;
  gap: 4px;
  width: 100%;
  height: 3px;
  margin-bottom: 0.5rem;
}

.progress-segment {
  flex: 1;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  width: 100%;
  height: 100%;
  background: #ffffff;
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

.progress-segment.completed .progress-fill {
  transform: scaleX(1) !important;
}

.progress-segment.active .progress-fill {
  background: var(--color-gold-light);
}

.story-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.story-header-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}

.header-monogram {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.header-title {
  font-family: var(--font-serif);
  min-width: 0;
  font-size: clamp(0.62rem, 2.8cqw, 0.85rem);
  letter-spacing: 0.03em;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  font-weight: 600;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.story-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-play-pause,
.btn-sound-toggle {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-play-pause:active,
.btn-sound-toggle:active {
  transform: scale(0.9);
}

/* Sound Waves Animation */
.sound-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.sound-wave i {
  width: 2px;
  background: #ffffff;
  border-radius: 1px;
}

.sound-wave.on i:nth-child(1) { height: 6px; animation: eq 1s ease-in-out infinite 0.1s; }
.sound-wave.on i:nth-child(2) { height: 12px; animation: eq 1s ease-in-out infinite 0.3s; }
.sound-wave.on i:nth-child(3) { height: 8px; animation: eq 1s ease-in-out infinite 0.2s; }
.sound-wave.on i:nth-child(4) { height: 14px; animation: eq 1s ease-in-out infinite 0.4s; }

/* Tap Zones (Left/Right) */
.story-tap-zone {
  border: 0;
  padding: 0;
  background: transparent;
  position: absolute;
  top: 60px;
  bottom: 70px;
  width: 30%;
  z-index: 40;
  cursor: pointer;
}

.story-tap-zone.left { left: 0; }
.story-tap-zone.right { right: 0; }

/* ============================================================
   SLIDES TRACK & SLIDES
   ============================================================ */
.story-slides-track {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.story-page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  visibility: hidden;
  transform: translate3d(100%, 0, 0);
  transition: transform 1.25s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.25s ease;
  will-change: transform;
  backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.story-page,
.story-page * {
  min-width: 0;
}

.story-page.active {
  visibility: visible;
  transform: translate3d(0, 0, 0);
  z-index: 10;
}

.story-page.prev-slide {
  visibility: visible;
  transform: translate3d(-100%, 0, 0);
  z-index: 5;
}

.story-page.next-slide {
  visibility: hidden;
  transform: translate3d(100%, 0, 0);
  z-index: 1;
}

.story-page.page-cover {
  transform: translate3d(0, 0, 0);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.story-page.page-cover.active {
  visibility: visible;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  z-index: 10;
}

.story-page.page-cover.prev-slide {
  visibility: visible;
  transform: translate3d(-100%, 0, 0);
  z-index: 5;
}

/* Fullscreen Backdrop Art (Static & Rock-Solid) */
.page-backdrop-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  z-index: 1;
  transform: none !important;
  transition: none !important;
}

.story-page.active .page-backdrop-art {
  transform: none !important;
}

/* Warm the wedding scene with a soft sunrise tint while preserving detail. */
.page-wedding .page-backdrop-art {
  filter: sepia(0.14) saturate(1.08) brightness(0.97);
}

.page-wedding::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 180, 112, 0.3) 0%,
    rgba(255, 224, 170, 0.14) 42%,
    rgba(231, 137, 99, 0.24) 100%
  );
  mix-blend-mode: soft-light;
}

/* Tactile Linen Paper Texture Overlay */
.page-linen-layer {
  position: absolute;
  inset: 0;
  background-image: url('assets/optimized/linen.webp');
  background-size: cover;
  opacity: 0.28;
  mix-blend-mode: overlay;
  z-index: 2;
  pointer-events: none;
}

/* All Slides: Full-frame background image fitting border perfectly with NO artificial frames */
.page-cover .page-backdrop-art,
.page-event .page-backdrop-art,
.page-families .page-backdrop-art,
.page-ending .page-backdrop-art,
.page-details .page-backdrop-art {
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

.page-cover .page-linen-layer,
.page-cover .page-filigree-frame,
.page-event .page-linen-layer,
.page-event .page-filigree-frame,
.page-families .page-linen-layer,
.page-families .page-filigree-frame,
.page-ending .page-linen-layer,
.page-ending .page-filigree-frame,
.page-details .page-linen-layer,
.page-details .page-filigree-frame {
  display: none !important;
}

/* Subtle Royal Gold Border Frame */
.page-filigree-frame {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  pointer-events: none;
  z-index: 3;
  border-radius: 4px;
}

.page-filigree-frame::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 0.5px solid rgba(212, 175, 55, 0.25);
}

.page-filigree-frame.gold-glow {
  border-color: rgba(254, 240, 138, 0.55);
  box-shadow: inset 0 0 25px rgba(212, 175, 55, 0.15);
}

/* ============================================================
   PAGE CONTENT FLOW (DIRECT OVERLAY ONTO PARCHMENT)
   ============================================================ */
.page-content-flow {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}

.page-content-flow > * {
  flex: 0 0 auto;
  max-width: 100%;
}

.page-cover .page-content-flow {
  justify-content: flex-start;
  padding: clamp(62px, 12cqh, 90px) 0.8rem clamp(20px, 4cqh, 32px);
  gap: clamp(0.12rem, 0.45vh, 0.28rem);
  box-sizing: border-box;
  max-width: 335px;
  margin: 0 auto;
}

.page-event .page-content-flow {
  justify-content: flex-start;
  padding: clamp(120px, 24cqh, 190px) 1rem clamp(40px, 7cqh, 60px);
  gap: clamp(0.1rem, 0.4vh, 0.24rem);
  box-sizing: border-box;
  max-width: 310px;
  margin: 0 auto;
}

.page-mahapujan .page-content-flow {
  padding-top: clamp(155px, 27cqh, 210px);
  gap: 0.05rem;
}

.page-mahapujan .event-main-title {
  font-size: clamp(0.92rem, 4.1cqw, 1.15rem);
  max-width: 270px;
}

.page-mahapujan .detail-val {
  font-size: clamp(0.78rem, 3.3cqw, 0.98rem);
}

.page-mahapujan .highlight-venue {
  font-size: clamp(0.82rem, 3.4cqw, 1rem);
}

.page-mahapujan .lunch-venue {
  font-size: clamp(0.76rem, 3.1cqw, 0.88rem);
}

/* Paat Sthapana: Positioned lower in clear parchment space below the hanging marigold toran & bells */
.page-paat .page-content-flow {
  padding-top: clamp(165px, 29cqh, 225px);
  padding-bottom: clamp(60px, 10cqh, 80px);
  max-width: 295px;
  gap: clamp(0.06rem, 0.3vh, 0.16rem);
}

/* Haldi Ceremony: Positioned lower in open cream parchment below the sunflower arch & bells */
.page-haldi .page-content-flow {
  padding-top: clamp(155px, 28cqh, 220px);
  padding-bottom: clamp(170px, 26cqh, 210px);
  max-width: 295px;
  gap: clamp(0.06rem, 0.3vh, 0.16rem);
}

/* Sangeet: Positioned lower in the warm golden spotlight beneath the crystal chandeliers */
.page-sangeet .page-content-flow {
  padding-top: clamp(180px, 33cqh, 260px);
  padding-bottom: clamp(170px, 26cqh, 210px);
  max-width: 295px;
  gap: clamp(0.06rem, 0.3vh, 0.16rem);
}

/* The Wedding: Positioned lower in the open ivory parchment below the jasmine garlands & bells */
.page-wedding .page-content-flow {
  padding-top: clamp(145px, 27cqh, 215px);
  padding-bottom: clamp(180px, 28cqh, 230px);
  max-width: 295px;
  gap: clamp(0.06rem, 0.3vh, 0.16rem);
}

.scrollable-family-content {
  justify-content: flex-start !important;
  padding-top: clamp(80px, 14cqh, 110px) !important;
  padding-bottom: 0 !important;
  max-width: 380px;
  margin-inline: auto;
}

.page-families .page-linen-layer,
.page-families .page-filigree-frame {
  display: none;
}

.page-content-flow::-webkit-scrollbar {
  display: none;
}

/* Sacred Invocations */
.sacred-invocations-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.1rem;
}

.gold-ganesha-badge {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin-bottom: 0.15rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.invocation-line {
  font-family: var(--font-serif);
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  color: var(--color-crimson);
  line-height: 1.4;
  font-weight: 700;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Royal Monogram Emblem */
.royal-monogram-emblem {
  position: relative;
  width: 36px;
  height: 36px;
  margin: 0.05rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.royal-monogram-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.hosts-title {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 3.8cqw, 0.98rem);
  letter-spacing: 0.01em;
  color: var(--color-crimson);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.hosts-invitation {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--color-charcoal);
  font-weight: 600;
  line-height: 1.3;
  margin: 0.08rem 0;
}

.grandson-badge {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--color-gold-deep);
  font-weight: 800;
  margin: 0.08rem 0;
}

/* Couple Hero Block */
.couple-hero-block {
  margin: 0.08rem 0;
}

.groom-royal-name,
.bride-royal-name {
  font-family: var(--font-script);
  font-size: clamp(2rem, 8vw, 2.4rem);
  letter-spacing: 0;
  color: var(--color-crimson);
  font-weight: 400;
  line-height: 1;
}

.with-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.08rem 0;
}

.gold-line {
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

.with-text {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  color: var(--color-gold-deep);
  font-weight: 700;
}

.parent-line {
  font-family: var(--font-serif);
  font-size: 0.84rem;
  color: var(--color-charcoal);
  font-weight: 600;
  margin-top: 0.06rem;
}

.parent-line-sub {
  font-family: var(--font-serif);
  font-size: 0.74rem;
  color: var(--color-muted);
  font-weight: 500;
  font-style: italic;
}

/* Cover Footer Block */
.cover-footer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  margin-top: 0.08rem;
}

.ornament-glyph {
  font-size: 0.7rem;
  color: var(--color-gold);
  letter-spacing: 0.35em;
  margin: 0.05rem 0;
}

.wedding-tagline {
  font-family: var(--font-script);
  font-size: 1.15rem;
  color: var(--color-crimson);
  line-height: 1.2;
  max-width: 240px;
}

.dates-pill-badge {
  font-family: var(--font-serif);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--color-crimson);
  font-weight: 700;
}


/* ============================================================
   EVENT CEREMONY PAGES (MAHAPUJAN, PAAT, HALDI, SANGEET, WEDDING)
   ============================================================ */
.event-theme-header {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--color-crimson);
  font-weight: 700;
}

.event-divine-prelude {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-style: italic;
  color: #382e2b;
  font-weight: 600;
  margin-top: 0.1rem;
}

.event-main-title {
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 4.8cqw, 1.35rem);
  letter-spacing: 0.02em;
  color: var(--color-crimson);
  font-weight: 700;
  line-height: 1.18;
  margin: 0.1rem 0;
}

.event-subtitle-italics {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-style: italic;
  color: #3e3330;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.gold-accent-divider {
  position: relative;
  width: 85px;
  height: 1px;
  margin: 0.2rem auto 0.28rem;
  background: linear-gradient(90deg, transparent, rgba(197, 155, 39, 0.85), transparent);
}

.gold-accent-divider::after {
  content: '❖';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  padding: 0 4px;
  font-size: 0.55rem;
  color: #b8860b;
  line-height: 1;
}

.detail-row {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.detail-label {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--color-gold-deep);
  font-weight: 800;
  margin-bottom: 0.08rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-transform: uppercase;
}

.detail-label::before,
.detail-label::after {
  content: '✦';
  font-size: 0.42rem;
  color: #c59b27;
  opacity: 0.85;
}

.detail-val {
  font-family: var(--font-serif);
  font-size: clamp(0.82rem, 3.6cqw, 1.08rem);
  color: var(--color-charcoal);
  font-weight: 600;
  line-height: 1.35;
}

.highlight-venue {
  font-family: var(--font-display);
  font-size: clamp(0.82rem, 3.5cqw, 1.05rem);
  letter-spacing: 0.02em;
  color: var(--color-crimson);
  font-weight: 700;
}

.venue-address {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 600;
  color: #382e2b;
  display: block;
  margin-top: 0.12rem;
}

.detail-separator {
  margin: 0.2rem 0 0.08rem;
  font-family: var(--font-serif);
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  color: var(--color-gold-deep);
  font-weight: 700;
  font-style: italic;
}

.lunch-venue {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.35;
  color: #382e2b;
  font-weight: 600;
}

/* Sangeet twilight palette with restrained glow for legibility. */
.page-sangeet .event-theme-header {
  color: #fef08a !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.82);
}

.page-sangeet .ornament-glyph {
  color: #fef08a !important;
  text-shadow: 0 0 4px rgba(254, 240, 138, 0.35), 0 1px 3px rgba(0, 0, 0, 0.8);
}

.page-sangeet .event-main-title {
  color: #fffdfa !important;
  text-shadow: 0 0 5px rgba(254, 240, 138, 0.28), 0 2px 5px rgba(0, 0, 0, 0.88);
}

.page-sangeet .event-subtitle-italics {
  color: #fff8eb !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.86);
}

.page-sangeet .gold-accent-divider {
  background: linear-gradient(90deg, transparent, rgba(254, 240, 138, 0.95), transparent) !important;
  box-shadow: 0 0 4px rgba(254, 240, 138, 0.28);
}

.page-sangeet .gold-accent-divider::after {
  background: transparent !important;
  color: #fef08a !important;
  text-shadow: 0 0 4px rgba(254, 240, 138, 0.35);
}

.page-sangeet .detail-label {
  color: #fde047 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.88);
}

.page-sangeet .detail-label::before,
.page-sangeet .detail-label::after {
  color: #fef08a !important;
  text-shadow: 0 0 3px rgba(254, 240, 138, 0.3);
}

.page-sangeet .detail-val {
  color: #ffffff !important;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.page-sangeet .highlight-venue {
  color: #fff9db !important;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92);
}

.gold-text {
  color: #fdfbf7 !important;
}

.gold-val {
  color: #fef08a !important;
  font-weight: 700;
}

/* Wedding Detailed Day Schedule */
.wedding-timeline-box {
  margin: 0.1rem auto;
  padding: 0.22rem 0.52rem;
  border: 1px solid rgba(197, 155, 39, 0.45);
  background: rgba(255, 253, 248, 0.68);
  border-radius: 6px;
  width: 100%;
  max-width: 285px;
  box-sizing: border-box;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--color-crimson);
  font-weight: 700;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

.schedule-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: var(--color-charcoal);
  font-weight: 600;
  line-height: 1.25;
}

.entry-time {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: var(--color-gold-deep);
  font-weight: 700;
}

.entry-bullet {
  font-size: 0.55rem;
  color: var(--color-gold);
}

.entry-name {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: var(--color-charcoal);
}

/* ============================================================
   TRANSPARENT CARICATURES & LIVING ANIMATIONS
   ============================================================ */
/* Caricature Portraits: Static, Grounded & Crisp */
.caricature-stage {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  max-width: 200px;
  height: clamp(72px, 13cqh, 112px);
  margin: 0.08rem auto 0.12rem;
  position: relative;
  z-index: 5;
  pointer-events: none;
  flex-shrink: 0;
}

.caricature-img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.24));
  display: block;
}

.caricature-stage video {
  width: 100%;
  height: 100%;
}


.animate-living-portrait,
.animate-sangeet-twirl,
.animate-float-gentle {
  animation: none !important;
  transform: none !important;
}

/* Haldi Caricature — Seated on the Wooden Stage Platform */
.haldi-caricature-stage {
  position: absolute;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  bottom: clamp(38px, 6.8cqh, 54px);
  width: clamp(120px, 33cqw, 145px);
  max-width: 155px;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.haldi-caricature-stage .caricature-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.22));
  display: block;
}

.story-active .story-page.page-haldi.active .haldi-caricature-stage {
  animation: kineticFadeUp 1.25s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

/* Sangeet Caricature — Dancing on the Candlelit Ballroom Floor */
.sangeet-caricature-stage {
  position: absolute;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  bottom: clamp(14px, 2.8cqh, 24px);
  width: clamp(112px, 30cqw, 132px);
  max-width: 140px;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.sangeet-caricature-stage .caricature-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
  display: block;
}


.story-active .story-page.page-sangeet.active .sangeet-caricature-stage {
  animation: kineticFadeUp 1.25s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

/* Wedding Caricature — Standing in the Middle of Mandap Covering the Flame */
.wedding-caricature-mandap,
.wedding-caricature-aside {
  position: absolute;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  bottom: clamp(14px, 3.1cqh, 24px);
  width: clamp(64px, 18cqw, 78px);
  max-width: 82px;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.wedding-caricature-mandap .caricature-img,
.wedding-caricature-aside .caricature-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.22));
  display: block;
}


.story-active .story-page.page-wedding.active .wedding-caricature-mandap,
.story-active .story-page.page-wedding.active .wedding-caricature-aside {
  animation: kineticFadeUp 1.25s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

/* ============================================================
   PAGE 7: THE FAMILIES SCROLLABLE ELEGANCE
   ============================================================ */
.scrollable-family-content {
  overflow-y: auto;
  justify-content: flex-start;
  gap: 0.35rem;
  scrollbar-width: none;
}

.scrollable-family-content::-webkit-scrollbar {
  display: none;
}

.families-main-title {
  font-family: var(--font-script);
  font-size: 1.65rem;
  letter-spacing: 0;
  color: var(--color-crimson);
  font-weight: 400;
  margin-bottom: 0.2rem;
}

.family-grid {
  width: 100%;
  max-width: 340px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "divine samdhi"
    "invitees compliments"
    "nanihal .";
  align-items: start;
  column-gap: 0.6rem;
  row-gap: 0.2rem;
}

.family-grid .family-unit:nth-child(1) { grid-area: divine; }
.family-grid .family-unit:nth-child(2) { grid-area: samdhi; }
.family-grid .family-unit:nth-child(3) { grid-area: invitees; }
.family-grid .family-unit:nth-child(4) { grid-area: nanihal; }
.family-grid .family-unit:nth-child(5) { grid-area: compliments; }

.family-unit {
  width: 100%;
  max-width: none;
  text-align: center;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.35);
  padding: 0 0.1rem 0.2rem;
}

.unit-heading {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  color: var(--color-gold-deep);
  font-weight: 800;
  margin-bottom: 0.12rem;
}

.unit-names {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  color: var(--color-charcoal);
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.with-love-box {
  width: 100%;
  max-width: 340px;
  align-self: center;
  text-align: center;
  padding-top: 0.2rem;
  border-bottom: 0;
}

.love-names {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--color-crimson);
  font-weight: 700;
}

.final-date {
  font-family: var(--font-serif);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--color-gold-deep);
  margin-top: 0.2rem;
  font-weight: 700;
}

.wedding-hashtag {
  font-family: var(--font-display);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: var(--color-crimson);
  font-weight: 800;
  margin: 0.35rem 0;
}

.firm-box {
  margin-top: 0.2rem;
  padding-top: 0.2rem;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.firm-label {
  font-family: var(--font-serif);
  font-size: 0.55rem;
  letter-spacing: 0.02em;
  color: var(--color-muted);
}

.firm-name {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--color-charcoal);
  font-weight: 700;
}

.firm-city {
  font-family: var(--font-serif);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--color-muted);
}

/* ============================================================
   CLOSING THANK-YOU SLIDE
   ============================================================ */
.ending-content-flow {
  z-index: 4;
  align-items: center;
  text-align: center;
  justify-content: flex-start;
}

.ending-kicker {
  font-family: var(--font-serif);
  color: var(--color-gold-deep);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ending-title {
  font-family: var(--font-script);
  color: var(--color-crimson);
  font-size: clamp(2.35rem, 12cqw, 3.7rem);
  font-weight: 400;
  line-height: 1.05;
  margin: 0.2rem 0 0.45rem;
}

.ending-message {
  max-width: 16rem;
  color: var(--color-charcoal);
  font-family: var(--font-serif);
  font-size: 0.86rem;
  line-height: 1.35;
  margin-bottom: 0.12rem;
}

.ending-couple-lockup {
  width: 100%;
  margin-top: 0.9rem;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
}

.ending-rule {
  width: 5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

.ending-names {
  color: var(--color-crimson);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ending-names span {
  color: var(--color-gold-deep);
  font-family: var(--font-script);
  font-size: 1.15em;
  font-weight: 400;
}

.ending-date,
.ending-hashtag {
  color: var(--color-gold-deep);
  font-family: var(--font-serif);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ending-hashtag {
  color: var(--color-crimson);
  font-family: var(--font-display);
  font-size: 0.82rem;
  margin-top: 0.12rem;
}

.ending-caricature-stage {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: clamp(0.35rem, 2cqh, 1.25rem);
  width: min(100%, 21rem);
  height: clamp(10.5rem, 42cqh, 18rem);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.ending-caricature-stage .caricature-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 0.4rem 0.35rem rgba(72, 35, 10, 0.18));
}

.ending-bloom {
  position: absolute;
  z-index: 2;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  opacity: 0.16;
  filter: blur(1px);
  background: radial-gradient(circle, rgba(185, 28, 28, 0.7) 0 9%, transparent 10% 20%, rgba(212, 175, 55, 0.65) 21% 28%, transparent 29% 100%);
}

.ending-bloom-left { left: -2.5rem; top: 28%; }
.ending-bloom-right { right: -2.5rem; top: 42%; transform: scale(0.8); }

/* ============================================================
   CALENDAR & LOCATION SLIDE
   ============================================================ */
.details-content-flow {
  z-index: 4;
  align-items: center;
  text-align: center;
  justify-content: center;
  transform: translateY(clamp(1.5rem, 4cqh, 3rem));
}

.details-kicker,
.map-label {
  color: var(--color-gold-deep);
  font-family: var(--font-serif);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.details-title {
  max-width: 18rem;
  color: var(--color-crimson);
  font-family: var(--font-script);
  font-size: clamp(1.9rem, 10cqw, 2.9rem);
  font-weight: 400;
  line-height: 1;
  margin: 0.12rem 0 0.25rem;
}

.details-intro {
  max-width: 17rem;
  color: var(--color-charcoal);
  font-family: var(--font-serif);
  font-size: 0.76rem;
  line-height: 1.3;
}

.calendar-actions {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 16rem;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.calendar-button {
  min-height: 3.6rem;
  display: grid;
  align-content: center;
  gap: 0.14rem;
  padding: 0.45rem 0.3rem;
  border: 1px solid rgba(142, 86, 6, 0.45);
  border-radius: 0.35rem;
  background: rgba(255, 250, 240, 0.86);
  box-shadow: 0 0.25rem 0.65rem rgba(72, 35, 10, 0.08);
  color: var(--color-crimson);
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.calendar-button:hover,
.calendar-button:focus-visible {
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-2px);
}

.calendar-button-day {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
}

.calendar-button-label {
  color: var(--color-gold-deep);
  font-family: var(--font-serif);
  font-size: 0.56rem;
  line-height: 1.1;
}

.details-divider {
  width: 5rem;
  height: 1px;
  margin: 0.6rem auto 0.15rem;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

.map-section {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
}

.map-title {
  color: var(--color-crimson);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.map-address {
  color: var(--color-muted);
  font-family: var(--font-serif);
  font-size: 0.68rem;
  font-style: italic;
}

.location-button {
  width: min(16rem, 100%);
  min-height: 2.9rem;
  margin-top: 0.2rem;
}

@media (max-height: 600px) {
  .scrollable-family-content {
    gap: 0.08rem;
  }

  .family-grid {
    row-gap: 0;
  }

  .family-unit {
    padding-bottom: 0.04rem;
  }

  .unit-heading {
    margin-bottom: 0.02rem;
  }

  .with-love-box {
    padding-top: 0.05rem;
  }

  .wedding-hashtag {
    margin: 0.2rem 0;
  }

  .firm-box {
    margin-top: 0.05rem;
    padding-top: 0.05rem;
  }
}

/* ============================================================
   BOTTOM HUD & RESUME BUTTON (Hidden to keep bottom invitation artwork pristine)
   ============================================================ */
.story-hud-bottom {
  display: none !important;
}

/* ============================================================
   FALLING PETALS SYSTEM (Drifts behind content flow so letters are never covered)
   ============================================================ */
.ambient-petals-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.falling-petal {
  position: absolute;
  top: -40px;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
}

/* Keyframe Animations */
@keyframes pulseGold {
  0% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.4)); }
  100% { transform: scale(1.06); filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.8)); }
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

@keyframes crackSeal {
  0% { transform: scale(1); }
  35% { transform: scale(1.25) rotate(-8deg); filter: brightness(1.3); }
  70% { transform: scale(1.1) rotate(12deg); opacity: 0.7; }
  100% { transform: scale(0.6) rotate(25deg); opacity: 0; visibility: hidden; }
}

@keyframes eq {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

/* ============================================================
   KINETIC STAGGERED MOTION CHOREOGRAPHY (MOTION REEL VIBE)
   ============================================================ */

/* Sacred Invocations & Event Theme Headers */
.story-active .story-page.active .sacred-invocations-box {
  animation: kineticDropIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

/* Emblem, Mandala Halo & Ornamental Glyphs on Cover */
.story-active .story-page.active .royal-monogram-emblem {
  animation: kineticZoomIn 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.65s both;
}

/* Main Ceremony & Grand Host Titles */
.story-active .story-page.active .hosts-title,
.story-active .story-page.active .families-main-title {
  animation: kineticTitleReveal 1.45s cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}

/* Grandson Badge, Invitations */
.story-active .story-page.active .hosts-invitation,
.story-active .story-page.active .grandson-badge {
  animation: kineticFadeUp 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1.3s both;
}

/* Couple Block & Footer on Cover */
.story-active .story-page.active .couple-hero-block {
  animation: kineticCardFloat 1.6s cubic-bezier(0.16, 1, 0.3, 1) 1.7s both;
}

.story-active .story-page.active .cover-footer-block {
  animation: kineticFadeUp 1.5s cubic-bezier(0.16, 1, 0.3, 1) 2.2s both;
}

/* Direct Text Overlay Animations on Event Pages (Graceful, Stately & Timed with Autoplay) */
.story-active .story-page.page-event.active .event-theme-header,
.story-active .story-page.page-event.active .event-divine-prelude,
.story-active .story-page.page-event.active .ornament-glyph {
  animation: kineticDropIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.story-active .story-page.page-event.active .event-main-title {
  animation: kineticTitleReveal 1.45s cubic-bezier(0.16, 1, 0.3, 1) 0.65s both;
}

.story-active .story-page.page-event.active .event-subtitle-italics,
.story-active .story-page.page-event.active .gold-accent-divider {
  animation: kineticFadeUp 1.3s cubic-bezier(0.16, 1, 0.3, 1) 0.95s both;
}

.story-active .story-page.page-event.active .detail-row {
  animation: kineticFadeUp 1.35s cubic-bezier(0.16, 1, 0.3, 1) 1.25s both;
}

.story-active .story-page.page-event.active .detail-separator,
.story-active .story-page.page-event.active .wedding-timeline-box {
  animation: kineticFadeUp 1.35s cubic-bezier(0.16, 1, 0.3, 1) 1.55s both;
}

/* Wedding Schedule Timeline Entries Stagger */
.story-active .story-page.active .schedule-entry:nth-child(2) {
  animation: kineticFadeUp 1.1s ease 0.9s both;
}
.story-active .story-page.active .schedule-entry:nth-child(3) {
  animation: kineticFadeUp 1.1s ease 1.2s both;
}
.story-active .story-page.active .schedule-entry:nth-child(4) {
  animation: kineticFadeUp 1.1s ease 1.5s both;
}
.story-active .story-page.active .schedule-entry:nth-child(5) {
  animation: kineticFadeUp 1.1s ease 1.8s both;
}

/* Family Units Cascade (Graceful 2x Slower Flow) */
.story-active .story-page.active .family-grid .family-unit,
.story-active .story-page.active .with-love-box {
  animation: kineticFadeUp 1.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.story-active .story-page.active .family-grid .family-unit:nth-child(2) { animation-delay: 0.4s; }
.story-active .story-page.active .family-grid .family-unit:nth-child(3) { animation-delay: 0.85s; }
.story-active .story-page.active .family-grid .family-unit:nth-child(4) { animation-delay: 1.3s; }
.story-active .story-page.active .family-grid .family-unit:nth-child(5) { animation-delay: 1.75s; }
.story-active .story-page.active .with-love-box { animation-delay: 2.2s; }

/* Kinetic Motion Keyframes */
@keyframes kineticDropIn {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes kineticZoomIn {
  0% {
    opacity: 0;
    transform: scale(0.75) translate3d(0, 0, 0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

@keyframes kineticTitleReveal {
  0% {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(0.96);
    letter-spacing: 0.04em;
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes kineticFadeUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes kineticCardFloat {
  0% {
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes kineticCaricatureEnter {
  0% {
    opacity: 0;
    transform: translate3d(0, 30px, 0) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* ============================================================
   DECORATIVE LIVING ATMOSPHERES (VIDEO REEL VIBE)
   ============================================================ */

/* 1. Sangeet Crystal Chandeliers & Night Sky */
.sangeet-chandeliers-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 105px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 16px;
  pointer-events: none;
  z-index: 4;
}

.chandelier-item {
  transform-origin: top center;
  filter: drop-shadow(0 4px 14px rgba(254, 240, 138, 0.45));
}

.chandelier-left,
.chandelier-center,
.chandelier-right {
  animation: none !important;
  transform: none !important;
}

.chandelier-flame-glow {
  animation: flameGlowPulse 1.8s ease-in-out infinite alternate;
}

@keyframes flameGlowPulse {
  0% { opacity: 0.5; transform: scale(0.85); }
  100% { opacity: 0.85; transform: scale(1.2); }
}

/* Sangeet Night Sky Twinkling Stars */
.night-stars-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.star-twinkle {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  animation: starPulse 2.8s ease-in-out infinite alternate;
}

@keyframes starPulse {
  0% { opacity: 0.15; transform: scale(0.6); }
  50% { opacity: 0.95; transform: scale(1.35); filter: drop-shadow(0 0 4px #fef08a); }
  100% { opacity: 0.25; transform: scale(0.75); }
}

/* 2. Haldi Festive Rajasthani Umbrella Canopy */
.haldi-festive-canopy {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  pointer-events: none;
  z-index: 4;
}

.umbrella-sway-left,
.umbrella-sway-center,
.umbrella-sway-right {
  animation: none !important;
  transform: none !important;
}

/* 3. Wedding Mandap Floral Canopy & Temple Bells */
.wedding-mandap-canopy {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 95px;
  pointer-events: none;
  z-index: 4;
}

.temple-bell-sway-1,
.temple-bell-sway-2,
.temple-bell-sway-center {
  animation: none !important;
  transform: none !important;
}

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

/* 4. Sacred Rotating Mandala Halo */
.sacred-mandala-halo {
  position: absolute;
  width: 140px;
  height: 140px;
  top: 50%;
  left: 50%;
  margin-top: -70px;
  margin-left: -70px;
  pointer-events: none;
  opacity: 0.35;
  animation: mandalaSpin 50s linear infinite;
  z-index: -1;
}

@keyframes mandalaSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 5. Sacred Diya Pair with Flickering Flame */
.sacred-diya-pair {
  position: absolute;
  top: clamp(3.2rem, 6.5vh, 4rem);
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}

.sacred-diya-svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.flame-outer {
  transform-origin: 46px 18px;
  animation: flameFlickerOuter 0.9s ease-in-out infinite alternate;
}

.flame-mid {
  transform-origin: 46px 17px;
  animation: flameFlickerMid 0.7s ease-in-out infinite alternate;
}

.flame-core {
  transform-origin: 46px 14px;
  animation: flameFlickerCore 0.5s ease-in-out infinite alternate;
}

.flame-glow-pulse {
  animation: flameGlowPulse 1.4s ease-in-out infinite alternate;
}

@keyframes flameFlickerOuter {
  0% { transform: scale(0.92) skewX(-2deg); }
  50% { transform: scale(1.08) skewX(2.5deg); }
  100% { transform: scale(0.96) skewX(-1.5deg); }
}

@keyframes flameFlickerMid {
  0% { transform: scale(0.9) skewX(2deg); }
  100% { transform: scale(1.1) skewX(-2deg); }
}

@keyframes flameFlickerCore {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.15); opacity: 1; }
}

/* 6. Wax Seal Spark Particles Burst */
.wax-spark-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  top: 50%;
  left: 50%;
  margin-top: -3px;
  margin-left: -3px;
}

@keyframes sparkBurst {
  0% {
    transform: translate(0, 0) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

.story-tap-zone:focus-visible { outline: 2px solid var(--color-gold-deep); outline-offset: -4px; }
#preloader[hidden] { display: none; }
