/* ================================================
   ENGAGEMENT INVITATION — STYLE & ANIMATIONS
   Nilay & Ananya
   ================================================ */

/* ---- Custom Properties ---- */
:root {
  /* Extra hero height that sits behind iOS Safari's floating bottom toolbar (0 elsewhere) */
  --hero-bleed: 0px;
  --bg-cream-loading: #F7EDD8;
  --bg-cream-welcome: #F7ECD7;
  --text-dark: #372A22;
  --gold-glow: rgba(212, 175, 55, 0.08);

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Jost', 'Segoe UI', sans-serif;

  /* Easing curves */
  --ease-elegant: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-decelerate: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-overshoot: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft-overshoot: cubic-bezier(0.34, 1.25, 0.64, 1);
  --ease-soft-bounce: cubic-bezier(0.22, 1.0, 0.36, 1);
}

/* iOS Safari ends the viewport at the top of its translucent bottom toolbar
   (~100pt above the screen edge) and shows whatever comes next in the page
   behind it. Make the hero that much taller so the ghat continues behind it.
   (-webkit-touch-callout is only supported by iOS WebKit.) */
@supports (-webkit-touch-callout: none) {
  :root {
    --hero-bleed: calc(env(safe-area-inset-bottom, 0px) + 120px);
  }
}

/* Build marker (shown by ?debug) — confirms the phone isn't using a cached stylesheet */
:root { --build: "2026-09-28zd"; }

/* ?debug: page background turns cyan (the hero column keeps its cream), so any
   strip Safari paints with the "page background" rather than content shows cyan */
html.debug-bleed,
html.debug-bleed body {
  background: #00C8FF !important;
}

/* ?debug: stripe the part of the hero that should sit behind Safari's bottom bar */
html.debug-bleed .welcome-content::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: max(var(--hero-bleed), 6px);
  background: repeating-linear-gradient(45deg, #FF00FF 0 12px, #FFE600 12px 24px);
  z-index: 50;
  pointer-events: none;
}

.debug-panel {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 8px;
  z-index: 1000;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #7CFC9A;
  font: 11px/1.45 ui-monospace, Menlo, monospace;
  white-space: pre;
  pointer-events: none;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  background: var(--bg-cream-loading);
  color: var(--text-dark);
  overflow-x: clip;
  min-height: 100vh;
}

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

/* ================================================
   LOADING SCREEN
   ================================================ */

.loading-screen {
  /* absolute, not fixed (iOS toolbar colour band); the page is locked at the top */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100vh + var(--hero-bleed));
  height: calc(100lvh + var(--hero-bleed));
  z-index: 100;
  background: var(--bg-cream-loading);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Lift the artwork above centre: discount the strip behind iOS Safari's
     toolbar, then raise it a little more */
  padding-bottom: calc(var(--hero-bleed) + 14vh);
  overflow: hidden;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: 412px;
  padding: 0 40px;
}

/* -- Ganesh SVG wrapper -- */
.ganesh-icon-wrap {
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  opacity: 0;
  transform: scale(0.95);
  will-change: opacity, transform;
}

.ganesh-svg {
  width: 100%;
  height: 100%;
}

/* Ganesha vector paths - styled for outline drawing + staggered solid fill */
.ganesh-svg path {
  stroke: var(--text-dark);
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: rgba(55, 42, 34, 0); /* Start transparent */
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  will-change: stroke-dashoffset, fill;
}

/* -- Hindi Text -- */
.ganesh-text {
  height: 28px;
  width: auto;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(25px);
  will-change: opacity, transform;
}

/* -- Flowers Row -- */
.loading-flowers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.flower {
  width: 38px;
  height: 38px;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.3);
  will-change: opacity, transform;
}

/* -- Loading Screen Fade Out -- */
.loading-screen.fade-out {
  animation: screenFadeOut 700ms var(--ease-elegant) forwards;
}

/* No native scrolling during the intro and on the hero (the page turn is gesture-driven) */
html.scroll-lock,
html.scroll-lock body {
  overflow: hidden;
  touch-action: none;
}

/* -- "Tap to open" (a tap is required before video can play with sound) -- */
.open-invite {
  /* A brass plaque to match the door's handles, bells and studs. Floats over the
     threshold, at the same height as the hero's Scroll pill. */
  position: absolute;
  left: 50%;
  bottom: calc(24px + var(--hero-bleed) + env(safe-area-inset-bottom, 0px));
  bottom: calc(24px + var(--hero-bleed) + max(env(safe-area-inset-bottom, 0px), 100lvh - 100svh));
  transform: translateX(-50%);
  z-index: 5;
  overflow: hidden;
  padding: 10px 26px;
  border: 1px solid #8A6424;
  border-radius: 999px;
  background: linear-gradient(180deg, #E9CD86 0%, #CFA650 48%, #B8873A 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 210, 0.75),
    inset 0 -1px 0 rgba(90, 60, 20, 0.35),
    0 2px 8px rgba(60, 35, 15, 0.28);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.6px;
  color: #4A2E14;
  text-shadow: 0 1px 0 rgba(255, 238, 190, 0.6);
  cursor: pointer;
  opacity: 0;
  translate: 0 10px;
  pointer-events: none;
  transition: opacity 500ms var(--ease-decelerate), translate 500ms var(--ease-decelerate), filter 0.2s ease;
}

/* Shimmer: a soft band of light sweeps across the brass every few seconds */
.open-invite::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 250, 225, 0.75) 50%, transparent 100%);
  transform: skewX(-18deg);
  pointer-events: none;
}

.open-invite.is-ready {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
}

.open-invite.is-ready::after {
  animation: brassShimmer 3.2s ease-in-out 700ms infinite;
}

.open-invite:hover { filter: brightness(1.06); }

.open-invite:focus-visible {
  outline: 2px solid #F7ECD7;
  outline-offset: 3px;
}

