/* ============================================
   RackNap – Animations
   ============================================ */

:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --anim-duration: 0.8s;
}

/* Page load – navbar (fade only; slide causes top gap) */
.site-header {
  animation: headerFadeIn 0.6s var(--ease-out-expo) both;
}

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


/* Floating hero cards */
.hero-card-1 {
  animation: float 4s ease-in-out infinite;
}

.hero-card-2 {
  animation: floatReverse 5s ease-in-out infinite 0.5s;
}

.hero-dashboard {
  transition: transform 0.4s var(--ease-out-expo);
}

.hero-visual:hover .hero-dashboard {
  transform: scale(1.02);
}

/* Scroll reveal */
.animate-on-scroll {
  opacity: 0;
  transition:
    opacity var(--anim-duration) var(--ease-out-expo),
    transform var(--anim-duration) var(--ease-out-expo);
  will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
  opacity: 1;
}

.animate-fade-up {
  transform: translateY(40px);
}

.animate-fade-up.is-visible {
  transform: translateY(0);
}

.animate-fade-left {
  transform: translateX(-40px);
}

.animate-fade-left.is-visible {
  transform: translateX(0);
}

.animate-fade-right {
  transform: translateX(40px);
}

.animate-fade-right.is-visible {
  transform: translateX(0);
}

.animate-scale-up {
  transform: scale(0.92);
}

.animate-scale-up.is-visible {
  transform: scale(1);
}

.animate-fade-in {
  transform: none;
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}

.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.35s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 0.45s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(6) { transition-delay: 0.55s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(7) { transition-delay: 0.65s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(8) { transition-delay: 0.75s; opacity: 1; transform: translateY(0); }

/* Button animations */
.btn-primary,
.btn-dark,
.btn-outline-dark {
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease, background-color 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(232, 93, 36, 0.35);
}

.btn-dark:hover,
.btn-outline-dark:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(26, 22, 20, 0.15);
}

.btn-demo {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

/* Card hover lift */
.blog-card {
  transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s ease;
}

.blog-card:hover {
  transform: translateY(-6px);
}

.product-link i {
  transition: transform 0.3s var(--ease-spring);
}

.product-link:hover i {
  transform: translateX(4px);
}

/* AI stats counter glow */
.stat-value {
  transition: color 0.3s ease;
}

.ai-stat.is-counted .stat-value {
  color: var(--color-primary);
}

.ai-visual img {
  transition: transform 0.5s var(--ease-out-expo);
}

.ai-visual:hover img {
  transform: scale(1.03) rotate(0.0deg);
}

/* Integration hex pop */
.integration-pop {
  opacity: 0;
  transform: scale(0.5) rotate(-10deg);
  transition: opacity 0.5s var(--ease-spring), transform 0.5s var(--ease-spring);
}

.integration-pop.is-visible {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.integration-icons img {
  transition: transform 0.35s var(--ease-spring);
}

.integration-icons img:hover {
  transform: scale(1.15) rotate(0deg);
}

/* CTA form focus animation */
.cta-form .form-control {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.cta-form .form-control:focus {
  transform: scale(1.02);
}

.cta-form.is-submitted .btn-primary {
  animation: popIn 0.5s var(--ease-spring);
}

/* Blog nav buttons */
.blog-nav-btn {
  transition: transform 0.25s var(--ease-spring), background 0.2s, border-color 0.2s, color 0.2s;
}

.blog-nav-btn:active {
  transform: scale(0.92);
}

.blog-slider-track.is-dragging {
  cursor: grabbing;
}

/* Accent text underline draw */
.text-accent-highlight {
  position: relative;
  display: inline;
}


.is-visible .text-accent-highlight::after,
.hero-title .text-accent-highlight::after {
  transform: scaleX(1);
}

/* Features CTA bar slide */
.features-cta-bar {
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease;
}

.features-cta-bar.is-visible:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

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

  .animate-on-scroll,
  .stagger-children > *,
  .integration-pop {
    opacity: 1;
    transform: none;
  }

  .logo-marquee-track {
    animation: none;
  }
}
