/* ==================== KEYFRAME ANIMATIONS ==================== */

/* Wave Flow Animation */
@keyframes wave-flow {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Floating Orb Animation */
@keyframes float-orb {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(20px, -30px) scale(1.05);
  }
  50% {
    transform: translate(-10px, -50px) scale(1);
  }
  75% {
    transform: translate(-30px, -20px) scale(0.95);
  }
}

/* Pulse Arrow Animation */
@keyframes pulse-arrow {
  0%, 100% {
    opacity: 1;
    transform: translateX(0);
  }
  50% {
    opacity: 0.6;
    transform: translateX(5px);
  }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide In From Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In From Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In Animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scale In Bounce Animation */
@keyframes scaleInBounce {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse Glow Animation */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(95, 201, 248, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(95, 201, 248, 0.6);
  }
}

/* Gradient Shift Animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Gentle Float Animation */
@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* Particle Float Animation */
@keyframes particleFloat {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.3;
  }
  25% {
    transform: translate(10px, -20px) rotate(90deg);
    opacity: 0.6;
  }
  50% {
    transform: translate(0, -40px) rotate(180deg);
    opacity: 0.4;
  }
  75% {
    transform: translate(-10px, -20px) rotate(270deg);
    opacity: 0.5;
  }
}

/* Shimmer Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Rotate Animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Border Glow Animation */
@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(95, 201, 248, 0.2);
  }
  50% {
    border-color: rgba(95, 201, 248, 0.5);
  }
}

/* Typing Cursor Blink */
@keyframes cursorBlink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* ==================== SCROLL-TRIGGERED ANIMATIONS ==================== */

/* Base scroll animation state */
.scroll-animate {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.active {
  opacity: 1;
  transform: translateY(0);
}

/* Slide from left variant */
.scroll-animate--left {
  transform: translateX(-50px);
}

.scroll-animate--left.active {
  transform: translateX(0);
}

/* Slide from right variant */
.scroll-animate--right {
  transform: translateX(50px);
}

.scroll-animate--right.active {
  transform: translateX(0);
}

/* Scale variant */
.scroll-animate--scale {
  transform: scale(0.9);
}

.scroll-animate--scale.active {
  transform: scale(1);
}

/* Stagger animation delays - improved timing */
.scroll-animate:nth-child(1) { transition-delay: 0s; }
.scroll-animate:nth-child(2) { transition-delay: 0.1s; }
.scroll-animate:nth-child(3) { transition-delay: 0.2s; }
.scroll-animate:nth-child(4) { transition-delay: 0.3s; }
.scroll-animate:nth-child(5) { transition-delay: 0.4s; }
.scroll-animate:nth-child(6) { transition-delay: 0.5s; }
.scroll-animate:nth-child(7) { transition-delay: 0.6s; }
.scroll-animate:nth-child(8) { transition-delay: 0.7s; }

/* ==================== HERO SECTION ANIMATIONS ==================== */

.hero__content {
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.hero__visual {
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s backwards;
}

.hero__title {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
}

.hero__subtitle {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s backwards;
}

.hero__badges {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s backwards;
}

.hero__buttons {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.7s backwards;
}

.hero__buttons .button {
  animation: scaleInBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.hero__buttons .button:nth-child(1) { animation-delay: 0.8s; }
.hero__buttons .button:nth-child(2) { animation-delay: 0.9s; }
.hero__buttons .button:nth-child(3) { animation-delay: 1s; }

/* ==================== FEATURE CARDS ANIMATIONS ==================== */

.feature-card {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.feature-card.active {
  opacity: 1;
  transform: translateY(0);
}

.feature-card:nth-child(1) { transition-delay: 0s; }
.feature-card:nth-child(2) { transition-delay: 0.1s; }
.feature-card:nth-child(3) { transition-delay: 0.2s; }
.feature-card:nth-child(4) { transition-delay: 0.3s; }
.feature-card:nth-child(5) { transition-delay: 0.4s; }
.feature-card:nth-child(6) { transition-delay: 0.5s; }

/* ==================== BUTTON HOVER EFFECTS ==================== */

.button--primary {
  position: relative;
  overflow: hidden;
}

.button--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.button--primary:hover::before {
  left: 100%;
}

/* Button pulse on hover */
.button--primary:hover {
  animation: pulseGlow 1.5s ease-in-out infinite;
}

/* ==================== CARD HOVER EFFECTS ==================== */

/* Gradient border on hover */
.card-gradient-border {
  position: relative;
}

.card-gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent-primary), transparent, var(--accent-bright));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-gradient-border:hover::before {
  opacity: 1;
}

/* ==================== LOADING STATES ==================== */

.loading-shimmer {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ==================== FLOATING PARTICLES ==================== */

.floating-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  opacity: 0.4;
  animation: particleFloat 8s ease-in-out infinite;
  pointer-events: none;
}

.floating-particle:nth-child(odd) {
  animation-duration: 10s;
  animation-direction: reverse;
}

.floating-particle:nth-child(3n) {
  width: 4px;
  height: 4px;
  animation-duration: 12s;
}

.floating-particle:nth-child(5n) {
  width: 8px;
  height: 8px;
  opacity: 0.3;
  animation-duration: 15s;
}

/* ==================== PARALLAX ELEMENTS ==================== */

.parallax-layer {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

.parallax-layer--slow {
  transition: transform 0.15s ease-out;
}

.parallax-layer--fast {
  transition: transform 0.05s ease-out;
}

/* ==================== SMOOTH SCROLL BEHAVIOR ==================== */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ==================== REDUCED MOTION ==================== */

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

  .scroll-animate {
    opacity: 1;
    transform: none;
  }

  .hero__wave,
  .hero__orb,
  .floating-particle {
    animation: none !important;
  }
}

/* ==================== SECTION TRANSITIONS ==================== */

.section {
  opacity: 1;
  transform: translateY(0);
}

.section-title-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-title-animate.active {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== INTERACTIVE ELEMENTS ==================== */

/* Link underline animation */
.animated-underline {
  position: relative;
  display: inline-block;
}

.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animated-underline:hover::after {
  width: 100%;
}

/* Icon rotation on hover */
.icon-rotate-hover {
  transition: transform 0.3s ease;
}

.icon-rotate-hover:hover {
  transform: rotate(15deg);
}

/* Scale on hover */
.scale-hover {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scale-hover:hover {
  transform: scale(1.05);
}

/* Lift on hover */
.lift-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lift-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ==================== CODE BLOCK ANIMATIONS ==================== */

.code-block-animate {
  position: relative;
  overflow: hidden;
}

.code-block-animate::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(95, 201, 248, 0.05), transparent);
  transform: translateX(-100%);
  animation: codeHighlight 3s ease-in-out infinite;
  animation-delay: 2s;
}

@keyframes codeHighlight {
  0% {
    transform: translateX(-100%);
  }
  50%, 100% {
    transform: translateX(100%);
  }
}

/* ==================== STEP CONNECTOR ANIMATION ==================== */

.step-connector {
  position: relative;
}

.step-connector::after {
  content: '';
  position: absolute;
  left: 29px;
  top: 70px;
  bottom: -30px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-muted));
  opacity: 0;
  transform: scaleY(0);
  transform-origin: top;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-connector.active::after {
  opacity: 0.3;
  transform: scaleY(1);
}

/* ==================== CURSOR EFFECTS ==================== */

.custom-cursor {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.15s ease, opacity 0.15s ease;
  mix-blend-mode: difference;
}

.custom-cursor--hover {
  transform: scale(1.5);
  background: rgba(95, 201, 248, 0.2);
}
