/* ================================================================
   WEDDING INVITATION — Nhựt Trường & Tuyết Nghi
   style.css — Design System, Animations & Custom Styles
   Author: Antigravity AI — Senior UI/UX & Front-end
   ================================================================ */

/* ----------------------------------------------------------------
   1. DESIGN TOKENS — CSS Variables
   ---------------------------------------------------------------- */
:root {
  /* Color Palette */
  --sage: #c4688b;
  --sage-light: #e6a8bc;
  --sage-lighter: #f9dbe4;
  --sage-dark: #a34166;
  --ivory: #FAF6F0;
  --ivory-dark: #F0EAE0;
  --gold: #C4973A;
  --gold-light: #E8D5A3;
  --gold-dark: #9A6F20;
  --warm-white: #FFFDF8;
  --text-dark: #2C2C2C;
  --text-medium: #5A5A5A;
  --text-light: #8A8A8A;
  --text-gold: #C4973A;

  /* Typography */
  --font-heading: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'Montserrat', sans-serif;

  /* Spacing */
  --section-py: clamp(4rem, 8vw, 8rem);

  /* Transitions */
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Shadows */
  --shadow-soft: 0 4px 24px rgba(196, 104, 139, 0.12);
  --shadow-gold: 0 4px 20px rgba(196, 151, 58, 0.25);
  --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.08);
}

/* ----------------------------------------------------------------
   2. RESET & BASE STYLES
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--ivory);
  color: var(--text-dark);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ----------------------------------------------------------------
   3. LOADING SCREEN
   ---------------------------------------------------------------- */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #FFFDFB 0%, #F5F0E6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.8s var(--transition-smooth), visibility 0.8s;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  width: 100px;
  height: 100px;
  animation: loadingPetal 2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  filter: drop-shadow(0 0 15px rgba(196, 151, 58, 0.4));
}

.loading-names {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--sage-dark);
  letter-spacing: 0.1em;
  animation: fadeInUp 1s ease forwards;
  opacity: 0;
  animation-delay: 0.3s;
}

.loading-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: fadeInUp 1s ease forwards;
  opacity: 0;
  animation-delay: 0.6s;
}

.loading-sub {
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  animation: fadeInUp 1s ease forwards;
  opacity: 0;
  animation-delay: 0.9s;
}

@keyframes loadingPetal {
  0% { transform: scale(0.95) rotate(-3deg); opacity: 0.8; filter: drop-shadow(0 0 10px rgba(196, 151, 58, 0.2)); }
  100% { transform: scale(1.05) rotate(3deg); opacity: 1; filter: drop-shadow(0 0 25px rgba(196, 151, 58, 0.6)); }
}

/* ----------------------------------------------------------------
   4. ENVELOPE / OPEN CARD SCREEN
   ---------------------------------------------------------------- */
#envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: radial-gradient(circle at center, #F8F4EE 0%, #F3EEE6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: opacity 0.8s var(--transition-smooth), visibility 0.8s;
  overflow: hidden;
}

#envelope-screen > svg {
  animation: floatLeaves 12s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes floatLeaves {
  0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 0.07; }
  100% { transform: translateY(-20px) scale(1.05) rotate(3deg); opacity: 0.12; }
}

/* Morning light rays effect */
#envelope-screen::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(255, 248, 220, 0.6) 0%, transparent 70%);
  pointer-events: none;
}

#envelope-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.envelope-to {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 700;
  color: #0F172A; /* High contrast dark slate */
  text-shadow: 0 2px 8px rgba(255,255,255,0.8);
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 2rem;
  z-index: 10;
  position: relative;
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

/* 3D Envelope Container */
.envelope-3d-wrapper {
  perspective: 1200px;
  width: min(420px, 95vw);
  animation: envelopeFloat 3.5s ease-in-out infinite;
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.envelope-3d-wrapper:hover {
  transform: scale(1.04) translateY(-8px) rotateX(4deg);
}

.envelope-3d {
  position: relative;
  width: 100%;
  padding-bottom: 70%; /* ~landscape envelope ratio */
  transform-style: preserve-3d;
  transition: transform 0.6s var(--transition-smooth);
}

/* Envelope Body (Pink Texture 3D) */
.envelope-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #D69CA6 0%, #C07F8A 100%);
  border-radius: 4px 4px 8px 8px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.2), 
    0 0 50px rgba(214, 156, 166, 0.4),
    inset 0 0 60px rgba(0,0,0,0.3), 
    inset 0 1px 0 rgba(255,255,255,0.4);
  border: 1px solid rgba(214, 156, 166, 0.8);
}