@keyframes brassShimmer {
  0%       { left: -60%; }
  45%, 100% { left: 130%; }
}


/* -- Doors: stone arch + toran (fixed) with two leaves that swing open in 3D.
      The stage covers the column like the hero; layer positions are the door
      image's own coordinates (768x1376 artwork) in %. -- */
.door-intro {
  /* absolute, not fixed: iOS Safari paints fixed elements' colour behind its
     toolbar. The page is scroll-locked at the top while this shows. */
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 95; /* under the loader (100), over the intro video (90) */
  width: 100%;
  max-width: 412px;
  height: calc(100vh + var(--hero-bleed));
  height: calc(100lvh + var(--hero-bleed));
  translate: -50% 0;
  overflow: hidden;
  container-type: size;
  cursor: pointer;
  transition: opacity 700ms var(--ease-elegant) 1500ms;
}

.door-stage {
  position: absolute;
  top: 0;
  left: 50%;
  width: max(100cqw, calc(100cqh * 768 / 1376));
  aspect-ratio: 768 / 1376;
  translate: -50% 0;
  perspective: 1100px;
  perspective-origin: 50% 55%;
  transform-origin: 50% 55%; /* centre of the doorway: we "walk through" it */
  transition: scale 2000ms cubic-bezier(0.55, 0, 0.3, 1) 450ms;
}

.door-frame,
.door-leaf {
  position: absolute;
}

.door-frame {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  z-index: 2;
  pointer-events: none;
}

.door-leaf {
  top: 27.7616%;
  height: 56.3953%;
  z-index: 1;
  backface-visibility: hidden;
  transition:
    transform 1600ms cubic-bezier(0.6, 0.02, 0.25, 1) 150ms,
    filter 1600ms ease 150ms;
}

.door-leaf img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}

.door-left  { left: 13.0208%; width: 39.4531%; transform-origin: 0% 50%; }
.door-right { left: 52.4740%; width: 34.7656%; transform-origin: 100% 50%; }

/* Open: leaves swing inward on their outer hinges and darken as they turn away */
.door-intro.is-open .door-left  { transform: rotateY(86deg); filter: brightness(0.55); }
.door-intro.is-open .door-right { transform: rotateY(-86deg); filter: brightness(0.55); }
.door-intro.is-open .door-stage { scale: 1.55; }
.door-intro.is-open { opacity: 0; pointer-events: none; }
.door-intro.is-open .open-invite {
  opacity: 0;
  animation: none;
  transition: opacity 250ms ease-out;
}
.door-intro.is-done { display: none; }

/* -- Intro video: same column + height as the hero, so its last frame can hand
      off to the hero ghat in place. No background (Safari edge colour extension). -- */
.intro-video {
  position: absolute; /* not fixed: see .door-intro */
  top: 0;
  left: 50%;
  z-index: 90; /* under the loader (100), over the page */
  width: 100%;
  max-width: 412px;
  height: calc(100vh + var(--hero-bleed));
  height: calc(100lvh + var(--hero-bleed));
  translate: -50% 0;
  overflow: hidden;
  visibility: hidden;
  transition: opacity 900ms var(--ease-elegant);
}

.intro-video.is-playing { visibility: visible; }
.intro-video.is-fading  { opacity: 0; pointer-events: none; }
.intro-video.is-done    { display: none; }

/* Sized and placed by script.js so the video's last frame sits exactly on the
   hero's ghat image; when narrower than the screen, the sides feather into
   the cream background. */
.intro-video video {
  position: absolute;
  display: block;
  object-fit: fill;
}

/* Transparent-sky mode: the canvas shows the keyed picture; the video element
   only plays (sound + frames) underneath, invisible */
.intro-video canvas {
  position: absolute;
  display: none;
  pointer-events: none;
}

.intro-video.has-alpha canvas { display: block; }
.intro-video.has-alpha video  { opacity: 0; }

.intro-video.is-narrow canvas,
.intro-video.is-narrow video {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}

.intro-skip {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 14px;
  padding: 5px 14px;
  border: 1px solid rgba(107, 74, 46, 0.28);
  border-radius: 999px;
  background: rgba(107, 74, 46, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: rgba(92, 62, 38, 0.8);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.intro-skip:hover {
  background: rgba(107, 74, 46, 0.14);
  color: #5C3E26;
}

/* -- Music mute button: top right of the column, frosted glass like the Scroll pill.
      Fixed so it stays put while the details pages scroll; it never touches
      the screen edge, so Safari doesn't tint its toolbar from it. Appears once
      the intro has handed off to the hero (the Skip button's spot until then). -- */
.music-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: calc(max(0px, (100vw - 412px) / 2) + 14px);
  z-index: 80; /* over the page, under the intro layers */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow:
    0 4px 18px rgba(30, 20, 12, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms var(--ease-decelerate) 400ms, visibility 0s linear 1000ms, background-color 0.2s ease;
}

.music-toggle.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 600ms var(--ease-decelerate) 400ms, visibility 0s, background-color 0.2s ease;
}

.music-toggle:hover { background: rgba(255, 255, 255, 0.28); }

.music-toggle:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
}

