/* ==========================================================================
   Atelier Vow — Interactive Digital Wedding Invitation Card Styles
   ========================================================================== */

.card-root {
  --card-surface: #f3f1ee;
  --card-text: #252936;
  --card-muted: #5c6274;
  --card-accent: #7b6b54;
  --card-dark-bg: #16211e;
  --card-dark-text: #f2ece2;
  --ribbon-color: #e8e4ea;
  --wax-color: #c9b99b;
  --envelope-color: #dad6dc;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Pinyon Script', cursive;
  --font-body: 'Cormorant Garamond', Georgia, serif;
  --name-scale: 1;
  --card-tracking: 0.14em;

  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--card-surface);
  color: var(--card-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.card-root button,
.card-root a,
.card-root label,
.card-root [data-action] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Paper Texture Overlays */
.card-root::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 45;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.card-root[data-texture='cotton']::after {
  opacity: 0.24;
  background-image:
    radial-gradient(rgba(80, 62, 42, 0.11) 0.65px, transparent 0.65px),
    radial-gradient(rgba(120, 98, 72, 0.08) 0.55px, transparent 0.55px);
  background-size: 9px 9px, 15px 15px;
  background-position: 0 0, 4px 6px;
  mix-blend-mode: multiply;
}

.card-root[data-texture='linen']::after {
  opacity: 0.16;
  background-image:
    repeating-linear-gradient(0deg, rgba(60, 50, 40, 0.08) 0, rgba(60, 50, 40, 0.08) 1px, transparent 1px, transparent 5px),
    repeating-linear-gradient(90deg, rgba(60, 50, 40, 0.06) 0, rgba(60, 50, 40, 0.06) 1px, transparent 1px, transparent 5px);
  mix-blend-mode: multiply;
}

.card-root[data-texture='watercolor']::after {
  opacity: 0.28;
  background:
    radial-gradient(ellipse at 15% 12%, rgba(255, 255, 255, 0.45), transparent 45%),
    radial-gradient(ellipse at 86% 78%, rgba(202, 184, 168, 0.25), transparent 50%),
    radial-gradient(rgba(90, 75, 65, 0.07) 0.7px, transparent 0.7px);
  background-size: 100% 100%, 100% 100%, 11px 11px;
}

.card-root[data-texture='silk']::after {
  opacity: 0.22;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.22) 0%, transparent 38%, rgba(255, 255, 255, 0.12) 66%, transparent 100%);
}

/* ==========================================================================
   Floating Top Controls (Music & Language Pill — Inspired by Video 1)
   ========================================================================== */
.card-floating-bar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px));
  left: max(14px, env(safe-area-inset-left, 14px));
  right: max(14px, env(safe-area-inset-right, 14px));
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.card-floating-bar > * {
  pointer-events: auto;
}

.card-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(24, 24, 30, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.card-pill-btn:hover {
  background: rgba(24, 24, 30, 0.56);
  transform: translateY(-1px);
}

.card-pill-btn.is-playing .music-bars span {
  animation: musicPulse 0.9s ease-in-out infinite;
}

.music-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.music-bars span {
  display: block;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  transition: height 0.2s ease;
}

.music-bars span:nth-child(2) { height: 8px; animation-delay: 0.18s; }
.music-bars span:nth-child(3) { height: 5px; animation-delay: 0.36s; }

@keyframes musicPulse {
  0%, 100% { height: 3px; }
  50% { height: 11px; }
}

/* ==========================================================================
   OPENING EXPERIENCE OVERLAY (3 Signature Interactive Animations)
   ========================================================================== */
.card-opening-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.85s ease;
}

.card-opening-overlay.is-dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Backdrop behind the envelope */
.opening-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), filter 1s ease;
}

.opening-tap-hint {
  position: absolute;
  bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 20px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #2c2724;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.9);
  animation: hintFloat 2.4s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes hintFloat {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -4px); }
}

/* ---------- STYLE 1: SILK RIBBON & 3D ENVELOPE (Video 1 Inspired) ---------- */
.envelope-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  cursor: pointer;
}

.envelope-body {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease 0.45s;
}

