/* ═══════════════════════════════════════════════════════════
   Mix & Spoy Wedding — Ultimate Luxury Styles
   ═══════════════════════════════════════════════════════════ */

:root {
  --rose: #B76E79;
  --rose-deep: #8B4557;
  --rose-light: #C98A93;
  --gold: #D4A574;
  --gold-light: #E8C9A0;
  --gold-border: rgba(212, 165, 116, 0.35);
  --blush: #F5E6E0;
  --cream: #FFF8F0;
  --white: #FFFFFF;
  --dark: #2C1810;
  --text: #5C3D2E;
  --text-light: #8B6F60;
  --font-thai: 'Prompt', 'Kanit', sans-serif;
  --font-script: 'Great Vibes', cursive;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-blessing: 'Kanit', 'Prompt', sans-serif;
  --section-pad: clamp(4rem, 10vw, 8rem);
  --container: 1100px;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.34, 1.56, 0.64, 1);
  --speed: 0.5s;
}

/* ─── Selection & Scrollbar ─── */
::selection { background: rgba(183,110,121,0.2); color: var(--dark); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--rose), var(--gold)); border-radius: 3px; }

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-thai); font-weight: 300;
  color: var(--dark); background: var(--cream);
  line-height: 1.8; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; height: 100vh; height: 100dvh; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── Animated Background Gradient (global) ─── */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 600px 600px at 15% 30%, rgba(183,110,121,0.06) 0%, transparent 100%),
    radial-gradient(ellipse 500px 500px at 85% 20%, rgba(212,165,116,0.06) 0%, transparent 100%),
    radial-gradient(ellipse 700px 700px at 50% 80%, rgba(245,230,224,0.1) 0%, transparent 100%);
  animation: bgDrift 25s ease-in-out infinite alternate;
}
/* ─── Subtle golden wedding frame ─── */
body::after {
  content: ''; position: fixed; inset: 6px; z-index: 9990; pointer-events: none;
  border: 1px solid rgba(212,165,116,0.1);
  border-radius: 4px;
}
@keyframes bgDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-3%, 2%) scale(1.04); }
  100% { transform: translate(3%, -2%) scale(1.02); }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .envelope-overlay { display: none !important; }
  body.no-scroll { overflow: auto; height: auto; }
  .animate-on-scroll { opacity: 1 !important; transform: none !important; }
  canvas { display: none !important; }
  .bg-petal, .hero__orb { display: none !important; }
}

/* ─── Scroll Animations ─── */
.animate-on-scroll { opacity: 0; transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.animate-on-scroll[data-animation="fade-up"] { transform: translateY(50px); }
.animate-on-scroll[data-animation="fade-scale"] { transform: scale(0.85); }
.animate-on-scroll[data-animation="flip-up"] { transform: perspective(800px) rotateX(25deg) translateY(50px); }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0) scale(1) rotateX(0deg); }

/* ═══════════════════════════════════════════════════════════
   SPARKLE CANVAS
   ═══════════════════════════════════════════════════════════ */
#sparkleCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9997;
}

/* ═══════════════════════════════════════════════════════════
   ENVELOPE OVERLAY
   ═══════════════════════════════════════════════════════════ */
