/* ==========================================================================
   WEB APP INVITACIÓN DIGITAL PREMIUM - PUBLIPATIA
   Arquitectura CSS de Alto Rendimiento (60fps) y Cero Dependencias Pesadas
   Paleta: Blanco, Negro y Toques de Dorado Imperial
   Totalmente optimizado para Celulares y Desktop
   ========================================================================== */

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

:root {
  --color-gold-main: #d4af37;
  --color-gold-light: #f4e0ad;
  --color-gold-dark: #b38f28;
  --color-gold-sand: #e6ca85;
  --color-ivory: #fdfbf7;
  --color-ivory-card: #fdfbf7;
  --color-dark-mate: #0a0a0a;
  --color-dark-card: #141414;
  --color-dark-surface: #1a1a1a;
  --color-border-gold: rgba(212, 175, 55, 0.35);
}

/* Tipografías de Alta Distinción */
.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, 'Segoe UI', Roboto, sans-serif;
}

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

/* Reglas Base */
html {
  scroll-behavior: smooth;
  background-color: var(--color-dark-mate);
  color: #f3f4f6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ==========================================================================
   REGLA CRÍTICA N°3: ENCUADRE DE FONDOS CON ENFOQUE SUPERIOR Y SIN RECORTES
   ========================================================================== */
.bg-smart-section {
  background-position: top center;
  background-repeat: no-repeat;
  background-size: cover;
  background-color: var(--color-dark-mate);
}

@media (min-width: 1024px) {
  .bg-smart-section {
    background-size: cover;
    background-position: top center;
  }
}

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

.bg-cover-top {
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* ==========================================================================
   PANTALLA DE INICIO 1: SOBRE FLOTANTE ADAPTADO A CELULAR Y DESKTOP
   ========================================================================== */
#welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1rem;
}

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

.envelope-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  background: var(--color-ivory-card);
  border: 1px solid var(--color-border-gold);
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 35px rgba(212, 175, 55, 0.2);
  padding: 2.25rem 1.5rem;
  text-align: center;
  overflow-y: auto;
  animation: floatCard 4.5s ease-in-out infinite alternate;
}

@media (max-width: 480px) {
  .envelope-card {
    padding: 1.75rem 1.25rem;
    border-radius: 20px;
  }
}

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

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

/* Círculo Dorado de Iniciales (Monograma Central) */
.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.2) 0%, rgba(212, 175, 55, 0.04) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(212, 175, 55, 0.15);
}

@media (max-width: 480px) {
  .gold-initials-ring {
    width: 66px;
    height: 66px;
  }
}

/* Botón Circular de Apertura de Sobre */
.btn-open-invitation {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold-main) 0%, var(--color-gold-dark) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.45);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

@media (max-width: 480px) {
  .btn-open-invitation {
    width: 60px;
    height: 60px;
  }
}

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

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

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

/* ==========================================================================
   BOTÓN FLOTANTE DE CONTROL DE MÚSICA
   ========================================================================== */
.music-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.9);
  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.6), 0 0 18px rgba(212, 175, 55, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 480px) {
  .music-btn {
    bottom: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
  }
}

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

@keyframes pulseMusic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); color: #ffffff; }
}

/* ==========================================================================
   SISTEMA DE PARTÍCULAS CANVAS
   ========================================================================== */
.particles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

/* ==========================================================================
   ITINERARIO LINEAL VERTICAL ANIMADO (OPTIMIZADO EN CELULAR)
   ========================================================================== */
.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: 20px;
    transform: none;
  }
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-dark-card);
  border: 2px solid var(--color-gold-main);
  color: var(--color-gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transform: translateX(-50%);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.4);
  z-index: 3;
}

@media (max-width: 768px) {
  .timeline-dot {
    left: 20px;
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
    transform: translateX(-50%);
  }
}

/* Animaciones Suaves de Entrada con Scroll */
.fade-up-element {
  opacity: 0;
  transform: translateY(30px);
  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);
}

/* ==========================================================================
   GALERÍA MASONRY / MOSAICO (SIN RECORTES)
   ========================================================================== */
.masonry-item {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: #111111;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

@media (min-width: 640px) {
  .masonry-item {
    margin-bottom: 1.25rem;
    border-radius: 1.25rem;
  }
}

.masonry-item:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(212, 175, 55, 0.3);
  border-color: var(--color-gold-main);
}

.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.masonry-item:hover img {
  transform: scale(1.03);
}

/* ==========================================================================
   SECCIÓN DE CONFIRMACIÓN DE ASISTENCIA (FORMULARIO ELEGANTE)
   ========================================================================== */
.input-underline {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(212, 175, 55, 0.4);
  padding: 0.85rem 0.35rem;
  color: #ffffff;
  font-size: 16px; /* Evita auto-zoom en iOS Safari */
  transition: all 0.3s ease;
  outline: none;
  border-radius: 0;
  min-height: 48px;
}

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

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

select.input-underline {
  background-color: var(--color-dark-card);
  color: #ffffff;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d4af37'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.5em;
  padding-right: 2rem;
}

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

/* Botón Píldora Dorado WhatsApp */
.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: #0a0a0a;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1rem 2.25rem;
  border-radius: 9999px;
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.45);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  width: 100%;
  max-width: 380px;
}

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

/* ==========================================================================
   FOOTER CON MICROINTERACCIONES SUTILES
   ========================================================================== */
.footer-link {
  position: relative;
  color: var(--color-gold-light);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-link::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -3px;
  left: 0;
  background: linear-gradient(90deg, var(--color-gold-main), var(--color-gold-light));
  transform-origin: bottom right;
  transition: transform 0.35s 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.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 1rem;
}

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

#lightbox-img {
  max-width: 96vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.25);
  transform: scale(0.95);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#lightbox-modal.active #lightbox-img {
  transform: scale(1);
}
