/* ============================================================
   ALIVE TYPOGRAPHY — D STYLEZ ART brand differentiator
   "We don't follow trends we break them."
   Brand text animates like the art comes alive:
   - letter-by-letter stagger reveal (on load / on scroll)
   - subtle floating "breathing" on hero headlines
   - gold shimmer sweep across key brand text
   Pure CSS animations — JS only splits letters + toggles .in.
   All motion disabled under prefers-reduced-motion.
   ============================================================ */

/* ---- base: letters start hidden, set up stagger delay var ---- */
[data-alive] .al-ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.45em) rotate(4deg);
  animation: al-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 28ms);
  will-change: transform, opacity;
}
/* keep spaces from collapsing */
[data-alive] .al-sp { display: inline-block; width: 0.28em; }

/* pause until in view (JS adds .in via IntersectionObserver) */
[data-alive]:not(.in) .al-ch { animation-play-state: paused; }
[data-alive].in .al-ch,
[data-alive-hero].in .al-ch { animation-play-state: running; }
/* hero animates immediately on load */
[data-alive-hero] .al-ch { animation-play-state: running; }

@keyframes al-rise {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

/* ---- breathing float for hero headlines ---- */
.alive-float {
  animation: al-breathe 5.5s ease-in-out infinite;
}
@keyframes al-breathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ---- gold shimmer sweep across brand text ---- */
.alive-shimmer {
  position: relative;
  background: linear-gradient(100deg,
    #f5c542 20%, #fff6d8 40%, #f5c542 60%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: al-shimmer 4.2s linear infinite;
}
@keyframes al-shimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
/* shimmer on the gold spans inside headlines */
.alive-shimmer .gold,
h1 .gold.alive-shimmer, h2 .gold.alive-shimmer {
  background: linear-gradient(100deg, #e8a90c 15%, #fff3c4 42%, #e8a90c 65%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: al-shimmer 4.2s linear infinite;
}

/* ---- scroll-in variant for section headlines: whole-line rise ---- */
[data-alive-line] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-alive-line].in {
  opacity: 1;
  transform: translateY(0);
}

/* ---- accessibility: kill all motion ---- */
@media (prefers-reduced-motion: reduce) {
  [data-alive] .al-ch,
  .alive-float,
  .alive-shimmer,
  .alive-shimmer .gold,
  h1 .gold.alive-shimmer, h2 .gold.alive-shimmer,
  [data-alive-line] {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    -webkit-text-fill-color: currentColor;
    color: inherit;
    background: none;
  }
  [data-alive] .al-ch { display: inline; }
}