.envelope-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(183,110,121,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(212,165,116,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(245,230,224,0.7) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 0%, rgba(212,165,116,0.04) 0%, transparent 40%),
    linear-gradient(160deg, #FFF8F0 0%, #F7E4DB 30%, var(--blush) 50%, #F2DDD5 70%, #EDD3CC 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.2s var(--ease), visibility 1.2s ease;
}
.envelope-overlay.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

#confettiCanvas, #flowerGardenCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#confettiCanvas { z-index: 4; }
#flowerGardenCanvas { z-index: 1; }

/* ─── Envelope Watercolor Bouquets ─── */
.env-bouquet { position: absolute; pointer-events: none; z-index: 3; }
.env-bouquet svg { width: 100%; height: auto; display: block; }
.env-bouquet--tl { top: -15px; left: -15px; width: clamp(160px, 30vw, 340px); }
.env-bouquet--tr { top: -15px; right: -15px; width: clamp(150px, 28vw, 310px); }
.env-bouquet--bl { bottom: -15px; left: -15px; width: clamp(140px, 26vw, 280px); }
.env-bouquet--br { bottom: -15px; right: -15px; width: clamp(140px, 26vw, 280px); }
.env-bouquet--bc { bottom: 0; left: 50%; transform: translateX(-50%); width: clamp(400px, 80vw, 800px); }
.env-bouquet--tc { top: 0; left: 50%; transform: translateX(-50%); width: clamp(400px, 80vw, 800px); }
/* Gentle fade-in for the bouquets */
.env-bouquet { animation: envBouquetIn 2s ease-out both; }
.env-bouquet--tl { animation-delay: 0.1s; }
.env-bouquet--tr { animation-delay: 0.3s; }
.env-bouquet--bl { animation-delay: 0.5s; }
.env-bouquet--br { animation-delay: 0.7s; }
.env-bouquet--bc { animation-delay: 0.4s; }
.env-bouquet--tc { animation-delay: 0.2s; }
@keyframes envBouquetIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
@keyframes envBouquetIn { from { opacity: 0; } to { opacity: 1; } }
.env-bouquet--bc { animation-name: envBouquetBcIn; }
.env-bouquet--tc { animation-name: envBouquetTcIn; }
@keyframes envBouquetBcIn { from { opacity: 0; transform: translateX(-50%) scale(0.85); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes envBouquetTcIn { from { opacity: 0; transform: translateX(-50%) scale(0.85); } to { opacity: 1; transform: translateX(-50%) scale(1); } }

/* ─── Dense CSS Petals (16) ─── */
.envelope-bg-petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.bg-petal {
  position: absolute; border-radius: 50% 0 50% 50%; opacity: 0;
  animation: floatPetal linear infinite;
  box-shadow: 0 0 8px rgba(183,110,121,0.1);
}
.bg-petal--1  { left: 5%;  width: 22px; height: 30px; background: rgba(183,110,121,0.18); animation-duration: 10s; animation-delay: 0s; }
.bg-petal--2  { left: 15%; width: 16px; height: 22px; background: rgba(212,165,116,0.16); animation-duration: 13s; animation-delay: 1s; }
.bg-petal--3  { left: 25%; width: 26px; height: 35px; background: rgba(183,110,121,0.14); animation-duration: 9s;  animation-delay: 2s; }
.bg-petal--4  { left: 35%; width: 18px; height: 24px; background: rgba(201,138,147,0.2);  animation-duration: 12s; animation-delay: 0.5s; }
.bg-petal--5  { left: 45%; width: 20px; height: 28px; background: rgba(212,165,116,0.14); animation-duration: 11s; animation-delay: 3s; }
.bg-petal--6  { left: 55%; width: 14px; height: 20px; background: rgba(183,110,121,0.16); animation-duration: 14s; animation-delay: 1.5s; }
.bg-petal--7  { left: 65%; width: 24px; height: 32px; background: rgba(232,201,160,0.18); animation-duration: 10s; animation-delay: 4s; }
.bg-petal--8  { left: 75%; width: 18px; height: 26px; background: rgba(183,110,121,0.12); animation-duration: 15s; animation-delay: 2.5s; }
.bg-petal--9  { left: 85%; width: 20px; height: 28px; background: rgba(201,138,147,0.16); animation-duration: 11s; animation-delay: 5s; }
.bg-petal--10 { left: 92%; width: 16px; height: 22px; background: rgba(212,165,116,0.14); animation-duration: 13s; animation-delay: 0.8s; }
.bg-petal--11 { left: 8%;  width: 14px; height: 18px; background: rgba(183,110,121,0.2);  animation-duration: 16s; animation-delay: 6s; }
.bg-petal--12 { left: 20%; width: 20px; height: 26px; background: rgba(245,230,224,0.25); animation-duration: 12s; animation-delay: 3.5s; }
.bg-petal--13 { left: 40%; width: 24px; height: 30px; background: rgba(183,110,121,0.1);  animation-duration: 9s;  animation-delay: 7s; }
.bg-petal--14 { left: 60%; width: 16px; height: 22px; background: rgba(201,138,147,0.18); animation-duration: 14s; animation-delay: 4.5s; }
.bg-petal--15 { left: 70%; width: 22px; height: 28px; background: rgba(232,201,160,0.16); animation-duration: 11s; animation-delay: 1.2s; }
.bg-petal--16 { left: 88%; width: 18px; height: 24px; background: rgba(183,110,121,0.14); animation-duration: 10s; animation-delay: 5.5s; }

@keyframes floatPetal {
  0%   { transform: translateY(110vh) rotate(0deg) scale(0.8); opacity: 0; }
  8%   { opacity: 1; }
  50%  { transform: translateY(50vh) rotate(180deg) translateX(30px) scale(1); }
  92%  { opacity: 0.8; }
  100% { transform: translateY(-10vh) rotate(400deg) translateX(-20px) scale(0.6); opacity: 0; }
}

.envelope-content { display: flex; flex-direction: column; align-items: center; gap: 2rem; z-index: 5; padding: 1rem; }

.envelope-pretext {
  font-family: var(--font-thai); font-weight: 300;
  font-size: clamp(0.95rem, 2.8vw, 1.2rem);
  color: var(--text); letter-spacing: 0.12em; text-align: center;
  animation: fadeInDown 1s ease 0.3s both;
  text-shadow: 0 1px 4px rgba(255,255,255,0.5);
}

/* ─── Floral Wreath ─── */
.envelope-wreath { position: relative; animation: fadeInUp 1s ease 0.6s both; }
.envelope-wreath__svg {
  position: absolute; inset: -40px -50px; width: calc(100% + 100px); height: calc(100% + 80px);
  pointer-events: none; z-index: 0;
  animation: wreathBreath 6s ease-in-out infinite;
}
@keyframes wreathBreath {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.03); opacity: 1; }
}

/* ─── Envelope 3D ─── */
.envelope-wrapper { position: relative; z-index: 1; perspective: 1000px; }
.envelope {
  position: relative;
  width: clamp(260px, 65vw, 340px); height: clamp(170px, 42vw, 225px);
  transform-style: preserve-3d;
  filter: drop-shadow(0 8px 30px rgba(160,120,80,0.25));
}
.envelope__back {
  position: absolute; inset: 0;
  background: linear-gradient(145deg, var(--gold), #C49A6C, var(--gold-light));
  border-radius: 10px; z-index: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.envelope__front {
  position: absolute; bottom: 0; left: 0; right: 0; height: 60%;
  background: linear-gradient(160deg, var(--gold-light), var(--gold), #C49A6C);
  border-radius: 0 0 10px 10px; z-index: 3;
  clip-path: polygon(0 40%, 50% 0, 100% 40%, 100% 100%, 0 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 12%;
}
.envelope__front-names {
  font-family: var(--font-script); font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  color: var(--rose-deep); opacity: 0.7;
  text-shadow: 0 1px 2px rgba(255,255,255,0.4);
}
.envelope__flap {
  position: absolute; top: 0; left: 0; right: 0; height: 65%;
  background: linear-gradient(180deg, #B8904C, var(--gold), var(--gold-light));
  border-radius: 10px 10px 0 0; z-index: 4;
  transform-origin: top center; transform: rotateX(0deg);
  transition: transform 0.9s var(--ease);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  display: flex; align-items: center; justify-content: center; padding-bottom: 22%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.envelope.is-open .envelope__flap { transform: rotateX(-180deg); z-index: 0; }
.envelope__seal { transition: opacity 0.3s ease; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15)); }
.envelope.is-open .envelope__seal { opacity: 0; }
.envelope__letter {
  position: absolute; left: 8%; right: 8%; bottom: 8%; height: 82%;
  background: var(--white); border-radius: 8px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  transform: translateY(0); transition: transform 0.9s var(--ease-out) 0.5s;
}
.envelope.is-open .envelope__letter { transform: translateY(-125%); }
.envelope__letter-content { text-align: center; padding: 1.2rem; opacity: 0; transition: opacity 0.6s ease 1s; }
.envelope.is-open .envelope__letter-content { opacity: 1; }
.letter-ornament { margin: 0.3rem 0; opacity: 0.6; }
.letter-names { font-family: var(--font-script); font-size: clamp(1.6rem, 5vw, 2.4rem); color: var(--rose); display: block; line-height: 1.15; }
.letter-heart { display: block; margin: 0.15rem 0; animation: heartbeat 1.8s ease-in-out infinite; }
.letter-date { font-family: var(--font-serif); font-weight: 400; font-size: clamp(0.7rem, 1.8vw, 0.85rem); color: var(--gold); margin-top: 0.2rem; letter-spacing: 0.2em; }

/* ─── Envelope Button ─── */
.envelope-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 2.4rem;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: var(--white); font-family: var(--font-thai); font-size: clamp(0.88rem, 2.5vw, 1rem); font-weight: 400;
  border-radius: 50px; letter-spacing: 0.08em;
  box-shadow: 0 4px 30px rgba(183,110,121,0.4);
  transition: all var(--speed) var(--ease);
  animation: fadeInUp 1s ease 0.9s both, pulseSoft 3s ease-in-out 2.5s infinite;
  position: relative; overflow: hidden;
}
.envelope-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0.7s ease;
}
.envelope-btn:hover::before { transform: translateX(100%); }
.envelope-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 40px rgba(183,110,121,0.5); }
.envelope-btn.is-hidden { opacity: 0; pointer-events: none; transform: scale(0.8); }

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */
.hero {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(212,165,116,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 85%, rgba(183,110,121,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(245,230,224,0.4) 0%, transparent 60%),
    linear-gradient(180deg, var(--cream) 0%, #F7E4DB 30%, var(--blush) 55%, #F7E4DB 80%, var(--cream) 100%);
  padding: 5rem 1.5rem 3rem; overflow: visible;
}

#petalCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: hidden; }

/* ─── Animated gradient orbs ─── */
.hero__gradient-orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.hero__orb {
  position: absolute; border-radius: 50%; filter: blur(80px);
}
.hero__orb--1 {
  width: 400px; height: 400px; top: -10%; left: -5%;
  background: radial-gradient(circle, rgba(183,110,121,0.12) 0%, transparent 70%);
  animation: orbFloat1 18s ease-in-out infinite;
}
.hero__orb--2 {
  width: 350px; height: 350px; bottom: 10%; right: -5%;
  background: radial-gradient(circle, rgba(212,165,116,0.1) 0%, transparent 70%);
  animation: orbFloat2 22s ease-in-out infinite;
}
.hero__orb--3 {
  width: 300px; height: 300px; top: 40%; left: 40%;
  background: radial-gradient(circle, rgba(245,230,224,0.15) 0%, transparent 70%);
  animation: orbFloat3 15s ease-in-out infinite;
}
@keyframes orbFloat1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(60px, 40px); } }
@keyframes orbFloat2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-50px, -30px); } }
@keyframes orbFloat3 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -50px); } }

