/* Capa de vida: fondos con paralaje, texto por palabras, brillos y respuesta al toque.
   Solo transform / opacity / translate / scale para que el teléfono no se trabe. */

/* ---------- Brillos y ondas al tocar ---------- */
.brillos { position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:40 }
.onda-tap { position:fixed; z-index:41; width:44px; height:44px; margin:-22px 0 0 -22px; border-radius:50%; pointer-events:none;
  border:1.5px solid rgba(230,213,182,.9); box-shadow:0 0 14px rgba(255,236,186,.55), inset 0 0 8px rgba(255,236,186,.35);
  animation:onda-tap .75s var(--ease) forwards }
.onda-tap.grande { width:76px; height:76px; margin:-38px 0 0 -38px; border-width:2px }
@keyframes onda-tap { from { transform:scale(.25); opacity:1 } to { transform:scale(1.55); opacity:0 } }

/* ---------- Capa de fondo por sección ---------- */
.vida { isolation:isolate; overflow:hidden }
.fondo-vida { position:absolute; inset:-14% -3%; z-index:-1; pointer-events:none; will-change:transform;
  transform:translate3d(0, calc(var(--p, 0) * -9%), 0); background-repeat:no-repeat; background-size:cover; background-position:center }
.fondo-vida > i { position:absolute; top:-35%; bottom:-35%; left:0; width:38%; pointer-events:none;
  background:linear-gradient(100deg, transparent 0%, rgba(255,240,205,.13) 45%, rgba(255,246,222,.2) 52%, transparent 70%);
  animation:haz-vida 13s ease-in-out infinite alternate }
@keyframes haz-vida { from { transform:translate3d(-40%,0,0) skewX(-14deg) } to { transform:translate3d(290%,0,0) skewX(-14deg) } }

.fondo-bienvenida { background:radial-gradient(ellipse at 50% 0%, rgba(230,213,182,.5), transparent 60%),
  url("../img/vitral.webp") center 40%/cover no-repeat; opacity:1 }
.fondo-bienvenida::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg, rgba(251,248,241,.92), rgba(251,248,241,.8) 50%, rgba(251,248,241,.96)) }
.fondo-bienvenida > i { z-index:1; background:linear-gradient(100deg, transparent 0%, rgba(230,213,182,.28) 45%, rgba(255,250,236,.5) 52%, transparent 70%) }

.fondo-familia::before { content:""; position:absolute; inset:0; background:radial-gradient(ellipse at 20% 80%, rgba(141,163,198,.22), transparent 60%) }

.fondo-fecha::before { content:""; position:absolute; left:50%; top:42%; width:min(150vw, 46rem); aspect-ratio:1; translate:-50% -50%;
  border-radius:50%; border:1px solid rgba(230,213,182,.16); box-shadow:inset 0 0 0 26px rgba(230,213,182,.025);
  animation:giro-lento 70s linear infinite }
.fondo-fecha::after { content:""; position:absolute; left:50%; top:42%; width:min(104vw, 31rem); aspect-ratio:1; translate:-50% -50%;
  border-radius:50%; border:1px dashed rgba(230,213,182,.2); animation:giro-lento 48s linear infinite reverse }
@keyframes giro-lento { to { rotate:360deg } }

.fondo-lugares { background:url("../img/arcos.svg") center top/130% auto no-repeat; opacity:.09 }
.fondo-vestimenta { background:radial-gradient(circle at 85% 15%, rgba(179,151,104,.32), transparent 48%), radial-gradient(circle at 10% 90%, rgba(255,255,255,.4), transparent 42%) }
.fondo-confirmacion { background:url("../img/vitral.webp") center 25%/cover no-repeat; opacity:.07 }
.fondo-regalos,.fondo-cierre { background:radial-gradient(circle at 50% 38%, rgba(255,226,160,.3), transparent 58%); animation:respirar 6.5s ease-in-out infinite alternate }
@keyframes respirar { from { opacity:.55 } to { opacity:1 } }

