/* ============================================================
   TECHNESTORS — Animations & Keyframes
   ============================================================ */

/* ── Pulse Dot ──────────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ── Float ──────────────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-16px) rotate(2deg); }
  66%       { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-24px); }
}

@keyframes float-reverse {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(20px); }
}

/* ── Fade In ────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-40px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Gradient Shift ─────────────────────────────────────────── */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes gradientRotate {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* ── Glow Pulse ─────────────────────────────────────────────── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,212,255,0.3), 0 0 40px rgba(0,212,255,0.1); }
  50%       { box-shadow: 0 0 40px rgba(0,212,255,0.6), 0 0 80px rgba(0,212,255,0.2); }
}

@keyframes glowPulseViolet {
  0%, 100% { box-shadow: 0 0 20px rgba(123,47,247,0.3), 0 0 40px rgba(123,47,247,0.1); }
  50%       { box-shadow: 0 0 40px rgba(123,47,247,0.6), 0 0 80px rgba(123,47,247,0.2); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(0,212,255,0.3); }
  50%       { border-color: rgba(0,212,255,0.8); }
}

/* ── Rotate ─────────────────────────────────────────────────── */
@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes rotateReverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

/* ── Shimmer ────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ── Scan Line ──────────────────────────────────────────────── */
@keyframes scanLine {
  from { top: -2px; }
  to   { top: 100%; }
}

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

/* ── Morph Border ───────────────────────────────────────────── */
@keyframes morphBorder {
  0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* ── Draw Path (SVG) ────────────────────────────────────────── */
@keyframes drawPath {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

/* ── Counter Up ─────────────────────────────────────────────── */
@keyframes countUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Particle Drift ─────────────────────────────────────────── */
@keyframes particleDrift {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.6; }
  33%  { transform: translate(30px, -40px) scale(1.1); opacity: 1; }
  66%  { transform: translate(-20px, -70px) scale(0.9); opacity: 0.8; }
  100% { transform: translate(10px, -100px) scale(0.5); opacity: 0; }
}

/* ── Typing Cursor ──────────────────────────────────────────── */
@keyframes typingCursor {
  0%, 100% { border-color: var(--color-cyan); }
  50%       { border-color: transparent; }
}

/* ── Hero Text Reveal ───────────────────────────────────────── */
@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(60px) skewY(3deg);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) skewY(0deg);
    filter: blur(0);
  }
}

/* ── Loading Bar ────────────────────────────────────────────── */
@keyframes loadingBar {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ── Orbit ──────────────────────────────────────────────────── */
@keyframes orbit {
  from { transform: rotate(0deg) translateX(60px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(60px) rotate(-360deg); }
}

/* ── Wave ───────────────────────────────────────────────────── */
@keyframes wave {
  0%, 100% { d: path("M0,50 C200,20 400,80 600,50 C800,20 1000,80 1200,50 L1200,100 L0,100 Z"); }
  50%       { d: path("M0,50 C200,80 400,20 600,50 C800,80 1000,20 1200,50 L1200,100 L0,100 Z"); }
}

/* ── Utility Animation Classes ──────────────────────────────── */

/* Initial hidden state for GSAP-animated elements */
.anim-hidden {
  opacity: 0;
  transform: translateY(40px);
}

.anim-hidden-left {
  opacity: 0;
  transform: translateX(-40px);
}

.anim-hidden-right {
  opacity: 0;
  transform: translateX(40px);
}

.anim-hidden-scale {
  opacity: 0;
  transform: scale(0.85);
}

/* Floating elements */
.animate-float      { animation: float 6s ease-in-out infinite; }
.animate-float-slow { animation: float-slow 8s ease-in-out infinite; }
.animate-float-rev  { animation: float-reverse 7s ease-in-out infinite; }

/* Rotate */
.animate-spin-slow  { animation: rotateSlow 20s linear infinite; }
.animate-spin-rev   { animation: rotateReverse 15s linear infinite; }

/* Glow */
.animate-glow       { animation: glowPulse 3s ease-in-out infinite; }
.animate-glow-v     { animation: glowPulseViolet 3s ease-in-out infinite; }
.animate-border-glow { animation: borderGlow 2s ease-in-out infinite; }

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

/* Shimmer text */
.animate-shimmer {
  background: linear-gradient(90deg,
    var(--color-cyan) 0%,
    var(--color-violet) 25%,
    var(--color-cyan) 50%,
    var(--color-violet) 75%,
    var(--color-cyan) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* Stagger helpers */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ── Page Loader ────────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.loader-bar-wrap {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  animation: loadingBar 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.loader-text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  animation: blink 1.5s ease-in-out infinite;
}

/* ── Scroll Indicator ───────────────────────────────────────── */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  opacity: 0.5;
  animation: fadeIn 1s ease 3s forwards;
  animation-fill-mode: both;
}

.scroll-indicator-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--color-cyan), transparent);
  animation: float-slow 2s ease-in-out infinite;
}

