/* ==========================================================================
   JAVVIER — animations.css
   Estados de entrada (reveal). Solo opacity / transform / letter-spacing.
   El movimiento guiado por scroll y por gesto vive en JS con springs
   (animations.js), no aquí: los keyframes no se pueden interrumpir.
   ========================================================================== */

/* ── Wordmark: tracking reveal al cargar ── */
.wordmark { animation: track-in 1.3s var(--ease-out) both; }
@keyframes track-in {
  from { opacity: 0; letter-spacing: 0.28em; }
  to   { opacity: 1; letter-spacing: var(--tracking-subheading); }
}

/* ── Hero: fade del video al cargar ── */
.hero__frame { animation: video-fade 1.2s ease-out both; }
@keyframes video-fade { from { opacity: 0.55; } to { opacity: 1; } }

/* ── Texto: aparece palabra por palabra, el tracking se cierra al asentarse ── */
.js [data-reveal] .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.45em);
  letter-spacing: 0.06em;
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out),
    letter-spacing 1.1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms);
}
.js [data-reveal].is-in .w {
  opacity: 1; transform: none; letter-spacing: var(--tracking-body);
}

/* ── Elementos que "suben" al entrar (galería de proyectos) ── */
.js [data-rise] { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.js [data-rise].is-in { opacity: 1; transform: none; }

/* ── Movimiento reducido: solo fundidos, sin desplazamientos ni tracking ── */
@media (prefers-reduced-motion: reduce) {
  .wordmark, .hero__frame { animation: none; }
  .js [data-rise] { transform: none; transition: opacity 0.3s linear; }
  .js [data-reveal] .w { transform: none; letter-spacing: var(--tracking-body); transition: opacity 0.3s linear; transition-delay: 0s; }
}