/* ─── Watercolor Floral Corners ─── */
.floral-corner { position: absolute; width: clamp(200px, 38vw, 420px); height: auto; z-index: 10; pointer-events: none; }
.floral-corner--tl { top: -20px; left: -20px; }
.floral-corner--tr { top: -20px; right: -20px; }
.floral-corner--bl { bottom: -20px; left: -20px; }
.floral-corner--br { bottom: -20px; right: -20px; }
.floral-corner svg { width: 100%; height: auto; display: block; }

/* Section-level floral accents (smaller) */
.section-floral { position: absolute; pointer-events: none; z-index: 0; }
.section-floral--tl { top: 0; left: 0; width: clamp(100px, 20vw, 200px); }
.section-floral--tr { top: 0; right: 0; width: clamp(100px, 20vw, 200px); }
.section-floral--br { bottom: 0; right: 0; width: clamp(100px, 20vw, 200px); }
.section-floral--bl { bottom: 0; left: 0; width: clamp(100px, 20vw, 200px); }
.section-floral svg { width: 100%; height: auto; }

.hero__content { position: relative; z-index: 2; text-align: center; max-width: 700px; width: 100%; }
.hero__ornament { margin: 0.6rem auto; opacity: 0.9; }

/* ─── Names with shimmer ─── */
.hero__title { line-height: 1; }
.hero__name {
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(3.2rem, 13vw, 6rem); display: block;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 25%, var(--gold) 50%, var(--rose) 75%, var(--gold) 100%);
  background-size: 400% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: shimmerName 6s ease-in-out infinite;
  filter: drop-shadow(0 3px 12px rgba(183,110,121,0.15));
}
@keyframes shimmerName { 0%, 100% { background-position: 0% center; } 50% { background-position: 400% center; } }

