/* ═══════════════════════════════════════════════════
   FLUX — Animations & Motion
   Scroll reveals · Glitch · Ticker · Blobs · Hover
═══════════════════════════════════════════════════ */

/* ── Keyframes ── */

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(0.97); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px currentColor; }
  50%       { opacity: 0.5; box-shadow: 0 0 16px currentColor; }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50%       { opacity: 0.3; transform: scaleY(0.6); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes glitch1 {
  0%,  94%  { transform: translate(0); opacity: 0; }
  95%        { transform: translate(-3px, 1px); opacity: 0.8; }
  96%        { transform: translate(3px, -1px); opacity: 0.8; }
  97%        { transform: translate(-2px, 2px); opacity: 0.8; }
  98%        { transform: translate(2px, -2px); opacity: 0.8; }
  99%, 100%  { transform: translate(0); opacity: 0; }
}

@keyframes glitch2 {
  0%,  91%  { transform: translate(0); opacity: 0; }
  92%        { transform: translate(3px, -1px); opacity: 0.7; }
  93%        { transform: translate(-3px, 1px); opacity: 0.7; }
  94%        { transform: translate(2px, 2px); opacity: 0.7; }
  95%, 100%  { transform: translate(0); opacity: 0; }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(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 countUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes borderGlow {
  0%, 100% { border-color: rgba(204,255,0,0.2); box-shadow: 0 0 20px rgba(204,255,0,0.1); }
  50%       { border-color: rgba(204,255,0,0.5); box-shadow: 0 0 40px rgba(204,255,0,0.25); }
}

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

@keyframes dotPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes barGrow {
  from { height: 0; }
  to   { height: var(--h); }
}

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

/* ── Scroll reveal base states ── */
.reveal-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.reveal-fade.visible { opacity: 1; }

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

/* ── Stagger delays ── */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* ── Nav entrance ── */
.nav-wrapper {
  animation: navSlideDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ── Hero headline line reveal ── */
.line-wrap {
  display: block;
  overflow: hidden;
}
.line-wrap > * {
  display: inline-block;
  animation: revealUp 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.line-wrap:nth-child(2) > * { animation-delay: 0.15s; }

/* ── Badge entrance ── */
.hero-badge {
  animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

/* ── Magnetic button effect ── */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease !important;
}

/* ── Feature card stagger ── */
.features-grid .feature-card:nth-child(1) { transition-delay: 0.05s; }
.features-grid .feature-card:nth-child(2) { transition-delay: 0.15s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.25s; }
.features-grid .feature-card:nth-child(4) { transition-delay: 0.1s; }
.features-grid .feature-card:nth-child(5) { transition-delay: 0.2s; }
.features-grid .feature-card:nth-child(6) { transition-delay: 0.3s; }

/* ── Pricing card stagger ── */
.pricing-grid .pricing-card:nth-child(1) { transition-delay: 0.05s; }
.pricing-grid .pricing-card:nth-child(2) { transition-delay: 0.15s; }
.pricing-grid .pricing-card:nth-child(3) { transition-delay: 0.25s; }

/* ── Stat counter animation ── */
.stat-item.visible .stat-number {
  animation: countUp 0.6s ease both;
}

/* ── Chart bar grow ── */
.bar, .mini-bar {
  animation: barGrow 1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.bar:nth-child(1) { animation-delay: 0.1s; }
.bar:nth-child(2) { animation-delay: 0.2s; }
.bar:nth-child(3) { animation-delay: 0.3s; }
.bar:nth-child(4) { animation-delay: 0.4s; }
.bar:nth-child(5) { animation-delay: 0.5s; }
.bar:nth-child(6) { animation-delay: 0.6s; }
.bar:nth-child(7) { animation-delay: 0.7s; }

/* ── Shimmer on featured card ── */
.card-featured::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.04) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  border-radius: inherit;
  pointer-events: none;
}

/* ── Glow pulse on featured pricing card ── */
.card-featured {
  animation: borderGlow 3s ease-in-out infinite;
}

/* ── Logo hover shimmer ── */
.logo-item {
  background: linear-gradient(
    90deg,
    rgba(250,250,250,0.06) 0%,
    rgba(250,250,250,0.12) 50%,
    rgba(250,250,250,0.06) 100%
  );
  background-size: 200% 100%;
  transition: background-position 0.4s ease, color 0.3s, border-color 0.3s;
}
.logo-item:hover {
  background-position: right center;
}

/* ── Testimonial card entrance ── */
.testimonial-card {
  animation: carouselFadeIn 0.5s ease both;
}

/* ── Dot pop animation ── */
.carousel-dot {
  animation: dotPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Flow node pulse ── */
.flow-node.active {
  animation: borderGlow 2s ease-in-out infinite;
}

/* ── Sidebar item hover ── */
.sidebar-item {
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.sidebar-item:hover:not(.active) {
  background: rgba(250,250,250,0.05);
  transform: translateX(3px);
}

/* ── Social link hover ── */
.social-link {
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Footer link hover ── */
.footer-col a {
  transition: color 0.2s, transform 0.2s;
}
.footer-col a:hover {
  transform: translateX(4px);
}

/* ── Nav link underline ── */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 14px; right: 14px;
  height: 1px;
  background: var(--neon);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-link:hover::after { transform: scaleX(1); }

/* ── Scroll progress bar ── */
#scrollProgress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon), var(--pink), var(--violet));
  z-index: 9998;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--neon);
}

/* ── Page load fade in ── */
body {
  animation: revealFade 0.4s ease both;
}

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