/* ==========================================================================
   LUXURY INTERACTIVE WEDDING INVITATION — STYLESHEET
   Palette: Sage Green, Warm Ivory, Champagne Gold
   ========================================================================== */

:root {
  /* Core Palette */
  --sage-deep: #3d4d37;
  --sage-base: #586a50;
  --sage-mid: #6b7f62;
  --sage-soft: #8a9e80;
  --sage-tint: #eef2ea;

  --ivory-pure: #fffdf8;
  --ivory-card: #f7f3e8;
  --ivory-warm: #f2ead9;
  --ivory-cream: #e8dcc4;

  --gold-light: #efe0b9;
  --gold-champagne: #c8a45d;
  --gold-antique: #ab8438;
  --gold-bronze: #856324;

  --ink-primary: #2e2923;
  --ink-secondary: #5c5347;
  --ink-muted: #7c7163;

  /* Typography */
  --font-script: "Parisienne", "Brush Script MT", cursive;
  --font-display: "Cinzel", Georgia, serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Geometry & Depth */
  --shell-max-width: 470px;
  --radius-card: 24px;
  --radius-pill: 999px;
  --shadow-card: 0 22px 60px rgba(34, 42, 30, 0.22), 0 4px 16px rgba(34, 42, 30, 0.08);
  --shadow-soft: 0 10px 28px rgba(46, 41, 35, 0.08);
  --shadow-gold: 0 8px 24px rgba(171, 132, 56, 0.25);

  --ease-luxury: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  font-family: var(--font-serif);
  color: var(--ink-primary);
  background:
    radial-gradient(circle at 20% 15%, rgba(200, 164, 93, 0.14), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(107, 127, 98, 0.22), transparent 50%),
    linear-gradient(155deg, #2d3829 0%, #3d4c37 45%, #2a3426 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
  height: 100dvh;
}

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

button,
input,
textarea {
  font-family: inherit;
}

/* Floating Ambient Dust Canvas */
#particlesCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* App Shell — Centered Luxury Card Frame on Desktop, Full Edge-to-Edge on Mobile */
.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--shell-max-width);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--ivory-card);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

@media (max-width: 520px) {
  body {
    background: var(--ivory-card);
  }
  .app-shell {
    max-width: 100%;
    box-shadow: none;
  }
}

/* ==========================================================================
   MUSIC TOGGLE BUTTON
   ========================================================================== */
.music-toggle {
  position: fixed;
  top: 16px;
  right: max(16px, calc(50% - var(--shell-max-width) / 2 + 16px));
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(200, 164, 93, 0.55);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(25, 30, 22, 0.16);
  transition: transform 0.3s var(--ease-luxury), background-color 0.3s ease, box-shadow 0.3s ease;
}

.music-toggle:hover {
  transform: translateY(-2px);
  background: var(--ivory-pure);
  box-shadow: 0 10px 26px rgba(25, 30, 22, 0.22);
}

.music-toggle:active {
  transform: scale(0.96);
}

.music-icon svg {
  width: 15px;
  height: 15px;
  color: var(--gold-antique);
  display: block;
}

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

.music-waves span {
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: var(--gold-antique);
  transition: height 0.25s ease;
}

.music-toggle.is-playing {
  background: rgba(88, 106, 80, 0.92);
  color: var(--ivory-pure);
  border-color: rgba(239, 224, 185, 0.65);
}

.music-toggle.is-playing .music-icon svg {
  color: var(--gold-light);
}

.music-toggle.is-playing .music-waves span {
  background: var(--gold-light);
  animation: waveBar 0.9s ease-in-out infinite;
}

.music-toggle.is-playing .music-waves span:nth-child(2) {
  animation-delay: 0.2s;
}

.music-toggle.is-playing .music-waves span:nth-child(3) {
  animation-delay: 0.4s;
}

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

/* ==========================================================================
   OPENING SCREEN — SAGE EMBOSSED ENVELOPE & WAX SEAL
   ========================================================================== */