.hero__ampersand {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.4rem, 5vw, 2.2rem); color: var(--gold); display: block; margin: 0.1rem 0;
}
.hero__date {
  font-family: var(--font-thai); font-weight: 200;
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  color: var(--text-light); letter-spacing: 0.25em; margin-top: 1.2rem;
}
.hero__subtitle {
  font-family: var(--font-thai); font-weight: 200; font-style: italic;
  font-size: clamp(0.82rem, 2vw, 0.95rem); color: var(--rose-light); margin-top: 0.4rem; opacity: 0.85;
}

/* ─── Hero Photo with glow ─── */
.hero__photo-frame {
  position: relative; margin: 2.5rem auto 0; max-width: 420px;
  border-radius: 20px; overflow: hidden;
  border: 2px solid var(--gold-border); aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--blush), var(--cream));
  box-shadow: 0 4px 12px rgba(183,110,121,0.06), 0 16px 50px rgba(183,110,121,0.12), 0 30px 90px rgba(212,165,116,0.08);
  transition: box-shadow 0.6s var(--ease);
}
.hero__photo-frame:hover { box-shadow: 0 4px 12px rgba(183,110,121,0.08), 0 24px 70px rgba(183,110,121,0.18), 0 50px 120px rgba(212,165,116,0.1); }
.hero__photo { width: 100%; height: 100%; object-fit: cover; transition: transform 8s ease; }
.hero__photo-frame:hover .hero__photo { transform: scale(1.04); }
.hero__photo-glow {
  position: absolute; inset: -20px; border-radius: 30px; z-index: -1;
  background: radial-gradient(ellipse, rgba(183,110,121,0.12) 0%, transparent 60%);
  animation: photoGlow 4s ease-in-out infinite;
}
@keyframes photoGlow { 0%, 100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.08); opacity: 1; } }

