/* 040-text-shine — reflet gradient qui balaye le titre en boucle */

.text-shine {
  /* Options */
  --text-shine-duration: 3.6s;      /* durée d'un cycle complet (sweep + pause) */
  --text-shine-highlight: #ffffff;  /* cœur du reflet */

  display: inline-block;
  color: var(--ml-fg, #e8eaf2); /* fallback si background-clip: text non supporté */
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .text-shine {
    background-image: linear-gradient(
      100deg,
      var(--ml-fg, #e8eaf2) 42%,
      var(--ml-accent, #7c8cff) 47%,
      var(--text-shine-highlight) 50%,
      var(--ml-accent-2, #2dd4bf) 53%,
      var(--ml-fg, #e8eaf2) 58%
    );
    background-size: 220% 100%;
    background-position: 130% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: text-shine-sweep var(--text-shine-duration, 3.6s) infinite;
  }
}

/* Le sweep occupe ~55 % du cycle, le reste est une pause : le reflet
   respire au lieu de tourner en continu. */
@keyframes text-shine-sweep {
  0% {
    background-position: 130% 0;
    animation-timing-function: cubic-bezier(0.45, 0.05, 0.25, 1);
  }
  55%,
  100% {
    background-position: -30% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .text-shine {
    animation: none;
    /* reflet figé au centre : le dégradé reste un accent statique */
    background-position: 50% 0;
  }
}

/* --- Habillage de la démo (snippet.html) --- */

.text-shine-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1rem;
}

.text-shine-demo__kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ml-muted, #8b91a3);
}

.text-shine-demo__title {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.text-shine-demo__sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ml-muted, #8b91a3);
}