.envelope-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
}

/* Envelope inner V-fold lines */
.envelope-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(196,151,58,0.06) 50%, transparent 50%),
    linear-gradient(225deg, rgba(196,151,58,0.06) 50%, transparent 50%);
  pointer-events: none;
}

/* Side flaps (with edge lighting) */
.envelope-left {
  position: absolute;
  top: 0; bottom: 0; left: 0; width: 50%;
  background: linear-gradient(to right, #E0A6B0 0%, #D69CA6 15%, #B57580 100%);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  z-index: 3;
  filter: drop-shadow(4px 0px 8px rgba(0,0,0,0.2));
}

.envelope-right {
  position: absolute;
  top: 0; bottom: 0; right: 0; width: 50%;
  background: linear-gradient(to left, #E0A6B0 0%, #D69CA6 15%, #B57580 100%);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  z-index: 3;
  filter: drop-shadow(-4px 0px 8px rgba(0,0,0,0.2));
}

/* Bottom triangle fold */
.envelope-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, #E0A6B0 0%, #D69CA6 20%, #B57580 100%);
  clip-path: polygon(0 100%, 50% 30%, 100% 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 3;
  filter: drop-shadow(0 -6px 15px rgba(0,0,0,0.3));
}

/* Envelope Flap (top lid) */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(to bottom, #EAAEB8 0%, #E0A6B0 20%, #B57580 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1), filter 0.9s;
  z-index: 4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.3));
}

.envelope-flap.open {
  transform: perspective(600px) rotateX(-165deg);
  filter: drop-shadow(0 -15px 25px rgba(0,0,0,0.2));
}

/* Realistic 3D Pink Wax Seal */
.envelope-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65px;
  height: 65px;
  background: 
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.6) 0%, transparent 20%),
    radial-gradient(circle at 75% 75%, rgba(0, 0, 0, 0.2) 0%, transparent 40%),
    linear-gradient(135deg, #EAAEB8 0%, #C07F8A 45%, #995964 100%);
  border-radius: 48% 52% 51% 49% / 50% 51% 49% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 12px 24px rgba(0,0,0,0.3), 
    0 5px 10px rgba(0,0,0,0.2),
    inset 0 3px 6px rgba(255,255,255,0.7),
    inset 0 -3px 8px rgba(0,0,0,0.4),
    inset 0 0 4px rgba(153,89,100,1);
  z-index: 5;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.envelope-seal::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C07F8A 0%, #D69CA6 100%);
  box-shadow: 
    inset 0 2px 5px rgba(0,0,0,0.3), 
    inset 0 -2px 5px rgba(255,255,255,0.5),
    0 1px 2px rgba(255,255,255,0.4);
}

.seal-monogram {
  position: relative;
  z-index: 1;
  font-family: 'Great Vibes', var(--font-heading);
  font-size: 16px;
  line-height: 1.1;
  text-align: center;
  letter-spacing: 1px;
  color: #D4AF37; /* Gold text */
  text-shadow: 
    -1px -1px 1px rgba(0,0,0,0.2),
    1px 1px 1px rgba(255,255,255,0.7);
}

.envelope-seal:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 
    0 15px 30px rgba(0,0,0,0.7), 
    0 0 25px rgba(212, 175, 55, 0.6),
    inset 0 3px 6px rgba(255,255,255,0.8),
    inset 0 -3px 8px rgba(0,0,0,0.8);
}

.envelope-seal.hidden {
  opacity: 0;
  transform: translate(-50%, -200%) scale(1.5) rotate(20deg);
  pointer-events: none;
}

/* Seal Instruction */
.seal-instruction {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--sage-dark);
  letter-spacing: 0.15em;
  opacity: 0.8;
  animation: pulseText 2.5s infinite alternate;
  pointer-events: none;
  transition: opacity 0.4s;
  white-space: nowrap;
}

@keyframes pulseText {
  0% { opacity: 0.4; }
  100% { opacity: 1; text-shadow: 0 0 10px rgba(196, 104, 139, 0.3); }
}

