/* ================================================================
   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 — Luxury Royal Gold & Warm Ivory */
  --sage: #C4973A;
  --sage-light: #DFBA6B;
  --sage-lighter: #FAF4E1;
  --sage-dark: #8B6508;
  --ivory: #FAF7EF;
  --ivory-dark: #F3EBD6;
  --gold: #C4973A;
  --gold-light: #E8D5A3;
  --gold-dark: #8B6508;
  --warm-white: #FFFDF8;
  --text-dark: #2C2C2C;
  --text-medium: #5A5A5A;
  --text-light: #8A8A8A;
  --text-gold: #C4973A;

  /* Typography */
  --font-heading: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', 'Montserrat', sans-serif;
  --font-cursive: 'Dancing Script', 'Great Vibes', cursive;

  /* 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, 151, 58, 0.15);
  --shadow-gold: 0 4px 20px rgba(196, 151, 58, 0.35);
  --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, #FFFDF8 0%, #F5EED8 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.45));
}

.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(--sage-dark);
  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)); }
}

/* ----------------------------------------------------------------
   3. ENVELOPE SCREEN (AUTHENTIC RECTANGULAR 3D WEDDING ENVELOPE)
   ---------------------------------------------------------------- */
#envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: radial-gradient(circle at center, #FCF9F1 0%, #F5ECD8 60%, #EFE1C6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  gap: 1.5rem;
  transition: opacity 0.8s var(--transition-smooth), visibility 0.8s;
  overflow: hidden;
}

.envelope-bg-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(750px, 130vw);
  height: min(750px, 130vw);
  background: radial-gradient(circle, rgba(245, 230, 185, 0.6) 0%, rgba(212, 175, 55, 0.1) 50%, transparent 70%);
  pointer-events: none;
  animation: pulseAura 4s ease-in-out infinite alternate;
}

@keyframes pulseAura {
  0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.9; }
}

#envelope-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

/* 3D Envelope Wrapper */
.envelope-3d-wrapper {
  perspective: 1200px;
  width: min(430px, 92vw);
  animation: envelopeFloat 3.8s ease-in-out infinite;
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

@keyframes envelopeFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(0.4deg); }
}

.envelope-3d-wrapper:hover {
  transform: scale(1.025) translateY(-5px);
}

