/* ==========================================================================
   Navidad con CIINSEV — Animaciones
   ========================================================================== */

@keyframes snow-fallback { to { background-position: 40px 260px, -30px 260px, 20px 260px, -40px 260px, 0 260px; } }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------- Entrada de la bienvenida ---------- */
.js .welcome .brand__tile { animation: tile-in 1.2s var(--ease-out) .1s both; }
.js .welcome .brand__hat { animation: hat-drop 1.1s var(--ease-spring) .75s both, hat-sway 6s ease-in-out 2.2s infinite; }
.js .welcome .brand { animation: float 6s ease-in-out 1.8s infinite; }
.js .welcome .t1 .ch { animation: letter-in 1s var(--ease-out) both; animation-delay: calc(.35s + var(--i) * .055s); }
.js .welcome .t2 { animation: blur-up 1s var(--ease-out) .85s both; }
.js .welcome__phrase { animation: blur-up 1s var(--ease-out) 1.05s both; }
.js .cta { animation: blur-up 1s var(--ease-out) 1.25s both; }

@keyframes tile-in { from { opacity: 0; transform: scale(.6) translateY(20px); filter: blur(12px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes hat-drop {
  0%   { opacity: 0; transform: translate(-10px, -90px) rotate(-60deg); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: rotate(-24deg); }
}
@keyframes hat-sway { 0%, 100% { transform: rotate(-24deg); } 50% { transform: rotate(-19deg); } }
@keyframes letter-in { from { opacity: 0; transform: translateY(.35em) rotateX(-60deg); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes blur-up { from { opacity: 0; transform: translateY(16px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- Salida de la bienvenida ---------- */
body.is-leaving .welcome__title,
body.is-leaving .welcome__phrase,
body.is-leaving .cta { animation: blur-out .55s var(--ease-out) forwards; }
body.is-leaving .welcome__phrase { animation-delay: .05s; }
body.is-leaving .cta { animation-delay: .1s; }
@keyframes blur-out { to { opacity: 0; transform: translateY(-14px) scale(.98); filter: blur(10px); } }

/* ---------- Entrada de la galería ---------- */
.gallery.is-entering .gallery__head h2,
.gallery.is-entering .gallery__count { animation: blur-up .9s var(--ease-out) .15s both; }
.gallery.is-entering .gallery__count { animation-delay: .25s; }

.card.is-pending { opacity: 0; }
.card.is-in { animation: card-in 1s var(--ease-out) both; animation-delay: var(--delay, 0s); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(34px) scale(.92); filter: blur(10px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ---------- Caja de regalo ---------- */
@keyframes gift-drop {
  0%   { opacity: 0; transform: translateY(-60px) scale(.6) rotate(-8deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes gift-shake {
  0%, 100% { transform: rotate(0) scale(1); }
  20% { transform: rotate(-8deg) scale(1.04, .96); }
  40% { transform: rotate(7deg) scale(.97, 1.05); }
  60% { transform: rotate(-5deg) scale(1.05, .95); }
  80% { transform: rotate(3deg) scale(1.08); }
}
@keyframes lid-pop {
  0%   { transform: none; }
  30%  { transform: translateY(-18px) rotate(-6deg); }
  100% { transform: translate(46px, -130px) rotate(42deg); opacity: 0; }
}
@keyframes gift-vanish {
  0%   { transform: scale(1); opacity: 1; }
  35%  { transform: scale(1.12, .88); }
  100% { transform: scale(.4) translateY(20px); opacity: 0; }
}
@keyframes gift-nope {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-3deg); } 40% { transform: translateX(7px) rotate(3deg); }
  60% { transform: translateX(-4px) rotate(-1.5deg); } 80% { transform: translateX(3px); }
}
@keyframes ring {
  0%   { opacity: .9; transform: scale(.2); border-width: 6px; }
  100% { opacity: 0; transform: scale(3.2); border-width: 1px; }
}

/* ---------- Contenido revelado ---------- */
.reveal__content .anim { opacity: 0; }
.reveal.is-revealed .reveal__content .anim { animation: blur-up .8s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
.reveal.is-revealed .gift-title .w { animation: word-in .9s var(--ease-out) both; animation-delay: calc(.12s + var(--i) * .07s); }
@keyframes word-in {
  from { opacity: 0; transform: translateY(18px) scale(.9); filter: blur(12px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.reveal__hero .reveal__name { transition: opacity .5s, transform .6s var(--ease-out); }
.reveal:not(.is-open) .reveal__name { opacity: 0; transform: translateY(10px); }
