/* ============================================================
   NOVAMETRI - Animations
   ============================================================ */

/* ============================================================
   REVEAL ON SCROLL (IntersectionObserver driven)
   ============================================================ */

/* Base hidden state */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1),
              transform 0.7s cubic-bezier(0.4,0,0.2,1);
  will-change: opacity, transform;
}

[data-reveal="up"]    { transform: translateY(40px); }
[data-reveal="down"]  { transform: translateY(-40px); }
[data-reveal="left"]  { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="scale"] { transform: scale(0.9); }
[data-reveal="fade"]  { transform: none; }

/* Revealed state */
[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

/* Stagger delays for children */
[data-stagger] > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger] > *:nth-child(2) { transition-delay: 0.15s; }
[data-stagger] > *:nth-child(3) { transition-delay: 0.25s; }
[data-stagger] > *:nth-child(4) { transition-delay: 0.35s; }
[data-stagger] > *:nth-child(5) { transition-delay: 0.45s; }
[data-stagger] > *:nth-child(6) { transition-delay: 0.55s; }

/* ============================================================
   KEYFRAME LIBRARY
   ============================================================ */

/* Floating animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-16px); }
}

/* Slow rotation */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Shimmer sweep */
@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

/* Pulse ring */
@keyframes pulse-ring {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Typing cursor blink */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Glow pulse */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,212,255,0.2); }
  50%       { box-shadow: 0 0 50px rgba(0,212,255,0.5), 0 0 100px rgba(0,212,255,0.2); }
}

/* Data stream */
@keyframes data-stream {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Number count up — handled via JS, but we add a flicker  */
@keyframes number-flash {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

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

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

.anim-float-slow {
  animation: float 7s ease-in-out infinite;
}

.anim-spin-slow {
  animation: spin-slow 20s linear infinite;
}

.anim-glow-pulse {
  animation: glow-pulse 2.5s ease-in-out infinite;
}

/* ============================================================
   PARTICLE CANVAS (Background particles drawn via JS)
   ============================================================ */

#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ============================================================
   SCANNING LINE EFFECT
   ============================================================ */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    rgba(0,212,255,0.5),
    rgba(0,212,255,0.8),
    rgba(0,212,255,0.5),
    transparent
  );
  animation: scan 4s linear infinite;
}

@keyframes scan {
  0%   { top: 0%; opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ============================================================
   HERO TEXT ENTRANCE
   ============================================================ */
.hero-content h1 {
  animation: hero-title 1s cubic-bezier(0.4,0,0.2,1) 0.3s both;
}

.hero-desc {
  animation: hero-desc 1s cubic-bezier(0.4,0,0.2,1) 0.5s both;
}

.hero-actions {
  animation: hero-desc 1s cubic-bezier(0.4,0,0.2,1) 0.7s both;
}

.hero-eyebrow {
  animation: hero-desc 0.8s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}

@keyframes hero-title {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@keyframes hero-desc {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   CARD HOVER SHINE
   ============================================================ */
.card-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.04) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  background-position: -100% 0;
  transition: background-position 0.5s ease;
  pointer-events: none;
}

.card:hover .card-shine {
  background-position: 200% 0;
}

/* ============================================================
   LOADING SKELETON (for images)
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ============================================================
   COUNTER ANIMATION
   ============================================================ */
.stat-number.counting {
  animation: number-flash 0.1s linear infinite;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar-wrap {
  background: rgba(255,255,255,0.05);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 100px;
  background: var(--grad-primary);
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 12px rgba(0,212,255,0.4);
}

.progress-bar.animated { width: var(--target-width, 0%); }