/* Triangular paper flaps composing a full-bleed opaque luxury pocket envelope */
.env-flap-bottom {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(rgba(70, 56, 48, 0.09) 0.75px, transparent 0.75px),
    radial-gradient(rgba(255, 255, 255, 0.3) 0.8px, transparent 0.8px),
    linear-gradient(180deg, color-mix(in srgb, var(--envelope-color) 92%, #1a1622) 0%, var(--envelope-color) 36%, color-mix(in srgb, var(--envelope-color) 94%, #ffffff) 100%);
  background-size: 7px 7px, 13px 13px, 100% 100%;
  background-position: 0 0, 3px 4px, 0 0;
  clip-path: polygon(0 100%, 50% 42%, 100% 100%);
  filter: drop-shadow(0 -6px 14px rgba(18, 20, 30, 0.16));
  transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.34s, opacity 0.7s ease 0.48s;
  z-index: 4;
}

.env-flap-left {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(rgba(60, 48, 42, 0.09) 0.75px, transparent 0.75px),
    radial-gradient(rgba(255, 255, 255, 0.25) 0.8px, transparent 0.8px),
    linear-gradient(105deg, color-mix(in srgb, var(--envelope-color) 94%, #1d1a24) 0%, color-mix(in srgb, var(--envelope-color) 85%, #15121d) 100%);
  background-size: 7px 7px, 13px 13px, 100% 100%;
  clip-path: polygon(0 0, 52% 52%, 0 100%);
  transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.3s, opacity 0.7s ease 0.46s;
  z-index: 3;
}

.env-flap-right {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(rgba(60, 48, 42, 0.09) 0.75px, transparent 0.75px),
    radial-gradient(rgba(255, 255, 255, 0.25) 0.8px, transparent 0.8px),
    linear-gradient(255deg, color-mix(in srgb, var(--envelope-color) 90%, #1d1a24) 0%, color-mix(in srgb, var(--envelope-color) 82%, #15121d) 100%);
  background-size: 7px 7px, 13px 13px, 100% 100%;
  clip-path: polygon(100% 0, 48% 52%, 100% 100%);
  transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.3s, opacity 0.7s ease 0.46s;
  z-index: 3;
}

.env-flap-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58%;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.95s cubic-bezier(0.36, 0, 0.18, 1) 0.28s, opacity 0.42s ease 0.78s;
  filter: drop-shadow(0 12px 18px rgba(12, 11, 20, 0.28));
  z-index: 8;
}

.env-flap-top-face {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(rgba(76, 66, 74, 0.1) 0.8px, transparent 0.8px),
    radial-gradient(rgba(255, 255, 255, 0.38) 0.9px, transparent 0.9px),
    linear-gradient(180deg, color-mix(in srgb, var(--envelope-color) 96%, #ffffff) 0%, color-mix(in srgb, var(--envelope-color) 96%, #e4dfe8) 68%, color-mix(in srgb, var(--envelope-color) 88%, #1b1724) 100%);
  background-size: 7px 7px, 13px 13px, 100% 100%;
  background-position: 0 0, 3px 5px, 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 96%);
  backface-visibility: hidden;
}

.env-flap-top-liner {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.06)), var(--card-surface);
  clip-path: polygon(0 0, 100% 0, 50% 96%);
  transform: rotateX(180deg);
  backface-visibility: hidden;
}

/* Realistic Frayed-Edge Silk Chiffon Ribbon — GPU-Composited Layers */
.silk-ribbon-wrap {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  color: var(--ribbon-color);
  overflow: hidden;
}

.silk-layer {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

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

/* Exact knot center pivot (190/380 = 50%, 412/760 = 54.2%) */
.silk-layer-loop-left,
.silk-layer-loop-right,
.silk-layer-tail-left,
.silk-layer-tail-right,
.silk-layer-knot {
  transform-origin: 50% 54.2%;
}

.silk-layer-upper {
  transform-origin: 50% 0%;
}

.silk-layer-lower {
  transform-origin: 50% 100%;
}

/* Hide tap hint gently right on click */
.envelope-stage.is-opening .opening-tap-hint {
  opacity: 0;
  transform: translate(-50%, 8px);
  animation: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

/* ==========================================================================
   4-Beat Video 1 Silky Untying Choreography (Locked 60/120fps GPU Compositing)
   Beat 1 (0.00s–0.65s): Bow loops smoothly draw INTO the knot as tails pull down
   Beat 2 (0.48s–0.92s): Center knot loosens, flattens & unravels
   Beat 3 (0.66s–1.46s): Upper & lower silk sashes glide smoothly off top & bottom edges
   Beat 4 (1.36s–2.42s): Bare 3D envelope unfolds smoothly to reveal the invitation
   ========================================================================== */

@keyframes untieLoopLeft {
  0% {
    transform: translate3d(0, 0, 0) scaleX(1) scaleY(1) rotate(0deg);
    opacity: 1;
  }
  20% {
    transform: translate3d(3px, 1px, 0) scaleX(0.92) scaleY(0.97) rotate(3deg);
    opacity: 1;
  }
  58% {
    transform: translate3d(14px, 4px, 0) scaleX(0.42) scaleY(0.84) rotate(-4deg);
    opacity: 0.96;
  }
  84% {
    transform: translate3d(18px, 6px, 0) scaleX(0.1) scaleY(0.68) rotate(-8deg);
    opacity: 0.45;
  }
  100% {
    transform: translate3d(18px, 6px, 0) scaleX(0.02) scaleY(0.55) rotate(-10deg);
    opacity: 0;
  }
}

@keyframes untieLoopRight {
  0% {
    transform: translate3d(0, 0, 0) scaleX(1) scaleY(1) rotate(0deg);
    opacity: 1;
  }
  20% {
    transform: translate3d(-3px, 1px, 0) scaleX(0.92) scaleY(0.97) rotate(-3deg);
    opacity: 1;
  }
  58% {
    transform: translate3d(-14px, 4px, 0) scaleX(0.42) scaleY(0.84) rotate(4deg);
    opacity: 0.96;
  }
  84% {
    transform: translate3d(-18px, 6px, 0) scaleX(0.1) scaleY(0.68) rotate(8deg);
    opacity: 0.45;
  }
  100% {
    transform: translate3d(-18px, 6px, 0) scaleX(0.02) scaleY(0.55) rotate(10deg);
    opacity: 0;
  }
}

@keyframes untieTailLeft {
  0% {
    transform: translate3d(0, 0, 0) scaleY(1) rotate(0deg);
    opacity: 1;
  }
  38% {
    transform: translate3d(-6px, 16px, 0) scaleY(1.16) rotate(-4deg);
    opacity: 1;
  }
  72% {
    transform: translate3d(-12px, 42px, 0) scaleY(1.22) rotate(-8deg);
    opacity: 0.72;
  }
  100% {
    transform: translate3d(-16px, 76px, 0) scaleY(1.18) rotate(-11deg);
    opacity: 0;
  }
}

@keyframes untieTailRight {
  0% {
    transform: translate3d(0, 0, 0) scaleY(1) rotate(0deg);
    opacity: 1;
  }
  38% {
    transform: translate3d(6px, 16px, 0) scaleY(1.16) rotate(4deg);
    opacity: 1;
  }
  72% {
    transform: translate3d(12px, 42px, 0) scaleY(1.22) rotate(8deg);
    opacity: 0.72;
  }
  100% {
    transform: translate3d(16px, 76px, 0) scaleY(1.18) rotate(11deg);
    opacity: 0;
  }
}

@keyframes untieKnot {
  0% {
    transform: translate3d(0, 0, 0) scaleX(1) scaleY(1);
    opacity: 1;
  }
  42% {
    transform: translate3d(0, 1px, 0) scaleX(0.94) scaleY(0.96);
    opacity: 1;
  }
  72% {
    transform: translate3d(0, 3px, 0) scaleX(1.16) scaleY(0.76);
    opacity: 0.68;
  }
  100% {
    transform: translate3d(0, 6px, 0) scaleX(0.8) scaleY(0.48);
    opacity: 0;
  }
}

@keyframes glideUpperSash {
  0% {
    transform: translate3d(0, 0, 0) scaleX(1);
    opacity: 1;
  }
  18% {
    transform: translate3d(0, -6%, 0) scaleX(1.05);
    opacity: 1;
  }
  82% {
    transform: translate3d(0, -88%, 0) scaleX(1.08);
    opacity: 0.96;
  }
  100% {
    transform: translate3d(0, -112%, 0) scaleX(1.08);
    opacity: 0;
  }
}

@keyframes glideLowerSash {
  0% {
    transform: translate3d(0, 0, 0) scaleX(1);
    opacity: 1;
  }
  18% {
    transform: translate3d(0, 6%, 0) scaleX(1.05);
    opacity: 1;
  }
  82% {
    transform: translate3d(0, 88%, 0) scaleX(1.08);
    opacity: 0.96;
  }
  100% {
    transform: translate3d(0, 112%, 0) scaleX(1.08);
    opacity: 0;
  }
}

.envelope-stage.is-opening .silk-layer-loop-left {
  animation: untieLoopLeft 0.64s cubic-bezier(0.4, 0, 0.2, 1) 0s forwards;
}

.envelope-stage.is-opening .silk-layer-loop-right {
  animation: untieLoopRight 0.64s cubic-bezier(0.4, 0, 0.2, 1) 0s forwards;
}

.envelope-stage.is-opening .silk-layer-tail-left {
  animation: untieTailLeft 0.72s cubic-bezier(0.36, 0, 0.2, 1) 0.04s forwards;
}

.envelope-stage.is-opening .silk-layer-tail-right {
  animation: untieTailRight 0.72s cubic-bezier(0.36, 0, 0.2, 1) 0.04s forwards;
}

.envelope-stage.is-opening .silk-layer-knot {
  animation: untieKnot 0.56s cubic-bezier(0.38, 0, 0.24, 1) 0.44s forwards;
}

.envelope-stage.is-opening .silk-layer-upper {
  animation: glideUpperSash 0.84s cubic-bezier(0.38, 0, 0.2, 1) 0.66s forwards;
}

.envelope-stage.is-opening .silk-layer-lower {
  animation: glideLowerSash 0.84s cubic-bezier(0.38, 0, 0.2, 1) 0.66s forwards;
}

.silk-ribbon-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Sequenced Beat 4: In Silk Ribbon mode, canvas physics triggers .is-unfolding right as sashes clear */
.envelope-stage.is-ribbon-mode .env-flap-top {
  transition: transform 0.96s cubic-bezier(0.32, 0, 0.16, 1) 0s, opacity 0.4s ease 0.58s;
}

.envelope-stage.is-ribbon-mode .env-flap-left,
.envelope-stage.is-ribbon-mode .env-flap-right {
  transition: transform 0.92s cubic-bezier(0.22, 1, 0.36, 1) 0.12s, opacity 0.55s ease 0.34s;
}

.envelope-stage.is-ribbon-mode .env-flap-bottom {
  transition: transform 0.92s cubic-bezier(0.22, 1, 0.36, 1) 0.16s, opacity 0.55s ease 0.38s;
}

.envelope-stage.is-wax-mode.is-opening .env-flap-top,
.envelope-stage.is-ribbon-mode.is-unfolding .env-flap-top {
  transform: rotateX(176deg);
  opacity: 0;
}

.envelope-stage.is-wax-mode.is-opening .env-flap-bottom,
.envelope-stage.is-ribbon-mode.is-unfolding .env-flap-bottom {
  transform: translateY(85%);
  opacity: 0;
}

.envelope-stage.is-wax-mode.is-opening .env-flap-left,
.envelope-stage.is-ribbon-mode.is-unfolding .env-flap-left {
  transform: translateX(-75%);
  opacity: 0;
}

.envelope-stage.is-wax-mode.is-opening .env-flap-right,
.envelope-stage.is-ribbon-mode.is-unfolding .env-flap-right {
  transform: translateX(75%);
  opacity: 0;
}

/* Wax Seal Emblem (shared by Wax Envelope & Botanical Bloom Step 2) */
.wax-seal-btn {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--wax-color) 75%, #ffffff), var(--wax-color) 58%, color-mix(in srgb, var(--wax-color) 72%, #2a2018));
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.55),
    inset 0 -4px 8px rgba(0, 0, 0, 0.24),
    0 10px 26px rgba(0, 0, 0, 0.28),
    0 0 0 5px color-mix(in srgb, var(--wax-color) 85%, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, opacity 0.45s ease;
}

.wax-seal-btn::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.wax-seal-btn:hover {
  transform: scale(1.06);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.65),
    inset 0 -4px 8px rgba(0, 0, 0, 0.24),
    0 14px 32px rgba(0, 0, 0, 0.34),
    0 0 0 6px color-mix(in srgb, var(--wax-color) 90%, #ffffff);
}

.wax-seal-monogram {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(48, 36, 26, 0.72);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.env-wax-holder {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  z-index: 16;
  transition: transform 0.55s ease, opacity 0.45s ease;
}

.envelope-stage.is-opening .env-wax-holder {
  transform: translate(-50%, -50%) scale(1.25);
  opacity: 0;
}

/* ---------- STYLE 2: BOTANICAL GARDEN BLOOM & WAX SEAL (Video 2 Inspired) ---------- */
.botanical-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--card-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.botanical-wreath-bg {
  position: absolute;
  inset: 0;
  background-image: url('../assets/botanical-wreath.jpg');
  background-size: 100% 100%;
  background-position: center;
  transform: scale(1.36);
  opacity: 0.22;
  transition: transform 1.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 1.4s ease;
}

.botanical-stage.phase-bloom .botanical-wreath-bg,
.botanical-stage.phase-seal .botanical-wreath-bg {
  transform: scale(1.01);
  opacity: 1;
}

/* Floral curtains that part smoothly outward on bloom */
.botanical-curtain-left,
.botanical-curtain-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56%;
  background-image: url('../assets/botanical-wreath.jpg');
  background-size: 200% auto;
  pointer-events: none;
  z-index: 6;
  transition: transform 1.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 1.2s ease;
}

.botanical-curtain-left {
  left: 0;
  background-position: left center;
}

.botanical-curtain-right {
  right: 0;
  background-position: right center;
}

.botanical-stage.phase-bloom .botanical-curtain-left,
.botanical-stage.phase-seal .botanical-curtain-left {
  transform: translateX(-100%) rotate(-4deg);
  opacity: 0;
}

.botanical-stage.phase-bloom .botanical-curtain-right,
.botanical-stage.phase-seal .botanical-curtain-right {
  transform: translateX(100%) rotate(4deg);
  opacity: 0;
}

.botanical-intro-center {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 28px 34px;
  max-width: 78%;
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.botanical-intro-kicker {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--card-muted);
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 0.45s, transform 0.8s ease 0.45s;
}

.botanical-intro-names {
  font-family: var(--font-script);
  font-size: calc(44px * var(--name-scale));
  line-height: 1.05;
  color: var(--card-accent);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.55s cubic-bezier(0.25, 0.8, 0.25, 1) 0.65s;
}

.botanical-intro-names .amp {
  display: block;
  font-size: 0.56em;
  margin: 2px 0;
  opacity: 0.85;
}

.botanical-stage.phase-bloom .botanical-intro-kicker {
  opacity: 1;
  transform: translateY(0);
}

.botanical-stage.phase-bloom .botanical-intro-names {
  clip-path: inset(0 0 0 0);
}

/* Step 2: Cream Cotton Wax Seal Overlay (Video 2 middle transition!) */
.botanical-seal-layer {
  position: absolute;
  inset: 0;
  z-index: 16;
  background: var(--card-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

.botanical-stage.phase-seal .botanical-seal-layer {
  opacity: 1;
  pointer-events: auto;
}

.botanical-wash-burst {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(206, 178, 146, 0.65) 0%, rgba(235, 220, 200, 0.3) 55%, transparent 75%);
  transform: scale(0.2);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.9s ease;
}

.botanical-stage.phase-burst .botanical-wash-burst {
  transform: scale(11);
  opacity: 1;
}

.botanical-stage.phase-burst .wax-seal-btn {
  transform: scale(1.3);
  opacity: 0;
}

.botanical-seal-caption {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--card-muted);
}

/* ---------- STYLE 3: SIDEWAYS DOUBLE-DOOR GATEFOLD CARD ---------- */
.gatefold-stage {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1450px;
  cursor: pointer;
  overflow: hidden;
  background: transparent;
}

.gatefold-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.4%;
  transform-style: preserve-3d;
  transition: transform 1.32s cubic-bezier(0.32, 0, 0.16, 1) 0.22s;
  will-change: transform;
  z-index: 8;
}

.gatefold-door-left {
  left: 0;
  transform-origin: left center;
}

.gatefold-door-right {
  right: 0;
  transform-origin: right center;
}

.gatefold-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background:
    radial-gradient(rgba(74, 62, 54, 0.095) 0.75px, transparent 0.75px),
    radial-gradient(rgba(255, 255, 255, 0.34) 0.85px, transparent 0.85px),
    linear-gradient(180deg, color-mix(in srgb, var(--envelope-color) 96%, #ffffff) 0%, var(--envelope-color) 55%, color-mix(in srgb, var(--envelope-color) 92%, #1d1824) 100%);
  background-size: 7px 7px, 13px 13px, 100% 100%;
}

.gatefold-door-left .gatefold-face {
  border-right: 1px solid rgba(26, 20, 16, 0.14);
  box-shadow: inset -12px 0 24px rgba(18, 15, 22, 0.08);
}

.gatefold-door-right .gatefold-face {
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 12px 0 24px rgba(18, 15, 22, 0.09);
}

/* Delicate inset embossed double border on both gatefold doors */
.gatefold-face::before {
  content: '';
  position: absolute;
  top: 22px;
  bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 34%, transparent);
  pointer-events: none;
}

.gatefold-door-left .gatefold-face::before {
  left: 18px;
  right: 10px;
  border-right: none;
}

.gatefold-door-right .gatefold-face::before {
  left: 10px;
  right: 18px;
  border-left: none;
}

.gatefold-liner {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  background: linear-gradient(90deg, color-mix(in srgb, var(--card-surface) 92%, #d8cfc0), var(--card-surface));
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.1);
}

.gatefold-seam-monogram {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.38s ease;
}

.gatefold-stage.is-opening .gatefold-seam-monogram {
  transform: translate(-50%, -50%) scale(1.18);
  opacity: 0;
}

.gatefold-stage.is-opening .opening-tap-hint {
  opacity: 0;
  transform: translate(-50%, 8px);
  animation: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gatefold-stage.is-opening .gatefold-door-left {
  transform: rotateY(-128deg);
}

.gatefold-stage.is-opening .gatefold-door-right {
  transform: rotateY(128deg);
}

/* ---------- STYLE 4: TOP & BOTTOM BI-FOLD ENVELOPE ---------- */
.bifold-stage {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1450px;
  cursor: pointer;
  overflow: hidden;
  background: transparent;
}

.bifold-flap {
  position: absolute;
  left: 0;
  right: 0;
  transform-style: preserve-3d;
  transition: transform 1.24s cubic-bezier(0.32, 0, 0.16, 1) 0.22s;
  will-change: transform;
}

.bifold-flap-top {
  top: 0;
  height: 53.5%;
  transform-origin: top center;
  z-index: 10;
  filter: drop-shadow(0 10px 18px rgba(15, 13, 22, 0.22));
}

.bifold-flap-bottom {
  bottom: 0;
  height: 52.5%;
  transform-origin: bottom center;
  z-index: 8;
}

.bifold-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background:
    radial-gradient(rgba(74, 62, 54, 0.095) 0.75px, transparent 0.75px),
    radial-gradient(rgba(255, 255, 255, 0.34) 0.85px, transparent 0.85px),
    linear-gradient(180deg, color-mix(in srgb, var(--envelope-color) 96%, #ffffff) 0%, var(--envelope-color) 62%, color-mix(in srgb, var(--envelope-color) 90%, #1c1722) 100%);
  background-size: 7px 7px, 13px 13px, 100% 100%;
}

.bifold-flap-top .bifold-face {
  border-bottom-left-radius: 26px 14px;
  border-bottom-right-radius: 26px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
}

.bifold-flap-bottom .bifold-face {
  background:
    radial-gradient(rgba(74, 62, 54, 0.095) 0.75px, transparent 0.75px),
    radial-gradient(rgba(255, 255, 255, 0.3) 0.85px, transparent 0.85px),
    linear-gradient(0deg, color-mix(in srgb, var(--envelope-color) 95%, #ffffff) 0%, var(--envelope-color) 62%, color-mix(in srgb, var(--envelope-color) 88%, #1c1722) 100%);
  background-size: 7px 7px, 13px 13px, 100% 100%;
}

/* Delicate embossed inner trim on top & bottom horizontal flaps */
.bifold-face::before {
  content: '';
  position: absolute;
  left: 20px;
  right: 20px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 32%, transparent);
  pointer-events: none;
}

.bifold-flap-top .bifold-face::before {
  top: 20px;
  bottom: 14px;
  border-bottom-left-radius: 18px 10px;
  border-bottom-right-radius: 18px 10px;
}

.bifold-flap-bottom .bifold-face::before {
  top: 24px;
  bottom: 20px;
}

.bifold-liner {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  transform: rotateX(180deg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--card-surface) 92%, #dad1c2), var(--card-surface));
}

.bifold-seal-holder {
  position: absolute;
  left: 50%;
  top: 52.5%;
  transform: translate(-50%, -50%);
  z-index: 16;
  transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.36s ease;
}

.bifold-stage.is-opening .bifold-seal-holder {
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 0;
}

.bifold-stage.is-opening .opening-tap-hint {
  opacity: 0;
  transform: translate(-50%, 8px);
  animation: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.bifold-stage.is-opening .bifold-flap-top {
  transform: rotateX(162deg);
}

.bifold-stage.is-opening .bifold-flap-bottom {
  transform: rotateX(-162deg);
}

/* ==========================================================================
   SCROLLABLE MULTI-SECTION INVITATION SUITE
   ========================================================================== */
.card-scroll-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.card-scroll-container::-webkit-scrollbar {
  display: none;
}

/* Scroll Reveal Animation */
.reveal-block {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-block.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- SECTION 1: HERO COVER ---------- */
.card-hero {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 68px 28px 110px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.card-hero.has-villa-bg {
  justify-content: flex-start;
  padding-top: 94px;
  padding-bottom: 190px;
  background-size: cover;
  background-position: center bottom;
}

.card-hero.has-wreath-bg {
  padding: 86px 52px 96px;
  background-size: 100% 100%;
  background-color: #f3ece0;
}

.hero-corner-ornament {
  position: absolute;
  width: 112px;
  height: 112px;
  pointer-events: none;
  z-index: 2;
}

.hero-corner-ornament.top-left { top: 8px; left: 8px; }
.hero-corner-ornament.top-right { top: 8px; right: 8px; transform: scaleX(-1); }
.hero-corner-ornament.bottom-left { bottom: 8px; left: 8px; transform: scaleY(-1); }
.hero-corner-ornament.bottom-right { bottom: 8px; right: 8px; transform: scale(-1); }

.floral-corner-svg {
  width: 100%;
  height: 100%;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 4;
  max-width: 320px;
  width: 100%;
}

.hero-names {
  font-family: var(--font-display);
  font-size: calc(38px * var(--name-scale));
  font-weight: 500;
  line-height: 1.08;
  color: var(--card-text);
  margin: 0 0 14px;
}

.hero-names.is-script {
  font-size: calc(46px * var(--name-scale));
  line-height: 1.04;
  color: var(--card-accent);
}

.hero-names .amp {
  display: block;
  font-family: var(--font-script);
  font-size: 0.66em;
  line-height: 0.9;
  margin: 4px 0;
  color: var(--card-accent);
}

/* ==========================================================================
   ANIMATED HANDWRITTEN COVER NAMES (Canvas Letter-by-Letter Calligraphy Pen)
   ========================================================================== */
.hero-names-stage {
  position: relative;
  width: 100%;
  margin: 0 auto 8px;
}

.hero-names-stage .hw-canvas {
  display: none;
  width: 100%;
  margin: 0 auto;
}

.hero-names-stage.is-canvas-writing .hero-names {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  margin: 0;
}

.hero-names-stage.is-canvas-writing .hw-canvas {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .hero-names-stage.is-canvas-writing .hero-names {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    margin: 0 0 14px;
  }
  .hero-names-stage.is-canvas-writing .hw-canvas {
    display: none;
  }
}

.hero-kicker {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: var(--card-tracking);
  text-transform: uppercase;
  color: var(--card-muted);
  margin: 0 auto 22px;
  max-width: 240px;
  line-height: 1.55;
}

/* Ornamental Date Stack (Inspired by Video 1: JULY / 27 / TUESDAY 2027) */
.hero-date-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 22px;
}

.hero-date-month {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--card-muted);
  margin-bottom: 2px;
}

.hero-date-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--card-accent);
}

.date-sprig {
  width: 52px;
  height: 20px;
  flex-shrink: 0;
}

.hero-date-day {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  color: var(--card-text);
}

.hero-date-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--card-muted);
  margin-top: 4px;
}

.hero-venue-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--card-muted);
  margin-bottom: 5px;
}

.hero-venue-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  font-weight: 500;
  color: var(--card-text);
  margin: 0;
}

.hero-venue-loc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--card-muted);
  margin-top: 2px;
}