.music-icon {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.music-cross { display: none; }
.music-toggle.is-muted .music-cross { display: inline; }
.music-toggle.is-muted .music-waves { display: none; }
.music-toggle.is-muted .music-icon { opacity: 0.85; }

/* Arriving from the video: the ghat sits at rest (no rise-in) so the video can be
   aligned to it, hidden while the video plays, then shown underneath the video's
   identical last frame just before the video fades away. */
.welcome-screen.from-video .welcome-ghat,
.welcome-screen.from-video.animate .welcome-ghat {
  animation: none;
  transform: none;
  opacity: 0;
  transition: opacity 350ms ease-out;
}

.welcome-screen.from-video.ghat-in .welcome-ghat {
  opacity: 1;
}


/* ---- Loading Animations (staggered transitions) ---- */

.loading-screen.animate .ganesh-icon-wrap {
  animation: ganeshEntrance 1400ms var(--ease-soft-bounce) forwards;
}

/* Staggered stroke drawing animations */
.loading-screen.animate .ganesh-svg path {
  animation: drawStroke 1400ms cubic-bezier(0.4, 0, 0.2, 1) forwards,
             fillGanesha 600ms var(--ease-elegant) forwards;
}

/* Stagger the delays of the stroke drawing so paths draw from their points sequentially! */
.loading-screen.animate .ganesh-svg path:nth-child(1)  { animation-delay: 0ms, 1200ms; }
.loading-screen.animate .ganesh-svg path:nth-child(2)  { animation-delay: 80ms, 1200ms; }
.loading-screen.animate .ganesh-svg path:nth-child(3)  { animation-delay: 160ms, 1200ms; }
.loading-screen.animate .ganesh-svg path:nth-child(4)  { animation-delay: 240ms, 1200ms; }
.loading-screen.animate .ganesh-svg path:nth-child(5)  { animation-delay: 320ms, 1200ms; }
.loading-screen.animate .ganesh-svg path:nth-child(6)  { animation-delay: 400ms, 1200ms; }
.loading-screen.animate .ganesh-svg path:nth-child(7)  { animation-delay: 480ms, 1200ms; }
.loading-screen.animate .ganesh-svg path:nth-child(8)  { animation-delay: 560ms, 1200ms; }
.loading-screen.animate .ganesh-svg path:nth-child(9)  { animation-delay: 640ms, 1200ms; }
.loading-screen.animate .ganesh-svg path:nth-child(10) { animation-delay: 720ms, 1200ms; }

.loading-screen.animate .ganesh-text {
  animation: slideUpFade 800ms var(--ease-decelerate) 900ms forwards;
}

.loading-screen.animate .flower-1 {
  animation: bloomIn 500ms var(--ease-overshoot) 1300ms forwards;
}
.loading-screen.animate .flower-2 {
  animation: bloomIn 500ms var(--ease-overshoot) 1500ms forwards;
}
.loading-screen.animate .flower-3 {
  animation: bloomIn 500ms var(--ease-overshoot) 1700ms forwards;
}


/* ================================================
   WELCOME SCREEN
   ================================================ */

.welcome-screen {
  min-height: calc(100vh + var(--hero-bleed));
  /* No background here on purpose: iOS 26 Safari paints the background colour of
     a sticky/fixed element touching the screen edge as a solid fill behind its
     toolbars, which hid the ghat. The cream comes from .invite underneath. */
  position: relative;
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 412px;
  margin: 0 auto;
  /* One screen tall, plus (on iOS) the strip behind Safari's bottom toolbar */
  height: calc(100vh + var(--hero-bleed));
  height: calc(100lvh + var(--hero-bleed));
  min-height: 640px;
  overflow: hidden;
  position: relative;
}

/* Fixed-height column: keep Figma sizes, let the ghat overflow the bottom */
.welcome-content > * {
  flex-shrink: 0;
}

/* Wraps every page in a single centred column (mobile and desktop alike) */
.invite {
  position: relative;
  width: 100%;
  max-width: 412px;
  margin: 0 auto;
  background: var(--bg-cream-welcome);
}

/* -- Welcome Top Decoration (Layered) --
   Leaves extend to 330px, but content flow resumes at 190px (Figma motif top). */
.welcome-top-decoration {
  width: 100%;
  height: 330px;
  /* Garland (61px down in Figma) starts right below the notch / status bar
     (safe-area inset is 0 on phones without one and on desktop). */
  margin-top: calc(env(safe-area-inset-top, 0px) - 61px);
  margin-bottom: -140px;
  position: relative;
  z-index: 3; /* Leaves sit above the ghat sky fade */
  overflow: hidden;
}

.layer-item {
  position: absolute;
  will-change: transform, opacity;
  opacity: 0;
}

.layer-top-floral-garland {
  top: 61px;
  left: 50%;
  width: 597px;
  height: 89px;
  margin-left: -298.5px; /* Center mathematically */
  z-index: 2;
}

.layer-bouquet-left {
  top: 122px;
  left: -33px; /* Reverted to original */
  width: 96px;
  height: 95px;
  z-index: 3;
}

.layer-bouquet-right {
  top: 117px;
  left: 352px;
  width: 82px;
  height: 95px;
  z-index: 3;
}

.layer-banana-leaf-left {
  top: 201px;
  /* Figma -19px, nudged 16px further off-screen to hide the flat cut along
     the bottom of the artwork's left side. */
  left: -35px;
  width: 108px;
  height: 82px;
  z-index: 4;
}

.layer-banana-leaf-right {
  top: 201px;
  left: 318px;
  width: 105.4px;
  height: 129.4px;
  z-index: 4;
}

.layer-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* -- Center Floral Motif (Larger + Moved Up) -- */
.center-motif {
  margin-top: -8px;
  width: 70px; /* Grown from 51px */
  height: 60px; /* Grown from 44px */
  opacity: 0;
  transform: scale(0) rotate(-30deg);
  will-change: opacity, transform;
  z-index: 5;
  position: relative;
}

.motif-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* -- Text Area -- */
.welcome-text-area {
  text-align: center;
  padding: 0 30px;
  position: relative;
  z-index: 6;
  margin-top: 20px; /* Subtitle top lands at Figma y=262 */
}

.welcome-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -0.16px;
  line-height: 1.445;
  color: var(--text-dark);
  opacity: 0;
  transform: translateY(18px);
  will-change: opacity, transform;
  margin-bottom: 2px;
}

.welcome-names {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  letter-spacing: -1.92px;
  line-height: 1.21;
  color: var(--text-dark);
  opacity: 0;
  transform: translateY(50px);
  will-change: opacity, transform;
  position: relative;
}

