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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

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

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Line sweep animation */
@keyframes lineSweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Subtle grid pulse */
@keyframes gridPulse {
  0%, 100% {
    opacity: 0.03;
  }
  50% {
    opacity: 0.06;
  }
}

/* Animation classes */
.fade-in-up {
  animation: fadeInUp var(--transition-slow) ease forwards;
}

.slide-in-left {
  animation: slideInLeft var(--transition-slow) ease forwards;
}

.slide-in-right {
  animation: slideInRight var(--transition-slow) ease forwards;
}

/* Scroll animation states - optimized for mobile */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Mobile: disable scroll animations for performance */
@media (max-width: 767px) {
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  
  .animate-on-scroll.visible {
    opacity: 1 !important;
    transform: none !important;
  }

  .scroll-line,
  .scroll-line::after {
    animation: scrollUp 2s ease-in-out infinite !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Only use will-change on desktop - can cause issues on mobile */
@media (min-width: 768px) {
  .animate-on-scroll {
    will-change: opacity, transform;
  }
}

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

/* Fade in (no transform) */
.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
}

/* Slide up */
.slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for children */
.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 100ms; }
.stagger-children > *:nth-child(3) { transition-delay: 200ms; }
.stagger-children > *:nth-child(4) { transition-delay: 300ms; }
.stagger-children > *:nth-child(5) { transition-delay: 400ms; }
.stagger-children > *:nth-child(6) { transition-delay: 500ms; }

/* Subtle floating animation for hero elements */
.hero-float {
  animation: float 6s ease-in-out infinite;
}

/* Gradient text animation */
.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* Shimmer effect */
.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Glow pulse for buttons/CTAs */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(165, 180, 252, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(165, 180, 252, 0.35);
  }
}

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

/* Line drawing animation */
@keyframes lineDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.line-draw {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: lineDraw 2s ease forwards;
}

/* Scale in animation */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Slide from left */
.slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right */
.slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ========================================
   TEXTURE PATTERNS - Lines & Grids
   ======================================== */

/* Grid texture - subtle dot grid */
.texture-grid {
  position: relative;
}

.texture-grid::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(165, 180, 252, 0.08) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Diagonal lines texture */
.texture-lines {
  position: relative;
}

.texture-lines::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    rgba(165, 180, 252, 0.03) 40px,
    rgba(165, 180, 252, 0.03) 41px
  );
  pointer-events: none;
  z-index: 0;
}

/* Horizontal lines texture */
.texture-horizontal {
  position: relative;
}

.texture-horizontal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 60px,
    rgba(165, 180, 252, 0.04) 60px,
    rgba(165, 180, 252, 0.04) 61px
  );
  pointer-events: none;
  z-index: 0;
}

/* Cross-hatch texture */
.texture-crosshatch {
  position: relative;
}

.texture-crosshatch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 80px,
      rgba(165, 180, 252, 0.025) 80px,
      rgba(165, 180, 252, 0.025) 81px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 80px,
      rgba(165, 180, 252, 0.025) 80px,
      rgba(165, 180, 252, 0.025) 81px
    );
  pointer-events: none;
  z-index: 0;
}

/* Corner accent lines */
.corner-lines {
  position: relative;
}

.corner-lines::before,
.corner-lines::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  pointer-events: none;
  z-index: 1;
}

.corner-lines::before {
  top: 20px;
  left: 20px;
  border-top: 1px solid rgba(165, 180, 252, 0.15);
  border-left: 1px solid rgba(165, 180, 252, 0.15);
}

.corner-lines::after {
  bottom: 20px;
  right: 20px;
  border-bottom: 1px solid rgba(165, 180, 252, 0.15);
  border-right: 1px solid rgba(165, 180, 252, 0.15);
}

/* Animated line sweep overlay */
.line-sweep {
  position: relative;
  overflow: hidden;
}

.line-sweep::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(165, 180, 252, 0.05) 50%,
    transparent 100%
  );
  animation: lineSweep 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

/* Noise texture overlay */
.texture-noise {
  position: relative;
}

.texture-noise::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
  z-index: 0;
}

/* Reduced motion support */
@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,
  .fade-in,
  .slide-up,
  .scale-in,
  .slide-left,
  .slide-right {
    opacity: 1;
    transform: none;
  }
  
  .hero-title,
  .hero-tagline,
  .cta-button {
    opacity: 1;
    transform: none;
    animation: none;
  }
  
  .hero-float,
  .gradient-animate,
  .shimmer,
  .glow-pulse,
  .line-sweep::after {
    animation: none;
  }
}
