@import url('https://fonts.googleapis.com/css2?family=Alex+Brush&family=Cinzel:wght@400;600;700;800&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  --color-sage-dark: #1b3022;
  --color-sage-medium: #2d4a36;
  --color-sage-light: #4a7c59;
  --color-sage-soft: #e9f1eb;
  --color-gold-main: #d4af37;
  --color-gold-light: #f4e0ad;
  --color-gold-dark: #b38f28;
  --color-gold-sand: #e6ca85;
  --color-ivory: #fbf9f4;
  --color-ivory-card: #fdfbf7;
  --color-dark-mate: #0b130e;
  --color-dark-card: #122117;
}

/* Custom Typography Classes */
.font-serif-title {
  font-family: 'Cinzel', 'Cormorant Garamond', Georgia, serif;
}

.font-serif-body {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.font-sans-clean {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-script {
  font-family: 'Alex Brush', cursive;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
  background-color: var(--color-dark-mate);
  color: #2b2b2b;
  overflow-x: hidden;
}

body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: var(--color-dark-mate);
}

/* Background image containment & top focus rules (REGLA CRÍTICA N°3) */
.bg-cover-top {
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
}

.bg-contain-top {
  background-position: top center;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: var(--color-dark-mate);
}

/* Smart Responsive Section BG */
.bg-smart-section {
  background-position: top center;
  background-repeat: no-repeat;
  background-size: cover;
  background-color: var(--color-dark-mate);
}

@media (min-aspect-ratio: 16/9) {
  .bg-smart-section {
    background-size: contain;
  }
}

/* Floating Envelope Welcome Modal */
#welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 19, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#welcome-overlay.hidden-overlay {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px) scale(0.98);
}

/* Envelope Card Styling */
.envelope-card {
  position: relative;
  width: 90%;
  max-width: 440px;
  background: var(--color-ivory-card);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.15);
  padding: 2.5rem 1.75rem;
  text-align: center;
  overflow: hidden;
  animation: floatCard 4s ease-in-out infinite alternate;
}

@keyframes floatCard {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}

.envelope-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--color-gold-main), transparent);
}

/* Golden Initials Monogram Badge */
.gold-initials-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid var(--color-gold-main);
  background: radial-gradient(circle, rgba(244, 224, 173, 0.25) 0%, rgba(212, 175, 55, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.25), inset 0 0 10px rgba(212, 175, 55, 0.15);
}

/* Ripple Glow Open Button */
.btn-open-invitation {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold-main) 0%, #b38f28 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-open-invitation::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(212, 175, 55, 0.5);
  animation: spinPulse 8s linear infinite;
}

.btn-open-invitation:hover {
  transform: scale(1.08);
  box-shadow: 0 15px 35px rgba(212, 175, 55, 0.6);
}

@keyframes spinPulse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Floating Music Control Button */
.music-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(18, 33, 23, 0.85);
  border: 2px solid var(--color-gold-main);
  color: var(--color-gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.3);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.3s ease;
}

.music-btn.playing i {
  animation: pulseMusic 1.8s ease-in-out infinite;
}

@keyframes pulseMusic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Particle canvas container */
.particles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

/* Timeline Styling */
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--color-gold-main) 15%, var(--color-gold-main) 85%, transparent);
  transform: translateX(-50%);
}

@media (max-width: 768px) {
  .timeline-line {
    left: 28px;
    transform: none;
  }
}

/* Scroll Animation Helper */
.fade-up-element {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.fade-up-element.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Masonry Columns Fixes */
.masonry-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.masonry-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 15px 30px rgba(212, 175, 55, 0.25);
}

/* Form Custom Underline Input (Section RSVP) */
.input-underline {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(212, 175, 55, 0.4);
  padding: 0.75rem 0.25rem;
  color: #ffffff;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.input-underline:focus {
  border-bottom-color: var(--color-gold-main);
  box-shadow: 0 4px 12px -2px rgba(212, 175, 55, 0.2);
}

.input-underline::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

select.input-underline {
  background-color: var(--color-dark-card);
  color: #ffffff;
  cursor: pointer;
}

select.input-underline option {
  background-color: var(--color-dark-card);
  color: #ffffff;
}

/* WhatsApp Action Button Styling */
.btn-whatsapp-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--color-gold-sand) 0%, var(--color-gold-main) 100%);
  color: #111827;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1rem 2.5rem;
  border-radius: 9999px;
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-whatsapp-pill:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 35px rgba(212, 175, 55, 0.6);
  background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold-main) 100%);
}

/* Footer Link Micro-interactions */
.footer-link {
  position: relative;
  color: var(--color-gold-light);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--color-gold-main);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.footer-link:hover {
  color: #ffffff;
}

.footer-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Image Lightbox Modal */
#lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

#lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

#lightbox-img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}