/* Subtle golden glow behind names */
.names-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 80px;
  background: radial-gradient(ellipse at center, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  will-change: opacity;
}

/* -- Ghat Illustration -- */
.welcome-ghat {
  /* Ghat width scales with the viewport height so the whole scene (temples, steps,
     river) fits on screen: shrinks on short phones (e.g. iPhone Safari with its bars),
     grows on very tall screens. Artwork starts 184px down; aspect is 1200:1493.
     Never narrower than 420px so it always covers the 412px column. */
  /* The intro video's picture is this artwork at 142.59% (centred), so sizing
     the ghat to 142.59% of the column makes the video exactly fill the width.
     On very tall screens the height rule wins so the river still reaches the bottom. */
  --ghat-w: max(calc(min(100vw, 412px) * 1.4259), calc((100vh + var(--hero-bleed) - 184px - env(safe-area-inset-top, 0px)) * 0.8038));
  --ghat-w: max(calc(min(100vw, 412px) * 1.4259), calc((100lvh + var(--hero-bleed) - 184px - env(safe-area-inset-top, 0px)) * 0.8038));
  width: 100%;
  position: relative;
  margin-top: -100px; /* Transparent sky at the top of the artwork overlaps the names */
  opacity: 0;
  transform: translateY(70px);
  will-change: opacity, transform;
  flex-grow: 1;
  z-index: 2;
}

.ghat-top-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(to bottom, var(--bg-cream-welcome), transparent);
  z-index: 4; /* Overlay on top of all images and clouds */
  pointer-events: none;
}

.welcome-ghat img.ghat-img {
  width: var(--ghat-w);
  max-width: none;
  margin-left: calc(50% - var(--ghat-w) / 2);
  display: block;
  position: relative;
  z-index: 2; /* Sandwiched between back clouds (1) and front clouds (3) */
}

/* -- Parallax Floating Clouds -- */
.cloud-item {
  position: absolute;
  left: -140px; /* Start completely off-screen on the left */
  pointer-events: none;
  opacity: 0.9;
  will-change: transform;
}

.cloud-back-1 {
  top: calc(var(--ghat-w) * 0.31); /* Behind the gold dome on the left */
  width: 60px;  /* Reduced from 85px by 30% */
  height: 31px; /* Reduced from 44px by 30% */
  z-index: 1;   /* Render behind ghat buildings */
  animation: driftCloud 65s linear infinite;
  animation-delay: -10s;
}

.cloud-back-2 {
  top: calc(var(--ghat-w) * 0.245); /* High in the sky, below the names and above the spires */
  width: 82px;  /* Reduced from 117px by 30% */
  height: 43px; /* Reduced from 61px by 30% */
  z-index: 1;   /* Render behind background temple spires */
  animation: driftCloud 80s linear infinite;
  animation-delay: -35s;
}

.cloud-back-3 {
  top: calc(var(--ghat-w) * 0.26); /* Mid-height sky, behind spires */
  width: 50px;  /* Reused small cloud scaled down */
  height: 26px;
  z-index: 1;   /* Render behind ghat buildings */
  animation: driftCloud 72s linear infinite;
  animation-delay: -50s; /* Starts late-drift */
}

.cloud-front-1 {
  top: calc(var(--ghat-w) * 0.33); /* In front of the main central temple building */
  width: 85px;  /* Reduced from 121px by 30% */
  height: 35px; /* Reduced from 50px by 30% */
  z-index: 3;   /* Render in front of ghat buildings (higher than image z-index: 2) */
  opacity: 0.9;
  animation: driftCloud 55s linear infinite;
  animation-delay: -20s;
}

.cloud-front-2 {
  top: calc(var(--ghat-w) * 0.29); /* Floating in front of buildings */
  width: 70px;  /* Reused mid cloud scaled down */
  height: 36px;
  z-index: 3;   /* Render in front of ghat buildings (higher than image z-index: 2) */
  opacity: 0.85;
  animation: driftCloud 60s linear infinite;
  animation-delay: -30s; /* Starts mid-drift */
}


/* -- Scroll pill (frosted glass over the ghat) --
   Wrapper owns position + entrance animation; the pill's opacity is driven by scroll in script.js. */
.scroll-indicator {
  position: absolute;
  /* Lift above the home indicator, and above Safari's toolbar: the hero is
     sized to the large viewport, so (lvh - svh) is the space the bars cover. */
  bottom: calc(24px + var(--hero-bleed) + env(safe-area-inset-bottom, 0px));
  bottom: calc(24px + var(--hero-bleed) + max(env(safe-area-inset-bottom, 0px), 100lvh - 100svh));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20; /* Keep on top of ghat fade overlay */
  opacity: 0;
  will-change: opacity, transform;
}

.scroll-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow:
    0 4px 18px rgba(30, 20, 12, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  cursor: pointer;
  transition: background-color 0.25s ease, opacity 0.2s linear;
}

.scroll-pill:hover {
  background: rgba(255, 255, 255, 0.28);
}

.scroll-pill:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
}

.scroll-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.scroll-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-arrow svg path {
  stroke: #FFFFFF;
  stroke-width: 2.5px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}


/* ---- Welcome Animations (staggered entrance + sway loops) ---- */

/* Containers handle the ENTRANCE transitions (slide/sweep/fade) */
.welcome-screen.animate .layer-top-floral-garland {
  animation: slideDownFade 600ms var(--ease-soft-bounce) 100ms forwards;
}

.welcome-screen.animate .layer-bouquet-left {
  animation: slideRightFade 550ms var(--ease-elegant) 200ms forwards;
}

.welcome-screen.animate .layer-bouquet-right {
  animation: slideLeftFade 550ms var(--ease-elegant) 220ms forwards;
}

.welcome-screen.animate .layer-banana-leaf-left {
  animation: sweepInLeft 800ms var(--ease-soft-overshoot) 300ms forwards;
}