.hero-scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--card-muted);
  opacity: 0.8;
}

.scroll-line {
  width: 1px;
  height: 22px;
  background: currentColor;
  animation: scrollDrop 2s ease-in-out infinite;
}

@keyframes scrollDrop {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  45% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  55% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ---------- SECTION 2: BOTANICAL PORTRAIT CAMEO & MONOGRAM BANNER (Video 2) ---------- */
.card-section {
  position: relative;
  padding: 58px 26px;
  text-align: center;
  background: var(--card-surface);
  color: var(--card-text);
}

.section-cameo {
  padding-top: 52px;
  padding-bottom: 52px;
}

.cameo-wrapper {
  position: relative;
  width: 266px;
  margin: 0 auto;
  padding: 26px 22px 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cameo-wreath-ring {
  position: absolute;
  inset: 0;
  background-image: url('../assets/botanical-wreath.jpg');
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  opacity: 0.92;
  mask-image: radial-gradient(ellipse 96% 96% at 50% 50%, #000 72%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 96% 96% at 50% 50%, #000 72%, transparent 100%);
}

.cameo-oval {
  position: relative;
  z-index: 2;
  width: 186px;
  height: 236px;
  border-radius: 50% / 46%;
  overflow: hidden;
  border: 3px solid #faf5ec;
  box-shadow:
    0 0 0 1px rgba(164, 134, 96, 0.45),
    0 14px 30px rgba(42, 32, 22, 0.16);
  background: var(--card-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cameo-oval img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bouquet-illustration {
  width: 92%;
  height: auto;
}

.cameo-banner {
  position: relative;
  z-index: 4;
  width: 224px;
  margin-top: -32px;
}

.monogram-banner-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(34, 24, 14, 0.12));
}

.monogram-banner-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.14em;
  fill: var(--card-accent);
}

.cameo-caption {
  position: relative;
  z-index: 3;
  margin-top: 12px;
  font-family: var(--font-script);
  font-size: 26px;
  color: var(--card-accent);
}

/* ---------- SECTION 3: LIVE COUNTDOWN IN FLORAL ARCH (Video 1) ---------- */
.section-eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--card-muted);
  margin: 0 0 6px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--card-text);
}

