/* ==========================================================================
   Animations & Effects
   ========================================================================== */

/* AOS Override - smoother feel */
[data-aos] {
  transition-duration: 800ms !important;
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Hover Effects */
.hover-lift {
  transition: transform var(--transition);
}
.hover-lift:hover {
  transform: translateY(-6px);
}

.hover-glow {
  transition: box-shadow var(--transition);
}
.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* Gradient Border */
.gradient-border {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  z-index: 1;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition);
}
.gradient-border:hover::before {
  opacity: 1;
}

/* Shimmer effect */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.shimmer {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Typewriter cursor */
@keyframes type-cursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Floating animation */
.float {
  animation: float-anim 3s ease-in-out infinite;
}
@keyframes float-anim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Rotate */
.rotate-slow {
  animation: rotate 20s linear infinite;
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Spin pulse */
.spin-pulse {
  animation: spin-pulse 4s ease-in-out infinite;
}
@keyframes spin-pulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.05); }
}

/* Glow pulse */
.glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(27, 158, 79, 0.4); }
  50% { box-shadow: 0 0 40px rgba(27, 158, 79, 0.7); }
}

/* Scale in */
@keyframes scale-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Fade in */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Slide in left/right */
@keyframes slide-in-left {
  from { transform: translateX(-50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slide-in-right {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Tilt on hover */
.tilt {
  transition: transform var(--transition);
  transform-style: preserve-3d;
}
.tilt:hover {
  transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
}

/* Number counter animation hint */
.counter-up {
  display: inline-block;
}

/* Glitch effect */
.glitch {
  position: relative;
  color: var(--text-light);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}
.glitch::before {
  animation: glitch-anim 3s infinite linear alternate-reverse;
  color: var(--accent);
  z-index: -1;
}
.glitch::after {
  animation: glitch-anim2 2s infinite linear alternate-reverse;
  color: var(--accent-2);
  z-index: -2;
}
@keyframes glitch-anim {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}
@keyframes glitch-anim2 {
  0% { transform: translate(0); }
  25% { transform: translate(2px, 0); }
  50% { transform: translate(-2px, 0); }
  100% { transform: translate(0); }
}

/* Magnetic button */
.magnetic {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Gradient text shift */
.gradient-shift {
  background: linear-gradient(120deg, var(--primary), var(--accent), var(--accent-2), var(--primary));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease-in-out infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Border draw */
@keyframes border-draw {
  0% { stroke-dashoffset: 100%; }
  100% { stroke-dashoffset: 0; }
}

/* Page transition */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-content {
  animation: page-fade-in 0.6s ease-out;
}

/* Tag reveal */
.tag-reveal {
  overflow: hidden;
}
.tag-reveal-inner {
  display: inline-block;
  animation: tag-reveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform: translateY(100%);
}
@keyframes tag-reveal {
  to { transform: translateY(0); }
}

/* Particle dot */
.particle-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-light);
  border-radius: 50%;
  pointer-events: none;
  animation: particle-rise 5s linear infinite;
}
@keyframes particle-rise {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  20% { opacity: 1; transform: translateY(-50px) scale(1); }
  100% { transform: translateY(-300px) scale(0); opacity: 0; }
}

/* Wave animation */
.wave {
  animation: wave 2.5s ease-in-out infinite;
  display: inline-block;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(0deg); }
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  animation: stagger-in 0.6s forwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.1s; }
.stagger > *:nth-child(2) { animation-delay: 0.2s; }
.stagger > *:nth-child(3) { animation-delay: 0.3s; }
.stagger > *:nth-child(4) { animation-delay: 0.4s; }
.stagger > *:nth-child(5) { animation-delay: 0.5s; }
.stagger > *:nth-child(6) { animation-delay: 0.6s; }
@keyframes stagger-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Bg gradient animation */
.bg-animated {
  background: linear-gradient(120deg, var(--bg-darker), var(--bg-dark), var(--bg-card), var(--bg-darker));
  background-size: 400% 400%;
  animation: bg-shift 10s ease infinite;
}
@keyframes bg-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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