/* ============================================================
   animations.css — scroll-reveal + keyframes
   (reduced-motion neutralised here and in reset.css)
   ============================================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Gentle float used for accents (e.g. FAB / hero flourishes) */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ---- Smooth light/dark theme switch ----
   Modern browsers: cross-fade the whole page via the View Transitions API. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.38s;
  animation-timing-function: var(--ease);
}
/* Fallback (e.g. Firefox): transition colours for ~0.4s during the flip. */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition: background-color 0.4s var(--ease),
              color 0.4s var(--ease),
              border-color 0.4s var(--ease),
              fill 0.4s var(--ease) !important;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
