/* ===================================================
   TRISHA'S BIRTHDAY CELEBRATION STYLESHEET
   Aesthetic: Royal Maroon & Champagne Gold Velvet Glow
   =================================================== */

:root {
  --bg-dark: #120105;
  --bg-gradient: radial-gradient(circle at 50% 20%, #420815 0%, #24040b 50%, #120105 100%);
  --maroon-dark: #2a050d;
  --maroon-card: rgba(56, 8, 17, 0.72);
  --maroon-border: rgba(255, 160, 180, 0.25);
  --maroon-primary: #9e142f;
  --maroon-glow: rgba(180, 24, 56, 0.5);
  --maroon-light: #f8b4c0;
  --gold-accent: #ffd166;
  --gold-glow: rgba(255, 209, 102, 0.45);
  --text-main: #fff5f7;
  --text-muted: #e2c2ca;
  --parchment-bg: #fffbf0;
  --parchment-text: #3c1e15;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Outfit', sans-serif;
  --font-handwriting: 'Dancing Script', cursive;
  --font-script2: 'Caveat', cursive;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  position: relative;
}

/* Ambient Canvas Background */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* ===================================================
   ACT 1: WAX SEALED ENVELOPE MODAL
   =================================================== */
.envelope-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #3d0612 0%, #120105 100%);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  padding: 20px;
}

.envelope-overlay.opened {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 480px;
  width: 100%;
  position: relative;
}

/* ===================================================
   ACT 1: REALISTIC LUXURY WAX-SEALED ENVELOPE
   =================================================== */
.envelope-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #35050f 0%, #120105 100%);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  padding: 20px;
}

.envelope-overlay.opened {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1200px;
}

/* 3D Envelope Realistic Body */
.envelope {
  position: relative;
  width: 360px;
  height: 240px;
  background: #5c0717;
  border-radius: 6px;
  cursor: pointer;
  perspective: 1200px;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    0 3px 10px rgba(0, 0, 0, 0.4);
}

.envelope:hover {
  transform: translateY(-8px) scale(1.02);
}

.envelope:hover .envelope-ground-shadow {
  transform: scale(0.92);
  opacity: 0.35;
}

/* Floating Soft Ground Shadow */
.envelope-ground-shadow {
  position: absolute;
  bottom: -35px;
  left: 5%;
  width: 90%;
  height: 25px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, transparent 75%);
  filter: blur(8px);
  pointer-events: none;
  transition: transform 0.4s ease, opacity 0.4s ease;
  z-index: -1;
}

/* Envelope Interior / Lining */
.envelope-interior {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #2b030b;
  border-radius: 6px;
  overflow: hidden;
  z-index: 1;
}