/* Card peeking out of envelope */
.envelope-card-peek {
  position: absolute;
  bottom: 10px;
  left: 8%;
  right: 8%;
  height: 90%;
  background: linear-gradient(145deg, #FFFFFF, #FFFDFC);
  border-radius: 4px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transform: translateY(0);
  opacity: 0; /* Hidden initially to prevent gaps */
  transition: transform 0.8s var(--transition-smooth), opacity 0.4s ease;
  z-index: 2;
  border: 1px solid rgba(196,151,58,0.2);
}

.envelope-card-peek.show-card {
  opacity: 1;
}

.envelope-card-peek.slide-up {
  animation: cardFlyOut 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes cardFlyOut {
  0% { 
    transform: translateY(0); 
    z-index: 2; 
    opacity: 1;
  }
  35% { 
    transform: translateY(-70%); 
    z-index: 2; 
    opacity: 1;
  }
  36% { 
    transform: translateY(-70%); 
    z-index: 6; 
    opacity: 1;
  }
  100% { 
    transform: translateY(-15%) scale(1.03); 
    z-index: 6; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    opacity: 1;
  }
}

.card-peek-names {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  color: #995964; /* Bold pink tone */
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
}

.card-peek-divider {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.card-peek-date {
  font-size: 0.7rem;
  color: var(--text-light);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Open Button */
.btn-open-card {
  position: relative;
  padding: 1rem 3rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: white;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(196, 151, 58, 0.4), 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s var(--transition-smooth);
  animation: magicalPulse 2s infinite;
}

.btn-open-card:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(196, 151, 58, 0.6);
}

@keyframes magicalPulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 151, 58, 0.6); }
  70% { box-shadow: 0 0 0 20px rgba(196, 151, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 151, 58, 0); }
}

.btn-open-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-open-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(196, 104, 139, 0.5), 0 4px 12px rgba(0,0,0,0.12);
}

.btn-open-card:hover::before { opacity: 1; }

.btn-open-card:active { transform: translateY(0); }

.swipe-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  animation: swipeHintFloat 2s ease-in-out infinite;
}

.swipe-hint span {
  font-size: 0.7rem;
  color: var(--text-light);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.swipe-arrow {
  width: 24px;
  height: 24px;
  border-left: 2px solid var(--text-light);
  border-top: 2px solid var(--text-light);
  transform: rotate(45deg);
  margin-top: 4px;
}

@keyframes swipeHintFloat {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-6px); opacity: 1; }
}

@keyframes envelopeFloat {
  0%, 100% { transform: translateY(0) rotateX(2deg); }
  50% { transform: translateY(-8px) rotateX(-2deg); }
}

/* ----------------------------------------------------------------
   5. FLOATING PARTICLES (Flowers/Leaves)
   ---------------------------------------------------------------- */
#particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  overflow: hidden;
}

.particle {
  position: absolute;
  top: -20px;
  font-size: 14px;
  opacity: 0;
  animation: particleFall linear infinite;
  will-change: transform, opacity;
  user-select: none;
}

@keyframes particleFall {
  0% {
    opacity: 0;
    transform: translateY(-20px) rotate(0deg) scale(0.8);
  }
  10% { opacity: 0.7; }
  90% { opacity: 0.5; }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(360deg) scale(1.1);
  }
}

/* ----------------------------------------------------------------
   6. HERO SECTION
   ---------------------------------------------------------------- */
.hero-new-layout {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #F8F5F0; /* Light paper-like ivory */
  color: #0F172A; /* Dark blue/slate color for text */
  padding: 4rem 1.5rem 2rem;
}

.hero-bg-texture {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

.hero-content-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 600px;
  width: 100%;
  animation: fadeInUp 1.2s ease forwards;
}

/* Oval Frame */
.hero-oval-frame {
  position: relative;
  width: 260px;
  height: 320px;
  margin: 0 auto 2rem;
  border-radius: 130px;
  border: 1px solid var(--gold);
  padding: 8px;
}

.hero-oval-frame::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(196, 151, 58, 0.3);
  border-radius: 140px;
}

.hero-oval-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 122px;
}

