/* Ocultar insignia y marcos inyectados de Netlify */
#nl-badge-frame,
#nl-hud-frame,
iframe[id^="nl-"],
iframe[title*="Netlify" i],
iframe[title*="Powered by Netlify" i] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  top: -99999px !important;
  left: -99999px !important;
  z-index: -999 !important;
}

:root {
  /* Paleta Baby Shower Isabela / Sirenita - Inspirada en la Invitación */
  --sand-linen: #f6f3ed;
  --sand-warm: #eee8de;
  --sea-mint: #769f8c;
  --sea-mint-light: #dceae3;
  --sea-mint-dark: #4f7868;
  --lilac-soft: #baa0d0;
  --lilac-deep: #8a64a3;
  --coral-soft: #eb7b77;
  --coral-deep: #d95853;
  --ocean-navy: #213242;
  --ocean-muted: #536b78;
  --gold-warm: #c5a059;
  --gold-light: #fae69e;
  --gold-dark: #967433;
  --line-gold: rgba(197, 160, 89, 0.28);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", Arial, sans-serif;
  --shadow-lux: 0 20px 50px rgba(79, 120, 104, 0.12);
  --shadow-gold: 0 10px 30px rgba(197, 160, 89, 0.22);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-family: var(--sans);
  color: var(--ocean-navy);
  background-color: var(--sand-linen);
}

body {
  overflow-x: hidden;
  background: linear-gradient(180deg, #f7f4ee 0%, #f0f7f3 35%, #f6f1f8 70%, #f7f4ee 100%);
  min-height: 100vh;
}

/* Tipografías */
.font-serif {
  font-family: var(--serif);
}

.font-sans {
  font-family: var(--sans);
}

/* Lienzo de partículas acuáticas / burbujas */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 40;
}

/* Pantalla de Apertura (Sobre de Lujo) - 100% Mobile First */
#envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at center, #fbf8f3 0%, #e8f2ec 55%, #dcebe2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.2s;
  touch-action: manipulation;
}

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

/* Contenedor del Sobre 3D - Adaptable a cualquier pantalla */
.envelope-wrapper {
  position: relative;
  width: min(340px, calc(100vw - 32px));
  height: min(230px, calc((100vw - 32px) * 0.68));
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(79, 120, 104, 0.25), 0 0 0 1px rgba(197, 160, 89, 0.4);
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  perspective: 1000px;
  overflow: visible;
}

@media (min-width: 640px) {
  .envelope-wrapper {
    width: 400px;
    height: 270px;
  }
}

.envelope-wrapper:active {
  transform: scale(0.98);
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #fdfbf7, #e8f2ec);
  border-radius: 14px;
  border: 1px solid rgba(197, 160, 89, 0.25);
}

/* Solapas con clip-path porcentual para escalabilidad perfecta */
.envelope-flap-left {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e3eee8, #d4e6dd);
  clip-path: polygon(0 0, 50% 50%, 0 100%);
  z-index: 2;
  border-radius: 14px 0 0 14px;
}

.envelope-flap-right {
  position: absolute;
  inset: 0;
  background: linear-gradient(225deg, #e3eee8, #d4e6dd);
  clip-path: polygon(100% 0, 50% 50%, 100% 100%);
  z-index: 2;
  border-radius: 0 14px 14px 0;
}

.envelope-flap-bottom {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ebf4ef 0%, #cde1d6 100%);
  clip-path: polygon(0 100%, 50% 46%, 100% 100%);
  z-index: 3;
  border-radius: 0 0 14px 14px;
}

.envelope-flap-top {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #d8ebe1 0%, #f6fbf8 100%);
  clip-path: polygon(0 0, 50% 56%, 100% 0);
  z-index: 4;
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 14px 14px 0 0;
}

.envelope-wrapper.opening .envelope-flap-top {
  transform: rotateX(180deg);
  z-index: 1;
}

/* Sello de Lacre Dorado con Concha Marina RyM */
.wax-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fae69e 0%, #c5a059 45%, #967433 85%, #664f1d 100%);
  box-shadow: 0 8px 25px rgba(79, 120, 104, 0.38), inset 0 2px 4px rgba(255, 255, 255, 0.6), inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: pulseSeal 2.4s infinite ease-in-out;
  transition: transform 0.3s ease, opacity 0.5s ease;
  border: 1px solid rgba(255, 245, 200, 0.6);
  user-select: none;
}

