/* The Automation & Software closing panel. The highlight rests on each step for a
   moment, then moves 48px (one row and its gap) to the next. Each tick lands as the highlight leaves
   its row: a step's run-step-* class delays its tick by a tenth of the loop per step, and the ticks clear
   again in the same order. */

:root {
  /* One full loop. */
  --run-cycle: 9s;
}

@layer utilities {
  @media (prefers-reduced-motion: no-preference) {
    .motion-safe\:animate-run-focus {
      animation: run-focus var(--run-cycle) var(--ease-smooth-out) infinite both;
    }

    .motion-safe\:animate-run-tick {
      animation: run-tick var(--run-cycle) var(--ease-smooth-out) calc(var(--run-step, 0) * var(--run-cycle) / 10) infinite both;
    }

    .motion-safe\:animate-run-done {
      animation: run-done var(--run-cycle) var(--ease-smooth-out) infinite both;
    }
  }

  /* A step's place in the rule. */
  .run-step-0 {
    --run-step: 0;
  }

  .run-step-1 {
    --run-step: 1;
  }

  .run-step-2 {
    --run-step: 2;
  }

  .run-step-3 {
    --run-step: 3;
  }
}

@keyframes run-focus {
  0%,
  6% {
    opacity: 0;
    transform: translateY(0);
  }
  9%,
  15% {
    opacity: 1;
    transform: translateY(0);
  }
  20%,
  25% {
    opacity: 1;
    transform: translateY(48px);
  }
  30%,
  35% {
    opacity: 1;
    transform: translateY(96px);
  }
  40%,
  46% {
    opacity: 1;
    transform: translateY(144px);
  }
  50%,
  100% {
    opacity: 0;
    transform: translateY(144px);
  }
}

@keyframes run-tick {
  0%,
  14% {
    opacity: 0;
    transform: scale(0.5);
  }
  17% {
    opacity: 1;
    transform: scale(1.12);
  }
  20%,
  76% {
    opacity: 1;
    transform: scale(1);
  }
  80%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes run-done {
  0%,
  50% {
    opacity: 0;
    transform: translateY(6px);
  }
  54%,
  76% {
    opacity: 1;
    transform: none;
  }
  80%,
  100% {
    opacity: 0;
    transform: none;
  }
}