/* Floral accents on frame */
.hero-floral-tl, .hero-floral-br {
  position: absolute;
  font-size: 2.5rem;
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.hero-floral-tl {
  top: -15px;
  left: -20px;
  transform: rotate(-45deg);
}

.hero-floral-br {
  bottom: -15px;
  right: -20px;
  transform: rotate(135deg);
}

/* Cursive Names */
.hero-cursive-names {
  font-family: var(--font-cursive, 'Great Vibes', cursive);
  font-size: clamp(3rem, 8vw, 4.5rem);
  color: #0b1c3c; /* Deep navy */
  line-height: 1.1;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.hero-and {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0.5rem;
  color: var(--sage-dark);
}

/* Date Layout */
.hero-date-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.date-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #0b1c3c;
  font-family: var(--font-heading);
  letter-spacing: 0.15em;
  font-weight: 600;
  font-size: 0.85rem;
}

.date-col-center {
  align-items: center;
}

.date-day {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.date-year {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
}

.date-col-sep {
  width: 1px;
  height: 40px;
  background-color: rgba(11, 28, 60, 0.3);
}

.hero-month-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: #0b1c3c;
  margin-bottom: 2rem;
}

/* Address */
.hero-address {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #0b1c3c;
  letter-spacing: 0.05em;
  max-width: 80%;
  margin: 0 auto;
}

/* Countdown Timer */
.countdown-wrapper {
  position: relative;
  z-index: 2;
  margin-top: 2rem;
  animation: fadeInUp 1.4s ease forwards;
  opacity: 0;
  animation-delay: 0.3s;
}

.countdown-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.countdown-num {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 500;
  color: #0b1c3c;
  line-height: 1;
  text-shadow: none;
  min-width: 2.5ch;
  text-align: center;
}

.countdown-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(11, 28, 60, 0.7);
  font-weight: 600;
}

.countdown-sep {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: rgba(11, 28, 60, 0.4);
  line-height: 1;
  margin-bottom: 1.2rem;
}

/* Scroll down indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: scrollBounce 2s ease-in-out infinite;
  cursor: pointer;
}

.scroll-indicator span {
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.6), transparent);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* Music Button */
#music-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  width: 48px;
  height: 48px;
  background: rgba(196, 104, 139, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: all 0.3s var(--transition-smooth);
  color: white;
}

#music-btn:hover {
  transform: scale(1.1);
  background: rgba(163, 65, 102, 0.95);
}

#music-btn.playing {
  animation: musicPulse 1.5s ease-in-out infinite;
}

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 0 0 0 rgba(196, 104, 139, 0.4); }
  50% { box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 0 0 12px rgba(196, 104, 139, 0); }
}

/* ----------------------------------------------------------------
   7. SECTION COMMON STYLES
   ---------------------------------------------------------------- */
.section-wrapper {
  padding: var(--section-py) 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-title.light {
  color: white;
}

.gold-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  margin: 1.5rem 0;
  border-radius: 2px;
}

.gold-line.centered { margin: 1.5rem auto; }

/* ----------------------------------------------------------------
   8. OPEN LETTER / THƯ NGỎ SECTION
   ---------------------------------------------------------------- */
#thu-ngo {
  background: var(--warm-white);
  position: relative;
  overflow: hidden;
}

/* Morning light dapple effect */
#thu-ngo::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(196, 151, 58, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

#thu-ngo::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(196, 104, 139, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.letter-container {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.letter-decoration {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  animation: petalSway 3s ease-in-out infinite alternate;
  display: inline-block;
}

@keyframes petalSway {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

.letter-greeting {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--sage-dark);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.letter-body {
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  color: var(--text-medium);
  line-height: 2;
  margin-bottom: 1.5rem;
}

.letter-signature {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--sage-dark);
  font-style: italic;
  margin-top: 2rem;
}

/* ----------------------------------------------------------------
   9. GALLERY SECTION
   ---------------------------------------------------------------- */
#gallery {
  background: var(--ivory);
  position: relative;
  overflow: hidden;
  padding-bottom: 3rem;
}

/* ── Gallery Film Strip (Marquee) ── */
.gallery-film-wrapper {
  overflow: hidden;
  position: relative;
  padding: 1rem 0 1.5rem;
  /* Mờ dần 2 cạnh để tạo hiệu ứng cuộn phim */
  mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
}

.gallery-film-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: galleryFilmScroll 35s linear infinite;
}

.gallery-film-track:hover {
  animation-play-state: paused;
}