@media (min-width: 640px) {
  .wax-seal {
    width: 78px;
    height: 78px;
  }
}

.envelope-wrapper:hover .wax-seal,
.envelope-wrapper:active .wax-seal {
  transform: translate(-50%, -50%) scale(1.06);
}

.envelope-wrapper.opening .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.4);
}

@keyframes pulseSeal {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(197, 160, 89, 0.4), 0 0 0 0 rgba(212, 160, 70, 0.5);
  }
  50% {
    box-shadow: 0 12px 30px rgba(197, 160, 89, 0.6), 0 0 0 12px rgba(212, 160, 70, 0);
  }
}

/* Reproductor Flotante de Música */
.music-player-pill {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  right: 16px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: 9999px;
  padding: 6px 14px 6px 8px;
  box-shadow: 0 12px 30px rgba(79, 120, 104, 0.2), 0 2px 8px rgba(197, 160, 89, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  transition: all 0.3s ease;
}

.vinyl-disc {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #769f8c 0%, #4f7868 50%, #213242 85%, #0e171e 100%);
  border: 2px solid #c5a059;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.vinyl-disc.playing {
  animation: spinVinyl 6s linear infinite;
}

@keyframes spinVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-center {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fae69e;
  border: 2px solid #4f7868;
}

/* Estilo Polaroid Táctil */
.polaroid-card {
  background: #ffffff;
  padding: 10px 10px 18px 10px;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(79, 120, 104, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(220, 234, 227, 0.85);
  touch-action: manipulation;
}

.polaroid-card:hover {
  transform: translateY(-6px) scale(1.02) !important;
  box-shadow: 0 20px 45px rgba(79, 120, 104, 0.22), 0 0 0 2px rgba(197, 160, 89, 0.4);
  z-index: 10;
}

.polaroid-card:active {
  transform: scale(0.98);
}

.polaroid-card:nth-child(even) {
  transform: rotate(1deg);
}

.polaroid-card:nth-child(odd) {
  transform: rotate(-1deg);
}

.polaroid-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background-color: #f1f6f3;
}

.polaroid-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.polaroid-card:hover .polaroid-img-wrapper img {
  transform: scale(1.05);
}

/* Cuadrícula de fotos compacta */
.grid-photo-card {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(197, 160, 89, 0.2);
  background-color: #f0f7f3;
  touch-action: manipulation;
}

.grid-photo-card:hover img {
  transform: scale(1.08);
}

.grid-photo-card:active {
  transform: scale(0.97);
}

.grid-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.grid-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(33, 50, 66, 0.7) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
}

.grid-photo-card:hover .grid-photo-overlay {
  opacity: 1;
}

/* Lightbox Modal */
#lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(14, 23, 31, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 12px;
  touch-action: pan-y;
}

#lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(197, 160, 89, 0.4);
}

/* Destello dorado */
.gold-shimmer {
  background: linear-gradient(90deg, #c5a059 0%, #fae69e 50%, #c5a059 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 4s linear infinite;
}

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

/* Animación de latido y flotación */
.heart-beat {
  animation: heartPulse 1.8s infinite ease-in-out;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.18); }
  28% { transform: scale(1); }
  42% { transform: scale(1.12); }
  70% { transform: scale(1); }
}

.wave-float {
  animation: waveFloat 3s ease-in-out infinite;
}

@keyframes waveFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Botón interactivo de amor y bendiciones */
.love-btn {
  background: linear-gradient(135deg, #769f8c 0%, #8ab3a0 50%, #baa0d0 100%);
  box-shadow: 0 10px 25px rgba(118, 159, 140, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
}

.love-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 15px 35px rgba(118, 159, 140, 0.45);
}

.love-btn:active {
  transform: scale(0.96);
}
