/* ==========================================================================
   ANIMATIONS.CSS — Scroll reveal, page-load entrance, subtle motion
   Driven by js/animations.js, which adds .js-anim to <html>, tags elements
   with .reveal, and adds .visible when they enter the viewport.
   Uses keyframe animations (not transitions) so card hover transforms in
   other stylesheets keep working after the reveal has finished.
   ========================================================================== */

:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --reveal-distance: 24px;
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(var(--reveal-distance)); }
  to   { opacity: 1; transform: none; }
}

@keyframes reveal-scale {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Hidden only while JS is active and the element has not been revealed,
   so the page stays fully visible if JavaScript fails to load. */
.js-anim .reveal:not(.visible) { opacity: 0; }

.js-anim .reveal.visible {
  animation: reveal-up 0.75s var(--ease-out) backwards;
  animation-delay: var(--reveal-delay, 0ms);
}

.js-anim .reveal--scale.visible { animation-name: reveal-scale; }

/* Smooth filtering on the projects page */
.project-card { transition: transform 250ms var(--ease-out), border-color 250ms, box-shadow 250ms, opacity 250ms; }

@media (prefers-reduced-motion: reduce) {
  .js-anim .reveal:not(.visible) { opacity: 1; }
  .js-anim .reveal.visible { animation: none; }
}