@keyframes galleryFilmScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.gallery-film-item {
  position: relative;
  flex-shrink: 0;
  width: 240px;
  height: 300px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  cursor: zoom-in;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

@media (min-width: 640px) {
  .gallery-film-item {
    width: 280px;
    height: 350px;
  }
}

@media (min-width: 1024px) {
  .gallery-film-item {
    width: 320px;
    height: 400px;
  }
}

.gallery-film-item:hover {
  transform: scale(1.04);
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
}

.gallery-film-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s ease;
  display: block;
}

.gallery-film-item:hover img {
  transform: scale(1.06);
}

.gallery-film-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(196,104,139,0.55) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.2rem;
}

.gallery-film-item:hover .gallery-film-overlay {
  opacity: 1;
}

.gallery-zoom-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transform: scale(0.7);
  transition: transform 0.3s ease;
}

.gallery-film-item:hover .gallery-zoom-icon {
  transform: scale(1);
}


/* Screen containing the envelope */
.envelope-screen {
  position: fixed;
  inset: 0;
  background-color: #FDF5F6; /* Soft blush pink background */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 1s var(--transition-smooth);
}

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

#lightbox.active {
  opacity: 1;
  visibility: visible;
}

#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
}

#lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* ----------------------------------------------------------------
   10. WEDDING INFO + TIMELINE SECTION
   ---------------------------------------------------------------- */
#wedding-info {
  background: #F9BAD1;
  position: relative;
  overflow: hidden;
}

#wedding-info::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.4) 0%, transparent 60%);
  pointer-events: none;
}

.info-cards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.info-card {
  width: 100%;
}

@media (min-width: 640px) {
  .info-card:nth-child(1),
  .info-card:nth-child(2) {
    width: calc(50% - 0.75rem);
  }
  .info-card:nth-child(3) {
    width: 100%;
  }
}

@media (min-width: 1024px) {
  .info-card:nth-child(1),
  .info-card:nth-child(2) {
    width: calc(40% - 0.75rem);
  }
  .info-card:nth-child(3) {
    width: calc(80% + 1.5rem);
  }
}

.info-card {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s var(--transition-smooth);
}

.info-card:hover {
  background: rgba(255,255,255,0.8);
  transform: translateY(-4px);
}

.info-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(249, 186, 209, 0.4);
  border: 1px solid #F9BAD1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.25rem;
  color: #d17596;
}

.info-card-label {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 0.5rem;
  font-family: var(--font-body);
}

.info-card-value {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: #111;
  line-height: 1.3;
}

.info-card-sub {
  font-size: 0.8rem;
  color: #555;
  margin-top: 0.25rem;
}gin-top: 0.25rem;
  line-height: 1.5;
}

/* Timeline */
.timeline-section {
  margin-bottom: 3rem;
}

.timeline-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #111;
  text-align: center;
  margin-bottom: 2rem;
  font-style: italic;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 80px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(196,151,58,0.5), transparent);
}

@media (min-width: 640px) {
  .timeline-list::before {
    left: 100px;
  }
}

.timeline-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  position: relative;
}

.timeline-time {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #111;
  min-width: 70px;
  text-align: right;
  padding-top: 2px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .timeline-time { min-width: 85px; }
}

.timeline-dot {
  width: 12px;
  height: 12px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid var(--gold-light);
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 0 4px rgba(196,151,58,0.2);
}

.timeline-content {
  flex: 1;
}

.timeline-event {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #111;
  line-height: 1.3;
}

.timeline-desc {
  font-size: 0.8rem;
  color: #555;
  margin-top: 0.2rem;
}

/* Map Section */
.map-section {
  margin-top: 2rem;
}

.map-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .map-wrapper {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

.map-embed {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  aspect-ratio: 16/9;
  min-height: 250px;
  width: 100%;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.map-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.qr-map-box {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  width: 160px;
}

.qr-map-box img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 8px;
  background: white;
  padding: 6px;
}

.qr-map-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.15em;
  margin-top: 0.5rem;
  text-transform: uppercase;
}

.btn-directions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(196, 151, 58, 0.4);
  transition: all 0.3s var(--transition-smooth);
  white-space: nowrap;
}

.btn-directions:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 151, 58, 0.5);
}

/* ----------------------------------------------------------------
   11. RSVP SECTION
   ---------------------------------------------------------------- */