.envelope-screen {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-max-width);
  height: 100dvh;
  z-index: 50;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #687b5f 0%, #4d5e46 62%, #394833 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--ease-luxury), visibility 0.8s ease;
}

.envelope-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope-ambient-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 48%, rgba(255, 240, 200, 0.18) 0%, transparent 55%);
  pointer-events: none;
  z-index: 6;
}

.envelope-stage {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Inner Rising Ivory Card Preview */
.envelope-inner-card {
  position: absolute;
  width: calc(100% - 44px);
  max-width: 390px;
  height: 62%;
  bottom: 16%;
  left: 50%;
  transform: translate(-50%, 30px) scale(0.94);
  background: linear-gradient(175deg, #fffdf9 0%, #f6efe0 100%);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 18px 45px rgba(24, 30, 21, 0.32);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

.inner-card-border {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(200, 164, 93, 0.55);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
}

.inner-eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.inner-names {
  font-family: var(--font-script);
  font-size: clamp(2.4rem, 9vw, 3.1rem);
  font-weight: 400;
  color: var(--ink-primary);
  line-height: 1.15;
}

.inner-names .amp {
  display: block;
  font-size: 1.5rem;
  color: var(--gold-antique);
  margin: 2px 0;
}

.inner-divider {
  width: 180px;
  margin: 14px auto;
}

.inner-sub {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--ink-secondary);
}

.inner-date {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--gold-bronze);
  text-transform: uppercase;
}

/* Lower Pocket */
.envelope-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36%;
  background: linear-gradient(180deg, rgba(61, 77, 55, 0) 0%, rgba(44, 56, 39, 0.55) 100%);
  z-index: 3;
  pointer-events: none;
}

/* Embossed Sage Gatefold Doors */
.envelope-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.4%;
  background:
    radial-gradient(circle at 50% 45%, rgba(126, 146, 114, 0.25), rgba(45, 58, 40, 0.35)),
    linear-gradient(135deg, #617458 0%, #52644a 55%, #46573f 100%);
  z-index: 4;
  overflow: hidden;
  will-change: transform;
  box-shadow: inset 0 0 40px rgba(25, 34, 21, 0.35);
}

.envelope-door-left {
  left: 0;
  transform-origin: left center;
  border-right: 1px solid rgba(35, 45, 31, 0.6);
}

.envelope-door-right {
  right: 0;
  transform-origin: right center;
  border-left: 1px solid rgba(154, 174, 143, 0.25);
}

.emboss-layer {
  position: absolute;
  inset: 0;
  background-image: url("assets/sage-emboss-pattern.svg");
  background-size: 220px 220px;
  opacity: 0.9;
  pointer-events: none;
}

.door-highlight {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%, rgba(0, 0, 0, 0.12) 100%);
  pointer-events: none;
}

/* Top Triangular Envelope Flap */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46%;
  z-index: 5;
  transform-origin: top center;
  filter: drop-shadow(0 12px 22px rgba(20, 28, 17, 0.38));
  will-change: transform;
  pointer-events: none;
}

.flap-surface {
  position: relative;
  width: 100%;
  height: 100%;
  clip-path: polygon(0 0, 100% 0, 50% 94%);
  background: linear-gradient(180deg, #5d7054 0%, #4c5d44 85%, #42523b 100%);
  overflow: hidden;
}

.flap-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 65%);
}

/* Vertical Velvet/Silk Cord Ribbon */
.envelope-ribbon-vertical {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 8px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    #232d1f 0%,
    #3d4f37 45%,
    #53674b 55%,
    #1f281c 100%
  );
  box-shadow: 0 0 12px rgba(15, 20, 13, 0.45);
  z-index: 6;
}

/* Envelope Texts */
.envelope-header-text {
  position: relative;
  z-index: 8;
  margin-bottom: 18px;
  text-align: center;
  padding: 0 24px;
}

