/* ═══════════════════════════════════════════════════════════════
   ukroofingleads.com — Animations Stylesheet
   Requires: global.css loaded first
═══════════════════════════════════════════════════════════════ */

/* ─── KEYFRAMES ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes drawLine {
  from { stroke-dashoffset: 314; }
  to   { stroke-dashoffset: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── HERO ENTRANCE (applied directly in CSS) ───────────────── */
.hero-eyebrow { animation: fadeIn     0.5s ease both; }
.hero h1      { animation: fadeUp     0.6s 0.1s ease both; }
.hero-sub     { animation: fadeUp     0.6s 0.22s ease both; }
.hero-actions { animation: fadeUp     0.6s 0.34s ease both; }
.hero-trust   { animation: fadeUp     0.6s 0.46s ease both; }
.hero-card    { animation: slideInRight 0.7s 0.2s ease both; }
.inner-hero__content { animation: fadeUp 0.6s 0.1s ease both; }

/* ─── SCROLL-REVEAL (JS adds .revealed) ────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal--left {
  transform: translateX(-24px);
}
.reveal--left.revealed { transform: translateX(0); }

.reveal--right {
  transform: translateX(24px);
}
.reveal--right.revealed { transform: translateX(0); }

.reveal--scale {
  transform: scale(0.95);
}
.reveal--scale.revealed { transform: scale(1); }

/* Staggered children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger.revealed > * { opacity: 1; transform: translateY(0); }
.stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
.stagger.revealed > *:nth-child(2) { transition-delay: 0.08s; }
.stagger.revealed > *:nth-child(3) { transition-delay: 0.16s; }
.stagger.revealed > *:nth-child(4) { transition-delay: 0.24s; }
.stagger.revealed > *:nth-child(5) { transition-delay: 0.32s; }
.stagger.revealed > *:nth-child(6) { transition-delay: 0.40s; }

/* ─── LOADING SHIMMER (for audit loading state) ─────────────── */
.shimmer {
  background: linear-gradient(90deg,
    var(--border) 25%,
    var(--cream)  50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}

.shimmer-line { height: 14px; margin-bottom: 8px; }
.shimmer-line--sm  { width: 40%; }
.shimmer-line--md  { width: 65%; }
.shimmer-line--lg  { width: 90%; }
.shimmer-block { height: 120px; width: 100%; }

/* ─── SCORE GAUGE DRAW ──────────────────────────────────────── */
.score-gauge .gauge-track { stroke-dasharray: 314; stroke-dashoffset: 0; }
.score-gauge .gauge-fill  {
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── STAT NUMBER COUNTER ───────────────────────────────────── */
.count-up { animation: countUp 0.5s ease both; }

/* ─── FLOATING CTA (sticky audit button on mobile) ─────────── */
.floating-cta {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 400;
  padding: var(--space-md);
  background: rgba(11,42,74,0.97);
  border-top: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
}

.floating-cta .btn { width: 100%; }

@media (max-width: 768px) {
  .floating-cta { display: block; }
  body { padding-bottom: 80px; } /* stop content hiding behind it */
}

/* ─── NAV HAMBURGER ANIMATION ───────────────────────────────── */
.nav__hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── PROGRESS BAR (page top) ───────────────────────────────── */
.progress-bar {
  position: fixed; top: 0; left: 0; z-index: 2000;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--orange));
  transition: width 0.1s linear;
}

/* ─── HOVER LIFT ────────────────────────────────────────────── */
.hover-lift {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ─── REDUCE MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
