/* ==========================================================================
   HARBORLIGHT CHURCH — ANIMATIONS
   Scroll-reveal utility classes (paired with js/animations.js), hover
   micro-interactions, and hero/keyframe animations.
   ========================================================================== */

/* Scroll reveal base state — toggled to .is-visible by IntersectionObserver */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(.2,.6,.2,1), transform 700ms cubic-bezier(.2,.6,.2,1);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

[data-reveal="fade"] { transform: none; }
[data-reveal="left"] { transform: translateX(-32px); }
[data-reveal="left"].is-visible { transform: translateX(0); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="right"].is-visible { transform: translateX(0); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal="scale"].is-visible { transform: scale(1); }

/* Stagger children via inline --delay custom property */
[data-reveal] { transition-delay: var(--delay, 0ms); }

/* Hero entrance */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content > * { animation: hero-rise 900ms cubic-bezier(.2,.6,.2,1) both; }
.hero-content .eyebrow { animation-delay: 60ms; }
.hero-content h1 { animation-delay: 160ms; }
.hero-content .lead { animation-delay: 280ms; }
.hero-content .hero-actions { animation-delay: 400ms; }
.hero-content .hero-chips { animation-delay: 500ms; }

/* Ambient drift for the hero arc glow */
@keyframes arc-drift {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(-14px) scale(1.03); }
}
.hero-arc { animation: arc-drift 9s ease-in-out infinite; }

/* Floating chip idle motion */
@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.chip-glass:nth-child(1) { animation: chip-float 6s ease-in-out infinite; }
.chip-glass:nth-child(2) { animation: chip-float 6s ease-in-out infinite 1.2s; }
.chip-glass:nth-child(3) { animation: chip-float 6s ease-in-out infinite 2.4s; }

/* Pulse for live indicators */
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(217,108,78,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(217,108,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(217,108,78,0); }
}
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--coral);
  animation: pulse-dot 2s infinite;
  display: inline-block;
}

/* Spin for loaders */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(0,0,0,0.15); border-top-color: currentColor; border-radius: 50%; animation: spin 700ms linear infinite; }

/* Gentle marquee for Instagram/partner strips */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* Countdown flip */
.countdown-unit { transition: transform 300ms ease; }
.countdown-unit.tick { animation: tick-pulse 350ms ease; }
@keyframes tick-pulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Testimonial / carousel slide fade */
.slide {
  opacity: 0;
  position: absolute;
  inset: 0;
  transition: opacity 500ms ease;
  pointer-events: none;
}
.slide.is-active { opacity: 1; position: relative; pointer-events: auto; }

/* Accordion (FAQ) */
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease, padding var(--transition);
}
.accordion-item.is-open .accordion-panel { max-height: 600px; }
.accordion-trigger svg { transition: transform var(--transition); }
.accordion-item.is-open .accordion-trigger svg { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
  .hero-arc, .chip-glass, .marquee-track, .live-dot { animation: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
