/* =============================================
   Fattorty - Animations & Scroll Effects
   ============================================= */

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.reveal-left {
  transform: translateX(-32px);
}

.reveal.reveal-right {
  transform: translateX(32px);
}

.reveal.reveal-scale {
  transform: scale(0.93);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Stagger delay for grid children */
.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > *:nth-child(6) { transition-delay: 400ms; }

/* --- Shimmer Loader --- */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    rgba(124, 58, 237, 0.15) 50%,
    var(--bg-card) 100%
  );
  background-size: 200% auto;
  animation: shimmer 2s linear infinite;
}

/* --- Glow Pulse --- */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3),
                0 0 40px rgba(124, 58, 237, 0.15);
  }
  50% {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.5),
                0 0 60px rgba(124, 58, 237, 0.25);
  }
}

.glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}

/* --- Typing Cursor --- */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--primary-light);
  margin-left: 2px;
}

/* --- Gradient Border Rotation --- */
@keyframes borderRotate {
  from { --angle: 0deg; }
  to { --angle: 360deg; }
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.animated-border {
  border: 1px solid transparent;
  background: linear-gradient(var(--bg-dark), var(--bg-dark)) padding-box,
              conic-gradient(from var(--angle), var(--primary), var(--primary-light), var(--primary)) border-box;
  animation: borderRotate 4s linear infinite;
}

/* --- Hover Lift --- */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* --- Particles in Hero --- */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleDrift linear infinite;
}

@keyframes particleDrift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: translate(var(--drift-x, 50px), var(--drift-y, -100px)) scale(0.5);
    opacity: 0;
  }
}

/* --- Feature Card Icon Animation --- */
.feature-card:hover .feature-icon {
  animation: iconPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* --- Step Connector Animation --- */
.step-connector svg {
  stroke-dasharray: 6, 4;
  animation: dashMove 2s linear infinite;
}

@keyframes dashMove {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -20; }
}

/* --- Pricing Card Recommended Pulse --- */
.pricing-card.featured .pricing-badge {
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.7), 0 0 45px rgba(124, 58, 237, 0.3);
  }
}

/* --- FAQ Arrow Smooth --- */
.faq-answer {
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Loading Dots --- */
@keyframes loadingDot {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

.loading-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  margin: 0 2px;
  animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* --- Hero Number Counter --- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-stat {
  animation: countUp 0.6s ease both;
}

.hero-stat:nth-child(1) { animation-delay: 0.8s; }
.hero-stat:nth-child(2) { animation-delay: 1s; }
.hero-stat:nth-child(3) { animation-delay: 1.2s; }

/* --- Smooth page transition --- */
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  animation: pageIn 0.5s ease both;
}

/* --- Hover Glow Text --- */
.hover-glow-text {
  transition: text-shadow var(--transition-base);
}

.hover-glow-text:hover {
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.6);
}

/* --- Active Nav Underline --- */
.nav-links a.active {
  color: var(--text-primary);
  position: relative;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--primary-light);
  border-radius: var(--radius-full);
}

/* --- Glassmorphism Shimmer on hover --- */
.glass-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  background-position: -100% 0;
  transition: background-position 0.6s ease;
  pointer-events: none;
}

.glass-card:hover::after {
  background-position: 100% 0;
}

.glass-card {
  position: relative;
  overflow: hidden;
}

/* --- Scroll progress bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 1001;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--primary-glow);
}