.envelope-cordial {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 3.3vw, 1rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #f6ecd7;
  text-shadow: 0 2px 10px rgba(20, 28, 18, 0.55);
}

.envelope-footer-text {
  position: relative;
  z-index: 8;
  margin-top: 22px;
  text-align: center;
  padding: 0 24px;
}

.envelope-hint {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: #f3e6cb;
  text-shadow: 0 2px 8px rgba(18, 24, 15, 0.6);
  animation: gentleFloat 2.8s ease-in-out infinite;
}

/* Ornamental Golden Wax Seal */
.wax-seal-btn {
  position: relative;
  z-index: 9;
  width: 148px;
  height: 148px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform 0.35s var(--ease-luxury);
}

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

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

.seal-halo {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 217, 162, 0.42) 0%, transparent 70%);
  animation: sealPulse 2.6s ease-in-out infinite;
  pointer-events: none;
}

.seal-scallop {
  position: relative;
  width: 146px;
  height: 146px;
  filter: drop-shadow(0 12px 24px rgba(18, 24, 15, 0.5));
}

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

.seal-text-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 14px;
  pointer-events: none;
}

.seal-tap-title {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #5c461a;
}

.seal-monogram {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1rem;
  color: #7c5f24;
}

@keyframes sealPulse {
  0%, 100% { transform: scale(0.96); opacity: 0.65; }
  50% { transform: scale(1.1); opacity: 1; }
}

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

/* ==========================================================================
   REVEAL CURTAINS (Pleated Champagne Silk)
   ========================================================================== */
.reveal-curtains {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-max-width);
  height: 100dvh;
  z-index: 45;
  pointer-events: none;
  display: flex;
  opacity: 0;
  visibility: hidden;
}

.reveal-curtains.is-active {
  opacity: 1;
  visibility: visible;
}

.curtain-panel {
  width: 50%;
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      #ece0c8 0px,
      #decdae 14px,
      #f8f1e2 28px,
      #d6c19d 42px
    );
  box-shadow: inset 0 0 50px rgba(105, 84, 46, 0.25);
  will-change: transform;
}

.curtain-left {
  border-right: 1px solid rgba(180, 145, 79, 0.35);
}

.curtain-right {
  border-left: 1px solid rgba(180, 145, 79, 0.35);
}

/* ==========================================================================
   MAIN INVITATION & SHARED CARD ARCHITECTURE
   ========================================================================== */
.invitation-main {
  position: relative;
  padding-bottom: 92px;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.invitation-main.is-visible {
  opacity: 1;
}

.invite-page {
  padding: 16px 14px;
  scroll-margin-top: 10px;
}

.invite-page.page-intro {
  padding: 0 0 16px;
}

.card-paper {
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.7), transparent 60%),
    linear-gradient(180deg, var(--ivory-pure) 0%, var(--ivory-card) 55%, var(--ivory-warm) 100%);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  border: 1px solid rgba(200, 164, 93, 0.28);
}

/* Cotton-paper subtle texture */
.card-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(133, 99, 36, 0.035) 1px, transparent 0);
  background-size: 16px 16px;
  pointer-events: none;
  z-index: 1;
}

.ornate-card {
  padding: 18px;
}

.ornate-inner-border {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(200, 164, 93, 0.5);
  border-radius: 18px;
  padding: 36px 22px 32px;
  text-align: center;
  background: rgba(255, 253, 248, 0.42);
}

.ornate-inner-border::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(200, 164, 93, 0.24);
  border-radius: 13px;
  pointer-events: none;
}

/* Floral Corner Ornaments */
.corner-ornament {
  position: absolute;
  width: 78px;
  height: 78px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.9;
}

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

/* Common Section Typography */
.section-eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage-base);
  margin-bottom: 6px;
}

.section-script-title {
  font-family: var(--font-script);
  font-size: clamp(2.35rem, 9vw, 3rem);
  font-weight: 400;
  color: var(--ink-primary);
  line-height: 1.15;
  margin-bottom: 10px;
}

