/* ============================================
   COMBINED ANIMATIONS - ALL TECH & ART EFFECTS
   Combines: keyframes.css, tech-art.css, lofi-art.css, experimental.css
   Performance Optimized - 2026-01-29
   ============================================ */

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

/* Glitch Effects */
@keyframes glitch {
  0%, 100% {
    transform: translate(0);
    filter: hue-rotate(0deg);
  }
  20% {
    transform: translate(-2px, 2px);
    filter: hue-rotate(90deg);
  }
  40% {
    transform: translate(-2px, -2px);
    filter: hue-rotate(180deg);
  }
  60% {
    transform: translate(2px, 2px);
    filter: hue-rotate(270deg);
  }
  80% {
    transform: translate(2px, -2px);
    filter: hue-rotate(360deg);
  }
}

@keyframes glitchText {
  0%, 100% {
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }
  20% {
    transform: translate(-2px, 1px);
    clip-path: inset(20% 0 60% 0);
  }
  40% {
    transform: translate(2px, -1px);
    clip-path: inset(10% 0 70% 0);
  }
  60% {
    transform: translate(-1px, 2px);
    clip-path: inset(30% 0 50% 0);
  }
  80% {
    transform: translate(1px, -2px);
    clip-path: inset(0 0 100% 0);
  }
}

@keyframes glitchShake {
  0%, 100% {
    transform: translate(0);
    filter: invert(0%) brightness(1);
  }
  10% {
    transform: translate(-3px, 2px) skewX(2deg);
    filter: invert(100%) brightness(1.2);
  }
  20% {
    transform: translate(3px, -2px) skewX(-2deg);
    filter: invert(0%) brightness(1);
  }
  30% {
    transform: translate(-2px, 3px) skewX(1deg);
    filter: invert(100%) brightness(1.15);
  }
  40% {
    transform: translate(2px, -3px) skewX(-1deg);
    filter: invert(0%) brightness(1);
  }
  50% {
    transform: translate(-1px, 1px);
    filter: invert(50%) brightness(1.1);
  }
  60% {
    transform: translate(1px, -1px);
    filter: invert(0%) brightness(1);
  }
  70% {
    transform: translate(-2px, 2px);
    filter: invert(100%) brightness(1.1);
  }
  80% {
    transform: translate(2px, -2px);
    filter: invert(0%) brightness(1);
  }
  90% {
    transform: translate(0);
    filter: invert(0%) brightness(1);
  }
}

@keyframes glitchColor {
  0%, 100% {
    filter: hue-rotate(0deg) brightness(1);
  }
  10% {
    filter: hue-rotate(90deg) brightness(1.1);
  }
  20% {
    filter: hue-rotate(180deg) brightness(0.9);
  }
  30% {
    filter: hue-rotate(270deg) brightness(1.05);
  }
  40% {
    filter: hue-rotate(360deg) brightness(1);
  }
}

@keyframes glitchHorizontal {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}

@keyframes glitchAnim1 {
  0%, 100% {
    clip: rect(44px, 450px, 56px, 0);
  }
  20% {
    clip: rect(30px, 450px, 70px, 0);
  }
  40% {
    clip: rect(50px, 450px, 40px, 0);
  }
  60% {
    clip: rect(35px, 450px, 65px, 0);
  }
  80% {
    clip: rect(45px, 450px, 55px, 0);
  }
}

@keyframes glitchAnim2 {
  0%, 100% {
    clip: rect(44px, 450px, 56px, 0);
  }
  20% {
    clip: rect(50px, 450px, 40px, 0);
  }
  40% {
    clip: rect(30px, 450px, 70px, 0);
  }
  60% {
    clip: rect(45px, 450px, 55px, 0);
  }
  80% {
    clip: rect(35px, 450px, 65px, 0);
  }
}

/* Floating & Movement Animations */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.3;
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
    opacity: 0.6;
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
    opacity: 0.4;
  }
}