.countdown-subdate {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--card-muted);
  margin-bottom: 24px;
}

.countdown-floral-frame {
  position: relative;
  max-width: 264px;
  margin: 0 auto;
  padding: 28px 22px;
  border-radius: 136px 136px 18px 18px;
  background: var(--card-surface);
  box-shadow: 0 14px 36px rgba(24, 22, 32, 0.08);
  overflow: hidden;
}

.countdown-floral-frame.has-floral {
  padding: 36px 26px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 28%, transparent);
}

.countdown-floral-frame.has-floral::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/botanical-wreath.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  pointer-events: none;
}

.countdown-floral-inner {
  position: relative;
  z-index: 2;
  padding: 22px 14px;
  border-radius: 112px 112px 12px 12px;
  background: color-mix(in srgb, var(--card-surface) 88%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--card-accent) 32%, transparent);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 10px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-unit.is-featured {
  grid-column: 1 / -1;
  padding-bottom: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--card-accent) 20%, transparent);
}

.countdown-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  color: var(--card-text);
  font-variant-numeric: tabular-nums;
}

.countdown-unit.is-featured .countdown-num {
  font-size: 46px;
  color: var(--card-accent);
}

.countdown-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--card-muted);
  margin-top: 5px;
}

/* ---------- SECTION 4: OUR STORY (Video 1) ---------- */
.section-story {
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--card-accent) 10%, transparent), transparent 62%),
    var(--card-surface);
}

