@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

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

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(11, 95, 165, 0.35); }
  100% { box-shadow: 0 0 0 14px rgba(11, 95, 165, 0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes check-draw {
  from { stroke-dashoffset: 40; }
  to { stroke-dashoffset: 0; }
}

@keyframes bounce-in {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}

/* Reusable classes ----------------------------------------------------- */

.anim-fade-in { animation: fade-in var(--dur-base) var(--ease-standard) both; }
.anim-rise-in { animation: rise-in var(--dur-slow) var(--ease-emphasized) both; }
.anim-pop-in { animation: pop-in var(--dur-base) var(--ease-emphasized) both; }
.anim-bounce-in { animation: bounce-in 480ms var(--ease-emphasized) both; }

/* Screen-level enter transition — applied by the router when it mounts a
   new screen, so navigation reads as motion rather than a hard swap. */
.screen-enter { animation: rise-in var(--dur-slow) var(--ease-emphasized) both; }

/* Stagger children of a list on first paint. Each item picks up
   --stagger-index (set inline by the renderer) to offset its delay. */
.stagger-item {
  animation: rise-in var(--dur-base) var(--ease-emphasized) both;
  animation-delay: calc(var(--stagger-index, 0) * 45ms);
}

.overlay { animation: overlay-in var(--dur-base) var(--ease-standard) both; }
.sheet { animation: sheet-up var(--dur-slow) var(--ease-emphasized) both; }
.dialog { animation: dialog-in var(--dur-base) var(--ease-emphasized) both; }
.toast { animation: toast-in var(--dur-base) var(--ease-emphasized) both; }

.pulse-ring { animation: pulse-ring 1.8s var(--ease-standard) infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