/* ---------- Motas de luz y estrella de fondo ---------- */
.mota { position:absolute; width:var(--tam, 3px); height:var(--tam, 3px); border-radius:50%; pointer-events:none;
  background:#fff3cf; box-shadow:0 0 6px 1px rgba(255,236,186,.7); opacity:0; animation:mota var(--dur, 9s) ease-in-out infinite }
@keyframes mota {
  0%,100% { transform:translate3d(0,0,0) scale(.6); opacity:0 }
  30% { opacity:.9 }
  60% { transform:translate3d(10px,-26px,0) scale(1); opacity:.5 }
  85% { opacity:.8 } }
.estrella-fondo { position:absolute; left:50%; top:20%; width:min(120vw,38rem); height:auto; aspect-ratio:1; translate:-50% -50%;
  color:var(--arena-oscura); opacity:.12; animation:giro-lento 90s linear infinite; pointer-events:none }

/* Títulos con paralaje suave */
.seccion h2 { translate:0 calc(var(--p, 0) * -16px) }

/* ---------- Texto que aparece por palabras ---------- */
.pal { display:inline-block; opacity:0; transform:translate3d(0,.5em,0); filter:blur(3px);
  transition:opacity .8s var(--ease) calc(var(--i) * 55ms), transform .9s var(--ease) calc(var(--i) * 55ms), filter .7s ease calc(var(--i) * 55ms) }
.vida.en-vista .pal { opacity:1; transform:none; filter:none }

/* ---------- Familia: nombres con viñeta de luz ---------- */
#padres li,#padrinos li { position:relative; padding-left:1.25rem; opacity:0; transform:translate3d(-18px,0,0);
  transition:opacity .7s var(--ease) calc(var(--i) * 120ms + 160ms), transform .8s var(--ease) calc(var(--i) * 120ms + 160ms) }
#padres li::before,#padrinos li::before { content:""; position:absolute; left:0; top:.6em; width:.46rem; height:.46rem; rotate:45deg;
  background:var(--arena-oscura); box-shadow:0 0 10px rgba(230,213,182,.7) }
.en-vista #padres li,.en-vista #padrinos li { opacity:1; transform:none }