.welcome-screen.animate .layer-banana-leaf-right {
  animation: sweepInRight 800ms var(--ease-soft-overshoot) 320ms forwards;
}

.welcome-screen.animate .center-motif {
  animation: motifBloom 500ms var(--ease-overshoot) 400ms forwards;
}

/* Inner images handle the CONTINUOUS sway loops independently (no property conflict!) */
/* Hero banana leaves move in a breeze: a slow, uneven gust pivoting at the stem
   end (transform), plus a quick light flutter layered on top (rotate). The two
   leaves run at different speeds so they never move in lockstep. */
.welcome-screen.animate .layer-banana-leaf-left img {
  transform-origin: 0% 60%;
  animation:
    heroLeafGustLeft 6.4s ease-in-out 900ms infinite,
    heroLeafFlutter 1.3s ease-in-out 900ms infinite alternate;
}

.welcome-screen.animate .layer-banana-leaf-right img {
  transform-origin: 100% 25%;
  animation:
    heroLeafGustRight 7.2s ease-in-out 1200ms infinite,
    heroLeafFlutter 1.55s ease-in-out 1000ms infinite alternate-reverse;
}

@keyframes heroLeafGustLeft {
  0%, 100% { transform: rotate(0deg) skewY(0deg); }
  28%      { transform: rotate(-7deg) skewY(-2deg); }
  52%      { transform: rotate(2.5deg) skewY(0.6deg); }
  76%      { transform: rotate(-4deg) skewY(-1deg); }
}

@keyframes heroLeafGustRight {
  0%, 100% { transform: rotate(0deg) skewY(0deg); }
  24%      { transform: rotate(6deg) skewY(1.6deg); }
  50%      { transform: rotate(-2.5deg) skewY(-0.6deg); }
  78%      { transform: rotate(4.5deg) skewY(1.1deg); }
}

/* Centre bouquet: a very subtle rock, pivoting at its bottom centre. On the
   inner image via `rotate`, so it layers with the wrapper's bloom-in entrance
   and the page-turn drift (translate) without either overriding the other. */
.welcome-screen.animate .motif-img {
  transform-origin: 50% 100%;
  animation: bouquetRock 4.6s ease-in-out 1200ms infinite alternate;
}

@keyframes bouquetRock {
  from { rotate: -2.5deg; }
  to   { rotate: 2.5deg; }
}

@keyframes heroLeafFlutter {
  from { rotate: -1deg; }
  to   { rotate: 1.2deg; }
}

.welcome-screen.animate .welcome-subtitle {
  animation: slideUpFade 400ms var(--ease-decelerate) 500ms forwards;
}

.welcome-screen.animate .welcome-names {
  animation: flyUpNames 650ms var(--ease-soft-bounce) 600ms forwards;
}

.welcome-screen.animate .names-glow {
  animation: glowFadeIn 900ms var(--ease-elegant) 1100ms forwards;
}

.welcome-screen.animate .welcome-ghat {
  animation: riseUpGhat 800ms var(--ease-decelerate) 800ms forwards;
}

/* Scroll indicator: dedicated entrance preserving center alignment + glimmer loop + bounce arrow */
.welcome-screen.animate .scroll-indicator {
  animation: scrollIndicatorEntrance 500ms var(--ease-decelerate) 1100ms forwards;
}

.welcome-screen.animate .scroll-arrow {
  animation: bounceArrow 1.6s ease-in-out infinite;
}

/* The pill hops once as soon as it has arrived, then again every 5s. On the
   pill's own `translate` and `scale`, so it layers with the wrapper's entrance transform. */
.welcome-screen.animate .scroll-pill {
  transform-origin: 50% 100%; /* squash against the "ground" */
  animation: pillBounce 5s linear 1650ms infinite;
}

/* One elastic ~1s bounce, then rest: springs up past its peak, lands a little
   past rest with a squash, rebounds smaller, and wobbles to a stop */