#rsvp {
  background: var(--warm-white);
  position: relative;
  overflow: hidden;
}

#rsvp::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 20%, rgba(196, 104, 139, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(196, 151, 58, 0.05) 0%, transparent 50%);
  pointer-events: none;
}


.rsvp-form-container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(196, 151, 58, 0.1);
  position: relative;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--ivory);
  transition: all 0.3s var(--transition-smooth);
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--sage);
  background: white;
  box-shadow: 0 0 0 3px rgba(196, 104, 139, 0.12);
}

.form-input.error { border-color: #E57373; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A5A5A' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* RSVP Radio buttons */
.rsvp-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.rsvp-option {
  position: relative;
}

.rsvp-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.rsvp-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.3s var(--transition-smooth);
  background: var(--ivory);
  text-align: center;
}

.rsvp-option input[type="radio"]:checked + label {
  border-color: #F9BAD1;
  background: rgba(249, 186, 209, 0.15);
  color: #111;
  font-weight: 600;
}

.btn-submit {
  width: 100%;
  padding: 1rem 2rem;
  background: #F9BAD1;
  color: #111;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(196, 104, 139, 0.4);
  transition: all 0.3s var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(196, 104, 139, 0.5);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #F9BAD1;
  color: #111;
  padding: 0.875rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 10001;
  opacity: 0;
  transition: all 0.4s var(--transition-smooth);
  white-space: nowrap;
}

.toast.error { background: #C62828; }

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------------------
   12. GUESTBOOK / SỔ LƯU BÚT
   ---------------------------------------------------------------- */
#guestbook {
  background: linear-gradient(160deg, #FAF0E0 0%, var(--ivory) 100%);
  overflow: hidden;
  position: relative;
}

.guestbook-marquee-wrapper {
  overflow: hidden;
  position: relative;
  padding: 1.5rem 0;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

/* Two rows of marquee for visual richness */
.marquee-track {
  display: flex;
  gap: 1.25rem;
  animation: marqueeSlide 40s linear infinite;
  width: max-content;
  margin-bottom: 1.25rem;
}

.marquee-track:last-child {
  animation-direction: reverse;
  animation-duration: 35s;
}

.marquee-track:hover { animation-play-state: paused; }

@keyframes drawCircle {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

/* Slide in animations for gallery */
.slide-left {
  opacity: 0;
  transform: translateX(-50px);
}
.slide-left.visible {
  animation: slideInLeft 1s var(--transition-bounce) forwards;
}

.slide-right {
  opacity: 0;
  transform: translateX(50px);
}
.slide-right.visible {
  animation: slideInRight 1s var(--transition-bounce) forwards;
}

@keyframes slideInLeft {
  0% { opacity: 0; transform: translateX(-50px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  0% { opacity: 0; transform: translateX(50px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes marqueeSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.wish-card {
  flex-shrink: 0;
  width: 240px;
  background: white;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  border: 1px solid rgba(196, 151, 58, 0.12);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wish-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* Ribbon accent */
.wish-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 3px;
  background: linear-gradient(90deg, var(--sage-light), var(--gold-light));
  border-radius: 0 0 4px 4px;
}


.wish-card-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--sage-dark);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.wish-card-message {
  font-size: 0.82rem;
  color: var(--text-medium);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wish-card-time {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 0.75rem;
  letter-spacing: 0.05em;
}

.wish-card.new-card {
  animation: newCardFadeIn 0.8s ease forwards;
}

@keyframes newCardFadeIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ----------------------------------------------------------------
   13. GIFT BOX / HỘP MỪNG CƯỚI
   ---------------------------------------------------------------- */
#gift-box {
  background: var(--warm-white);
  position: relative;
}

.gift-section-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.gift-intro {
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  color: var(--text-medium);
  line-height: 1.9;
  margin-bottom: 2rem;
}

/* Nút Mừng Cưới - tối ưu cho touch trên điện thoại */
.gift-reveal-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, rgba(196,151,58,0.15), rgba(196,151,58,0.07));
  border: 1.5px solid var(--gold);
  border-radius: 50px;
  color: var(--gold-dark);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-style: italic;
  cursor: pointer;
  /* Bỏ overflow:hidden và pseudo-element để tránh block touch trên iOS */
  position: relative;
  /* Đảm bảo vùng chạm đủ lớn trên mobile */
  min-height: 48px;
  -webkit-tap-highlight-color: rgba(196,151,58,0.2);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

@media (hover: hover) {
  .gift-reveal-trigger:hover {
    background: linear-gradient(135deg, rgba(196,151,58,0.25), rgba(196,151,58,0.1));
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
  }
}

.gift-reveal-trigger:active {
  opacity: 0.8;
  transform: scale(0.97);
}

/* Gift Modal - rút ngắn transition để hiển thị ngay */
#gift-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
  /* Quan trọng: pointer-events phải tắt khi hidden để không chặn nút bên dưới */
  pointer-events: none;
}

#gift-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gift-modal-box {
  background: white;
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 80px rgba(0,0,0,0.3);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s var(--transition-bounce);
  position: relative;
}

#gift-modal.active .gift-modal-box {
  transform: scale(1) translateY(0);
}

.gift-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: var(--ivory);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.gift-modal-close:hover { background: var(--ivory-dark); }

.gift-modal-name {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--sage-dark);
  margin-bottom: 0.25rem;
}

.gift-modal-bank {
  font-size: 0.8rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.gift-modal-qr {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin: 0 auto 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--ivory-dark);
  padding: 8px;
  background: white;
}

.gift-account-number {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--text-dark);
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.gift-bank-label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.625rem 1.5rem;
  background: var(--ivory);
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.3s var(--transition-smooth);
  letter-spacing: 0.05em;
}

.btn-copy:hover {
  background: var(--sage-lighter);
  border-color: var(--sage-light);
  color: var(--sage-dark);
}

.btn-copy.copied {
  background: rgba(249, 186, 209, 0.25);
  border-color: #F9BAD1;
  color: #111;
}

/* ----------------------------------------------------------------
   14. THANK YOU SECTION
   ---------------------------------------------------------------- */
#thank-you {
  background: linear-gradient(160deg, #FAF6F0 0%, #EDE0C8 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

#thank-you::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(196,151,58,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.thank-you-content {
  max-width: 680px;
  margin: 0 auto;
}

.thank-you-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  animation: heartBeat 2s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  56% { transform: scale(1); }
}