.envelope-gold-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(rgba(255, 209, 102, 0.15) 1px, transparent 1px),
    radial-gradient(rgba(255, 209, 102, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  opacity: 0.7;
}

/* Letter inside the envelope */
.envelope-letter-preview {
  position: absolute;
  top: 15px;
  left: 24px;
  right: 24px;
  height: 195px;
  background: #fffcf5;
  background-image: 
    radial-gradient(#eedac3 1px, transparent 1px),
    radial-gradient(#eedac3 1px, #fffcf5 1px);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 
    0 -3px 12px rgba(0, 0, 0, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-top: 2px solid #800020;
}

.preview-header-line {
  width: 45px;
  height: 3px;
  background: #800020;
  border-radius: 2px;
  margin-bottom: 14px;
}

.preview-text-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 80%;
  align-items: center;
}

.preview-text-lines span {
  display: block;
  height: 2px;
  background: #d4a373;
  border-radius: 2px;
}

.preview-text-lines span:nth-child(1) { width: 100%; }
.preview-text-lines span:nth-child(2) { width: 85%; }
.preview-text-lines span:nth-child(3) { width: 60%; }

.preview-seal-heart {
  font-size: 1.4rem;
  margin-top: 15px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* Realistic Paper Side Flaps (Left & Right) */
.envelope-side-flap {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.envelope-side-flap.flap-left {
  left: 0;
  background: linear-gradient(115deg, #740c1f 0%, #540816 70%, #3e040f 100%);
  clip-path: polygon(0 0, 0 100%, 53% 50%);
  filter: drop-shadow(2px 0 4px rgba(0, 0, 0, 0.35));
}

.envelope-side-flap.flap-right {
  right: 0;
  background: linear-gradient(245deg, #660a1b 0%, #4d0714 70%, #38030d 100%);
  clip-path: polygon(100% 0, 100% 100%, 47% 50%);
  filter: drop-shadow(-2px 0 4px rgba(0, 0, 0, 0.4));
}

/* Realistic Paper Bottom Flap */
.envelope-bottom-flap {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, #480512 0%, #5f091a 60%, #6e0c1f 100%);
  clip-path: polygon(0 100%, 100% 100%, 50% 46%);
  z-index: 4;
  filter: drop-shadow(0 -3px 6px rgba(0, 0, 0, 0.35));
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Realistic Top Triangular Flap */
.envelope-top-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #851026 0%, #700c1f 55%, #580817 100%);
  clip-path: polygon(0 0, 100% 0, 50% 55%);
  transform-origin: top center;
  z-index: 5;
  transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.65));
}

.top-flap-gold-edge {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(0 0, 100% 0, 50% 55%, 50% 54%, 98% 2%, 2% 2%);
  background: linear-gradient(to bottom, rgba(255, 209, 102, 0.4) 0%, rgba(255, 209, 102, 0.1) 100%);
  pointer-events: none;
}

/* ===================================================
   REALISTIC MOLTEN WAX SEAL
   =================================================== */
.wax-seal {
  position: absolute;
  top: 130px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  /* Organic melted wax edge */
  border-radius: 52% 48% 51% 49% / 49% 52% 48% 51%;
  background: radial-gradient(circle at 35% 32%, #e63956 0%, #aa142f 40%, #70081a 80%, #480410 100%);
  z-index: 6;
  box-shadow: 
    0 6px 18px rgba(0, 0, 0, 0.65),
    0 2px 4px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    inset 0 -3px 6px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
  animation: waxBreathe 3s infinite alternate ease-in-out;
}

.wax-seal:hover {
  transform: translate(-50%, -50%) scale(1.12);
  filter: brightness(1.1);
}

@keyframes waxBreathe {
  0% { 
    box-shadow: 
      0 6px 18px rgba(0, 0, 0, 0.65),
      0 0 12px rgba(255, 77, 109, 0.3),
      inset 0 2px 4px rgba(255, 255, 255, 0.35),
      inset 0 -3px 6px rgba(0, 0, 0, 0.6);
  }
  100% { 
    box-shadow: 
      0 8px 25px rgba(0, 0, 0, 0.8),
      0 0 24px rgba(255, 209, 102, 0.4),
      inset 0 2px 4px rgba(255, 255, 255, 0.45),
      inset 0 -3px 6px rgba(0, 0, 0, 0.7);
  }
}

/* Realistic specular gloss reflection */
.wax-gloss-highlight {
  position: absolute;
  top: 5px;
  left: 10px;
  width: 28px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
  transform: rotate(-35deg);
  pointer-events: none;
}

/* Debossed Stamped Groove */
.wax-pressed-border {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.45);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.6),
    0 1px 1px rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.seal-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.wax-heart-svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* ===================================================
   UNFOLDING ANIMATION STATES
   =================================================== */
.envelope.unfolding .envelope-top-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.envelope.unfolding .wax-seal {
  transform: translate(-50%, -130%) scale(0);
  opacity: 0;
  transition: all 0.55s ease;
}

.envelope.unfolding .envelope-letter-preview {
  transform: translateY(-110px);
}


/* ===================================================
   MAIN CONTENT CONTAINER
   =================================================== */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 20px 80px 20px;
  opacity: 1;
  transition: opacity 1s ease;
}

.main-content.hidden {
  display: none;
}

/* ===================================================
   HERO BANNER
   =================================================== */
.hero-section {
  text-align: center;
  padding: 60px 10px 90px 10px;
  position: relative;
}

.hero-badge {
  display: inline-block;
  background: rgba(158, 20, 47, 0.25);
  border: 1px solid rgba(255, 209, 102, 0.35);
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: glowPulse 3s infinite ease-in-out;
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 10px rgba(158, 20, 47, 0.3); }
  50% { box-shadow: 0 0 25px rgba(255, 209, 102, 0.4); }
  100% { box-shadow: 0 0 10px rgba(158, 20, 47, 0.3); }
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
}

.shimmer-text {
  background: linear-gradient(120deg, #ff8da1 0%, #ffd166 40%, #ff4d6d 70%, #ffc2d1 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 4s linear infinite;
  display: inline-block;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.8vw, 1.4rem);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 40px auto;
  font-weight: 300;
}

.scroll-down-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--maroon-light);
  opacity: 0.85;
}

.bounce-arrow {
  font-size: 1.4rem;
  animation: bounceUpDown 2s infinite ease-in-out;
  color: var(--gold-accent);
}

@keyframes bounceUpDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ===================================================
   COMMON SECTION STYLING
   =================================================== */
.section {
  padding: 70px 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 35px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  color: var(--text-main);
  margin-bottom: 0;
}

.letter-quote-box {
  background: rgba(158, 20, 47, 0.1);
  border-left: 4px solid var(--maroon-primary);
  padding: 14px 22px;
  margin: 22px 0;
  border-radius: 0 10px 10px 0;
}

.letter-quote-box p {
  font-family: var(--font-handwriting);
  font-size: 1.85rem;
  color: var(--maroon-primary);
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}


/* ===================================================
   ACT 5: THE PARCHMENT LOVE LETTER
   =================================================== */
.letter-section {
  padding-bottom: 90px;
}

.letter-parchment-wrapper {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}

.parchment-sheet {
  background: var(--parchment-bg);
  background-image: 
    radial-gradient(#eedac3 1px, transparent 1px),
    radial-gradient(#eedac3 1px, var(--parchment-bg) 1px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  color: var(--parchment-text);
  border-radius: 12px;
  padding: 50px 45px;
  box-shadow: 
    0 1px 3px rgba(0,0,0,0.12),
    0 10px 30px rgba(0,0,0,0.4),
    0 25px 60px rgba(0,0,0,0.3);
  position: relative;
  border-left: 5px solid #800020;
}

.letter-stamp {
  position: absolute;
  top: 25px;
  right: 25px;
  border: 2px dashed #800020;
  color: #800020;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  transform: rotate(6deg);
}

.letter-salutation {
  font-family: var(--font-handwriting);
  font-size: 2.2rem;
  font-weight: 700;
  color: #630517;
  margin-bottom: 25px;
}

.letter-body {
  font-family: var(--font-script2);
  font-size: 1.45rem;
  line-height: 1.7;
  color: #380a13;
}

.letter-body p {
  margin-bottom: 18px;
}

.letter-promise {
  font-weight: 700;
  color: #800020;
}

.letter-signature {
  margin-top: 35px;
  text-align: right;
}

.signature-date {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: #7d4e3d;
}

.signature-handwritten {
  font-family: var(--font-handwriting);
  font-size: 2rem;
  font-weight: 700;
  color: #800020;
}


/* ===================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   =================================================== */
@media (max-width: 768px) {
  .parchment-sheet {
    padding: 35px 20px;
  }

  .letter-stamp {
    position: static;
    display: inline-block;
    margin-bottom: 15px;
  }
}

@media (max-width: 420px) {
  .envelope {
    width: 300px;
    height: 200px;
  }

  .wax-seal {
    top: 110px;
    width: 62px;
    height: 62px;
  }

  .wax-heart-svg {
    width: 22px;
    height: 22px;
  }
}