/* The Rectangular Envelope Box */
.rect-envelope {
  position: relative;
  width: 100%;
  height: 270px;
  background: linear-gradient(150deg, #FAF6EB 0%, #F5EED5 45%, #EBE0BF 100%);
  border-radius: 12px;
  box-shadow:
    0 25px 65px rgba(74, 53, 5, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.08),
    inset 0 0 30px rgba(212, 175, 55, 0.12);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
  will-change: transform;
}

/* Inside Card (Slides Up on click) */
.envelope-card-inside {
  position: absolute;
  bottom: 8px;
  left: 5%;
  right: 5%;
  height: 92%;
  background: linear-gradient(160deg, #FFFFFF 0%, #FFFDF8 60%, #FAF5E8 100%);
  border-radius: 8px;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 -4px 20px rgba(74, 53, 5, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  transform: translateY(0);
  opacity: 0;
  z-index: 2;
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
}

.card-inside-border {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.5rem;
  text-align: center;
  gap: 0.2rem;
}

.card-inside-photo-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #FFF0BA, #C4973A, #8B6508);
  box-shadow: 0 4px 12px rgba(139, 101, 8, 0.25);
  margin-bottom: 0.15rem;
  flex-shrink: 0;
}

.card-inside-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.card-inside-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-logo-emblem {
  font-family: serif;
  font-size: 1.05rem;
  font-weight: bold;
  color: #C4973A;
  line-height: 1;
}

.card-inside-subtitle {
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: #8B6508;
  font-weight: 600;
  text-transform: uppercase;
}

.card-inside-names {
  font-family: var(--font-cursive);
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  color: #7A530E;
  font-weight: 700;
  line-height: 1.1;
  margin: 0.1rem 0;
}

.card-inside-divider {
  width: 45px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #C4973A, transparent);
  margin: 0.15rem 0;
}

.card-inside-date {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: #555;
  letter-spacing: 0.05em;
}

.card-inside-place {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: #888;
  letter-spacing: 0.1em;
}

/* Rising animation for inside card */
.envelope-card-inside.rise-up {
  opacity: 1;
  transform: translateY(-70%);
  z-index: 6;
  box-shadow: 0 25px 60px rgba(74, 53, 5, 0.35);
}

/* 3D Top Flap */
.envelope-flap-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 145px;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
}

.envelope-flap-top.open {
  transform: rotateX(180deg);
  z-index: 1;
}

.flap-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Front closed face of flap (triangular lid) */
.flap-front {
  filter: drop-shadow(0 8px 16px rgba(74, 53, 5, 0.22));
}

.flap-triangle-shape {
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #FAF6EB 0%, #F5ECD2 60%, #EFE1B8 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* Back face of flap (revealed when opened) */
.flap-back {
  transform: rotateX(180deg);
  background: linear-gradient(to top, #FAF6EB 0%, #F5ECD2 60%, #EFE1B8 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.flap-back-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 240px;
  padding: 0 0.5rem;
  margin-top: 10px;
}

.inner-rings {
  display: flex;
  justify-content: center;
  margin-bottom: 2px;
}

.flap-thanks {
  font-family: var(--font-cursive);
  font-size: 1.25rem;
  font-weight: 700;
  color: #8B6508;
  line-height: 1.1;
  text-shadow: 0 1px 1px rgba(255,255,255,0.8);
}

.flap-quote {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-style: italic;
  color: #9A6F20;
  line-height: 1.25;
  margin-top: 2px;
}

/* Front Pocket of the Envelope */
.envelope-front-pocket {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
}

/* Realistic origami diagonal folds on front */
.pocket-fold-left {
  position: absolute;
  top: 0; bottom: 0; left: 0; width: 50%;
  background: linear-gradient(to right, #FAF6EB 0%, #F5EED5 40%, #EAE0BE 100%);
  clip-path: polygon(0 0, 100% 55%, 0 100%);
  border-left: 1px solid rgba(255,255,255,0.7);
  filter: drop-shadow(2px 0 5px rgba(139,101,8,0.1));
}

.pocket-fold-right {
  position: absolute;
  top: 0; bottom: 0; right: 0; width: 50%;
  background: linear-gradient(to left, #FAF6EB 0%, #F5EED5 40%, #EAE0BE 100%);
  clip-path: polygon(100% 0, 0 55%, 100% 100%);
  border-right: 1px solid rgba(255,255,255,0.7);
  filter: drop-shadow(-2px 0 5px rgba(139,101,8,0.1));
}

.pocket-fold-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to top, #FAF6EB 0%, #F5EED5 40%, #E8DCB8 100%);
  clip-path: polygon(0 100%, 50% 25%, 100% 100%);
  border-top: 1px solid rgba(212,175,55,0.3);
  filter: drop-shadow(0 -3px 8px rgba(139,101,8,0.12));
}

/* Front Cover Content */
.pocket-front-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1rem 0.9rem;
  z-index: 5;
  pointer-events: none;
}

.pocket-names-header {
  text-align: center;
  width: 100%;
}

.pocket-couple-names {
  font-family: var(--font-cursive);
  font-size: clamp(1.5rem, 4.8vw, 2.05rem);
  font-weight: 700;
  background: linear-gradient(135deg, #6B4904 0%, #B8860B 28%, #6B4904 55%, #C4973A 80%, #5C4103 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.85);
  line-height: 1.15;
  letter-spacing: 0.015em;
}

.pocket-date-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #8B6508;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  margin-top: 1px;
}

.pocket-wing {
  font-size: 0.95rem;
  color: #C4973A;
  opacity: 0.9;
}

.pocket-date {
  font-weight: 600;
  letter-spacing: 0.12em;
}

.pocket-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
}

.pocket-invitation-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: #7A530E;
  font-weight: 600;
  text-transform: uppercase;
}

.pocket-guest-pill {
  border: 1.6px solid #C4973A;
  border-radius: 30px;
  padding: 0.32rem 1.25rem;
  background: rgba(255, 253, 245, 0.96);
  box-shadow:
    inset 0 1px 3px rgba(139, 101, 8, 0.1),
    0 2px 8px rgba(196, 151, 58, 0.18);
  width: min(210px, 85%);
  text-align: center;
}

.pocket-to-text {
  font-family: var(--font-heading);
  font-size: clamp(0.82rem, 2.4vw, 0.98rem);
  font-weight: 600;
  color: #4A3505;
  display: block;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Luxury 3D Gold Medallion Seal (Placed on the flap tip) */
.envelope-seal-btn {
  position: absolute;
  top: 125px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  cursor: pointer;
  transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 6px 16px rgba(74, 53, 5, 0.45));
}

.seal-medallion-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Gold Foil Shimmer on Seal & Pocket */
.envelope-seal-btn {
  overflow: hidden;
}

.envelope-seal-btn::after {
  content: '';
  position: absolute;
  top: -20%;
  left: -120%;
  width: 65%;
  height: 140%;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.65) 50%, transparent 80%);
  transform: skewX(-20deg);
  animation: goldShimmer 3.6s ease-in-out infinite;
  pointer-events: none;
}

