/* Custom Design System & Section-by-Section Mobile Invitation Layout matching reference */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600;1,700&family=Great+Vibes&family=Pinyon+Script&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,300,0,0&display=swap');

:root {
  --color-primary: #815062;
  --color-primary-container: #c48b9f;
  --color-secondary: #735c00;
  --color-secondary-container: #fed65b;
  --color-tertiary: #526442;
  --color-tertiary-container: #8ea17b;
  --color-background: #fcf9f6;
  --color-surface: #fcf9f6;
  --color-surface-container-low: #f6f3f0;
  --color-surface-container-lowest: #ffffff;
  --color-on-surface: #1b1c1a;
  --color-on-surface-variant: #504347;
  --color-sage-green: #8aa076;
}

html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #f4efe9;
  color: var(--color-on-surface);
  font-family: 'EB Garamond', serif;
  overflow-x: hidden;
}

/* Snap Scroll Section-by-Section Engine */
.snap-scroll-wrapper {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  height: 100vh;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.snap-section-card {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: #f4efe9;
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary-container);
  border-radius: 9999px;
}

/* Fluid Typography */
.font-display-responsive {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw + 1rem, 4.2rem);
  line-height: 1.15;
}

.font-headline-responsive {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.75rem, 3vw + 0.8rem, 2.8rem);
  line-height: 1.25;
}

.font-title-responsive {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.35rem, 2vw + 0.6rem, 2.2rem);
  line-height: 1.3;
}

.font-script-accent {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw + 0.8rem, 3.2rem);
  font-style: italic;
}

.font-label-caps {
  font-family: 'EB Garamond', serif;
  font-size: clamp(11px, 1.2vw + 8px, 14px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Delicate Gold Foil Inset Frame */
.gold-frame {
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: inset 0 0 0 2px rgba(253, 250, 247, 0.8), 0 12px 36px -4px rgba(196, 139, 159, 0.12);
}

/* Embossed Parchment Card Texture */
.embossed-card-bg {
  background-image: url('assets/images/embossed_parchment.jpg');
  background-size: cover;
  background-position: center;
}

/* Shimmer Effect */
@keyframes goldShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.gold-shimmer-text {
  background: linear-gradient(90deg, #735c00 0%, #d4af37 50%, #735c00 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: goldShimmer 6s linear infinite;
}

/* Prevent Alpine FOUC */
[x-cloak] {
  display: none !important;
}

/* 3D Interactive Envelope Animations */
.perspective-1000 {
  perspective: 1200px;
}

.envelope-flap-top {
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 25;
}

.envelope-flap-top.open {
  transform: rotateX(180deg);
  z-index: 5;
}

.envelope-letter {
  transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s;
}

.envelope-letter.extracted {
  transform: translateY(-45%) scale(1.03);
}

/* Pulsing Sage Green Seal */
@keyframes sageSealPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(138, 160, 118, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(138, 160, 118, 0); }
}

.seal-sage-pulse {
  animation: sageSealPulse 2.5s infinite ease-in-out;
}

/* Popping Heart Animation for Main Envelope Loading Overlay */
@keyframes heartPopBeat {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 2px 6px rgba(120, 20, 40, 0.4));
  }
  15% {
    transform: scale(1.38);
    filter: drop-shadow(0 0 16px rgba(225, 29, 72, 0.85));
  }
  28% {
    transform: scale(1.08);
    filter: drop-shadow(0 2px 6px rgba(120, 20, 40, 0.4));
  }
  42% {
    transform: scale(1.48);
    filter: drop-shadow(0 0 22px rgba(225, 29, 72, 0.95));
  }
  70%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 2px 6px rgba(120, 20, 40, 0.4));
  }
}

.animate-heart-pop {
  animation: heartPopBeat 1.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

/* Sharp rendering utility */
.sharp-render {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Card 1 Envelope 3-Line Wedding Typography */
.envelope-names-container {
  position: absolute;
  left: 48%;
  bottom: 8%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 82%;
  pointer-events: none;
  user-select: none;
  z-index: 10;
}

.envelope-word-name {
  font-family: 'Great Vibes', 'Playfair Display', cursive, serif;
  font-size: clamp(2.3rem, 6.2vw + 0.6rem, 3.8rem);
  font-weight: 400;
  line-height: 1.12;
  color: #3b0d19; /* Deep royal burgundy matching wax seal */
  letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7), 0 2px 4px rgba(59, 13, 25, 0.15);
  display: block;
}

.envelope-word-weds {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.4rem, 3.5vw + 0.3rem, 2.2rem);
  font-weight: 400;
  line-height: 1;
  color: #722036; /* Rich satin rose burgundy */
  margin: -0.15rem 0 0.05rem 0;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  display: block;
}

