/* ==========================================================================
   THEME: MIDNIGHT BLACK & GOLD ROYALE
   Demo 2: Mateo & Isabella • Boda Gala Nocturna
   ========================================================================== */

:root {
  --color-dark-bg: #0D110F;
  --color-card-bg: #161D19;
  --color-gold: #D4AF5F;
  --color-gold-light: #F5E5BE;
  --color-gold-dark: #916E27;
  --color-text-light: #F2EFE9;
  --color-text-muted: #A3ACA6;
  --color-border: #2A362F;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Montserrat', system-ui, sans-serif;
  --font-script: 'Great Vibes', cursive;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-dark-bg);
  color: var(--color-text-light);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: radial-gradient(circle at 50% 20%, rgba(212, 175, 95, 0.08) 0%, transparent 60%);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-text-light);
}

.wedding-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.wedding-card {
  background: var(--color-card-bg);
  border: 1.5px solid var(--color-gold);
  border-radius: 1.75rem;
  padding: 2.5rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 95, 0.1);
  text-align: center;
}

/* Retrato Pareja */
.couple-photo-wrapper {
  max-width: 320px;
  margin: 0 auto 1.5rem;
  perspective: 1000px;
}

.couple-photo-frame {
  position: relative;
  border-radius: 1.5rem;
  padding: 8px;
  background: linear-gradient(135deg, #D4AF5F 0%, #3B2A08 50%, #D4AF5F 100%);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(212, 175, 95, 0.25);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.couple-photo-wrapper:hover .couple-photo-frame {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 35px rgba(212, 175, 95, 0.4);
}

.couple-photo-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 1.15rem;
  display: block;
}

/* Hero */
.hero-section {
  text-align: center;
  padding: 4rem 1.25rem 2rem;
}

.hero-names {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--color-gold-light);
  margin: 0.5rem 0;
  text-shadow: 0 0 20px rgba(212, 175, 95, 0.3);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #D4AF5F 0%, #F5E5BE 50%, #B88B35 100%);
  color: #1A1303;
  box-shadow: 0 8px 24px rgba(212, 175, 95, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(212, 175, 95, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--color-gold);
  border-color: var(--color-gold);
}

.btn-outline:hover {
  background: rgba(212, 175, 95, 0.1);
}

/* Countdown */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  max-width: 440px;
  margin: 1.5rem auto 0;
}

.countdown-box {
  background: #0E1411;
  border: 1px solid var(--color-gold);
  border-radius: 1rem;
  padding: 1rem 0.5rem;
}

.countdown-number {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-gold);
}

.countdown-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Timeline */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
  text-align: left;
}

.timeline-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #0E1411;
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  border-radius: 1rem;
}

.timeline-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-gold);
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-light);
}

.timeline-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   SOBRE 3D MIDNIGHT BLACK & GOLD (GALA REALISTA)
   ========================================================================== */
#envelope-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(20, 27, 23, 0.98) 0%, rgba(8, 11, 10, 0.99) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  cursor: pointer;
  transition: opacity 1.0s cubic-bezier(0.25, 1, 0.5, 1), filter 1.0s ease, visibility 1.0s ease, transform 1.0s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform, filter, visibility;
}

#envelope-overlay.opened {
  opacity: 0;
  filter: blur(4px);
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.06);
}

.envelope-wrapper {
  position: relative;
  width: 92vw;
  max-width: 560px;
  height: 350px;
  perspective: 1600px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

@media (max-width: 600px) {
  .envelope-wrapper {
    max-width: 92vw;
    height: 270px;
  }
}

.envelope-wrapper:hover {
  transform: translateY(-6px) rotateX(2deg);
}

.envelope-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #1C231F 0%, #121815 50%, #0B100D 100%);
  border-radius: 18px;
  box-shadow: 
    0 30px 60px -15px rgba(0, 0, 0, 0.9),
    0 15px 25px -10px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1.5px rgba(212, 175, 95, 0.5);
  overflow: visible;
  transform-style: preserve-3d;
}

.envelope-liner {
  position: absolute;
  inset: 6px;
  background: linear-gradient(135deg, #2D2311 0%, #151109 100%);
  border-radius: 14px;
  z-index: 1;
}

.envelope-letter {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  bottom: 14px;
  background: #101613;
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(212, 175, 95, 0.6);
  transform: translateY(35px) scale(0.96);
  opacity: 0;
  transition: transform 1.3s cubic-bezier(0.25, 1, 0.5, 1) 1.0s, opacity 0.8s ease 1.0s, box-shadow 1.3s ease 1.0s;
  will-change: transform, opacity, box-shadow;
}

.envelope-letter::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(212, 175, 95, 0.4);
  border-radius: 8px;
  pointer-events: none;
}

.envelope-wrapper.is-opening .envelope-letter {
  transform: translateY(-145px) scale(1.06);
  opacity: 1;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 95, 0.3);
  z-index: 5;
}

@media (max-width: 600px) {
  .envelope-wrapper.is-opening .envelope-letter {
    transform: translateY(-100px) scale(1.05);
  }
}

.envelope-pocket {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #18201C 0%, #0F1411 100%);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  border-radius: 0 0 18px 18px;
  z-index: 3;
  box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.4);
}

.envelope-pocket::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 40%);
  pointer-events: none;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(180deg, #242E28 0%, #161C18 60%, #0F1411 100%);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  border-radius: 18px 18px 0 0;
}

.envelope-flap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 95, 0.8), transparent);
}

.envelope-wrapper.is-opening .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.4);
}

.wax-seal {
  position: absolute;
  top: 56%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, #FFF4CC 0%, #D4AF5F 35%, #8A6421 75%, #4A330D 100%);
  border: 3px solid #FFF3C4;
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(212, 175, 95, 0.4),
    inset 0 4px 8px rgba(255, 255, 255, 0.7),
    inset 0 -4px 8px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2E1F07;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.45rem;
  z-index: 6;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease, filter 0.5s ease;
}

@media (max-width: 600px) {
  .wax-seal {
    width: 82px;
    height: 82px;
    top: 56%;
  }
}

.envelope-wrapper:hover .wax-seal {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.9), 0 0 25px rgba(212, 175, 95, 0.6);
}

.envelope-wrapper.is-opening .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.2) translateY(-10px);
  filter: blur(4px);
  pointer-events: none;
}

.palette-container {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.palette-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.floating-music-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1B241F;
  border: 1.5px solid var(--color-gold);
  color: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