.envelope-front-pocket::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 248, 220, 0.35) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: pocketShimmer 4.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
}

@keyframes goldShimmer {
  0%, 55% { left: -120%; }
  100% { left: 160%; }
}

@keyframes pocketShimmer {
  0%, 60% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

/* Radial Confetti Burst from Seal */
.seal-burst-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  user-select: none;
  will-change: transform, opacity;
  animation: sealRadialBurst var(--dur, 1s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.seal-burst-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, #FFF0BA, #C4973A);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.8);
}

@keyframes sealRadialBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.15) rotate(var(--rot));
  }
}

@media (max-width: 480px) {
  .rect-envelope {
    height: 245px;
  }
  .envelope-flap-top {
    height: 132px;
  }
  .envelope-seal-btn {
    top: 114px;
    width: 68px;
    height: 68px;
  }
  .card-inside-photo-wrap {
    width: 48px;
    height: 48px;
  }
  .card-inside-names {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }
}

.envelope-seal-btn:hover {
  transform: translate(-50%, -50%) scale(1.1) rotate(4deg);
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.95));
}

.envelope-seal-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.envelope-seal-btn.hidden {
  opacity: 0;
  transform: translate(-50%, -150%) scale(1.6) rotate(25deg);
  pointer-events: none;
}

/* Seal Instruction */
.seal-instruction {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #8B6508;
  letter-spacing: 0.15em;
  opacity: 0.9;
  animation: pulseText 2.5s infinite alternate;
  pointer-events: none;
  transition: opacity 0.4s;
  white-space: nowrap;
  margin-top: 0.5rem;
}

@keyframes pulseText {
  0% { opacity: 0.5; }
  100% { opacity: 1; text-shadow: 0 0 10px rgba(196, 151, 58, 0.4); }
}

/* 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, 151, 58, 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: #FAF6EB; /* Warm pastel yellow / ivory */
  color: #0F172A;
  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, 151, 58, 0.92);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 235, 176, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(139, 101, 8, 0.35);
  transition: all 0.3s var(--transition-smooth);
  color: white;
}

#music-btn:hover {
  transform: scale(1.1);
  background: rgba(139, 101, 8, 0.98);
  box-shadow: 0 6px 20px rgba(196, 151, 58, 0.5);
}

#music-btn.playing {
  animation: musicPulse 1.5s ease-in-out infinite;
}

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(139, 101, 8, 0.25), 0 0 0 0 rgba(196, 151, 58, 0.5); }
  50% { box-shadow: 0 4px 16px rgba(139, 101, 8, 0.25), 0 0 0 12px rgba(196, 151, 58, 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, 151, 58, 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,151,58,0.6) 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: #FAF7EF;
  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); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.45);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
  user-select: none;
}

.lightbox-nav:hover {
  background: rgba(196, 151, 58, 0.85);
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.92);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

