/* ==========================================================================
   PARA VOS — hoja de estilos
   ==========================================================================
   EDITAR COLORES Y TIPOGRAFÍA ACÁ ABAJO (bloque :root).
   El resto del archivo casi nunca hace falta tocarlo.
   ========================================================================== */

:root {
  /* -------- paleta -------- */
  --bg:            #FBF3EE;
  --bg-card:       #FFFCF8;
  --blush:         #F4D9CD;
  --rose:          #C77C90;
  --rose-deep:     #9C4A63;
  --plum:          #3B1F2B;
  --plum-soft:     #6E4C57;
  --gold:          #B4893F;
  --gold-light:    #E3C583;

  /* -------- tipografía -------- */
  --font-display: 'Cormorant Garamond', serif;
  --font-script:  'Parisienne', cursive;
  --font-body:    'Jost', sans-serif;

  /* -------- otros -------- */
  --radius: 18px;
  --shadow-soft: 0 20px 45px -20px rgba(59, 31, 43, 0.35);
  --max-width: 1080px;
}

/* ---------- reset básico ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--plum);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; font-weight: 600; }
p { margin: 0 0 1em; }

.script { font-family: var(--font-script); font-size: 1.4em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- sello decorativo ---------- */
.seal {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 70%);
  color: var(--bg-card);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  box-shadow: 0 8px 18px -6px rgba(180, 137, 63, 0.6), inset 0 0 0 2px rgba(255,255,255,0.35);
}
.seal-sm { width: 40px; height: 40px; font-size: 1rem; }
.seal-lg { width: 84px; height: 84px; font-size: 2rem; }

/* ==========================================================================
   PANTALLA DE CANDADO
   ========================================================================== */
.lock-screen {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(228, 197, 131, 0.35), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(199, 124, 144, 0.35), transparent 50%),
    var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.lock-screen.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.lock-thread {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent, var(--gold-light), transparent);
  opacity: 0.5;
}

.lock-card {
  position: relative;
  max-width: 420px; width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 44px 34px 36px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(180, 137, 63, 0.25);
}
.lock-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--rose-deep);
  margin-bottom: 6px;
}
.lock-title {
  font-size: 2rem;
  font-style: italic;
  color: var(--plum);
  margin-bottom: 12px;
}
.lock-sub { color: var(--plum-soft); font-size: 0.95rem; }

.lock-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.lock-form input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--blush);
  background: #fff;
  color: var(--plum);
  text-align: center;
  outline-offset: 3px;
}
.lock-form input:focus { border-color: var(--rose); }
.lock-form button {
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 14px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose));
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lock-form button:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(156, 74, 99, 0.6); }
.lock-form button:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--rose-deep); outline-offset: 3px;
}

.lock-error {
  min-height: 1.2em;
  margin-top: 14px;
  color: var(--rose-deep);
  font-size: 0.85rem;
}
.shake { animation: shake 0.4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ---------- mensaje sorpresa ---------- */
.surprise {
  position: fixed; inset: 0; z-index: 110;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--rose-deep), var(--plum));
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  padding: 24px;
}
.surprise.show { opacity: 1; visibility: visible; }
.surprise-inner { text-align: center; max-width: 480px; }
.surprise-text {
  color: #fff;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.5;
}

/* ==========================================================================
   PANTALLA DE CARGA — progreso real (dura lo que tarden los assets)
   Paleta distinta a la del candado pero que combina: base dorada
   oscura -> ciruela, con el anillo en rosa vino / dorado claro.
   ========================================================================== */
.loading-screen {
  position: fixed; inset: 0; z-index: 105;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--plum) 0%, #4a2536 55%, var(--rose-deep) 130%);
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  padding: 24px;
}
.loading-screen.show { opacity: 1; visibility: visible; }
.loading-inner { text-align: center; }

.loading-ring {
  position: relative;
  width: 118px; height: 118px;
  margin: 0 auto 26px;
}
.loading-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.loading-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 6;
}
.loading-ring-fill {
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 276.46; /* 2 * PI * 44 */
  stroke-dashoffset: 276.46;
  transition: stroke-dashoffset 0.25s ease;
}
.loading-percent {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: #fff;
}
.loading-message {
  color: var(--gold-light);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  min-height: 1.6em;
  opacity: 0;
  transition: opacity 0.4s ease;
  max-width: 320px;
}
.loading-message.show { opacity: 1; }

/* ==========================================================================
   SITIO / NAV
   ========================================================================== */
.site { overflow-x: hidden; }

.navbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 6vw;
  background: rgba(251, 243, 238, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(180, 137, 63, 0.18);
}
.nav-brand {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--rose-deep);
  text-decoration: none;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--plum-soft);
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0; height: 1.5px; background: var(--gold);
  transition: width 0.25s ease;
}
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--plum); display: block; }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 100%; right: 6vw; left: 6vw;
    background: var(--bg-card);
    flex-direction: column; gap: 4px;
    padding: 14px 18px; border-radius: 14px;
    box-shadow: var(--shadow-soft);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 4px; }
}

