/* ==========================================================================
   GreenCleans – Animation & Effects
   Includes scroll-reveal helpers, keyframes, page loader and hover polish.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Page loader
   -------------------------------------------------------------------------- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background-color: var(--gc-light);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--gc-border);
  border-top-color: var(--gc-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loader-text {
  font-family: var(--gc-font-heading);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gc-primary);
}

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

/* --------------------------------------------------------------------------
   Scroll-reveal animations
   Elements with [data-reveal] start hidden and animate in when visible.
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

[data-reveal="left"] { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="zoom"] { transform: scale(0.92); }

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Floating animation for hero imagery accents
   -------------------------------------------------------------------------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Hero heading entrance
   -------------------------------------------------------------------------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-heading h1,
.hero-heading .sep,
.hero-text p,
.hero-text .btn {
  animation: fade-up 0.8s ease both;
}

.hero-heading .sep { animation-delay: 0.1s; }
.hero-heading h1 { animation-delay: 0.2s; }
.hero-text p { animation-delay: 0.35s; }
.hero-text .btn { animation-delay: 0.5s; }

/* --------------------------------------------------------------------------
   Pulse effect for primary buttons
   -------------------------------------------------------------------------- */
@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(55, 122, 0, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(55, 122, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(55, 122, 0, 0); }
}

.btn-pulse:hover {
  animation: pulse-glow 1.2s ease-out infinite;
}

/* --------------------------------------------------------------------------
   Back-to-top smooth reveal handled in JS (.is-visible)
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Hover lift for cards
   -------------------------------------------------------------------------- */
.hover-lift {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(1, 21, 2, 0.14);
}