.story-body {
  max-width: 288px;
  margin: 18px auto 0;
  font-size: 15px;
  line-height: 1.72;
  color: var(--card-muted);
}

.story-body p {
  margin: 0 0 14px;
}

.story-signature {
  font-family: var(--font-script);
  font-size: 30px;
  color: var(--card-accent);
  margin-top: 20px;
}

/* ---------- SECTION 5: THE CELEBRATION (Customizable Airy or Editorial Contrast Band) ---------- */
.section-celebration {
  padding: 58px 24px 64px;
  background: var(--card-dark-bg);
  color: var(--card-dark-text);
  transition: background 0.35s ease, color 0.35s ease;
}

.section-celebration .section-heading,
.section-celebration .celebration-venue,
.section-celebration .celebration-time {
  color: var(--card-dark-text);
}

.section-celebration .section-eyebrow,
.section-celebration .celebration-subvenue,
.section-celebration .celebration-desc,
.section-celebration .celebration-dress {
  color: color-mix(in srgb, var(--card-dark-text) 82%, transparent);
}

.fountain-arch {
  width: 224px;
  height: 260px;
  margin: 0 auto 26px;
  border-radius: 120px 120px 10px 10px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--card-dark-text) 16%, #ffffff);
  box-shadow: 0 14px 32px rgba(30, 26, 22, 0.14);
  background: #faf6ef;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-celebration.is-dark-band .fountain-arch {
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
  background: #161d1c;
}