/* ─── Scroll Indicator ─── */
.hero__scroll-indicator {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  z-index: 2; animation: fadeIn 1s ease 1.5s both;
}
.hero__scroll-text { font-weight: 200; font-size: 0.7rem; color: var(--text-light); letter-spacing: 0.2em; opacity: 0.5; }
.hero__scroll-chevron { animation: bounce 2.5s ease-in-out infinite; color: var(--rose); opacity: 0.4; }

/* ═══════════════════════════════════════════════════════════
   SECTION DIVIDERS (ornate wedding style)
   ═══════════════════════════════════════════════════════════ */
.section-divider { max-width: 400px; margin: 0 auto; padding: 1.5rem 2rem; opacity: 0.8; }
.section-divider svg { width: 100%; height: auto; }

/* Soft petal-like shadow between sections */
.congrats, .gallery, .blessings, .closing {
  box-shadow: 0 -30px 60px -20px rgba(183,110,121,0.04);
}

/* ═══════════════════════════════════════════════════════════
   CONGRATS
   ═══════════════════════════════════════════════════════════ */
.congrats {
  position: relative; overflow: hidden;
  padding: var(--section-pad) 0; text-align: center;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(212,165,116,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(183,110,121,0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--blush) 0%, #F7E4DB 40%, var(--cream) 100%);
}
.congrats__ornament { margin-bottom: 1.2rem; }
.congrats__heading {
  font-family: var(--font-thai); font-weight: 500;
  font-size: clamp(1.6rem, 5vw, 2.6rem); color: var(--dark); margin-bottom: 0.4rem;
}
.congrats__subheading {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: clamp(0.95rem, 2.8vw, 1.2rem); color: var(--rose); margin-bottom: 2.5rem;
}
.congrats__card {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,248,240,0.98));
  border-radius: 20px; padding: clamp(2.2rem, 6vw, 3.5rem);
  max-width: 650px; margin: 0 auto;
  box-shadow: 0 4px 20px rgba(183,110,121,0.06), 0 16px 50px rgba(183,110,121,0.08);
  border-left: 3px solid var(--gold-border); text-align: left; overflow: hidden;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.congrats__card::before {
  content: '\201C'; position: absolute; top: -5px; left: 18px;
  font-family: var(--font-serif); font-size: 7rem; color: var(--gold); opacity: 0.08; line-height: 1;
}
.congrats__card-floral { position: absolute; width: 80px; height: 80px; pointer-events: none; }
.congrats__card-floral--tl { top: 0; left: 0; }
.congrats__card-floral--br { bottom: 0; right: 0; }
.congrats__message {
  font-family: var(--font-thai); font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.12rem); color: var(--dark); line-height: 2.1;
}
.congrats__message p { margin-bottom: 0.8rem; }
.congrats__message p:last-child { margin-bottom: 0; }
.congrats__message .word { display: inline; opacity: 0; transition: opacity 0.5s ease; }
.congrats__message .word.is-visible { opacity: 1; }
.congrats__signature {
  font-family: var(--font-script); font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--gold); text-align: right; margin-top: 1.5rem;
  padding-top: 1rem; border-top: 1px solid rgba(212,165,116,0.2);
}