/* ---------- Fecha y cuenta regresiva ---------- */
.fecha-numero { background:linear-gradient(180deg,#fff6df 0%,#e6d5b6 45%,#b39768 100%); -webkit-background-clip:text; background-clip:text; color:transparent;
  background-size:100% 200%; animation:brillo-vertical 8s ease-in-out infinite alternate }
@keyframes brillo-vertical { from { background-position:0 0 } to { background-position:0 100% } }
.cuenta { border:0; padding:0; gap:.55rem; margin-top:1.2rem }
.cuenta > div { padding:.95rem .15rem .85rem; border-radius:1rem; border:1px solid rgba(230,213,182,.28);
  background:linear-gradient(165deg, rgba(255,255,255,.12), rgba(255,255,255,.025)); box-shadow:inset 0 1px 0 rgba(255,255,255,.14), 0 14px 26px rgba(3,8,20,.32) }
.cuenta > div + div { border-left:1px solid rgba(230,213,182,.28) }
.cuenta > div.latido { animation:latido .95s var(--ease) }
@keyframes latido {
  0% { box-shadow:inset 0 1px 0 rgba(255,255,255,.14), 0 14px 26px rgba(3,8,20,.32) }
  30% { box-shadow:inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 5px rgba(230,213,182,.2), 0 0 26px rgba(255,226,160,.42) }
  100% { box-shadow:inset 0 1px 0 rgba(255,255,255,.14), 0 14px 26px rgba(3,8,20,.32) } }
.fecha .cuenta small { color:var(--suave) }

/* ---------- Lugares: foto con paralaje y marco ---------- */
.lugar-medio img { translate:0 calc(var(--q, 0) * -9%); scale:1.16 }
.lugar.en-vista .lugar-medio { box-shadow:0 0 0 1px rgba(230,213,182,.35), 0 24px 40px -22px rgba(4,11,25,.55) }
.lugar .boton { min-height:2.75rem; align-items:center }

/* ---------- Galería: hojas con profundidad ---------- */
.album-hoja { transform:perspective(900px) rotateY(calc(var(--d, 0) * -11deg)) scale(calc(1 - var(--d, 0) * var(--d, 0) * .09));
  opacity:calc(1 - var(--d, 0) * var(--d, 0) * .3); transition:none }
.album-foto { will-change:auto }

/* ---------- Vestimenta: muestras que laten ---------- */
.muestra { transition:transform .35s var(--ease) }
.muestra:active { transform:scale(.93) }
.muestra::after { content:""; position:absolute; top:.45rem; left:50%; translate:-50% 0; width:clamp(4.1rem,7vw,6.6rem); aspect-ratio:1;
  border-radius:50%; border:1px solid var(--arena-oscura); opacity:0; pointer-events:none;
  animation:anillo 3s ease-out infinite; animation-delay:calc(var(--i, 0) * 1s + 1s) }
@keyframes anillo { 0% { transform:scale(1); opacity:.75 } 100% { transform:scale(1.85); opacity:0 } }

/* ---------- Regalos: sobre que flota ---------- */
.regalo-sobre { animation:flotar 4.2s ease-in-out infinite }
@keyframes flotar { 0%,100% { translate:0 0 } 50% { translate:0 -7px } }

/* ---------- Cierre: nombre con brillo ---------- */
.cierre-nombre { background:linear-gradient(100deg,#e6d5b6 0%,#fff6df 32%,#c8ab75 50%,#fff6df 68%,#e6d5b6 100%);
  background-size:260% 100%; -webkit-background-clip:text; background-clip:text; color:transparent; animation:brillo-texto 7s linear infinite }
@keyframes brillo-texto { from { background-position:100% 0 } to { background-position:-60% 0 } }

/* ---------- Botón de sonido ---------- */
.musica-control { display:flex; align-items:center; gap:.55rem }
.sonido { width:2.9rem; height:2.9rem; border-radius:50%; display:grid; place-items:center; cursor:pointer; color:var(--arena);
  background:rgba(19,40,74,.86); border:1px solid rgba(230,213,182,.5); box-shadow:0 8px 18px rgba(3,8,20,.45) }
.sonido .icono { width:1.25rem; height:1.25rem }
.sonido .tachado { opacity:0; transition:opacity .25s }
.sonido.apagado .tachado { opacity:1 }
.sonido:focus-visible { outline:2px solid var(--arena); outline-offset:3px }

/* ---------- Móvil ---------- */
@media (max-width:40rem) {
  .fecha-numero { font-size:clamp(8rem,38vw,11rem) }
  .cuenta span { font-size:clamp(2.1rem,9vw,2.9rem) }
  .lugar-medio img { scale:1.22 }
  .bienvenida p { font-size:clamp(1.3rem,5.4vw,1.6rem); line-height:1.5 }
}

/* ---------- Movimiento reducido: todo estático, sin perder contenido ---------- */
@media (prefers-reduced-motion: reduce) {
  .mota,.estrella-fondo,.fondo-vida > i,.fondo-vida::before,.fondo-vida::after,.muestra::after,.regalo-sobre,.cierre-nombre,.fecha-numero,
  .fondo-regalos,.fondo-cierre,.cuenta > div.latido,.onda-tap { animation:none!important }
  .fondo-vida { transform:none!important }
  .pal,#padres li,#padrinos li { opacity:1!important; transform:none!important; filter:none!important; transition:none!important }
  .album-hoja { transform:none!important; opacity:1!important }
  .lugar-medio img { translate:none; scale:1 }
  .seccion h2 { translate:none }
}

/* ---------- Lugar de la misa: anillo dorado detrás del arco ---------- */
.lugar-misa { position:relative }
.lugar-misa::before { content:""; position:absolute; z-index:0; left:50%; top:15%; width:min(88vw,25rem); aspect-ratio:1; translate:-50% -50%;
  border-radius:50%; border:1px solid rgba(179,151,104,.4); box-shadow:inset 0 0 0 10px rgba(179,151,104,.05); pointer-events:none;
  animation:giro-lento 60s linear infinite }
.lugar-misa .lugar-medio { z-index:1 }