@keyframes floatParticle {
  0% {
    transform: translate(0, 0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translate(10px, -20px) scale(1);
  }
  50% {
    transform: translate(50px, -100px) scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: translate(100px, -200px) scale(0);
    opacity: 0;
  }
}

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

@keyframes scanLine {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100vh);
  }
}

/* Warping Orb Animations */
@keyframes warpOrb {
  0%, 100% {
    transform: translate(-50%, -50%) translateZ(0) scale(1) rotate(0deg);
  }
  25% {
    transform: translate(-48%, -52%) translateZ(0) scale(1.1) rotate(90deg);
  }
  50% {
    transform: translate(-52%, -48%) translateZ(0) scale(0.95) rotate(180deg);
  }
  75% {
    transform: translate(-50%, -50%) translateZ(0) scale(1.05) rotate(270deg);
  }
}

@keyframes orbGlow {
  0%, 100% {
    opacity: 0.7;
    transform: translateZ(0) scale(1);
  }
  50% {
    opacity: 0.9;
    transform: translateZ(0) scale(1.15);
  }
}

@keyframes orbShift {
  0%, 100% {
    transform: translate(0, 0) translateZ(0) scale(1);
    opacity: 0.5;
  }
  33% {
    transform: translate(30px, -30px) translateZ(0) scale(1.1);
    opacity: 0.6;
  }
  66% {
    transform: translate(-20px, 20px) translateZ(0) scale(0.9);
    opacity: 0.4;
  }
}

/* Morphing Blob Animation */
@keyframes morphBlob {
  0%, 100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    transform: translate(0, 0) scale(1);
  }
  25% {
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    transform: translate(50px, -50px) scale(1.1);
  }
  50% {
    border-radius: 30% 70% 50% 50% / 50% 50% 70% 30%;
    transform: translate(-30px, 40px) scale(0.9);
  }
  75% {
    border-radius: 60% 40% 60% 40% / 40% 60% 40% 60%;
    transform: translate(40px, 30px) scale(1.05);
  }
}

/* Gradient & Color Animations */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

/* Grid & Pattern Animations */
@keyframes gridMove {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 200px 200px, 200px 200px;
  }
}

/* Text & Reveal Animations */
@keyframes textReveal {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

@keyframes brushStroke {
  0% {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

/* ============================================
   WARPING ORB COMPONENT
   ============================================ */

.warping-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%) translateZ(0);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  animation: warpOrb 12s ease-in-out infinite;
  filter: blur(40px);
  opacity: 0.75;
  will-change: transform;
  backface-visibility: hidden;
  contain: layout style paint;
  transform-origin: center center;
}

.warping-orb::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 35% 35%, #f31bf8 0%, #f31bf8 40%, #5bf590 70%, transparent 100%);
  border-radius: 50%;
  opacity: 0.85;
  animation: orbGlow 8s ease-in-out infinite;
  transform-origin: center center;
  transform: translateZ(0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  contain: layout style paint;
}

.warping-orb::after {
  content: '';
  position: absolute;
  top: 15%;
  right: 15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle at 65% 65%, #f31bf8 0%, #f31bf8 45%, #5bf590 75%, transparent 100%);
  border-radius: 50%;
  opacity: 0.65;
  filter: blur(30px);
  animation: orbShift 10s ease-in-out infinite;
  transform-origin: center center;
  transform: translateZ(0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  contain: layout style paint;
}

/* ============================================
   HERO TITLE UNDERLINE
   ============================================ */

.hero__title-underline {
  display: block;
  width: 340px;
  height: 10px;
  background: none;
  border-bottom: 3px solid #ffffff;
  margin-top: 5px;
  transform: translateX(0) scaleX(1.6);
  transform-origin: left;
  cursor: default;
  user-select: none;
}

/* ============================================
   PARTICLE SYSTEM
   ============================================ */

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--color-primary);
  border-radius: 50%;
  opacity: 0;
  animation: floatParticle 15s infinite;
}