/* ═══════════════════════════════════════════════════════════
   ♥ HEART GALLERY — THE SHOWSTOPPER ♥
   ═══════════════════════════════════════════════════════════ */
.gallery {
  position: relative; overflow: hidden;
  padding: var(--section-pad) 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(183,110,121,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(212,165,116,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(245,230,224,0.08) 0%, transparent 50%),
    linear-gradient(180deg, var(--cream) 0%, #F7E4DB 30%, var(--blush) 50%, #F7E4DB 70%, var(--cream) 100%);
}
.gallery__header { text-align: center; margin-bottom: 2.5rem; }
.gallery__heading {
  font-family: var(--font-thai); font-weight: 500;
  font-size: clamp(1.6rem, 5vw, 2.6rem); color: var(--dark); margin-bottom: 0.3rem;
}
.gallery__subheading {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: clamp(0.95rem, 2.8vw, 1.2rem); color: var(--rose);
}

.gallery__heart-wrapper {
  display: flex; justify-content: center; align-items: center;
  padding: 2rem 0; position: relative;
}

.gallery__heart {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  width: min(82vw, 680px);
  aspect-ratio: 1 / 1.08;
  clip-path: polygon(50% 16%, 61% 3%, 74% 0%, 87% 5%, 97% 17%, 100% 33%, 97% 50%, 88% 62%, 76% 74%, 63% 85%, 50% 100%, 37% 85%, 24% 74%, 12% 62%, 3% 50%, 0% 33%, 3% 17%, 13% 5%, 26% 0%, 39% 3%);
  filter:
    drop-shadow(0 4px 20px rgba(183,110,121,0.15))
    drop-shadow(0 12px 40px rgba(212,165,116,0.1));
  transform-origin: center center;
}

/* Heartbeat pulse — starts after entrance */
.gallery__heart.is-beating {
  animation: heartPulse 3s ease-in-out infinite;
}
@keyframes heartPulse {
  0%   { transform: scale(1); }
  4%   { transform: scale(1.02); }
  8%   { transform: scale(1); }
  12%  { transform: scale(1.02); }
  20%  { transform: scale(1); }
  100% { transform: scale(1); }
}

.gallery__cell {
  overflow: hidden; cursor: pointer; position: relative;
  background: var(--blush);
}
.gallery__cell img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease), filter 0.4s ease;
}
.gallery__cell:hover img {
  transform: scale(1.2);
  filter: brightness(1.1) saturate(1.1);
}

/* Gold glow ring behind heart — via pseudo on wrapper */
.gallery__heart-wrapper::before {
  content: ''; position: absolute;
  width: min(88vw, 720px); aspect-ratio: 1 / 1.08;
  background: radial-gradient(ellipse, rgba(212,165,116,0.12) 0%, transparent 55%);
  border-radius: 50%; pointer-events: none;
  animation: heartGlow 3s ease-in-out infinite;
}
@keyframes heartGlow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.05); opacity: 0.9; }
}

.gallery__hint {
  text-align: center; margin-top: 1.5rem;
  font-family: var(--font-thai); font-weight: 200; font-size: 0.85rem;
  color: var(--text-light); opacity: 0.6; letter-spacing: 0.06em;
}

/* Mobile tweaks for heart gallery */
@media (max-width: 480px) {
  .gallery__heart {
    width: 94vw;
    gap: 2px;
  }
  .floral-corner { width: clamp(140px, 40vw, 220px); }
  .env-bouquet--tl, .env-bouquet--tr { width: clamp(110px, 32vw, 180px); }
  .env-bouquet--bl, .env-bouquet--br { width: clamp(100px, 28vw, 160px); }
  .env-bouquet--bc, .env-bouquet--tc { width: clamp(300px, 90vw, 500px); }
}
@media (max-width: 360px) {
  .gallery__heart { grid-template-columns: repeat(4, 1fr); }
  .floral-corner { width: 140px; }
  .env-bouquet--tl, .env-bouquet--tr { width: 110px; }
  .env-bouquet--bl, .env-bouquet--br { width: 100px; }
  .env-bouquet--bc, .env-bouquet--tc { width: 300px; }
}

/* ═══════════════════════════════════════════════════════════
   BLESSINGS
   ═══════════════════════════════════════════════════════════ */