@media (max-width: 639px) {
  .lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

/* ----------------------------------------------------------------
   10. WEDDING INFO + TIMELINE SECTION
   ---------------------------------------------------------------- */
#wedding-info {
  background: linear-gradient(160deg, #FBF8EE 0%, #F5EED8 60%, #EFE3C7 100%);
  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(212, 175, 55, 0.15);
  border: 1px solid #DFBA6B;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.25rem;
  color: #8B6508;
}

.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, 151, 58, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(196, 151, 58, 0.06) 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.15);
  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, 151, 58, 0.18);
}

.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: #C4973A;
  background: rgba(196, 151, 58, 0.12);
  color: #8B6508;
  font-weight: 600;
}

.btn-submit {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #C4973A 0%, #D4AF37 50%, #B8860B 100%);
  color: #FFF;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(196, 151, 58, 0.45);
  transition: all 0.3s var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(196, 151, 58, 0.6);
}

.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: linear-gradient(135deg, #FAF2DC 0%, #F5E8C4 100%);
  color: #4A3505;
  border: 1px solid #DFBA6B;
  padding: 0.875rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 10001;
  opacity: 0;
  transition: all 0.4s var(--transition-smooth);
  white-space: nowrap;
}

.toast.error { background: #C62828; color: #FFF; border-color: #B71C1C; }

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------------------
   12. GUESTBOOK / SỔ LƯU BÚT
   ---------------------------------------------------------------- */
#guestbook {
  background: linear-gradient(160deg, #FBF8EE 0%, #F6EED5 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(196, 151, 58, 0.2);
  border-color: #C4973A;
  color: #8B6508;
}

/* ----------------------------------------------------------------
   14. THANK YOU SECTION
   ---------------------------------------------------------------- */
#thank-you {
  background: linear-gradient(160deg, #FBF8EE 0%, #F4EBCE 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: #2B2215;
  color: #E8D5A3;
  text-align: center;
  padding: 2rem 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: #C4973A;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: #8B6508; }

/* ----------------------------------------------------------------
   19. SELECTION STYLING
   ---------------------------------------------------------------- */
::selection {
  background: rgba(196, 151, 58, 0.25);
  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, #quick-nav { display: none; }
}

/* ----------------------------------------------------------------
   22. SKIP ENVELOPE, QUICK NAV & GIFT TABS
   ---------------------------------------------------------------- */
.skip-envelope-btn {
  margin-top: 0.75rem;
  padding: 0.45rem 1.1rem;
  background: rgba(255, 253, 248, 0.75);
  border: 1px solid rgba(196, 151, 58, 0.45);
  border-radius: 999px;
  color: var(--sage-dark);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s var(--transition-smooth);
  z-index: 20;
}

.skip-envelope-btn:hover {
  background: var(--warm-white);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.quick-nav {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(196, 151, 58, 0.35);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(139, 101, 8, 0.16);
  max-width: calc(100vw - 1.5rem);
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-nav::-webkit-scrollbar { display: none; }

.quick-nav-item {
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-medium);
  text-decoration: none;
  transition: all 0.25s var(--transition-smooth);
}

.quick-nav-item:hover {
  color: var(--sage-dark);
  background: rgba(196, 151, 58, 0.12);
}

.quick-nav-item.active {
  background: linear-gradient(135deg, var(--gold), var(--sage-dark));
  color: #fff;
  box-shadow: 0 2px 10px rgba(196, 151, 58, 0.35);
}

@media (max-width: 639px) {
  #music-btn {
    bottom: 4.5rem;
    right: 1rem;
    width: 42px;
    height: 42px;
  }
  .quick-nav-item {
    padding: 0.38rem 0.65rem;
    font-size: 0.72rem;
  }
}

.gift-tabs {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.3rem;
  background: var(--ivory);
  border-radius: 999px;
  border: 1px solid rgba(196, 151, 58, 0.25);
  margin-bottom: 1rem;
}

.gift-tab {
  border: none;
  background: transparent;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.25s var(--transition-smooth);
}

.gift-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--sage-dark));
  color: #fff;
  box-shadow: 0 2px 10px rgba(196, 151, 58, 0.3);
}

.gift-panel {
  display: none;
}

.gift-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}