.scroll-indicator-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-cyan);
  animation: glowPulse 2s ease-in-out infinite;
}

.scroll-indicator-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

/* ── Cursor Glow ────────────────────────────────────────────── */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
}

/* ── Tilt Card 3D ───────────────────────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform var(--transition-base);
  will-change: transform;
}

.tilt-card-inner {
  transform: translateZ(20px);
  pointer-events: none;
}

/* ── Noise Overlay ──────────────────────────────────────────── */
.noise-overlay {
  position: fixed;
  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.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}

/* ── Neon Glow Text ──────────────────────────────────────────── */
@keyframes neonGlow {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(0,212,255,0.6),
      0 0 20px rgba(0,212,255,0.4),
      0 0 40px rgba(0,212,255,0.2);
  }
  50% {
    text-shadow:
      0 0 20px rgba(0,212,255,1),
      0 0 40px rgba(0,212,255,0.7),
      0 0 80px rgba(0,212,255,0.4),
      0 0 120px rgba(123,47,247,0.2);
  }
}

/* ── Holographic Shimmer ─────────────────────────────────────── */
@keyframes holographicShimmer {
  0%   { background-position: -200% center; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { background-position: 200% center; opacity: 0; }
}

/* ── Scan Grid ──────────────────────────────────────────────── */
@keyframes scanGrid {
  from { transform: translateY(-100%); opacity: 0.4; }
  to   { transform: translateY(100vh); opacity: 0; }
}

/* ── Data Stream ────────────────────────────────────────────── */
@keyframes dataStream {
  0%   { transform: translateY(-20px); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(100px); opacity: 0; }
}

/* ── Text Reveal Clip ───────────────────────────────────────── */
@keyframes textRevealClip {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

/* ── Magnetic Pulse ─────────────────────────────────────────── */
@keyframes magneticPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

/* ── Card 3D Float ──────────────────────────────────────────── */
@keyframes card3DFloat {
  0%, 100% {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateZ(0px);
  }
  25% {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateZ(8px);
  }
  75% {
    transform: perspective(1000px) rotateX(-1deg) rotateY(2deg) translateZ(4px);
  }
}

/* ── Industry Icon Hover ────────────────────────────────────── */
@keyframes industryIconPop {
  0%   { transform: scale(1) rotate(0deg); }
  30%  { transform: scale(1.15) rotate(-5deg); }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1.1) rotate(0deg); }
}

/* ── Glow Ring Expand ───────────────────────────────────────── */
@keyframes glowRingExpand {
  from {
    transform: scale(0.8);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(0,212,255,0.5);
  }
  to {
    transform: scale(1.5);
    opacity: 0;
    box-shadow: 0 0 0 30px rgba(0,212,255,0);
  }
}

/* ── Holographic Border ─────────────────────────────────────── */
@keyframes holoBorder {
  0%   { border-color: rgba(0,212,255,0.4); box-shadow: 0 0 15px rgba(0,212,255,0.1); }
  33%  { border-color: rgba(123,47,247,0.5); box-shadow: 0 0 20px rgba(123,47,247,0.15); }
  66%  { border-color: rgba(236,72,153,0.4); box-shadow: 0 0 20px rgba(236,72,153,0.12); }
  100% { border-color: rgba(0,212,255,0.4); box-shadow: 0 0 15px rgba(0,212,255,0.1); }
}

/* ── Counter Flip ───────────────────────────────────────────── */
@keyframes counterFlip {
  from { transform: rotateX(-90deg); opacity: 0; }
  to   { transform: rotateX(0deg); opacity: 1; }
}

/* ── About Section Parallax ─────────────────────────────────── */
@keyframes aboutImageFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(-12px) scale(1.02); }
}

/* ── Utility Classes — New ──────────────────────────────────── */
.animate-neon-glow    { animation: neonGlow 3s ease-in-out infinite; }
.animate-holo-border  { animation: holoBorder 4s ease-in-out infinite; }
.animate-card-float   { animation: card3DFloat 8s ease-in-out infinite; }
.animate-glow-ring    { animation: glowRingExpand 2s ease-out infinite; }
.animate-shimmer-text {
  background: linear-gradient(
    90deg,
    var(--color-cyan) 0%,
    #fff 25%,
    var(--color-violet) 50%,
    #fff 75%,
    var(--color-cyan) 100%
  );
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 5s linear infinite;
}