.floral-divider {
  width: min(230px, 75%);
  margin: 14px auto;
}

.botanical-crest {
  width: 175px;
  margin: 0 auto 12px;
}

.floating-slow {
  animation: gentleFloat 4.2s ease-in-out infinite;
}

/* Reveal-on-scroll states (graceful fallback without GSAP) */
.reveal-item {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease-luxury), transform 0.75s var(--ease-luxury);
}

.reveal-item.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Page-Turn Highlight when navigating via controls */
.invite-page.is-page-turning .card-paper {
  animation: pageTurnGlow 0.75s var(--ease-luxury);
}

@keyframes pageTurnGlow {
  0% { transform: perspective(1000px) rotateY(-4deg) scale(0.985); }
  100% { transform: perspective(1000px) rotateY(0deg) scale(1); }
}

/* ==========================================================================
   PAGE 1 — COURTYARD ARCH INTRODUCTION
   ========================================================================== */
.page-intro-card {
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  border-top: none;
  min-height: min(94dvh, 840px);
  background: var(--ivory-card);
}

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

.courtyard-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

.courtyard-top-fade {
  position: absolute;
  top: 20%;
  bottom: 24%;
  left: 0;
  right: 0;
  background: radial-gradient(
    ellipse at 50% 48%,
    rgba(247, 243, 232, 0.85) 35%,
    rgba(247, 243, 232, 0) 85%
  );
}

.ornate-arch-frame {
  position: relative;
  z-index: 4;
  min-height: min(94dvh, 840px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(122px, 19vh, 165px) 24px clamp(180px, 26vh, 230px);
}

.intro-content {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.intro-crest-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  color: var(--sage-base);
}

.intro-crest-heart svg {
  width: 16px;
  height: 16px;
  fill: var(--sage-base);
}

.intro-overline {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-secondary);
  letter-spacing: 0.04em;
}

.intro-families {
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bronze);
  margin: 6px 0 12px;
}

.couple-lockup {
  margin: 4px 0;
}

.couple-name {
  font-family: var(--font-script);
  font-size: clamp(2.85rem, 11vw, 3.55rem);
  font-weight: 400;
  color: var(--ink-primary);
  line-height: 1.04;
}

.parents-line {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.couple-ampersand {
  font-family: var(--font-script);
  font-size: 1.85rem;
  color: var(--gold-antique);
  margin: 2px 0;
  line-height: 1;
}

.intro-request {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  color: var(--ink-secondary);
  line-height: 1.45;
  margin-bottom: 14px;
}

.intro-key-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.key-detail-pill {
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(200, 164, 93, 0.36);
  backdrop-filter: blur(4px);
}

.detail-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sage-base);
}

.detail-value {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink-primary);
}

.scroll-cue {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid rgba(88, 106, 80, 0.35);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, 0.88);
  color: var(--sage-deep);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.scroll-cue svg {
  width: 14px;
  height: 14px;
  animation: gentleFloat 1.8s ease-in-out infinite;
}

.scroll-cue:hover {
  background: var(--ivory-pure);
  transform: translateY(1px);
}

/* ==========================================================================
   PAGE 2 — WEDDING MESSAGE
   ========================================================================== */
.wedding-message-body {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink-primary);
  margin: 10px auto 16px;
  max-width: 340px;
}

.wedding-message-blessing {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink-secondary);
  max-width: 320px;
  margin: 0 auto 18px;
}

.message-signature {
  font-family: var(--font-script);
  font-size: 2rem;
  color: var(--gold-bronze);
}

/* ==========================================================================
   PAGE 3 — SAVE THE DATE & SCRATCH HEART & COUNTDOWN
   ========================================================================== */
.scratch-card-wrap {
  margin: 10px auto 18px;
}

.scratch-instruction {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.scratch-heart-stage {
  position: relative;
  width: 240px;
  height: 220px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 12px 24px rgba(61, 77, 55, 0.18));
}

