/* ================================================================== */
/*  Benzo Agent — 100+ animations                                      */
/*  Every class is prefixed with .anim-* or is an intrinsic keyframe   */
/* ================================================================== */

/* ------------------------------ Keyframes --------------------------- */
@keyframes fadeIn       { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut      { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeInUp     { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeInDown   { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }
@keyframes fadeInLeft   { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
@keyframes fadeInRight  { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn      { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes zoomIn       { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUp      { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes slideDown    { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft  { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes float        { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes floatUp      { 0% { transform: translateY(60px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes breathe      { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes pulse        { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes pulseDot     { 0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.7); } 50% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } }
@keyframes ringPulse    { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes shine        { 0% { transform: translateX(-100%); } 60%,100% { transform: translateX(200%); } }
@keyframes gradientShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes shimmer      { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes hueShift     { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
@keyframes spin         { to { transform: rotate(360deg); } }
@keyframes scrollHint   { 0%,100% { transform: scaleY(1); opacity: .6; } 50% { transform: scaleY(1.4); opacity: 1; } }
@keyframes typewriter   { from { width: 0; } to { width: 100%; } }
@keyframes blink        { 50% { opacity: 0; } }
@keyframes marquee      { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marqueeRev   { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes wave         { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
@keyframes shake        { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes wobble       { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-5deg); } 70% { transform: rotate(5deg); } }
@keyframes tada         { 0%,100% { transform: scale(1) rotate(0); } 20%,60% { transform: scale(1.08) rotate(-3deg); } 40%,80% { transform: scale(1.08) rotate(3deg); } }
@keyframes jello        { 0%,100% { transform: skewX(0) skewY(0); } 30% { transform: skewX(-6deg) skewY(-6deg); } 60% { transform: skewX(3deg) skewY(3deg); } }
@keyframes heartbeat    { 0%,100% { transform: scale(1); } 25% { transform: scale(1.15); } 40% { transform: scale(1); } 60% { transform: scale(1.1); } }
@keyframes swing        { 20% { transform: rotate(8deg); } 40% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } 80% { transform: rotate(-2deg); } 100% { transform: rotate(0); } }
@keyframes bounce       { 0%,20%,50%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-14px); } 60% { transform: translateY(-7px); } }
@keyframes ripple       { 0% { transform: scale(0); opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes shimmerText  { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes glowPulse    { 0%,100% { box-shadow: 0 0 20px rgba(139,92,246,.3); } 50% { box-shadow: 0 0 40px rgba(139,92,246,.7); } }
@keyframes borderFlow   { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes neonFlicker  { 0%,19%,21%,23%,25%,54%,56%,100% { opacity: 1; text-shadow: 0 0 12px currentColor; } 20%,22%,24%,55% { opacity: .7; text-shadow: none; } }
@keyframes glitch       { 0%,100% { transform: none; } 20% { transform: translate(-2px, 2px); } 40% { transform: translate(-2px, -2px); } 60% { transform: translate(2px, 2px); } 80% { transform: translate(2px, -2px); } }
@keyframes tilt         { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes drift        { 0%,100% { transform: translate(0,0) rotate(0); } 33% { transform: translate(10px,-10px) rotate(1deg); } 66% { transform: translate(-10px,10px) rotate(-1deg); } }
@keyframes scan         { 0% { background-position: 0 0; } 100% { background-position: 0 200%; } }
@keyframes cardLift     { to { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0,0,0,.4); } }
@keyframes revealClip   { from { clip-path: inset(0 100% 0 0); opacity: 0; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes textReveal   { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes lineGrow     { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes progressFill { from { width: 0; } to { width: 100%; } }
@keyframes countUp      { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes morph        { 0%,100% { border-radius: 40% 60% 55% 45%; } 50% { border-radius: 60% 40% 45% 55%; } }
@keyframes orbit        { from { transform: rotate(0deg) translateX(30px) rotate(0deg); } to { transform: rotate(360deg) translateX(30px) rotate(-360deg); } }
@keyframes dotBounce    { 0%,80%,100% { transform: scale(0); } 40% { transform: scale(1); } }

/* ------------------------------ Application ------------------------- */
/* Fade family */
.anim-fade-in      { animation: fadeIn .8s var(--ease-out) both; }
.anim-fade-up      { animation: fadeInUp .9s var(--ease-out) both; }
.anim-fade-down    { animation: fadeInDown .9s var(--ease-out) both; }
.anim-fade-left    { animation: fadeInLeft .9s var(--ease-out) both; }
.anim-fade-right   { animation: fadeInRight .9s var(--ease-out) both; }
.anim-scale-in     { animation: scaleIn .8s var(--ease-spring) both; }
.anim-zoom-in      { animation: zoomIn .6s var(--ease-spring) both; }
.anim-slide-up     { animation: slideUp .9s var(--ease-out) both; }
.anim-slide-down   { animation: slideDown .9s var(--ease-out) both; }
.anim-slide-left   { animation: slideInLeft 1s var(--ease-out) both; }
.anim-slide-right  { animation: slideInRight 1s var(--ease-out) both; }
.anim-float-up     { animation: floatUp 1.2s var(--ease-out) both; }

/* Delay utilities */
.delay-100 { animation-delay: .1s; }
.delay-200 { animation-delay: .2s; }
.delay-300 { animation-delay: .3s; }
.delay-400 { animation-delay: .4s; }
.delay-500 { animation-delay: .5s; }
.delay-700 { animation-delay: .7s; }
.delay-1000 { animation-delay: 1s; }

/* Inline data-delay based staggering (set via CSS var) */
.anim-stagger {
  animation: fadeInUp .9s var(--ease-out) both;
  animation-delay: calc(var(--stagger-delay, 0ms) * 1ms);
}
[data-delay].anim-stagger,
[data-delay].anim-slide-up {
  animation-delay: calc(var(--delay-attr, 0) * 1ms);
}

/* Loop / decorative */
.anim-float       { animation: float 4s ease-in-out infinite; }
.anim-breathe     { animation: breathe 5s ease-in-out infinite; }
.anim-pulse       { animation: pulse 2s ease-in-out infinite; }
.anim-spin        { animation: spin 8s linear infinite; }
.anim-spin-slow   { animation: spin 20s linear infinite; }
.anim-drift       { animation: drift 12s ease-in-out infinite; }
.anim-tilt        { animation: tilt 6s ease-in-out infinite; }
.anim-wave        { animation: wave 3s ease-in-out infinite; }
.anim-glow-pulse  { animation: glowPulse 3s ease-in-out infinite; }
.anim-heartbeat   { animation: heartbeat 2s ease-in-out infinite; }
.anim-bounce      { animation: bounce 2s infinite; }

/* Text effects */
.anim-gradient    { background-size: 200% 100%; animation: gradientShift 6s ease infinite; }
.anim-shimmer     { background: linear-gradient(90deg, currentColor 0%, currentColor 40%, transparent 50%, currentColor 60%, currentColor 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmerText 3s linear infinite; }
.anim-typewriter  { overflow: hidden; white-space: nowrap; border-right: 2px solid currentColor; animation: typewriter 3s steps(40, end), blink 1s step-end infinite; }
.anim-glitch      { animation: glitch .5s ease-in-out infinite; }
.anim-neon        { animation: neonFlicker 4s infinite; }

/* Interactive micro-animations */
.hover-lift       { transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.hover-zoom       { overflow: hidden; }
.hover-zoom img,
.hover-zoom svg   { transition: transform .5s var(--ease-out); }
.hover-zoom:hover img,
.hover-zoom:hover svg { transform: scale(1.06); }

.hover-tilt       { transition: transform .3s var(--ease); }
.hover-tilt:hover { transform: perspective(600px) rotateX(2deg) rotateY(-2deg) translateY(-3px); }

.hover-shine      { position: relative; overflow: hidden; }
.hover-shine::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.15) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform .6s var(--ease-out);
  pointer-events: none;
}
.hover-shine:hover::before { transform: translateX(100%); }

/* Border flow — animated gradient border */
.anim-border-flow {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-lg);
}
.anim-border-flow::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: spin 6s linear infinite;
  pointer-events: none;
}

/* Reveal on scroll (initial state) */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal-left  { opacity: 0; transform: translateX(-40px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal-left.in { opacity: 1; transform: none; }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal-right.in { opacity: 1; transform: none; }
.reveal-scale { opacity: 0; transform: scale(.94); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal-scale.in { opacity: 1; transform: none; }

/* Ripple effect on click */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  transform: scale(0);
  animation: ripple .6s ease-out;
  pointer-events: none;
}
[data-theme="light"] .ripple { background: rgba(0,0,0,.15); }

/* Loading dots */
.loading-dots { display: inline-flex; gap: 4px; }
.loading-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: dotBounce 1.4s ease-in-out infinite both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale { opacity: 1; transform: none; }
}