/* Particle Positioning - 15 particles (desktop), responsive reduced on mobile */
.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; background: var(--color-primary); }
.particle:nth-child(2) { left: 20%; top: 40%; animation-delay: 2s; background: var(--color-accent); }
.particle:nth-child(3) { left: 30%; top: 60%; animation-delay: 4s; background: var(--color-accent-2); }
.particle:nth-child(4) { left: 40%; top: 30%; animation-delay: 6s; background: var(--color-secondary); }
.particle:nth-child(5) { left: 60%; top: 50%; animation-delay: 8s; background: var(--color-primary); }
.particle:nth-child(6) { left: 70%; top: 70%; animation-delay: 10s; background: var(--color-accent); }
.particle:nth-child(7) { left: 80%; top: 25%; animation-delay: 12s; background: var(--color-accent-2); }
.particle:nth-child(8) { left: 90%; top: 45%; animation-delay: 14s; background: var(--color-secondary); }
.particle:nth-child(9) { left: 50%; top: 10%; animation-delay: 16s; background: var(--color-primary); }
.particle:nth-child(10) { left: 15%; top: 60%; animation-delay: 1s; background: var(--color-accent-2); }

/* Particles 11-15: Hidden on mobile for performance */
.particle:nth-child(11) { left: 25%; top: 15%; animation-delay: 3s; background: var(--color-secondary); }
.particle:nth-child(12) { left: 35%; top: 75%; animation-delay: 5s; background: var(--color-primary); }
.particle:nth-child(13) { left: 45%; top: 5%; animation-delay: 7s; background: var(--color-accent); }
.particle:nth-child(14) { left: 55%; top: 80%; animation-delay: 9s; background: var(--color-accent-2); }
.particle:nth-child(15) { left: 65%; top: 15%; animation-delay: 11s; background: var(--color-secondary); }

/* Responsive: Hide particles 11-15 on mobile */
@media (max-width: 768px) {
  .particle:nth-child(n+11) {
    display: none;
  }
}

/* ============================================
   MORPHING BLOB
   ============================================ */

.morphing-blob {
  position: absolute;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  background: var(--gradient-vibrant);
  opacity: 0.15;
  animation: morphBlob 25s ease-in-out infinite;
  filter: blur(40px);
}

/* ============================================
   TECH GRID & PATTERNS
   ============================================ */

.tech-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--color-primary-25) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-primary-25) 1px, transparent 1px);
  background-size: 200px 200px;
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
  animation: gridMove 30s linear infinite;
}

.circuit-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 2px 2px, var(--color-primary-12) 1px, transparent 0),
    radial-gradient(circle at 2px 2px, var(--color-accent-2-08) 1px, transparent 0),
    radial-gradient(circle at 2px 2px, var(--color-accent-08) 1px, transparent 0);
  background-size: 50px 50px, 80px 80px, 110px 110px;
  background-position: 0 0, 25px 25px, 50px 50px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 1;
  animation: gridMove 50s linear infinite;
}

.hero .circuit-pattern {
  display: none;
}

/* ============================================
   LOFI & ARTISTIC PATTERNS
   ============================================ */

.artistic-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--color-primary-12) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-primary-12) 1px, transparent 1px);
  background-size: 150px 150px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: soft-light;
}

.lofi-texture {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      0deg,
      var(--color-primary-04) 0px,
      transparent 1px,
      transparent 2px,
      var(--color-accent-2-03) 3px,
      transparent 4px
    );
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

.lofi-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--color-primary-12) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-primary-12) 1px, transparent 1px);
  background-size: 150px 150px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

.hero .lofi-grid,
.hero .pixel-mesh {
  display: none;
}

.pixel-mesh {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      0deg,
      var(--color-primary-08) 0px,
      transparent 1px,
      transparent 2px,
      var(--color-accent-2-05) 3px,
      transparent 4px
    ),
    repeating-linear-gradient(
      90deg,
      var(--color-primary-06) 0px,
      transparent 1px,
      transparent 2px,
      var(--color-accent-2-04) 3px,
      transparent 4px
    );
  opacity: 0.6;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  z-index: 1;
}