.fountain-arch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fountain-arch img.crop-bottom {
  object-position: center 94%;
  transform: scale(1.08);
  transform-origin: center bottom;
}

.fountain-arch img.crop-top {
  object-position: center 8%;
}

.fountain-arch .bouquet-illustration {
  width: 88%;
  height: auto;
}

.fountain-arch::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 114px 114px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.section-celebration.is-dark-band .fountain-arch::after {
  border-color: rgba(255, 255, 255, 0.22);
}

.filigree-divider {
  width: 170px;
  height: 20px;
  margin: 8px auto 18px;
  color: var(--card-accent);
  display: block;
}

.section-celebration.is-dark-band .filigree-divider {
  color: color-mix(in srgb, var(--card-dark-text) 65%, var(--card-accent));
}

.celebration-frame {
  max-width: 288px;
  margin: 18px auto 0;
  padding: 26px 20px;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 24%, transparent);
  position: relative;
}

.celebration-frame::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  pointer-events: none;
}

.celebration-venue {
  font-family: var(--font-display);
  font-size: 24px;
  font-style: italic;
  font-weight: 500;
  margin: 0 0 4px;
}

.celebration-subvenue {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.celebration-desc {
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 16px;
}

.celebration-time {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.1em;
  margin: 0 0 10px;
}

.celebration-dress {
  font-family: 'Montserrat', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 20px;
}

.card-outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-family: 'Montserrat', sans-serif;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.card-outline-btn:hover {
  background: currentColor;
  transform: translateY(-1px);
}

.card-outline-btn:hover span {
  color: var(--card-dark-bg);
}

/* ---------- SECTION 6: THE DAY / WEDDING PROGRAM (Video 1) ---------- */
.villa-etching {
  width: 240px;
  height: auto;
  margin: 0 auto 14px;
  color: var(--card-accent);
  opacity: 0.85;
  display: block;
}

.schedule-days-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px auto 26px;
  flex-wrap: wrap;
}

