/* 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 {
  --paper: #fff7fa;
  --white: #ffffff;
  --ink: #2c2628;
  --muted: #75666a;
  --rose: #e67696;
  --rose-soft: #fbdde6;
  --rose-mist: #fff0f4;
  --rose-deep: #bd4b6d;
  --berry: #77394c;
  --gold: #b98a3b;
  --gold-light: #f5d485;
  --gold-dark: #8c631e;
  --line: rgba(185, 138, 59, 0.25);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", Arial, sans-serif;
  --shadow-lux: 0 20px 50px rgba(119, 57, 76, 0.12);
  --shadow-gold: 0 12px 35px rgba(185, 138, 59, 0.25);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--sans);
  color: var(--ink);
  background-color: #fff6f9;
}

body {
  overflow-x: hidden;
  background: linear-gradient(180deg, #fff9fb 0%, #fff1f5 30%, #fae8ee 68%, #fff3f7 100%);
  min-height: 100vh;
}

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

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

/* Lienzo de partículas de fondo */
#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, #fff6f9 0%, #fce0ea 58%, #e9b3c6 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 ancho de celular */
.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(119, 57, 76, 0.28), 0 0 0 1.5px rgba(185, 138, 59, 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, #fff5f8, #fbdde6);
  border-radius: 14px;
  border: 1px solid rgba(185, 138, 59, 0.3);
}

/* Solapas usando clip-path para escalabilidad milimétrica en cualquier resolución */
.envelope-flap-left {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f9e0e9, #f3cad8);
  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, #f9e0e9, #f3cad8);
  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, #fce7f0 0%, #f1c5d4 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, #f6d1df 0%, #fdf0f5 100%);
  clip-path: polygon(0 0, 50% 56%, 100% 0);
  z-index: 4;
  transform-origin: top center;
  transition: transform 0.85s 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 tamaño táctil óptimo */
.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%, #d4a046 45%, #916117 85%, #664109 100%);
  box-shadow: 0 8px 25px rgba(119, 57, 76, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.65), 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: 1.5px solid rgba(255, 245, 200, 0.7);
  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(185, 138, 59, 0.4), 0 0 0 0 rgba(212, 160, 70, 0.5);
  }
  50% {
    box-shadow: 0 12px 30px rgba(185, 138, 59, 0.6), 0 0 0 12px rgba(212, 160, 70, 0);
  }
}

/* Retrato de Honor en el Hero */
.memorial-portrait-frame {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 0 auto 24px auto;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, #f5d485 0%, #b98a3b 50%, #fae69e 100%);
  box-shadow: 0 18px 45px rgba(119, 57, 76, 0.22), 0 0 28px rgba(245, 212, 133, 0.55);
}

@media (min-width: 640px) {
  .memorial-portrait-frame {
    width: 210px;
    height: 210px;
    padding: 7px;
  }
}

.memorial-portrait-frame::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(185, 138, 59, 0.55);
  animation: spinSlow 28s linear infinite;
}

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

.memorial-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #ffffff;
}

/* Reproductor Flotante Optimizado para Móvil */
.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(185, 138, 59, 0.4);
  border-radius: 9999px;
  padding: 6px 14px 6px 8px;
  box-shadow: 0 12px 30px rgba(119, 57, 76, 0.18), 0 2px 8px rgba(185, 138, 59, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  transition: all 0.35s ease;
}

.music-player-pill.video-active {
  border-color: rgba(189, 75, 109, 0.45);
  background: rgba(255, 248, 250, 0.95);
}

.vinyl-disc {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, #bd4b6d 0%, #77394c 50%, #2c2c2c 85%, #000 100%);
  border: 2px solid #b98a3b;
  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 5s linear infinite;
}

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

.vinyl-center {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f5d485;
  border: 2px solid #77394c;
}

/* Estilo Polaroid Táctil */
.polaroid-card {
  background: #ffffff;
  padding: 12px 12px 20px 12px;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(80, 62, 45, 0.09), 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(245, 212, 133, 0.55);
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.polaroid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(119, 57, 76, 0.14), 0 4px 12px rgba(185, 138, 59, 0.15);
}

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

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

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

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

.polaroid-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #77394c;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(185, 138, 59, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Marco de Video Conmemorativo Al Final */
.video-showcase-card {
  position: relative;
  background: linear-gradient(145deg, #ffffff 0%, #fff5f8 100%);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 25px 60px rgba(119, 57, 76, 0.18), 0 0 0 1.5px rgba(185, 138, 59, 0.45);
}

@media (min-width: 640px) {
  .video-showcase-card {
    padding: 22px;
    border-radius: 24px;
  }
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #140b0e;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(245, 212, 133, 0.4);
  aspect-ratio: 9 / 16;
  max-height: 76vh;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #140b0e;
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 11, 14, 0.2) 0%, rgba(20, 11, 14, 0.55) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 10;
  padding: 20px;
  text-align: center;
}

.video-play-overlay.hidden-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.video-play-btn-circle {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fae69e 0%, #d4a046 50%, #916117 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 8px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: pulseSeal 2.4s infinite ease-in-out;
}

.video-play-overlay:hover .video-play-btn-circle,
.video-play-overlay:active .video-play-btn-circle {
  transform: scale(1.08);
}

/* Lightbox Modal optimizado para pantallas táctiles */
#lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(14, 8, 11, 0.96);
  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: 74vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(185, 138, 59, 0.45);
}

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

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

/* Animación de latido */
.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); }
}

/* Botón interactivo con retroalimentación táctil */
.love-btn {
  background: linear-gradient(135deg, #77394c 0%, #bd4b6d 55%, #b98a3b 100%);
  box-shadow: 0 10px 25px rgba(119, 57, 76, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
}

.love-btn:hover {
  box-shadow: 0 14px 30px rgba(189, 75, 109, 0.45);
}

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