/**
 * Motion utilities — micro + interface. Experience motion lives in page modules.
 */
@media (prefers-reduced-motion: no-preference) {
  .to-fade-in {
    animation: to-fade-in var(--motion-standard) var(--ease-out) both;
  }
  .to-rise-in {
    animation: to-rise-in var(--motion-slow) var(--ease-emphasized) both;
  }
  .to-stagger > * {
    animation: to-rise-in var(--motion-slow) var(--ease-emphasized) both;
  }
  .to-stagger > *:nth-child(1) { animation-delay: calc(var(--motion-stagger) * 0); }
  .to-stagger > *:nth-child(2) { animation-delay: calc(var(--motion-stagger) * 1); }
  .to-stagger > *:nth-child(3) { animation-delay: calc(var(--motion-stagger) * 2); }
  .to-stagger > *:nth-child(4) { animation-delay: calc(var(--motion-stagger) * 3); }
  .to-stagger > *:nth-child(5) { animation-delay: calc(var(--motion-stagger) * 4); }
  .to-shake {
    animation: to-shake 420ms var(--ease-out);
  }
  .to-btn-morph.is-loading .to-btn-label { opacity: 0; }
  .to-btn-morph.is-success {
    background: var(--success-text) !important;
    border-color: var(--success-text) !important;
  }
}

@keyframes to-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes to-rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes to-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .to-fade-in,
  .to-rise-in,
  .to-stagger > *,
  .to-shake {
    animation: none !important;
  }
}