.scratch-revealed-content {
  position: absolute;
  inset: 8px;
  background: radial-gradient(circle at 50% 42%, #fffdf8 0%, #f5ecda 100%);
  border: 2px solid var(--gold-champagne);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* Heart mask via SVG data URI */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 220'%3E%3Cpath d='M120 208 C120 208 16 144 16 74 C16 36 46 12 78 12 C99 12 113 24 120 38 C127 24 141 12 162 12 C194 12 224 36 224 74 C224 144 120 208 120 208 Z' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 220'%3E%3Cpath d='M120 208 C120 208 16 144 16 74 C16 36 46 12 78 12 C99 12 113 24 120 38 C127 24 141 12 162 12 C194 12 224 36 224 74 C224 144 120 208 120 208 Z' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.revealed-kicker {
  font-family: var(--font-script);
  font-size: 1.45rem;
  color: var(--sage-base);
}

.revealed-date {
  font-family: var(--font-display);
  font-size: 0.96rem;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
  margin: 4px 0;
}

.revealed-day-time {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--gold-bronze);
}

.scratch-canvas {
  position: relative;
  z-index: 2;
  width: 240px;
  height: 220px;
  touch-action: none;
  cursor: grab;
  transition: opacity 0.6s ease;
}

.scratch-canvas:active {
  cursor: grabbing;
}

.scratch-canvas.is-cleared {
  opacity: 0;
  pointer-events: none;
}

.save-date-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 8px;
}

.date-meta-item {
  padding: 12px 6px;
  border-radius: 14px;
  background: var(--ivory-pure);
  border: 1px solid rgba(200, 164, 93, 0.35);
}

.date-meta-item svg {
  width: 17px;
  height: 17px;
  color: var(--sage-base);
  margin: 0 auto 6px;
}

.meta-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.meta-val {
  display: block;
  margin-top: 2px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-primary);
}

/* Countdown Timer */
.countdown-heading {
  font-family: var(--font-script);
  font-size: 1.85rem;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.countdown-box {
  background: linear-gradient(180deg, #fffdf9 0%, #f4ebd8 100%);
  border: 1px solid rgba(200, 164, 93, 0.45);
  border-radius: 14px;
  padding: 12px 4px;
  box-shadow: 0 6px 16px rgba(133, 99, 36, 0.08);
}

.countdown-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  font-weight: 600;
  color: var(--sage-deep);
  line-height: 1.1;
}

.countdown-unit {
  display: block;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bronze);
}

.countdown-grid[hidden],
.countdown-celebration[hidden] {
  display: none;
}

.countdown-celebration {
  margin-bottom: 20px;
  padding: 18px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf9 0%, #f4ebd8 100%);
  border: 1px solid rgba(200, 164, 93, 0.55);
  box-shadow: 0 8px 22px rgba(133, 99, 36, 0.1);
}

.celebration-title {
  display: block;
  font-family: var(--font-script);
  font-size: clamp(2rem, 8vw, 2.5rem);
  color: var(--sage-deep);
  line-height: 1.15;
}

.celebration-sub {
  display: block;
  margin-top: 6px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.96rem;
  color: var(--ink-secondary);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-luxury-primary,
.btn-luxury-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease-luxury), box-shadow 0.3s ease, background-color 0.3s ease;
}

.btn-luxury-primary {
  width: 100%;
  border: 1px solid rgba(239, 224, 185, 0.5);
  background: linear-gradient(135deg, var(--sage-base) 0%, var(--sage-deep) 100%);
  color: var(--ivory-pure);
  box-shadow: 0 10px 24px rgba(61, 77, 55, 0.28);
}

.btn-luxury-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(61, 77, 55, 0.36);
}

.btn-luxury-primary:active {
  transform: scale(0.98);
}

.btn-luxury-outline {
  border: 1px solid rgba(171, 132, 56, 0.65);
  background: rgba(255, 253, 248, 0.85);
  color: var(--gold-bronze);
}