.thank-you-text {
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  color: var(--text-medium);
  line-height: 2;
  margin-bottom: 2rem;
}

.thank-you-signature {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--sage-dark);
  font-style: italic;
}

/* Footer */
footer {
  background: #F9BAD1;
  color: #111;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

footer a {
  color: var(--gold-light);
  text-decoration: none;
}

/* ----------------------------------------------------------------
   15. SCROLL ANIMATIONS
   ---------------------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.8s var(--transition-smooth);
}

.fade-in.visible { opacity: 1; }

.stagger-1 { transition-delay: 0.1s !important; }
.stagger-2 { transition-delay: 0.2s !important; }
.stagger-3 { transition-delay: 0.3s !important; }
.stagger-4 { transition-delay: 0.4s !important; }

/* ----------------------------------------------------------------
   16. GLOBAL ANIMATIONS
   ---------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ----------------------------------------------------------------
   17. RESPONSIVE UTILITIES
   ---------------------------------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }

@media (max-width: 639px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 640px) {
  .hide-desktop { display: none !important; }
}

/* ----------------------------------------------------------------
   18. SCROLLBAR STYLING
   ---------------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ivory); }
::-webkit-scrollbar-thumb {
  background: #F9BAD1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: #d17596; }

/* ----------------------------------------------------------------
   19. SELECTION STYLING
   ---------------------------------------------------------------- */
::selection {
  background: rgba(196, 104, 139, 0.2);
  color: var(--sage-dark);
}

/* ----------------------------------------------------------------
   20. LANDSCAPE MOBILE FIX
   ---------------------------------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  #hero { min-height: 100svh; }
  .hero-names { font-size: clamp(1.8rem, 5vh, 3rem); }
  .countdown-num { font-size: clamp(1.2rem, 4vh, 2rem); }
  #envelope-screen { overflow-y: auto; padding: 2rem 1rem; }
}

/* ----------------------------------------------------------------
   21. PRINT STYLES
   ---------------------------------------------------------------- */
@media print {
  #loading-screen, #envelope-screen, #music-btn, #particles-container { display: none; }
}