.schedule-day-pill {
  position: relative;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 28%, transparent);
  background: transparent;
  color: var(--card-muted);
  font-family: var(--font-display);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.schedule-day-pill.is-active {
  background: var(--card-text);
  color: var(--card-surface);
  border-color: var(--card-text);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.schedule-day-pill.is-wedding-day::after {
  content: '♥';
  position: absolute;
  top: -7px;
  right: -2px;
  font-size: 11px;
  color: var(--card-accent);
}

.schedule-day-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--card-accent);
  margin: -14px 0 22px;
}

.program-timeline {
  position: relative;
  max-width: 288px;
  margin: 0 auto;
  text-align: left;
  padding-left: 22px;
}

.program-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: color-mix(in srgb, var(--card-accent) 30%, transparent);
}

.program-item {
  position: relative;
  padding-bottom: 20px;
}

.program-item:last-child {
  padding-bottom: 0;
}

.program-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card-accent);
  box-shadow: 0 0 0 3px var(--card-surface);
}

.program-time {
  font-family: 'Montserrat', sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--card-accent);
  margin-bottom: 3px;
}

.program-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--card-text);
  margin: 0 0 2px;
}

.program-note {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--card-muted);
  margin: 0;
}

/* ---------- SECTION 7: INTERACTIVE RSVP ---------- */
.section-rsvp {
  border-top: 1px solid color-mix(in srgb, var(--card-accent) 18%, transparent);
  background:
    radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--card-accent) 12%, transparent), transparent 65%),
    var(--card-surface);
}

.rsvp-deadline {
  font-size: 13.5px;
  font-style: italic;
  color: var(--card-muted);
  margin: 0 0 22px;
}

.rsvp-form {
  max-width: 288px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.rsvp-input,
.rsvp-select,
.rsvp-textarea {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 11px 13px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 28%, transparent);
  background: color-mix(in srgb, var(--card-surface) 70%, #ffffff);
  color: var(--card-text);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rsvp-input:focus,
.rsvp-select:focus,
.rsvp-textarea:focus {
  border-color: var(--card-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-accent) 14%, transparent);
}

.rsvp-side-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rsvp-field-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--card-muted);
  text-align: center;
}