.btn-luxury-outline:hover {
  transform: translateY(-2px);
  background: var(--ivory-pure);
  box-shadow: var(--shadow-gold);
}

.btn-luxury-primary svg,
.btn-luxury-outline svg {
  width: 15px;
  height: 15px;
}

.btn-subtle-link {
  border: none;
  background: transparent;
  color: var(--sage-base);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 6px 10px;
}

/* ==========================================================================
   PAGE 4 — RSVP FORM & CONFIRMATION
   ========================================================================== */
.rsvp-envelope-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--sage-tint);
  border: 1px solid rgba(88, 106, 80, 0.25);
  display: grid;
  place-items: center;
  color: var(--sage-base);
}

.rsvp-envelope-icon svg {
  width: 20px;
  height: 20px;
}

.rsvp-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.96rem;
  color: var(--ink-muted);
  margin-bottom: 20px;
}

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

.form-group label,
.group-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sage-deep);
  margin-bottom: 6px;
}

.rsvp-form input[type="text"],
.rsvp-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(200, 164, 93, 0.45);
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.rsvp-form input[type="text"]:focus,
.rsvp-form textarea:focus {
  outline: none;
  border-color: var(--sage-base);
  box-shadow: 0 0 0 3px rgba(88, 106, 80, 0.14);
}

.guest-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(200, 164, 93, 0.45);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.9);
  padding: 4px;
}

.stepper-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(200, 164, 93, 0.35);
  background: var(--ivory-card);
  color: var(--ink-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.stepper-btn:hover {
  background: var(--sage-tint);
}

.stepper-btn svg {
  width: 16px;
  height: 16px;
}

.guest-stepper input[type="number"] {
  width: 60px;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.attendance-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.attendance-card {
  cursor: pointer;
  position: relative;
}

.attendance-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.attendance-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid rgba(200, 164, 93, 0.4);
  background: rgba(255, 253, 248, 0.85);
  transition: all 0.25s var(--ease-luxury);
}

.attendance-box svg {
  width: 18px;
  height: 18px;
  color: var(--gold-antique);
  margin-bottom: 6px;
}

.attendance-box strong {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-primary);
}

.attendance-box small {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.attendance-card input:checked + .attendance-box {
  background: var(--sage-tint);
  border-color: var(--sage-base);
  box-shadow: 0 8px 20px rgba(88, 106, 80, 0.16);
}

.form-error {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: #9e3232;
  background: #fdf0f0;
  border: 1px solid #ecc6c6;
  border-radius: 10px;
  padding: 8px 12px;
}

/* RSVP Confirmation Animation */
.rsvp-confirmation {
  padding: 20px 10px;
  animation: fadeScaleIn 0.6s var(--ease-luxury);
}

.confirm-seal-anim {
  position: relative;
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage-base), var(--sage-deep));
  color: var(--ivory-pure);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 26px rgba(61, 77, 55, 0.3);
}

.confirm-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-champagne);
  animation: sealPulse 2.2s ease-in-out infinite;
}

.confirm-seal-anim svg {
  width: 30px;
  height: 30px;
}

.confirm-title {
  font-family: var(--font-script);
  font-size: 2.3rem;
  font-weight: 400;
  color: var(--ink-primary);
}

.confirm-text {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--ink-secondary);
  margin: 8px auto 18px;
  max-width: 300px;
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   PAGE 5 — WEDDING EVENTS TIMELINE
   ========================================================================== */
.events-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink-muted);
}

.events-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
  text-align: left;
}

.event-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(160deg, #fffdf9 0%, #f6eedf 100%);
  border: 1px solid rgba(200, 164, 93, 0.42);
  box-shadow: 0 8px 20px rgba(46, 41, 35, 0.05);
  transition: transform 0.3s var(--ease-luxury), box-shadow 0.3s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(133, 99, 36, 0.12);
}

