/* Animated Shiny Text: a vanilla port of dillionverma's "Animated Shiny Text" (Magic UI) on 21st.dev (MIT).
   The text is painted at 70% grey; a soft band of darker (light theme) or lighter (dark theme) colour, the
   shimmer width wide, sweeps across it through background-clip: text. Keyframes and timing are the original's:
   8s infinite (default ease per segment): it crosses left → right over 0–30%, rests, crosses back over 60–90%, rests.
   In RTL the sweep starts from the right.

   Use: <span class="fx-shiny">New: …</span>, optionally mountShinyText(el, { shimmerWidth }) from shiny-text.js.
   Tokens (unset = the original's Tailwind values):
     --fx-shiny-width                       the band width. Original prop shimmerWidth: 100 → 100px
     --fx-shiny-color / --fx-shiny-color-dark   the resting text. Original: #525252b3 / #a3a3a3b3 (neutral-600/70, neutral-400/70)
     --fx-shiny-shine / --fx-shiny-shine-dark   the band's centre. Original: rgb(0 0 0 / .8) / rgb(255 255 255 / .8)
   data-fx-tone="dark" | "light" (on the element or any ancestor badge) pins one tuning. */

.fx-shiny {
  --_color: var(--fx-shiny-color, #525252b3);
  --_shine: var(--fx-shiny-shine, rgb(0 0 0 / .8));
  color: var(--_color);
  /* bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent */
  background-image: linear-gradient(to right, transparent, var(--_shine) 50%, transparent);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: var(--fx-shiny-width, 100px) 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: fx-shiny-text 8s infinite;
}
/* Theme and tone, flattened with :where() so source order decides: page dark, then a pinned tone wins. */
:where(:root[data-theme="dark"]) .fx-shiny {
  --_color: var(--fx-shiny-color-dark, #a3a3a3b3);
  --_shine: var(--fx-shiny-shine-dark, rgb(255 255 255 / .8));
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .fx-shiny {
    --_color: var(--fx-shiny-color-dark, #a3a3a3b3);
    --_shine: var(--fx-shiny-shine-dark, rgb(255 255 255 / .8));
  }
}
:where([data-fx-tone="dark"]) .fx-shiny,
.fx-shiny:where([data-fx-tone="dark"]) {
  --_color: var(--fx-shiny-color-dark, #a3a3a3b3);
  --_shine: var(--fx-shiny-shine-dark, rgb(255 255 255 / .8));
}
:where([data-fx-tone="light"]) .fx-shiny,
.fx-shiny:where([data-fx-tone="light"]) {
  --_color: var(--fx-shiny-color, #525252b3);
  --_shine: var(--fx-shiny-shine, rgb(0 0 0 / .8));
}

.fx-shiny:dir(rtl) {
  animation-name: fx-shiny-text-rtl;
}

@keyframes fx-shiny-text {
  0%, 90%, 100% { background-position: calc(-100% - var(--fx-shiny-width, 100px)) 0; }
  30%, 60% { background-position: calc(100% + var(--fx-shiny-width, 100px)) 0; }
}
/* The exact mirror of the above: a band whose left edge sits at x in LTR sits at (W - w - x) in RTL, where W is
   the box width and w the band width. With percentages resolving against (W - w): -100% - w → 200% + w, 100% + w → -w. */
@keyframes fx-shiny-text-rtl {
  0%, 90%, 100% { background-position: calc(200% + var(--fx-shiny-width, 100px)) 0; }
  30%, 60% { background-position: calc(0% - var(--fx-shiny-width, 100px)) 0; }
}

/* Reduced motion: no sweep; the text rests in its grey, as between the original's sweeps. */
@media (prefers-reduced-motion: reduce) {
  .fx-shiny,
  .fx-shiny:dir(rtl) {
    animation: none;
    background-position: calc(-100% - var(--fx-shiny-width, 100px)) 0;
  }
}
