/* ============================================================
   Fair and Square Inspections, LLC — animations.css
   Premium scroll-reveal: content slides up + fades in on scroll
   ============================================================ */

/* Base hidden state — applied by JS only (so no-JS users see content) */
.reveal-init {
  opacity: 0;
  transform: translateY(44px);
  will-change: opacity, transform;
  transition:
    opacity .8s cubic-bezier(.16,1,.3,1),
    transform .8s cubic-bezier(.16,1,.3,1);
}

/* Revealed state */
.reveal-init.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger: children of a revealed group cascade in.
   JS sets --reveal-i on each item; delay = i * step. */
.reveal-init {
  transition-delay: calc(var(--reveal-i, 0) * 80ms);
}

/* Subtler, faster reveal for large hero blocks (they're above the fold) */
.hero .reveal-init { transition-duration: .8s; }

/* Page-load entrance for the hero (fires immediately, no scroll needed) */
@keyframes hpiHeroIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-grid > div > * {
  animation: hpiHeroIn .7s cubic-bezier(.22,.61,.36,1) both;
}
.hero-grid > div > *:nth-child(1) { animation-delay: .05s; }
.hero-grid > div > *:nth-child(2) { animation-delay: .15s; }
.hero-grid > div > *:nth-child(3) { animation-delay: .25s; }
.hero-grid > div > *:nth-child(4) { animation-delay: .35s; }
.hero-grid > div > *:nth-child(5) { animation-delay: .45s; }

/* The quote card slides in from the right on load */
@keyframes hpiCardIn {
  from { opacity: 0; transform: translateY(24px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-grid > #quote, .hero-grid > div:last-child .calc-card {
  animation: hpiCardIn .9s cubic-bezier(.22,.61,.36,1) both;
  animation-delay: .3s;
}

/* Respect users who prefer reduced motion — show everything, no movement */
@media (prefers-reduced-motion: reduce) {
  .reveal-init,
  .reveal-init.is-visible,
  .hero-grid > div > *,
  .hero-grid > #quote,
  .hero-grid > div:last-child .calc-card {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
