/* h4a-effects.css — Lightweight animation library for host4.ai sites */

/* === SCROLL REVEAL === */
.h4a-reveal,
.h4a-reveal-left,
.h4a-reveal-right,
.h4a-reveal-up {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.h4a-reveal { transform: translateY(30px); }
.h4a-reveal-left { transform: translateX(-40px); }
.h4a-reveal-right { transform: translateX(40px); }
.h4a-reveal-up { transform: translateY(40px); }

.h4a-reveal.h4a-visible,
.h4a-reveal-left.h4a-visible,
.h4a-reveal-right.h4a-visible,
.h4a-reveal-up.h4a-visible {
  opacity: 1;
  transform: translate(0);
}

/* Stagger children: add .h4a-stagger to parent */
.h4a-stagger > *:nth-child(1) { transition-delay: 0s; }
.h4a-stagger > *:nth-child(2) { transition-delay: 0.1s; }
.h4a-stagger > *:nth-child(3) { transition-delay: 0.15s; }
.h4a-stagger > *:nth-child(4) { transition-delay: 0.2s; }
.h4a-stagger > *:nth-child(5) { transition-delay: 0.25s; }
.h4a-stagger > *:nth-child(6) { transition-delay: 0.3s; }

/* === GRADIENT TEXT === */
.h4a-gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: h4aGradientShift 4s ease infinite;
}
.h4a-gradient-text-warm {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 50%, #ec4899 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: h4aGradientShift 4s ease infinite;
}
.h4a-gradient-text-ocean {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: h4aGradientShift 4s ease infinite;
}
@keyframes h4aGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* === PARALLAX === */
.h4a-parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
@supports (-webkit-touch-callout: none) {
  .h4a-parallax { background-attachment: scroll; }
}

/* === CARD TILT === */
.h4a-tilt {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.h4a-tilt:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* === GLOW BUTTON === */
.h4a-glow {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.h4a-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(99, 102, 241, 0.2);
}
.h4a-glow-warm:hover {
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.4), 0 0 40px rgba(249, 115, 22, 0.2);
}
.h4a-glow-green:hover {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), 0 0 40px rgba(16, 185, 129, 0.2);
}

/* === FLOATING === */
.h4a-float {
  animation: h4aFloat 3s ease-in-out infinite;
}
@keyframes h4aFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* === PULSE === */
.h4a-pulse {
  animation: h4aPulse 2s ease-in-out infinite;
}
@keyframes h4aPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* === SHIMMER LOADING === */
.h4a-shimmer {
  position: relative;
  overflow: hidden;
}
.h4a-shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: h4aShimmer 2s infinite;
}
@keyframes h4aShimmer {
  100% { left: 100%; }
}

/* === BLUR-IN TEXT === */
.h4a-blur-in {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.8s ease, filter 0.8s ease;
}
.h4a-blur-in.h4a-visible {
  opacity: 1;
  filter: blur(0);
}

/* === UNDERLINE DRAW === */
.h4a-underline-draw {
  position: relative;
  display: inline-block;
}
.h4a-underline-draw::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: currentColor;
  transition: width 0.4s ease;
}
.h4a-underline-draw:hover::after {
  width: 100%;
}

/* === COUNTER (styled by JS) === */
.h4a-counter {
  font-variant-numeric: tabular-nums;
}

/* === KINETIC GRID === */
.h4a-kinetic-grid {
  position: relative;
  overflow: hidden;
}
.h4a-kinetic-grid > *:not(canvas) {
  position: relative;
  z-index: 1;
}

/* === MAGNETIC BUTTON === */
.h4a-magnetic {
  transition: transform 0.2s ease-out;
  will-change: transform;
}

/* === IMAGE ZOOM REVEAL === */
.h4a-img-zoom {
  overflow: hidden;
  position: relative;
}
.h4a-img-zoom img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.6s ease;
  will-change: transform;
}
.h4a-img-zoom:hover img {
  transform: scale(1.08);
  filter: brightness(1.1);
}
.h4a-img-zoom::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.h4a-img-zoom:hover::after {
  opacity: 1;
}

/* === CARD SHINE === */
.h4a-shine {
  position: relative;
  overflow: hidden;
}
.h4a-shine::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at var(--shine-x, -100%) var(--shine-y, -100%), rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* === CURSOR SPOTLIGHT (on hero) === */
.h4a-spotlight {
  position: relative;
  overflow: hidden;
}
.h4a-spotlight::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  left: var(--spot-x, -200px);
  top: var(--spot-y, -200px);
  z-index: 1;
  transition: left 0.1s ease-out, top 0.1s ease-out;
}

/* === TYPEWRITER === */
.h4a-typewriter {
  overflow: hidden;
  border-right: 2px solid currentColor;
  white-space: nowrap;
  width: 0;
  animation: h4aType 2s steps(40) forwards, h4aBlink 0.7s step-end infinite;
}
@keyframes h4aType {
  to { width: 100%; }
}
@keyframes h4aBlink {
  50% { border-color: transparent; }
}

/* === HOVER LIFT (stronger than tilt for images) === */
.h4a-lift {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}
.h4a-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.15), 0 8px 16px rgba(0,0,0,0.1);
}

/* === BORDER GLOW ANIMATION === */
.h4a-border-glow {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}
.h4a-border-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(from 0deg, #667eea, #764ba2, #f093fb, #667eea);
  border-radius: inherit;
  z-index: -1;
  animation: h4aBorderSpin 3s linear infinite;
}
@keyframes h4aBorderSpin {
  to { transform: rotate(360deg); }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  .h4a-reveal, .h4a-reveal-left, .h4a-reveal-right, .h4a-reveal-up, .h4a-blur-in {
    opacity: 1; transform: none; filter: none; transition: none;
  }
  .h4a-float, .h4a-pulse, .h4a-gradient-text, .h4a-gradient-text-warm, .h4a-gradient-text-ocean {
    animation: none;
  }
  .h4a-shimmer::after { animation: none; }
  .h4a-typewriter { width: auto; animation: none; border: none; }
  .h4a-border-glow::before { animation: none; }
  .h4a-lift:hover { transform: none; }
}