.rsvp-side-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rsvp-attendance-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rsvp-choice {
  position: relative;
}

.rsvp-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.rsvp-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 28%, transparent);
  font-family: 'Montserrat', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--card-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rsvp-choice input:checked + span {
  background: var(--card-text);
  border-color: var(--card-text);
  color: var(--card-surface);
}

.rsvp-submit-btn {
  margin-top: 6px;
  min-height: 46px;
  padding: 13px 20px;
  border: none;
  border-radius: 4px;
  background: var(--card-text);
  color: var(--card-surface);
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.rsvp-submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.rsvp-confirmation {
  max-width: 280px;
  margin: 0 auto;
  padding: 26px 20px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 32%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card-surface) 82%, #ffffff);
  animation: fadePop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadePop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.rsvp-confirmation-seal {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--wax-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ---------- FOOTER ---------- */
.card-footer {
  padding: 36px 24px max(52px, calc(env(safe-area-inset-bottom, 0px) + 40px));
  text-align: center;
  background: var(--card-surface);
  border-top: 1px solid color-mix(in srgb, var(--card-accent) 14%, transparent);
}

.footer-monogram {
  font-family: var(--font-script);
  font-size: 32px;
  color: var(--card-accent);
  margin-bottom: 6px;
}

.footer-replay-btn {
  margin-top: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 30%, transparent);
  background: transparent;
  color: var(--card-muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.footer-replay-btn:hover {
  color: var(--card-text);
  border-color: var(--card-text);
}

/* ==========================================================================
   AMBIENT FALLING PETALS / LEAVES / STARDUST (GPU-Composited 60fps)
   ========================================================================== */
.falling-petals-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 42;
  perspective: 520px;
}

.petal-drop {
  position: absolute;
  top: -36px;
  display: block;
  will-change: transform, opacity;
  animation-name: petalVerticalFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.petal-drop.is-far {
  opacity: 0.52;
  filter: blur(0.85px);
}

.petal-drop.is-mid {
  opacity: 0.84;
}

.petal-drop.is-near {
  opacity: 0.96;
  filter: drop-shadow(0 4px 6px rgba(32, 22, 26, 0.14));
}

.petal-sway {
  display: block;
  will-change: transform;
  transform-style: preserve-3d;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.petal-sway.sway-a {
  animation-name: petalFlutterA;
}

.petal-sway.sway-b {
  animation-name: petalFlutterB;
}

.petal-svg {
  display: block;
}

.petal-style-gold .petal-svg {
  filter: drop-shadow(0 0 4px rgba(242, 208, 128, 0.55));
}

@keyframes petalVerticalFall {
  0% {
    transform: translate3d(0, -6vh, 0);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  86% {
    opacity: 0.92;
  }
  100% {
    transform: translate3d(0, 108vh, 0);
    opacity: 0;
  }
}

@keyframes petalFlutterA {
  0% {
    transform: translate3d(calc(var(--sway-amp, 22px) * -0.8), 0, 0) rotateX(12deg) rotateY(-18deg) rotateZ(-22deg);
  }
  25% {
    transform: translate3d(calc(var(--sway-amp, 22px) * 0.6), 0, 0) rotateX(48deg) rotateY(32deg) rotateZ(24deg);
  }
  50% {
    transform: translate3d(calc(var(--sway-amp, 22px) * 1), 0, 0) rotateX(18deg) rotateY(-28deg) rotateZ(58deg);
  }
  75% {
    transform: translate3d(calc(var(--sway-amp, 22px) * -0.4), 0, 0) rotateX(-38deg) rotateY(42deg) rotateZ(12deg);
  }
  100% {
    transform: translate3d(calc(var(--sway-amp, 22px) * -0.8), 0, 0) rotateX(12deg) rotateY(-18deg) rotateZ(-22deg);
  }
}

@keyframes petalFlutterB {
  0% {
    transform: translate3d(calc(var(--sway-amp, 22px) * 0.9), 0, 0) rotateX(-16deg) rotateY(22deg) rotateZ(26deg);
  }
  30% {
    transform: translate3d(calc(var(--sway-amp, 22px) * -0.5), 0, 0) rotateX(40deg) rotateY(-36deg) rotateZ(-18deg);
  }
  55% {
    transform: translate3d(calc(var(--sway-amp, 22px) * -1), 0, 0) rotateX(-24deg) rotateY(30deg) rotateZ(-54deg);
  }
  80% {
    transform: translate3d(calc(var(--sway-amp, 22px) * 0.45), 0, 0) rotateX(34deg) rotateY(-22deg) rotateZ(-8deg);
  }
  100% {
    transform: translate3d(calc(var(--sway-amp, 22px) * 0.9), 0, 0) rotateX(-16deg) rotateY(22deg) rotateZ(26deg);
  }
}

/* Additional Hero Background Layout Support */
.card-hero.has-moody-bg {
  background-size: cover;
  background-position: center;
}

.rsvp-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--card-muted);
  background: color-mix(in srgb, var(--card-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-accent) 26%, transparent);
}

.rsvp-sync-pill.is-synced {
  color: #2f5e41;
  background: rgba(56, 122, 82, 0.1);
  border-color: rgba(56, 122, 82, 0.28);
}

@media (max-width: 400px) {
  .card-section {
    padding: 48px 18px;
  }

  .section-celebration {
    padding: 48px 18px 54px;
  }

  .card-pill-btn {
    min-height: 34px;
    padding: 0 12px;
  }

  .fountain-arch {
    width: 196px;
    height: 230px;
  }

  .villa-etching {
    width: 204px;
  }

  .rsvp-form {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .falling-petals-layer {
    display: none;
  }
}
