/*
 * animations.css
 * Todos los @keyframes y lógica de movimiento de la página.
 * Las animaciones solo corren si el usuario no prefiere movimiento reducido.
 */

/* ════════════════════════════════
   KEYFRAMES
   ════════════════════════════════ */
@keyframes rise {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

@keyframes float {
  50% { transform: translateY(-16px) rotate(2deg); }
}

@keyframes popin {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; }
}

@keyframes pulse {
  50% { transform: scale(1.07); opacity: .85; }
}

@keyframes wobble {
  50% { transform: rotate(-6deg) scale(1.05); }
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@keyframes scrolldot {
  0%, 100% { transform: translateY(0);    opacity: 1; }
  50%       { transform: translateY(10px); opacity: .3; }
}

@keyframes live {
  70%  { box-shadow: 0 0 0 7px rgba(55,211,107,0); }
  100% { box-shadow: 0 0 0 0   rgba(55,211,107,0); }
}

@keyframes ripple {
  0%   { transform: scale(.4);   opacity: .9; }
  100% { transform: scale(1.5);  opacity: 0; }
}

@keyframes fabring {
  0%   { transform: scale(1);   opacity: .7; }
  100% { transform: scale(1.5); opacity: 0; }
}


/* ════════════════════════════════
   REVEAL ON SCROLL
   Base: visible por defecto.
   Oculto solo cuando el motion está permitido — evita FOUC.
   ════════════════════════════════ */
.reveal {
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}

@media (prefers-reduced-motion: no-preference) {
  /* Elementos ocultos al inicio, js/ui.js añade .in para revelarlos */
  .reveal:not(.in) {
    opacity: 0;
    transform: translateY(34px);
  }

  /* Animaciones del hero */
  .hero h1 .ln span {
    animation: rise .9s cubic-bezier(.16,1,.3,1) both;
  }
  .hero h1 .ln:nth-child(2) span { animation-delay: .12s; }
  .hero h1 .ln:nth-child(3) span { animation-delay: .24s; }

  .hero p.lead   { animation: fadeUp .8s ease .5s  both; }
  .hero-cta      { animation: fadeUp .8s ease .65s both; }

  .hero-burger img {
    animation: float 6s ease-in-out infinite, popin 1s cubic-bezier(.16,1,.3,1) both;
  }
}

/* Eliminar TODO movimiento si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