.event-floral-badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--sage-tint);
  border: 1px solid rgba(200, 164, 93, 0.4);
  display: grid;
  place-items: center;
  padding: 7px;
}

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

.event-info {
  flex: 1;
  min-width: 0;
}

.event-title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
  margin-bottom: 4px;
}

.event-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  color: var(--sage-deep);
  font-weight: 500;
  margin-bottom: 5px;
}

.event-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.event-venue-line {
  font-family: var(--font-serif);
  font-size: 0.94rem;
  color: var(--ink-secondary);
}

.event-attire {
  margin-top: 5px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.84rem;
  color: var(--gold-bronze);
}

/* ==========================================================================
   PAGE 6 — VENUE & LOCATION
   ========================================================================== */
.venue-pin-badge {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--sage-tint);
  border: 1px solid rgba(200, 164, 93, 0.4);
  display: grid;
  place-items: center;
  color: var(--sage-base);
}

.venue-details-card {
  padding: 16px;
  margin: 10px 0 16px;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.85);
  border: 1px solid rgba(200, 164, 93, 0.35);
}

.venue-name {
  font-family: var(--font-display);
  font-size: 1.06rem;
  letter-spacing: 0.08em;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.venue-address {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  color: var(--ink-secondary);
}

.venue-note {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--sage-base);
}

.map-frame-wrap {
  width: 100%;
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(200, 164, 93, 0.5);
  background: var(--ivory-warm);
  margin-bottom: 16px;
  box-shadow: 0 8px 22px rgba(46, 41, 35, 0.08);
}

.map-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.venue-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   PAGE 7 — CLOSING PAGE
   ========================================================================== */
.closing-border {
  padding: 44px 24px 38px;
  border: 1.5px solid rgba(200, 164, 93, 0.65);
}

.closing-headline {
  font-family: var(--font-script);
  font-size: clamp(2.25rem, 8.5vw, 2.85rem);
  font-weight: 400;
  color: var(--ink-primary);
  line-height: 1.22;
  margin: 10px 0;
}

.closing-names {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage-deep);
}

.closing-names .amp {
  color: var(--gold-antique);
  margin: 0 8px;
}

.closing-date-tag {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-muted);
}

.closing-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   FLOATING BOTTOM PAGE NAVIGATION
   ========================================================================== */
.floating-nav {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translate(-50%, 90px);
  width: min(calc(100% - 24px), calc(var(--shell-max-width) - 24px));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(200, 164, 93, 0.48);
  box-shadow: 0 12px 32px rgba(25, 30, 22, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.6s var(--ease-luxury), opacity 0.6s ease;
}

.floating-nav.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.nav-arrow-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(200, 164, 93, 0.35);
  background: var(--ivory-card);
  color: var(--ink-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-arrow-btn:hover {
  background: var(--sage-tint);
}

.nav-arrow-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.nav-arrow-btn svg {
  width: 16px;
  height: 16px;
}

.nav-dots-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  background: rgba(133, 99, 36, 0.28);
  cursor: pointer;
  padding: 0;
  transition: width 0.3s var(--ease-luxury), background-color 0.3s ease;
}

.nav-dot.is-active {
  width: 22px;
  background: var(--sage-base);
}

.nav-current-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-secondary);
  min-width: 34px;
  text-align: center;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-msg {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translate(-50%, -14px);
  z-index: 90;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(46, 41, 35, 0.92);
  color: var(--ivory-pure);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-luxury);
}

.toast-msg.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   PAGE 6 — INVITED BY
   ========================================================================== */
.invited-by-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px auto 6px;
  max-width: 340px;
}

.invited-by-item {
  position: relative;
  padding: 11px 16px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 253, 249, 0.94) 0%, rgba(246, 238, 223, 0.72) 100%);
  border: 1px solid rgba(200, 164, 93, 0.36);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.38;
  box-shadow: 0 5px 14px rgba(46, 41, 35, 0.04);
}

/* Reduced Motion Respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