@keyframes pillBounce {
  0%   { translate: 0 0;     scale: 1 1;       animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
  5%   { translate: 0 -14px; scale: 0.96 1.05; animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.35); }
  9%   { translate: 0 3px;   scale: 1.07 0.92; animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
  12.5% { translate: 0 -6px; scale: 0.98 1.02; animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.35); }
  15.5% { translate: 0 1.5px; scale: 1.03 0.97; animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
  18.5% { translate: 0 -1px; scale: 1 1;       animation-timing-function: ease-out; }
  21%  { translate: 0 0;     scale: 1 1; }
  100% { translate: 0 0;     scale: 1 1; }
}


/* ================================================
   KEYFRAME ANIMATIONS
   ================================================ */

/* -- Loading: Ganesha wrapper zoom -- */
@keyframes ganeshEntrance {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* -- Loading: Draw SVG strokes along path lines -- */
@keyframes drawStroke {
  0% {
    stroke-dashoffset: 600;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* -- Loading: Fade in solid fill after drawing -- */
@keyframes fillGanesha {
  0% {
    fill: rgba(55, 42, 34, 0);
  }
  100% {
    fill: rgba(55, 42, 34, 1);
  }
}

/* -- Generic: Slide up + fade in -- */
@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(25px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -- Scroll Indicator: Slide up + fade in (Preserves X-centering) -- */
@keyframes scrollIndicatorEntrance {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(25px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* -- Loading: Flower bloom in -- */
@keyframes bloomIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  65% {
    opacity: 1;
    transform: scale(1.12);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* -- Loading: Screen fade out -- */
@keyframes screenFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

/* -- Welcome: Top elements slide down -- */
@keyframes slideDownFade {
  0% {
    opacity: 0;
    transform: translateY(-40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -- Welcome: Bouquet Left slide right -- */
@keyframes slideRightFade {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* -- Welcome: Bouquet Right slide left -- */
@keyframes slideLeftFade {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* -- Welcome: Banana leaf sweep left -- */
@keyframes sweepInLeft {
  0% {
    opacity: 0;
    transform: translateX(-100px) scale(0.9) rotate(-10deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0deg);
  }
}

/* -- Welcome: Banana leaf sweep right -- */
@keyframes sweepInRight {
  0% {
    opacity: 0;
    transform: translateX(100px) scale(0.9) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0deg);
  }
}

/* -- Welcome: Center motif bloom + rotate -- */
@keyframes motifBloom {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-30deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* -- Welcome: Names fly up -- */
@keyframes flyUpNames {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px);
  }
  80% {
    transform: translateY(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -- Welcome: Golden glow fade in -- */
@keyframes glowFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* -- Welcome: Ghat rise up -- */
@keyframes riseUpGhat {
  0% {
    opacity: 0;
    transform: translateY(70px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -- Scroll indicator chevron bounce -- */
@keyframes bounceArrow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

/* ---- Loop sway animations for heritage flora ---- */

@keyframes swayGarland {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

@keyframes swayBouquetLeft {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(5px, -4px) rotate(3deg); }
}

@keyframes swayBouquetRight {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-5px, -4px) rotate(-3deg); }
}

@keyframes swayLeafLeft {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-5px, 3px) rotate(-3.5deg); }
}

@keyframes swayLeafRight {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(5px, 3px) rotate(3.5deg); }
}

@keyframes floatMotif {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.04) translateY(-6px); }
}

/* -- Parallax Cloud drift from left to right -- */
@keyframes driftCloud {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(580px); /* Covers 412px card + 130px offset + buffer */
  }
}


/* ================================================
   DESKTOP / RESPONSIVE
   ================================================ */

/* On desktop, frame the page as a centered mobile card */
@media (min-width: 480px) {
  body {
    background: #EDE2D1;
  }

  /* The whole invitation is one continuous phone-width column */
  .invite {
    box-shadow:
      0 0 24px rgba(55, 42, 34, 0.12),
      0 0 64px rgba(55, 42, 34, 0.08);
  }
}

/* Larger phones */
@media (min-width: 412px) and (max-width: 479px) {
  .welcome-content {
    max-width: 412px;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .welcome-names {
    font-size: 40px;
    letter-spacing: -1.6px;
  }

  .ganesh-icon-wrap {
    width: 64px;
    height: 64px;
  }

  .ganesh-text {
    height: 25px;
  }

  .flower {
    width: 34px;
    height: 34px;
  }

  .center-motif {
    width: 55px;
    height: 48px;
  }
}


/* ================================================
   INVITATION DETAILS — Figma 21:67 (arch) + 23:189 (venue)
   Positions are taken 1:1 from the 412px Figma frames.
   ================================================ */

:root {
  --ink-blue: #0D4C9E;
  --bg-cream-venue: #F7ECD7;
}

/* The hero sits in normal flow (never sticky: see initPageTurn in script.js).
   While the date page is up, it's hidden and the details pages scroll from the top. */
.welcome-screen {
  position: relative;
  z-index: 1;
}

html.mode-details .welcome-screen {
  display: none;
}

/* Welcome dims as the date page opens over it (--cover set in script.js).
   No scale-down: shrinking would lift the hero's edges off the screen edges. */

.welcome-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Alpha in the colour itself (not opacity) so at rest this is truly
     transparent and never picked up by Safari's edge colour extension */
  background: rgba(42, 29, 20, calc(var(--cover, 0) * 0.45));
  pointer-events: none;
  z-index: 30;
}

.details-screen {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 412px;
  margin: 0 auto;
  /* Transparent so the welcome page shows through while the arch "door" opens */
  background: transparent;
  overflow: hidden;
}

/* -- Arch card: fixed 412 x 800 stage, centred and clipped on narrow phones --
   --p (0 → 1) is driven by scroll in script.js: the arch opens from a narrow
   temple-door window into the full page as it slides up over the welcome screen. */
.details-arch {
  --p: 1;
  --q: calc(1 - var(--p));
  position: relative;
  height: 800px;
  overflow: hidden;
  clip-path: inset(
    calc(var(--q) * 24%) calc(var(--q) * 40%) 0
    round calc(var(--q) * 206px) calc(var(--q) * 206px) 0 0
  );
}

.details-stage {
  position: absolute;
  top: 0;
  left: 50%;
  width: 412px;
  height: 800px;
  margin-left: -206px;
}

.details-stage > * {
  position: absolute;
}

.arch-bg {
  left: -172px;
  top: -23px;
  width: 755px;
  max-width: none;
  height: 940px;
  /* Starts zoomed in and settles as the arch opens */
  transform: scale(calc(1 + var(--q) * 0.22));
  transform-origin: 50% 55%;
}

.arch-leaf {
  max-width: none;
  z-index: 1;
}

.arch-leaf-left {
  left: -57px;
  top: 261px;
  width: 164.5px;
  height: 212.5px;
}

.arch-leaf-right {
  left: 327px;
  top: 262px;
  width: 158.5px;
  height: 186px;
}

/* Header: swastika + mantra */
.details-mantra {
  top: 127px;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}

.swastika-svg {
  width: 40px;
  height: 40px;
}

.mantra-text {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 23.12px;
  color: #000;
}

/* Blessing copy */
.blessing {
  left: 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 23.12px;
  letter-spacing: -0.16px;
  color: var(--text-dark);
}

.blessing-1 { top: 219px; }
.blessing-2 { top: 276px; }

/* Couple names with faint ampersand */
.couple-names {
  top: 344px;
  left: 99px;
  width: 224px;
  height: 85px;
  font-weight: 700;
}

.ampersand-svg {
  position: absolute;
  left: 88px;
  top: 0;
  width: 56px;
  height: 56px;
}

.couple-name {
  position: absolute;
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 58.128px;
  letter-spacing: -1.44px;
  color: var(--ink-blue);
  white-space: nowrap;
}

.couple-name-first  { left: 0;    top: 3px; }
.couple-name-second { left: 84px; top: 27px; }

/* "— on —" divider */
.date-divider {
  top: 437px;
  left: 92px;
  width: 237px;
  height: 23px;
  display: flex;
  align-items: center;
  gap: 11px;
}

/* Same brass rules as the Dress Code heading: fade in towards the word */
.divider-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to var(--dir, right), transparent, rgba(168, 122, 52, 0.55));
}
.divider-rule:last-child { --dir: left; }

.divider-text {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 23.12px;
  letter-spacing: -0.16px;
  color: var(--text-dark);
  opacity: 0.5;
}

/* Date */
.date-block {
  top: 470px;
  left: 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-blue);
}

.date-day {
  font-size: 24px;
  line-height: 29.064px;
  letter-spacing: -0.72px;
  margin-bottom: 3px;
}

.date-main {
  font-size: 34px;
  line-height: 41.174px;
  letter-spacing: -1.02px;
}

.date-time {
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 28px;
  letter-spacing: -0.4px;
  /* Full-height digits: Cormorant's default old-style figures sit at
     x-height and made "10:00" look smaller than "AM" */
  font-variant-numeric: lining-nums;
  color: var(--ink-blue);
}

/* "Add to Calendar": frosted-glass pill under the time, like the Scroll pill
   but white-tinted with ink-blue text so it reads on the cream page.
   .date-block is centred text, so an inline-flex pill centres itself. */
.calendar-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  height: 30px;
  padding: 0 14px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow:
    0 3px 12px rgba(55, 42, 34, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.2px;
  color: var(--ink-blue);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.calendar-btn:hover,
.calendar-btn:active {
  background: rgba(255, 255, 255, 0.6);
}

.calendar-btn:focus-visible {
  outline: 2px solid var(--ink-blue);
  outline-offset: 2px;
}

.couple-illustration {
  left: 153px;
  top: 636px;
  width: 107px;
  /* Full art is 151px tall; crop the feet so the couple ends on the top edge
     of the carved border (772px) instead of overlapping it */
  height: 136px;
  object-fit: cover;
  object-position: 50% 0;
}

/* -- Dress code (between the arch and the venue) --
   Flowers are from the Figma sticker sheet (7:11). Cards take the temple-arch
   shape of the date page and the doors; banana leaves frame the sides. */
.dress-section {
  --brass: rgba(168, 122, 52, 0.55);
  background: var(--bg-cream-venue);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 8px;
  text-align: center;
  overflow: hidden;
}

/* Heading: ——  ✿ Dress Code ✿  —— */
.dress-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

.dress-heading-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to var(--dir, right), transparent, var(--brass));
}

.dress-heading-rule:last-child { --dir: left; }

.dress-daisy {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.dress-label {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 23.12px;
  letter-spacing: -0.16px;
  color: var(--text-dark);
  opacity: 0.6;
  white-space: nowrap;
}

.dress-cards {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
  margin-top: 52px; /* room for the flowers crowning the arches */
  position: relative;
  z-index: 2;
}

.dress-card {
  position: relative;
  flex: 1;
  max-width: 156px;
  padding: 48px 12px 22px;
  border-radius: 999px 999px 12px 12px;
  background: linear-gradient(180deg, #FCF6EA 0%, #FAF0DD 100%);
  /* Double keyline like a printed invitation card */
  border: 1px solid var(--brass);
  box-shadow:
    inset 0 0 0 4px #FBF3E3,
    inset 0 0 0 5px rgba(168, 122, 52, 0.22),
    0 6px 18px rgba(92, 62, 38, 0.10);
}

.dress-flower {
  position: absolute;
  left: 50%;
  top: 0;
  max-width: none;
  translate: -50% -58%;
  opacity: 0;
  scale: 0.4;
  rotate: -25deg;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 3px 4px rgba(92, 62, 38, 0.18));
  transition:
    opacity 400ms var(--ease-decelerate) 250ms,
    scale 700ms var(--ease-overshoot) 250ms,
    rotate 700ms var(--ease-soft-bounce) 250ms;
}

.dress-flower-lily     { width: 78px; }
.dress-flower-marigold { width: 66px; }

.dress-card.is-visible .dress-flower {
  opacity: 1;
  scale: 1;
  rotate: 0deg;
}

/* Once bloomed, the flowers rock very gently, like the hero's centre bouquet */
.dress-card.is-visible .dress-flower-lily     { animation: dressFlowerRock 4.4s ease-in-out 1.2s infinite alternate; }
.dress-card.is-visible .dress-flower-marigold { animation: dressFlowerRock 5s ease-in-out 1.5s infinite alternate-reverse; }

@keyframes dressFlowerRock {
  from { transform: rotate(-4deg); }
  to   { transform: rotate(4deg); }
}

.dress-who {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dark);
  opacity: 0.65;
}

.dress-title {
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 27px;
  letter-spacing: -0.6px;
  color: var(--ink-blue);
}

/* Banana leaves peeking in from the sides, swaying like the arch page's */
/* Their stems sit off-screen, so the fronds reach in behind the cards */
.dress-leaf {
  position: absolute;
  top: 150px;
  width: 124px;
  max-width: none;
  z-index: 1;
  pointer-events: none;
  transform-origin: 50% 100%;
}

.dress-leaf-left {
  left: -84px;
  rotate: 32deg;
  animation: swayLeafLeft 5.2s ease-in-out infinite alternate;
}

.dress-leaf-right {
  right: -84px;
  scale: -1 1; /* mirrored */
  rotate: -32deg;
  animation: swayLeafRight 5.6s ease-in-out infinite alternate;
}

/* Rose bud · marigold · rose bud, like the loader's flower row */
.dress-flourish {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
}

.flourish-bud {
  width: 24px;
  height: auto;
}

.flourish-bud-left  { rotate: -18deg; transform-origin: 50% 100%; }
.flourish-bud-right { rotate: 18deg;  transform-origin: 50% 100%; }

.flourish-marigold {
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
}

@media (max-width: 340px) {
  .dress-cards { gap: 10px; }
  .dress-title { font-size: 21px; line-height: 24px; }
}

/* -- Venue + map (continues below the arch band) -- */
.venue-section {
  background: var(--bg-cream-venue);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 32.5px calc(28px + env(safe-area-inset-bottom, 0px));
  /* Keep the closing band clear of Safari's bottom toolbar: (lvh - svh) is the
     space the bars cover */
  padding-bottom: calc(28px + max(env(safe-area-inset-bottom, 0px), 100lvh - 100svh));
  text-align: center;
}

/* "Venue" sits between the same brass rules as the Dress Code heading */
.venue-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.venue-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to var(--dir, right), transparent, rgba(168, 122, 52, 0.55));
}
.venue-rule:last-child { --dir: left; }

.venue-label {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 23.12px;
  letter-spacing: -0.16px;
  color: var(--text-dark);
  opacity: 0.5;
}

.venue-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 33.908px;
  letter-spacing: -0.84px;
  color: var(--ink-blue);
}

/* Map sits in a mat with a very light brown keyline */
.venue-map {
  display: block;
  margin-top: 16px;
  width: 100%;
  max-width: 347px;
  aspect-ratio: 347 / 242;
  padding: 5px;
  border: 1px solid rgba(139, 101, 62, 0.22);
  border-radius: 10px;
  background: #FBF3E4;
}

.venue-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 6px;
  /* Static snapshot as a placeholder until the live map paints over it */
  background: #E8E2D6 url('assets/venue_map.jpg') center / cover no-repeat;
}

/* Closing band at the end of the invite (details_band.jpg is 1510x54; shown
   at the same half scale as on the date page, centred) */
.invite-end {
  align-self: stretch;
  margin: 44px -32.5px 0;
  height: 27px;
  background: url('assets/details_band.jpg') center / auto 27px no-repeat;
}

/* -- Venue scroll reveal -- */
.reveal {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 700ms var(--ease-decelerate), translate 700ms var(--ease-soft-bounce);
}

.reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

/* -- Date page reveal choreography --
   .is-opening (arch mostly open) brings in the leaves; .is-revealed (page settled
   in place) then plays the remaining .arch-step items in order of --i. */
.arch-step {
  opacity: 0;
  translate: 0 18px;
  /* Keep each item on one stable compositor layer for its whole life. Without this
     the browser drops the animation layer when the transition ends and re-rasterises
     the text, which shows as a small jitter/snap as it settles. (No blur filter on
     text for the same reason.) */
  will-change: opacity, translate;
  backface-visibility: hidden;
  transition:
    opacity 450ms var(--ease-decelerate),
    translate 550ms var(--ease-soft-bounce),
    rotate 650ms var(--ease-soft-bounce),
    scale 550ms var(--ease-soft-overshoot),
    letter-spacing 700ms var(--ease-decelerate);
  transition-delay: 0ms;
}

.arch-step[data-anim="leaf-left"]  { translate: -80px 30px; rotate: -16deg; transform-origin: 0% 100%; }
.arch-step[data-anim="leaf-right"] { translate: 80px 30px;  rotate: 16deg;  transform-origin: 100% 100%; }
.arch-step[data-anim="bloom"]      { translate: 0 0; scale: 0.5; }
.arch-step[data-anim="from-left"]  { translate: -48px 0; }
.arch-step[data-anim="from-right"] { translate: 48px 0; }
.arch-step[data-anim="rise"]       { translate: 0 48px; scale: 0.9; transform-origin: 50% 100%; }
.arch-step[data-anim="date"]       { letter-spacing: 8px; }
.arch-step[data-anim="draw"]       { translate: 0 0; }

/* Divider rules draw outward from the word "on" */
.date-divider .divider-rule {
  scale: 0 1;
  transition: scale 550ms var(--ease-decelerate);
  transition-delay: inherit;
}
.date-divider .divider-rule:first-child { transform-origin: 100% 50%; }
.date-divider .divider-rule:last-child  { transform-origin: 0% 50%; }

/* Stage 1 — leaves sweep in while the arch is still opening (.is-opening) */
.details-arch.is-opening .arch-leaf {
  opacity: 1;
  translate: 0 0;
  rotate: 0deg;
  transition-delay: 0ms;
}

/* Stage 2 — text plays once the page has settled in place (.is-revealed) */
.details-arch.is-revealed .arch-step:not(.arch-leaf) {
  opacity: 1;
  translate: 0 0;
  rotate: 0deg;
  scale: 1;
  transition-delay: calc((var(--i) - 1) * 70ms + 60ms);
}

.details-arch.is-revealed .date-main { letter-spacing: -1.02px; }
.details-arch.is-revealed .date-divider .divider-rule { scale: 1 1; }

/* Leaves keep swaying gently once they have swept in */
.details-arch.is-opening .arch-leaf-left  { animation: swayLeafLeft 5s ease-in-out 1.2s infinite alternate; }
.details-arch.is-opening .arch-leaf-right { animation: swayLeafRight 5.4s ease-in-out 1.2s infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .arch-step,
  .date-divider .divider-rule {
    opacity: 1;
    translate: none;
    rotate: none;
    scale: none;
    filter: none;
    transition: none;
  }
  .details-arch { clip-path: none; }
  .arch-bg { transform: none; }
  .welcome-screen.animate .layer-banana-leaf-left img,
  .welcome-screen.animate .layer-banana-leaf-right img,
  .welcome-screen.animate .motif-img,
  .welcome-screen.animate .scroll-pill,
  .dress-leaf,
  .dress-card.is-visible .dress-flower { animation: none; }
  .dress-flower { opacity: 1; scale: none; rotate: none; transition: none; }
}