.blessings {
  position: relative; overflow: hidden;
  padding: var(--section-pad) 0; text-align: center;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(212,165,116,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 70%, rgba(183,110,121,0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--cream) 0%, var(--blush) 40%, #F7E4DB 70%, var(--cream) 100%);
}
.blessings__heading {
  font-family: var(--font-thai); font-weight: 500;
  font-size: clamp(1.6rem, 5vw, 2.6rem); color: var(--dark); margin-bottom: 0.3rem;
}
.blessings__subheading {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: clamp(0.95rem, 2.8vw, 1.2rem); color: var(--rose); margin-bottom: 2.5rem;
}
.blessings__grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; max-width: 900px; margin: 0 auto; }
@media (min-width: 768px) { .blessings__grid { grid-template-columns: repeat(3, 1fr); } }

.blessings__card {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,248,240,0.93));
  border-radius: 20px; padding: clamp(2rem, 5vw, 2.8rem) clamp(1.5rem, 3vw, 2rem);
  border-top: 2px solid var(--gold-border);
  box-shadow: 0 4px 20px rgba(183,110,121,0.05), 0 8px 32px rgba(0,0,0,0.03);
  transition: transform 0.6s var(--ease-out), box-shadow 0.5s var(--ease);
  position: relative; overflow: hidden;
}
.blessings__card::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(212,165,116,0.06) 0%, transparent 60%);
  pointer-events: none; opacity: 0; transition: opacity 0.5s ease;
}
.blessings__card:hover { transform: translateY(-12px); box-shadow: 0 16px 50px rgba(183,110,121,0.12), 0 24px 70px rgba(0,0,0,0.05); }
.blessings__card:hover::after { opacity: 1; }
.blessings__icon { margin-bottom: 1rem; }
.blessings__text {
  font-family: var(--font-blessing); font-weight: 300;
  font-size: clamp(0.92rem, 2.2vw, 1.02rem); color: var(--dark); line-height: 2;
}

/* ═══════════════════════════════════════════════════════════
   CLOSING
   ═══════════════════════════════════════════════════════════ */
.closing {
  position: relative; padding: clamp(5rem, 14vw, 11rem) 1.5rem;
  text-align: center; overflow: hidden;
  min-height: 55vh; display: flex; align-items: center; justify-content: center;
}
#fireworksCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.closing__bg-image { position: absolute; inset: 0; z-index: 0; }
.closing__bg-image img { width: 100%; height: 100%; object-fit: cover; }
.closing__overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(183,110,121,0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 30% 70%, rgba(212,165,116,0.08) 0%, transparent 40%),
    linear-gradient(150deg, rgba(139,69,87,0.94) 0%, rgba(44,24,16,0.93) 100%);
}
.closing__floral { position: absolute; width: 160px; height: 160px; z-index: 2; pointer-events: none; }
.closing__floral--tl { top: 0; left: 0; }
.closing__floral--br { bottom: 0; right: 0; }
.closing__content { position: relative; z-index: 5; }
.closing__names {
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(2.8rem, 10vw, 5rem); color: var(--white);
  text-shadow: 0 2px 30px rgba(212,165,116,0.3), 0 4px 60px rgba(183,110,121,0.15);
  margin-bottom: 0.5rem;
}
.closing__date {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(0.95rem, 2.5vw, 1.3rem);
  color: var(--gold-light); letter-spacing: 0.3em; margin-bottom: 1.5rem;
}
.closing__divider {
  width: 80px; height: 1px; margin: 0 auto 1.5rem;
  background: linear-gradient(90deg, transparent, var(--gold-light), var(--gold), var(--gold-light), transparent);
  background-size: 200% 100%; animation: shimmerLine 3.5s ease-in-out infinite;
}
@keyframes shimmerLine { 0%, 100% { background-position: -200% center; } 50% { background-position: 200% center; } }
.closing__message {
  font-family: var(--font-thai); font-weight: 200;
  font-size: clamp(1.05rem, 3vw, 1.3rem); color: var(--white); opacity: 0.92; margin-bottom: 2.5rem;
}
.closing__credit {
  font-family: var(--font-thai); font-weight: 200;
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  color: var(--gold-light); opacity: 0.55; letter-spacing: 0.06em;
  display: flex; align-items: center; justify-content: center; gap: 0.3rem;
}
.closing__heart-icon { color: var(--rose-light); animation: heartbeat 2s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════════
   FLOATING CANVAS
   ═══════════════════════════════════════════════════════════ */
#floatingCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9996; opacity: 0; transition: opacity 1.5s ease;
}
#floatingCanvas.is-active { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   MUSIC TOGGLE
   ═══════════════════════════════════════════════════════════ */
