/* ============================================================
   ANIMATIONS.CSS — Keyframes & Animation Classes
   ============================================================ */

/* ========================
   Core Keyframes
   ======================== */

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

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

@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 20px rgba(124,58,237,.3); }
  50%      { box-shadow: 0 0 50px rgba(124,58,237,.6), 0 0 80px rgba(6,182,212,.2); }
}

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

@keyframes ripple {
  0%   { transform: scale(0); opacity: .6; }
  100% { transform: scale(4); opacity: 0; }
}

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

@keyframes morphBorder {
  0%,100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25%      { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50%      { border-radius: 50% 60% 30% 60% / 40% 40% 60% 50%; }
  75%      { border-radius: 40% 60% 60% 30% / 60% 40% 60% 50%; }
}

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

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

@keyframes slideInUp {
  from { transform: translateY(60px);  opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

@keyframes rotateIn {
  from { transform: rotate(-10deg) scale(.9); opacity: 0; }
  to   { transform: rotate(0deg)   scale(1);  opacity: 1; }
}

@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes dotPulse {
  0%,80%,100% { transform: scale(0); opacity: 0; }
  40%          { transform: scale(1); opacity: 1; }
}

@keyframes waveForm {
  0%,100% { height: 6px; }
  50%      { height: 20px; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes borderDraw {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

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

@keyframes particleFloat {
  0%,100% { transform: translateY(0)   rotate(0deg); }
  33%      { transform: translateY(-20px) rotate(120deg); }
  66%      { transform: translateY(10px)  rotate(240deg); }
}

@keyframes aurora {
  0%,100% { background-position: 0% 50%; opacity: .4; }
  50%      { background-position: 100% 50%; opacity: .7; }
}

/* ========================
   Stagger Animation Utilities
   ======================== */

.stagger-1  { animation-delay: .1s !important; }
.stagger-2  { animation-delay: .2s !important; }
.stagger-3  { animation-delay: .3s !important; }
.stagger-4  { animation-delay: .4s !important; }
.stagger-5  { animation-delay: .5s !important; }
.stagger-6  { animation-delay: .6s !important; }

/* ========================
   Reusable Animation Classes
   ======================== */

.animate-fade-in {
  animation: fadeIn .8s ease both;
}

.animate-slide-up {
  animation: slideInUp .8s cubic-bezier(.16,1,.3,1) both;
}

.animate-slide-left {
  animation: slideInLeft .8s cubic-bezier(.16,1,.3,1) both;
}

.animate-slide-right {
  animation: slideInRight .8s cubic-bezier(.16,1,.3,1) both;
}

.animate-zoom-in {
  animation: zoomIn .7s cubic-bezier(.16,1,.3,1) both;
}

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

.animate-pulse-glow {
  animation: pulseGlow 2.5s ease infinite;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    transparent 20%,
    rgba(255,255,255,.08) 50%,
    transparent 80%
  );
  background-size: 200% auto;
  animation: shimmer 2s linear infinite;
}

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

.animate-morph {
  animation: morphBorder 8s ease-in-out infinite;
}

/* ========================
   Hover Effects
   ======================== */

.hover-lift {
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,.3);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(124,58,237,.4);
}

.hover-scale {
  transition: transform .3s ease;
}
.hover-scale:hover { transform: scale(1.05); }

/* ========================
   Noise / Grain Overlay
   ======================== */

.noise-overlay::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
  opacity: .5;
}

/* ========================
   Section Entrance Animations
   ======================== */

/* Applied via JS IntersectionObserver — classes added when in view */
.section-header .section-tag.animated  { animation: slideInUp .6s .1s both; }
.section-header .section-title.animated { animation: slideInUp .6s .25s both; }
.section-header .section-line.animated  { animation: slideInUp .6s .4s both; }

/* ========================
   Loading States
   ======================== */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-card-2) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
  border-radius: 8px;
}

/* ========================
   Particle & Orb Decorations
   ======================== */

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: aurora 8s ease infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,.15), transparent 70%);
  top: -100px; right: -100px;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,.1), transparent 70%);
  bottom: -100px; left: -100px;
  animation-delay: 4s;
}

/* ========================
   Scroll Progress Bar
   ======================== */

.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 9997;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
  transition: width .1s linear;
}

/* ========================
   Tooltip
   ======================== */

[data-tooltip] { position: relative; }
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e1e3f;
  color: var(--text);
  font-size: .72rem;
  white-space: nowrap;
  padding: .35rem .7rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================
   Typing Effect Helper
   ======================== */

.typed-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--cyan);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-start infinite;
}

/* ========================
   Aurora Background
   ======================== */

.aurora-bg {
  position: absolute; inset: 0; overflow: hidden;
  pointer-events: none; z-index: 0;
}
.aurora-bg::before,
.aurora-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: aurora 10s ease infinite;
}
.aurora-bg::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,.12), transparent);
  top: -200px; right: -100px;
}
.aurora-bg::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(6,182,212,.08), transparent);
  bottom: -150px; left: -100px;
  animation-delay: 5s;
}
