/**
 * Elisys Design System · @elisys/design-tokens/animations.css
 * The fifteen-pattern animation library (Build Blueprint Ch.10 — locked).
 * All timing values are CSS custom properties so they can be adjusted
 * without code changes. Break-through is RESERVED for class-A critical
 * events firing during pause state.
 */

:root {
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1); /* @kind other */
  --ease-data: ease-out; /* @kind other */

  --dur-count-up: 600ms; /* @kind other */          /* score values, vote counts */
  --dur-slide-in-top: 300ms; /* @kind other */      /* activity feed items, alerts */
  --dur-drift-out-bottom: 800ms; /* @kind other */  /* evidence video exit */
  --dur-morph-bar: 700ms; /* @kind other */         /* bar chart updates (ease-out) */
  --dur-sweep-donut: 500ms; /* @kind other */       /* percentage rings */
  --dur-fill-region: 400ms; /* @kind other */       /* coverage map density */
  --dur-cross-fade: 400ms; /* @kind other */        /* photo entry, content swaps */
  --dur-slide-scene: 500ms; /* @kind other */       /* video entry, major changes */
  --dur-pulse-attention: 2000ms; /* @kind other */  /* critical incident badge · 3 pulses, calm */
  --speed-ticker-flow: 60; /* @kind other */        /* px/sec · incident ticker */
  --dur-pop-counter: 200ms; /* @kind other */       /* PU grid tile state change · scale 1.1 */
  --dur-reveal-card: 300ms; /* @kind other */       /* audio entry · from scale 0.8 */
  --dur-freeze-hold: 200ms; /* @kind other */       /* evidence photo/video exit: hold… */
  --dur-freeze-fade: 600ms; /* @kind other */       /* …then fade */
  --dur-resume-catchup: 800ms; /* @kind other */    /* underlay resuming after overlay */
  --dur-break-through: 300ms; /* @kind other */     /* class-A critical during pause */
  --aggregation-window: 250ms; /* @kind other */    /* live-update coalescing window */
}

@keyframes el-slide-in-top {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes el-drift-out-bottom {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(24px); }
}
@keyframes el-cross-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes el-slide-scene {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes el-pulse-attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,16,46,0.35); }
  50%      { box-shadow: 0 0 0 8px rgba(200,16,46,0); }
}
@keyframes el-pop-counter {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes el-reveal-card {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes el-break-through {
  from { opacity: 0; transform: scale(0.98); border-color: rgba(var(--accent-rgb),0.9); }
  to   { opacity: 1; transform: scale(1);    border-color: rgba(var(--accent-rgb),0.4); }
}
@keyframes el-freeze-fade {
  0%, 25% { opacity: 1; }   /* 200ms hold of an 800ms total */
  100%    { opacity: 0; }
}

.el-anim-slide-in-top    { animation: el-slide-in-top var(--dur-slide-in-top) var(--ease-enter) both; }
.el-anim-drift-out       { animation: el-drift-out-bottom var(--dur-drift-out-bottom) var(--ease-data) both; }
.el-anim-cross-fade      { animation: el-cross-fade var(--dur-cross-fade) var(--ease-enter) both; }
.el-anim-slide-scene     { animation: el-slide-scene var(--dur-slide-scene) var(--ease-enter) both; }
.el-anim-pulse-attention { animation: el-pulse-attention var(--dur-pulse-attention) ease-in-out 3; }
.el-anim-pop-counter     { animation: el-pop-counter var(--dur-pop-counter) var(--ease-data) both; }
.el-anim-reveal-card     { animation: el-reveal-card var(--dur-reveal-card) var(--ease-enter) both; }
.el-anim-break-through   { animation: el-break-through var(--dur-break-through) var(--ease-enter) both; }
.el-anim-freeze-fade     { animation: el-freeze-fade 800ms var(--ease-data) both; }

@media (prefers-reduced-motion: reduce) {
  [class*="el-anim-"] { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
