/* Entrance motion for the workspace dashboard. Pairs with app-entrance.js.
   Everything here is opt-in through body.sums-enter, which the script only
   sets when the visitor has not asked for reduced motion. */
@keyframes sums-rise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes sums-grow-x {
  from { transform: scaleX(0); }
}
@keyframes sums-draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}
@keyframes sums-fade {
  from { opacity: 0; }
}
@keyframes sums-target-glow {
  0%   { box-shadow: 0 0 0 0 rgba(202,255,124,0); }
  30%  { box-shadow: 0 0 0 3px rgba(202,255,124,.35); }
  100% { box-shadow: 0 0 0 0 rgba(202,255,124,0); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  body.sums-enter [data-enter]:not(.is-in) { opacity: 0; }
  body.sums-enter [data-enter].is-in {
    animation: sums-rise 560ms cubic-bezier(.2,.8,.2,1) both;
    animation-delay: calc(var(--enter-i, 0) * 60ms);
  }

  body.sums-enter .bar > i {
    transform-origin: left center;
    animation: sums-grow-x 700ms cubic-bezier(.2,.8,.2,1) both;
  }

  body.sums-enter svg.is-drawing .trend-line {
    stroke-dasharray: 1;
    animation: sums-draw 1100ms cubic-bezier(.4,0,.2,1) both;
  }
  body.sums-enter svg.is-drawing .trend-area {
    animation: sums-fade 900ms ease 350ms both;
  }

  body.sums-enter .panel:target,
  body.sums-enter .kpis:target {
    animation: sums-target-glow 1200ms ease-out 250ms;
  }
}
