/* ============================================================
   Animations — snappy: short durations, tight stagger, no long
   intro delay. All keyed to .slide.is-active so they replay on
   each activation. JS handles count-ups + video.
   ============================================================ */

@keyframes fadeUp  { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop     { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes popUp   { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes rowIn   { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes spinIn  { from { opacity: 0; transform: rotate(115deg) scale(.6); } to { opacity: 1; transform: rotate(0) scale(1); } }
@keyframes revealX { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes dotPop  { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes arrowDrop { 0% { opacity: 0; transform: translateY(-16px); } 60% { opacity: 1; transform: translateY(5px); } 100% { transform: translateY(0); } }
@keyframes barGrow { from { width: 0; } }
@keyframes cellFlash { 0% { box-shadow: inset 0 0 0 2px transparent; } 35% { box-shadow: inset 0 0 0 2px rgba(192,39,26,.9); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
@keyframes ctaGlow { 0%,100% { box-shadow: 0 16px 34px -12px rgba(31,177,95,.7), inset 0 1px 0 rgba(255,255,255,.25); } 50% { box-shadow: 0 16px 44px -10px rgba(31,177,95,.95), inset 0 1px 0 rgba(255,255,255,.25); } }

.slide.is-active > * { animation-fill-mode: both; }

/* ---------------- Slide A ---------------- */
.slide-a.is-active .a-sheet { animation: fadeUp .55s cubic-bezier(.2,.7,.3,1); }
.slide-a.is-active .a-band .band-title { animation: fadeUp .5s both .16s; }
.slide-a.is-active .a-band .brand-lockup { animation: fadeUp .5s both .3s; }
.slide-a.is-active .a-sheet .t-err,
.slide-a.is-active .a-sheet .t-bad { animation: cellFlash 1s ease .55s 1; }

/* ---------------- Slide B ---------------- */
.slide-b.is-active .b-title  { animation: fadeUp .5s both .04s; }
.slide-b.is-active .b-sheet  { animation: fadeUp .5s both .18s; }
.slide-b.is-active .b-video  { animation: fadeIn .55s both .3s; }
.slide-b.is-active .b-video-mug { animation: pop .45s both .6s; }

/* ---------------- Slide C ---------------- */
.slide-c.is-active .c-title  { animation: fadeUp .45s both; }
.slide-c.is-active .c-sheet  { animation: fadeUp .5s both .12s; }
.slide-c.is-active .c-arrow path { animation: arrowDrop .55s both .5s; }
.slide-c.is-active .c-app    { animation: popUp .55s cubic-bezier(.2,.8,.25,1) both .66s; }
.slide-c.is-active .c-app .p-table tbody tr { animation: rowIn .4s both calc(.95s + var(--ri) * .05s); }
.slide-c.is-active .c-band   { animation: fadeUp .5s both .9s; }

/* ---------------- Slide D ---------------- */
.slide-d.is-active .d-app { animation: pop .5s cubic-bezier(.2,.7,.3,1); }
.slide-d.is-active .kpi { animation: fadeUp .42s both; }
.slide-d.is-active .kpi:nth-child(1) { animation-delay: .12s; }
.slide-d.is-active .kpi:nth-child(2) { animation-delay: .19s; }
.slide-d.is-active .kpi:nth-child(3) { animation-delay: .26s; }
.slide-d.is-active .kpi:nth-child(4) { animation-delay: .33s; }
.slide-d.is-active .kpi:nth-child(5) { animation-delay: .40s; }
.slide-d.is-active .kpi-bar > i { animation: barGrow .8s ease both .5s; }
.slide-d.is-active .c-line .reveal { animation: revealX .8s ease both .35s; }
.slide-d.is-active .c-line .dot { animation: dotPop .32s back-out both; animation-delay: calc(.7s + var(--i) * .09s); }
.slide-d.is-active .donut-rot { animation: spinIn .7s cubic-bezier(.2,.8,.25,1) both .4s; }
.slide-d.is-active .donut-legend li { animation: fadeUp .4s both calc(.7s + var(--i, 0) * .07s); }
.slide-d.is-active .alerts .al { animation: fadeUp .42s both calc(.55s + var(--ri) * .08s); }
.slide-d.is-active .d-band .band-title { animation: fadeUp .5s both .22s; }
.slide-d.is-active .d-band .cta { animation: ctaPop .5s both .44s, ctaGlow 2.4s ease 1s infinite; }
.slide-d.is-active .d-band .brand-lockup { animation: fadeUp .5s both .6s; }
@keyframes ctaPop { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

/* shared bar grow for the dashboard wherever it appears */
.slide.is-active .kpi-bar > i,
.slide.is-active .p-av .av-bar > i { animation: barGrow .8s ease both .5s; }

/* legend items need an index fallback */
.donut-legend li:nth-child(1) { --i: 0; }
.donut-legend li:nth-child(2) { --i: 1; }
.donut-legend li:nth-child(3) { --i: 2; }
.donut-legend li:nth-child(4) { --i: 3; }

@media (prefers-reduced-motion: reduce) {
  .slide.is-active * { animation: none !important; }
}
