/* ============================================
   ARKTIC WEB SOLUTIONS — ANIMATIONS
   ============================================ */

/* ---- KEYFRAMES ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); }
  50%       { box-shadow: 0 0 40px rgba(0, 212, 255, 0.45); }
}
@keyframes borderGlow {
  0%, 100% { border-color: rgba(0, 212, 255, 0.2); }
  50%       { border-color: rgba(0, 212, 255, 0.5); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes shimmer {
  from { background-position: -400px 0; }
  to   { background-position: 400px 0; }
}
@keyframes textReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}
@keyframes lineGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes morphBackground {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}
@keyframes scanline {
  0%   { top: -10%; }
  100% { top: 110%; }
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%       { transform: scale(1.4); opacity: 1; }
}
@keyframes ringExpand {
  from { transform: scale(0.5); opacity: 0.8; }
  to   { transform: scale(2.5); opacity: 0; }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes neonFlicker {
  0%, 95%, 100% { opacity: 1; }
  96%            { opacity: 0.8; }
  97%            { opacity: 1; }
  98%            { opacity: 0.85; }
}

/* ---- SCROLL REVEAL BASE STATE ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.reveal-left {
  transform: translateX(-32px);
}
.reveal.reveal-right {
  transform: translateX(32px);
}
.reveal.reveal-scale {
  transform: scale(0.9);
}
.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* ---- STAGGERED CHILDREN ---- */
.stagger-group .stagger-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.stagger-group.revealed .stagger-item:nth-child(1)  { transition-delay: 0.05s; opacity: 1; transform: none; }
.stagger-group.revealed .stagger-item:nth-child(2)  { transition-delay: 0.15s; opacity: 1; transform: none; }
.stagger-group.revealed .stagger-item:nth-child(3)  { transition-delay: 0.25s; opacity: 1; transform: none; }
.stagger-group.revealed .stagger-item:nth-child(4)  { transition-delay: 0.35s; opacity: 1; transform: none; }
.stagger-group.revealed .stagger-item:nth-child(5)  { transition-delay: 0.45s; opacity: 1; transform: none; }
.stagger-group.revealed .stagger-item:nth-child(6)  { transition-delay: 0.55s; opacity: 1; transform: none; }

/* ---- HEADLINE WORD REVEAL ---- */
.word-reveal-wrap {
  overflow: hidden;
  display: inline-block;
}
.word-reveal-wrap .word {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.word-reveal-wrap.revealed .word:nth-child(1) { transform: translateY(0); transition-delay: 0s; }
.word-reveal-wrap.revealed .word:nth-child(2) { transform: translateY(0); transition-delay: 0.1s; }
.word-reveal-wrap.revealed .word:nth-child(3) { transform: translateY(0); transition-delay: 0.2s; }
.word-reveal-wrap.revealed .word:nth-child(4) { transform: translateY(0); transition-delay: 0.3s; }
.word-reveal-wrap.revealed .word:nth-child(5) { transform: translateY(0); transition-delay: 0.4s; }
.word-reveal-wrap.revealed .word:nth-child(6) { transform: translateY(0); transition-delay: 0.5s; }

/* ---- UNDERLINE ANIMATE ---- */
.underline-animate {
  position: relative;
  display: inline;
}
.underline-animate::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
}
.underline-animate.revealed::after { transform: scaleX(1); }

/* ---- GLOWING BORDER ANIMATION ---- */
.glow-border {
  animation: borderGlow 3s ease-in-out infinite;
}

/* ---- FLOATING ANIMATION ---- */
.float-anim {
  animation: float 4s ease-in-out infinite;
}
.float-anim-slow {
  animation: float 6s ease-in-out infinite;
}

/* ---- GRADIENT ANIMATED BG ---- */
.gradient-animate {
  background-size: 300% 300%;
  animation: gradientShift 6s ease infinite;
}

/* ---- PULSE RING ---- */
.pulse-ring {
  position: relative;
}
.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ringExpand 2.5s ease-out infinite;
}

/* ---- SHIMMER LOADING ---- */
.shimmer {
  background: linear-gradient(90deg,
    var(--bg-card) 25%,
    rgba(255,255,255,0.06) 50%,
    var(--bg-card) 75%
  );
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite;
}

/* ---- NEON TEXT ---- */
.neon-text {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0,212,255,0.6), 0 0 30px rgba(0,212,255,0.3);
  animation: neonFlicker 5s ease-in-out infinite;
}

/* ---- COUNTER NUMBERS ---- */
.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1;
}

/* ---- HERO GRID DECORATION ---- */
.hero-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ---- ANIMATED DOTS ---- */
.dot-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(0,212,255,0.15) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* ---- CARD HOVER SPARKLE ---- */
.card-sparkle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover .card-sparkle { opacity: 1; animation: dotPulse 1.2s ease-in-out infinite; }

/* ---- LINE GROW ---- */
.line-h {
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}
.line-h.revealed { transform: scaleX(1); }

/* ---- TEMPLATE CARD HOVER ---- */
.template-card {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.template-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,212,255,0.12);
}

/* ---- MORPHING BLOB ---- */
.morph-blob {
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: morphBackground 8s ease-in-out infinite;
}

/* ---- TYPEWRITER CURSOR ---- */
.typewriter-cursor::after {
  content: '|';
  color: var(--accent);
  animation: neonFlicker 1s step-end infinite;
  margin-left: 2px;
}

/* ---- NOISE OVERLAY ---- */
.noise::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  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)'/%3E%3C/svg%3E");
}

/* ---- SCANLINE EFFECT ---- */
.scanline-wrap {
  position: relative;
  overflow: hidden;
}
.scanline-wrap::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 40px;
  background: linear-gradient(transparent, rgba(0,212,255,0.04), transparent);
  animation: scanline 4s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* ---- ACTIVE NAV INDICATOR ---- */
.nav-link.active {
  color: var(--text-primary);
}
.nav-link.active::after {
  transform: scaleX(1);
}

/* ---- MARQUEE ---- */
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ---- COUNTER ENTER ---- */
@keyframes counterFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- SMOOTH ENTRY DELAYS ---- */
.delay-100 { transition-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; }
.delay-600 { transition-delay: 0.6s !important; }
