/**
 * The working shimmer — base class sb-shimmer.
 *
 * The module's effect standard: an element wears BOTH the base
 * class and its roster attribute —
 *
 *   <div class="sb-shimmer" data-sb-shimmer='["is-thinking"]'>
 *
 * — and the activator (sb-effects.js) toggles sb-shimmer--active
 * whenever the element carries any class the roster names. The
 * base class is inert plumbing (the containment the travelling
 * rail needs); every visible effect lives on the --active
 * modifier, so a dormant element costs nothing.
 *
 * The rail is indeterminate on purpose: motion is the whole
 * message, separating "still working" from "finished" when there
 * is no honest percentage to report. Each 1.4-second sweep wears
 * the next ink of an eight-second walk through the logo's palette
 * — the Three Amigos (red #d73647, blue #005a9c, orange #f8991d)
 * and the green underline (#008457) — keyed off currentColor so
 * the walk drives the gradient directly.
 */

.sb-shimmer {
  position: relative;
  overflow: hidden;
}

.sb-shimmer--active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: var(--sb-shimmer-height, 3px);
  width: 40%;
  color: #d73647;
  background: linear-gradient(
    90deg,
    transparent,
    currentColor,
    transparent
  );
  animation:
    sb-shimmer-travel 1.4s ease-in-out infinite,
    sb-shimmer-amigos 8s ease-in-out infinite;
}

@keyframes sb-shimmer-travel {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Red -> blue -> orange -> green, two seconds an ink. */
@keyframes sb-shimmer-amigos {
  0%, 100% { color: #d73647; }
  25%      { color: #005a9c; }
  50%      { color: #f8991d; }
  75%      { color: #008457; }
}

/* Motion here is decoration, never information the reader needs —
   the text already says what is happening — so it yields: a still,
   half-strength rail keeping only the slow color walk. */
@media (prefers-reduced-motion: reduce) {
  .sb-shimmer--active::after {
    animation: sb-shimmer-amigos 12s ease-in-out infinite;
    width: 100%;
    opacity: 0.5;
  }
}