.music-toggle {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9000;
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: var(--white);
  box-shadow: 0 4px 24px rgba(183,110,121,0.35);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--speed) var(--ease);
  opacity: 0; transform: scale(0); pointer-events: none;
}
.music-toggle.is-visible { opacity: 1; transform: scale(1); pointer-events: all; }
.music-toggle:hover { transform: scale(1.1); box-shadow: 0 6px 32px rgba(183,110,121,0.5); }
.music-toggle__icon { position: absolute; transition: opacity 0.3s ease, transform 0.3s ease; }
.music-toggle__icon--on { opacity: 0; transform: scale(0.5); }
.music-toggle.is-playing .music-toggle__icon--off { opacity: 0; transform: scale(0.5); }
.music-toggle.is-playing .music-toggle__icon--on { opacity: 1; transform: scale(1); }
.music-toggle:not(.is-playing).is-visible { animation: pulseSoft 3s ease-in-out infinite; }
.music-toggle.is-playing { animation: none; }

/* ═══════════════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 20000;
  background: rgba(0,0,0,0.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__close {
  position: absolute; top: 1rem; right: 1.2rem;
  color: rgba(255,255,255,0.7); width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all 0.3s ease; z-index: 3;
  background: rgba(255,255,255,0.06);
}
.lightbox__close:hover { color: white; background: rgba(255,255,255,0.12); transform: rotate(90deg); }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.6); width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.04); transition: all 0.3s ease; z-index: 3;
}
.lightbox__nav:hover { color: white; background: rgba(255,255,255,0.1); }
.lightbox__nav--prev { left: 0.8rem; }
.lightbox__nav--next { right: 0.8rem; }
.lightbox__image-container { max-width: 90vw; max-height: 85vh; display: flex; align-items: center; justify-content: center; }
.lightbox__img {
  max-width: 100%; max-height: 85vh; object-fit: contain;
  border-radius: 6px; box-shadow: 0 0 80px rgba(0,0,0,0.4);
  transition: opacity 0.35s ease; user-select: none;
}
.lightbox__counter {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.4); font-family: var(--font-serif); font-size: 0.85rem; letter-spacing: 0.2em;
}

/* ═══════════════════════════════════════════════════════════
   CLICK HEARTS
   ═══════════════════════════════════════════════════════════ */
.click-heart {
  position: absolute; pointer-events: none;
  animation: clickHeartRise 2s ease-out forwards;
  color: var(--rose);
}
@keyframes clickHeartRise {
  0%   { opacity: 1; transform: translateY(0) scale(0.5) rotate(0deg); }
  50%  { opacity: 0.8; transform: translateY(-60px) scale(1.2) rotate(15deg); }
  100% { opacity: 0; transform: translateY(-140px) scale(0.4) rotate(-10deg); }
}

/* ═══════════════════════════════════════════════════════════
   KEYFRAMES
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp   { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-25px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseSoft  { 0%, 100% { box-shadow: 0 4px 24px rgba(183,110,121,0.35); } 50% { box-shadow: 0 4px 35px rgba(183,110,121,0.55), 0 0 0 10px rgba(183,110,121,0.06); } }
@keyframes bounce     { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } 60% { transform: translateY(-4px); } }
@keyframes heartbeat  { 0% { transform: scale(1); } 14% { transform: scale(1.18); } 28% { transform: scale(1); } 42% { transform: scale(1.18); } 70% { transform: scale(1); } }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 360px) { .envelope { width: 230px; height: 155px; } .hero__name { font-size: 2.8rem; } }
@media (min-width: 768px) { .hero__photo-frame { max-width: 380px; } .lightbox__nav--prev { left: 1.5rem; } .lightbox__nav--next { right: 1.5rem; } }
@media (min-width: 1024px) { .hero__photo-frame { max-width: 420px; } }
@media (pointer: coarse) { .lightbox__close, .lightbox__nav { width: 56px; height: 56px; } .music-toggle { width: 54px; height: 54px; } }
@media print { .envelope-overlay, #floatingCanvas, #petalCanvas, #sparkleCanvas, .music-toggle, .hero__scroll-indicator, .section-divider, .hero__gradient-orbs { display: none !important; } .animate-on-scroll { opacity: 1 !important; transform: none !important; } }
