/* =========================================================================
   Joliet Islamic Center — Animations
   -------------------------------------------------------------------------
   Keyframes + the scroll-reveal system driven by assets/js/main.js.
   Reveal attributes:
     data-reveal            fade up (default)
     data-reveal="left"     slide in from the left
     data-reveal="right"    slide in from the right
     data-reveal="zoom"     scale in
     data-reveal="mask"     wipe in (used on images)
     data-stagger           children reveal one after another
     data-split             headline words rise in one by one
   Everything is disabled for people who prefer reduced motion.
   ========================================================================= */

/* Keyframes ------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes moon-float {
  0%, 100% { transform: rotate(-20deg) translateY(0); }
  50%      { transform: rotate(-14deg) translateY(-14px); }
}
@keyframes twinkle {
  0%, 100% { opacity: .15; transform: scale(.8); }
  50%      { opacity: .95; transform: scale(1.2); }
}
@keyframes pattern-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-96px, -96px, 0); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes glow {
  0%, 100% { transform: scale(1); opacity: .8; }
  50%      { transform: scale(1.15); opacity: 1; }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25%      { transform: scale(1.25); }
  50%      { transform: scale(.95); }
  75%      { transform: scale(1.15); }
}
@keyframes scroll-wheel {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
@keyframes halo {
  0%, 100% { transform: scale(1); opacity: .3; }
  50%      { transform: scale(1.35); opacity: .12; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes rise {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(218,175,96,.6); }
  100% { box-shadow: 0 0 0 16px rgba(218,175,96,0); }
}

/* Live "next prayer" dot */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-500); animation: pulse-ring 1.8s ease-out infinite;
}

/* Scroll reveal --------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
  transition:
    opacity 1s var(--ease-out),
    transform 1.1s var(--ease-out),
    clip-path 1.3s var(--ease-out);
  transition-delay: var(--delay, 0s);
  will-change: opacity, transform;
}
.js [data-reveal="left"]  { transform: translate3d(-60px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(60px, 0, 0); }
.js [data-reveal="zoom"]  { transform: scale(.9); }
/* Mask: the clip sits on the children so IntersectionObserver still sees the target */
.js [data-reveal="mask"]  { opacity: 1; transform: none; }
.js [data-reveal="mask"] > * { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease-out); transition-delay: var(--delay, 0s); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js [data-reveal="mask"].is-visible > * { clip-path: inset(0 0 0 0); }

/* Staggered children */
.js [data-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition: opacity .9s var(--ease-out), transform 1s var(--ease-out), box-shadow .6s var(--ease-out), color .5s, border-color .5s, background .5s;
  transition-delay: calc(var(--i, 0) * .1s + var(--delay, 0s));
}
.js [data-stagger].is-visible > * { opacity: 1; transform: none; }
/* main.js removes data-reveal / data-stagger once the entrance has finished,
   so each element's own hover transitions take over again. */

/* Split headline: each word rises out of a mask */
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.split-word__inner { display: inline-block; }
.js [data-split] .split-word__inner { transform: translateY(110%); }
.js [data-split].is-visible .split-word__inner {
  animation: rise 1.1s var(--ease-out) forwards;
  animation-delay: calc(var(--w, 0) * .08s + var(--delay, 0s));
}

/* Gradient (accent) text keeps its gradient once split into words */
[data-split] .accent { background: none; }
[data-split] .accent .split-word { padding-right: .08em; margin-right: -.08em; }
[data-split] .accent .split-word__inner {
  background: linear-gradient(100deg, var(--gold-600), var(--gold-500) 45%, var(--gold-600));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero [data-split] .accent .split-word__inner, .page-hero [data-split] .accent .split-word__inner,
.section--dark [data-split] .accent .split-word__inner, .cta [data-split] .accent .split-word__inner {
  background-image: linear-gradient(100deg, var(--gold-500), #f6dfab 45%, var(--gold-500));
}

/* Hero entrance (plays once the preloader is gone) */
.js .hero [data-hero] { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--delay, 0s); }
.js.is-ready .hero [data-hero] { opacity: 1; transform: none; }

/* Prayer bar rises in just after the hero */
.js .hero-times__card { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: .85s; }
.js.is-ready .hero-times__card { opacity: 1; transform: none; }

/* Reduced motion -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal], .js [data-stagger] > *, .js .hero-times__card, .js .hero [data-hero] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .js [data-reveal="mask"] > * { clip-path: none !important; }
  .js [data-split] .split-word__inner { transform: none !important; }
  .marquee__track { animation: none !important; }
}
