/* =============================================
   CAPRI CLEANERS — ANIMATIONS
   animations.css
   ============================================= */

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

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%,100% { transform: translateY(0px) rotate(0deg); }
  33%      { transform: translateY(-18px) rotate(2deg); }
  66%      { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes floatSlow {
  0%,100% { transform: translateY(0px); }
  50%      { transform: translateY(-24px); }
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1);   opacity: 0.6; }
  25%  { transform: translate(15px, -20px) scale(1.05); opacity: 0.8; }
  50%  { transform: translate(-10px, -35px) scale(0.95); opacity: 0.5; }
  75%  { transform: translate(20px, -15px) scale(1.08); opacity: 0.7; }
  100% { transform: translate(0, 0) scale(1);   opacity: 0.6; }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes starPop {
  0%   { opacity: 0; transform: scale(0) rotate(-30deg); }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

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

@keyframes borderGrow {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes navSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes heroWordIn {
  from { opacity: 0; transform: translateY(20px) skewY(2deg); }
  to   { opacity: 1; transform: translateY(0) skewY(0deg); }
}

@keyframes scrollBounce {
  0%,100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(8px); opacity: 1; }
}

@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 12px rgba(200,169,110,0.3); }
  50%      { box-shadow: 0 0 28px rgba(200,169,110,0.65); }
}

/* ── Scroll-Triggered Base States ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* ── Staggered Children ── */
.stagger-children > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.stagger-children.visible > *:nth-child(1)  { opacity:1; transform:none; transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2)  { opacity:1; transform:none; transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(3)  { opacity:1; transform:none; transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(4)  { opacity:1; transform:none; transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(5)  { opacity:1; transform:none; transition-delay: 0.45s; }
.stagger-children.visible > *:nth-child(6)  { opacity:1; transform:none; transition-delay: 0.55s; }
.stagger-children.visible > *:nth-child(7)  { opacity:1; transform:none; transition-delay: 0.65s; }
.stagger-children.visible > *:nth-child(8)  { opacity:1; transform:none; transition-delay: 0.75s; }

/* ── Floating Orbs ── */
.float-orb {
  animation: float 7s ease-in-out infinite;
}
.float-orb--slow  { animation: floatSlow 10s ease-in-out infinite; }
.float-orb--delay { animation-delay: 2s; }
.float-orb--delay2{ animation-delay: 4s; }

/* ── Sparkle Dots (CTA Banner) ── */
.sparkle {
  position: absolute;
  border-radius: 50%;
  background: var(--color-gold);
  pointer-events: none;
  animation: drift 8s ease-in-out infinite;
}
.sparkle:nth-child(2) { animation-delay: 2s;  animation-duration: 10s; }
.sparkle:nth-child(3) { animation-delay: 4s;  animation-duration: 7s;  }
.sparkle:nth-child(4) { animation-delay: 1s;  animation-duration: 12s; }
.sparkle:nth-child(5) { animation-delay: 3.5s; animation-duration: 9s; }

/* ── Hero Load Animations ── */
.hero-word {
  display: inline-block;
  opacity: 0;
  animation: heroWordIn 0.6s ease forwards;
}

.hero-subtitle { opacity: 0; animation: fadeUp 0.7s ease 0.6s forwards; }
.hero-ctas     { opacity: 0; animation: fadeUp 0.7s ease 0.9s forwards; }
.hero-badge    { opacity: 0; animation: fadeIn 0.7s ease 1.1s forwards; }
.hero-scroll   { opacity: 0; animation: fadeIn 0.8s ease 1.4s forwards; }

/* ── Scroll Bounce (chevron) ── */
.scroll-chevron {
  animation: scrollBounce 1.8s ease-in-out infinite;
}

/* ── Shimmer Text ── */
.shimmer-text {
  background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-gold-light) 40%, var(--color-gold) 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ── Glow Pulse on CTA ── */
.glow-pulse { animation: glowPulse 2.5s ease-in-out infinite; }

/* ── Star Pop (reviews) ── */
.star-pop { animation: starPop 0.4s ease forwards; }
.star-pop:nth-child(2) { animation-delay: 0.08s; }
.star-pop:nth-child(3) { animation-delay: 0.16s; }
.star-pop:nth-child(4) { animation-delay: 0.24s; }
.star-pop:nth-child(5) { animation-delay: 0.32s; }

/* ── Underline Grow ── */
.underline-grow { position: relative; }
.underline-grow::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width var(--transition-slow);
}
.underline-grow:hover::after,
.underline-grow.active::after { width: 100%; }

/* ── Card Lift ── */
.card-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

/* ── Image Zoom Wrapper ── */
.img-zoom { overflow: hidden; }
.img-zoom img {
  transition: transform 0.5s ease;
}
.img-zoom:hover img { transform: scale(1.06); }

/* ── Prefers Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale,
  .stagger-children > * { opacity: 1; transform: none; }
}
