/* Animation Classes */

/* Fade animations */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
  opacity: 0;
  transform: translateY(-30px);
  animation: fadeInDown 0.8s ease forwards;
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  animation: fadeInRight 0.8s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Stagger delays for multiple elements */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* Scale animations */
.scale-in {
  opacity: 0;
  transform: scale(0.8);
  animation: scaleIn 0.6s ease forwards;
}

@keyframes scaleIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Glow pulse */
.glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 5px var(--color-accent-glow));
  }
  50% {
    filter: drop-shadow(0 0 20px var(--color-accent-primary));
  }
}

/* Rotate continuous */
.rotate-slow {
  animation: rotateSlow 20s linear infinite;
}

@keyframes rotateSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Floating animation */
.float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Typing animation for hero text */
.typing {
  overflow: hidden;
  border-right: 2px solid var(--color-accent-primary);
  white-space: nowrap;
  animation: typing 3s steps(40) 0.5s forwards, blink 0.75s step-end infinite;
  width: 0;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--color-accent-primary);
  }
}

/* Shimmer effect for loading states */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-bg-secondary) 0%,
    var(--color-bg-elevated) 50%,
    var(--color-bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Draw line animation */
.draw-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 2s ease forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Reveal from bottom */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Parallax elements */
.parallax-slow {
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects */
.hover-lift {
  transition: transform var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

.hover-glow {
  transition: all var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--glow-accent);
}

/* Grid stagger reveal */
.grid-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

.grid-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.grid-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.grid-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.grid-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.grid-stagger > *:nth-child(5) { animation-delay: 0.5s; }
.grid-stagger > *:nth-child(6) { animation-delay: 0.6s; }

/* Particle system */
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background-color: var(--color-accent-primary);
  border-radius: 50%;
  pointer-events: none;
  animation: particleFloat 10s infinite ease-in-out;
}

@keyframes particleFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* ── Hero title glitch ── */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.glitch::before {
  color: #0ff;
  animation: glitch-shift 6s infinite linear alternate-reverse;
}

.glitch::after {
  color: #f0f;
  animation: glitch-shift 6s 0.3s infinite linear alternate;
}

@keyframes glitch-shift {
  0%, 92%  { opacity: 0; clip-path: inset(0 0 100% 0); }
  93%      { opacity: 0.7; clip-path: inset(20% 0 60% 0); transform: translate(-3px, 0); }
  94%      { opacity: 0; clip-path: inset(0 0 100% 0); }
  95%      { opacity: 0.5; clip-path: inset(50% 0 20% 0); transform: translate(2px, 0); }
  96%      { opacity: 0; clip-path: inset(0 0 100% 0); }
  97%      { opacity: 0.6; clip-path: inset(10% 0 70% 0); transform: translate(-2px, 1px); }
  98%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .glitch::before,
  .glitch::after { animation: none; display: none; }
}

/* ── Ambient aura glows (wide screens only) ── */
.aura-left,
.aura-right {
  display: none;
  position: fixed;
  top: 20%;
  width: 350px;
  height: 550px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(110px);
  will-change: opacity, background;
}

.aura-left {
  left: -60px;
  animation: auraShiftLeft 12s ease-in-out infinite alternate;
}

.aura-right {
  right: -60px;
  animation: auraShiftRight 14s ease-in-out infinite alternate;
}

@keyframes auraShiftLeft {
  0%   { background: #00b4d8; opacity: 0.15; }
  33%  { background: #7b2ff7; opacity: 0.20; }
  66%  { background: #00ffc8; opacity: 0.12; }
  100% { background: #00b4d8; opacity: 0.18; }
}

@keyframes auraShiftRight {
  0%   { background: #f72f8e; opacity: 0.12; }
  33%  { background: #00b4d8; opacity: 0.18; }
  66%  { background: #7b2ff7; opacity: 0.15; }
  100% { background: #f72f8e; opacity: 0.14; }
}

@media (min-width: 1200px) {
  .aura-left, .aura-right { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .aura-left, .aura-right { display: none; }
}

/* Slide in from edges */
.slide-in-left {
  transform: translateX(-100%);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left.active {
  transform: translateX(0);
}

.slide-in-right {
  transform: translateX(100%);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right.active {
  transform: translateX(0);
}
