/* Motion tokens – see docs/DESIGN.md › Motion. Animate transform & opacity only. */
:root {
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --dur-slow: 320ms;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes skeleton-pulse {
  50% {
    opacity: 0.5;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes page-forward {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes page-back {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}

/* Screen transitions (shell/app.js sets the class): short 24px slide + fade, tabs crossfade */
.page--forward {
  animation: page-forward 260ms var(--ease-out) both;
}
.page--back {
  animation: page-back 260ms var(--ease-out) both;
}
.page--tab {
  animation: fade-in 180ms var(--ease-out) both;
}

/* Staggered entrance for lists: set --i on each child (max ~6) */
.stagger > * {
  animation: fade-up var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 6) * 30ms);
}

/* Reduced motion: OS setting or in-app switch (html.reduce-motion) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
}