/* ---------- botón de música ---------- */
.music-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 52px; height: 52px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose));
  color: #fff; font-size: 1.3rem;
  box-shadow: 0 10px 25px -10px rgba(156, 74, 99, 0.7);
  transition: transform 0.2s ease;
}
.music-toggle:hover { transform: scale(1.08); }
.music-toggle[aria-pressed="true"] .music-icon { animation: spin 3.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 100px 6vw 60px;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-color: var(--blush);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hero-bg.loaded { opacity: 1; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(59,31,43,0.15) 0%, rgba(59,31,43,0.55) 75%, rgba(59,31,43,0.75) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 640px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.75rem;
  color: var(--gold-light);
  margin-bottom: 10px;
}
.hero-title {
  font-family: var(--font-script);
  font-size: clamp(3.2rem, 10vw, 6rem);
  color: #fff;
  line-height: 1;
  margin-bottom: 16px;
  text-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.hero-sub { color: #fbeee7; font-size: 1.05rem; max-width: 480px; margin: 0 auto 26px; }
.hero-cta {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.6);
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.hero-cta:hover { background: rgba(255,255,255,0.15); border-color: #fff; }

.compliment-strip {
  position: relative; z-index: 2;
  margin-top: 46px;
  min-height: 1.6em;
}
.compliment-text {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold-light);
  font-size: 1.15rem;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.compliment-text.show { opacity: 1; }

/* ==========================================================================
   SECCIONES GENERALES
   ========================================================================== */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 6vw;
}
.section-head { text-align: center; max-width: 620px; margin: 0 auto 50px; }
.section-title {
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-style: italic;
  color: var(--rose-deep);
  margin: 4px 0 10px;
}
.section-sub { color: var(--plum-soft); }

.section-belleza { background: linear-gradient(180deg, transparent, rgba(244, 217, 205, 0.35) 20%, rgba(244, 217, 205, 0.35) 80%, transparent); }

/* ---------- galería de fotos ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-soft);
  background: var(--blush);
  /* clave para el rendimiento: el navegador no calcula layout/paint
     de los items que están lejos del viewport */
  content-visibility: auto;
  contain-intrinsic-size: 340px 425px;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.5s ease;
}
.gallery-item img.loaded { opacity: 1; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 16px 14px;
  background: linear-gradient(0deg, rgba(59,31,43,0.85), transparent);
  color: #fff;
}
.gallery-caption .cap-title { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; }
.gallery-caption .cap-desc { font-size: 0.82rem; opacity: 0.9; margin: 2px 0 0; }

/* ==========================================================================
   VIDEO — poster estático borroso de fondo (NO video duplicado)
   + video real (contain) hidratado solo cuando entra en viewport.
   ========================================================================== */
.gallery-item.video-item {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
  contain-intrinsic-size: 340px 191px;
}

.video-frame {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
}

/* fondo: UNA imagen (poster) agrandada y borrosa vía CSS — no un
   segundo <video> reproduciéndose. Esto es lo que corta a la mitad
   el costo de decodificación por cada video. */
.video-poster-bg {
  position: absolute; inset: -30px;
  width: calc(100% + 60px); height: calc(100% + 60px);
  background-size: cover; background-position: center;
  filter: blur(28px) brightness(0.7) saturate(1.1);
  transform: scale(1.1);
}

.video-main {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.video-main.loaded { opacity: 1; }

.video-controls {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  display: flex; gap: 8px;
}
.video-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(59, 31, 43, 0.55);
  backdrop-filter: blur(4px);
  color: #fff; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.video-btn:hover { background: rgba(59, 31, 43, 0.8); transform: scale(1.05); }

.video-item .gallery-caption {
  z-index: 2;
  background: linear-gradient(0deg, rgba(59, 31, 43, 0.85), transparent);
}
.video-item .gallery-caption .cap-title,
.video-item .gallery-caption .cap-desc {
  display: block;
  width: fit-content;
  border: 1px solid rgba(228, 197, 131, 0.6);
  border-radius: 8px;
  padding: 4px 10px;
  background: rgba(59, 31, 43, 0.55);
  color: #fff;
}
.video-item .gallery-caption .cap-title { margin-bottom: 6px; opacity: 1; }
.video-item .gallery-caption .cap-desc { opacity: 1; }

/* ---------- nota de apoyo ---------- */
.note-card {
  background: var(--bg-card);
  border-left: 3px solid var(--gold);
  border-radius: 4px 18px 18px 4px;
  padding: 34px 32px;
  max-width: 720px;
  margin: 0 auto 50px;
  box-shadow: var(--shadow-soft);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--plum);
}
.note-card p:last-child { margin-bottom: 0; }

/* ---------- hitos / logros ---------- */
.milestones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  max-width: 900px;
  margin: 0 auto;
}
.milestone {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.milestone .m-icon { font-size: 1.6rem; margin-bottom: 8px; color: var(--gold); }
.milestone h3 { font-size: 1.1rem; font-style: italic; color: var(--rose-deep); margin-bottom: 6px; }
.milestone p { font-size: 0.88rem; color: var(--plum-soft); margin: 0; }

/* ---------- carta ---------- */
.section-carta { background: linear-gradient(180deg, transparent, rgba(228,197,131,0.15) 20%, rgba(228,197,131,0.15) 85%, transparent); }
.letter {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 52px 44px;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.letter::before {
  content: '';
  position: absolute; inset: 14px;
  border: 1px solid rgba(180, 137, 63, 0.3);
  border-radius: 12px;
  pointer-events: none;
}
.letter-greeting { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--rose-deep); }
.letter p { font-size: 1.02rem; }
.letter-sign { margin-top: 26px; color: var(--plum-soft); }
.letter-sign .script { color: var(--rose-deep); }

/* ---------- footer ---------- */
.footer {
  text-align: center;
  padding: 60px 6vw 80px;
  color: var(--plum-soft);
  font-size: 0.85rem;
}

/* ---------- animaciones de aparición al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- galería responsive ---------- */
@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr; }
}