.pixel-blocks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(90deg, var(--color-primary-10) 0%, transparent 20%),
    linear-gradient(180deg, var(--color-accent-2-08) 0%, transparent 30%),
    linear-gradient(270deg, var(--color-accent-08) 0%, transparent 25%);
  background-size: 200px 200px, 300px 300px, 250px 250px;
  background-position: 20% 30%, 70% 60%, 50% 80%;
  opacity: 0.15;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  z-index: 1;
  filter: blur(0.5px);
}

.gradient-mesh {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(at 20% 30%, var(--color-primary-20) 0px, transparent 50%),
    radial-gradient(at 60% 70%, var(--color-accent-2-15) 0px, transparent 50%),
    radial-gradient(at 80% 40%, var(--color-accent-10) 0px, transparent 50%),
    radial-gradient(at 40% 80%, var(--color-accent-2-08) 0px, transparent 50%);
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}

.lofi-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 0%, var(--color-background-40) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ============================================
   GLITCH TEXT EFFECTS
   ============================================ */

.glitch-text {
  position: relative;
  animation: glitchText 3s infinite;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 var(--color-accent);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitchAnim1 5s infinite;
}

.glitch-text::after {
  left: -2px;
  text-shadow: -2px 0 var(--color-primary), 2px 2px var(--color-accent-2);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitchAnim2 3s infinite;
}

/* ============================================
   SCAN LINE & SPECIAL EFFECTS
   ============================================ */

.scan-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-accent),
    transparent
  );
  opacity: 0.3;
  animation: scanLine 8s linear infinite;
  z-index: 10;
  pointer-events: none;
}

.brush-stroke {
  position: absolute;
  width: 100%;
  height: 200px;
  background: var(--gradient-vibrant);
  opacity: 0.1;
  clip-path: polygon(0 40%, 100% 20%, 100% 60%, 0 80%);
  animation: brushStroke 2s ease-out forwards;
  pointer-events: none;
}

.digital-noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      0deg,
      var(--color-primary-03) 0px,
      transparent 1px,
      transparent 2px,
      var(--color-accent-03) 3px
    );
  pointer-events: none;
  opacity: 0.5;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.glitch-effect {
  animation: glitch 0.3s infinite;
}

.glitch-text-effect {
  animation: glitchText 0.3s infinite;
}

.glitch-shake {
  animation: glitchShake 0.4s;
  animation-fill-mode: forwards;
}

.glitch-color {
  animation: glitchColor 0.5s;
  animation-fill-mode: forwards;
}

.float-animation {
  animation: float 20s ease-in-out infinite;
}

.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}

.text-reveal {
  animation: textReveal 1s ease-out forwards;
}

.neon-glow {
  text-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor,
    0 0 15px currentColor,
    0 0 20px currentColor;
}

.holographic {
  background: linear-gradient(
    45deg,
    var(--color-primary) 0%,
    var(--color-accent-2) 25%,
    var(--color-accent) 50%,
    var(--color-secondary) 75%,
    var(--color-primary) 100%
  );
  background-size: 200% 200%;
  animation: holographicShift 3s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pixelated-text {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: contrast(1.1);
}

.pixel-border {
  border: 2px solid;
  border-image: linear-gradient(135deg, var(--color-primary), var(--color-accent-4), var(--color-secondary)) 1;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.pixel-glow {
  filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 16px currentColor);
  image-rendering: pixelated;
}

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

@media (prefers-reduced-motion: reduce) {
  .particle,
  .glitch-text,
  .morphing-blob,
  .scan-line,
  .warping-orb,
  .gradient-animate,
  .holographic,
  .tech-grid,
  .circuit-pattern {
    animation: none !important;
  }
}
