/* ============================================================
   LKI Coder — animations.css
   Scroll-triggered reveals, micro-interactions, transitions
   ============================================================ */

/* ── Reveal on Scroll ───────────────────────────────────────── */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-fade {
  opacity: 0;
  transition-property: opacity, transform;
  transition-duration: 0.7s;
  transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
  transition-delay: var(--delay, 0ms);
}

.reveal-up    { transform: translateY(40px); }
.reveal-left  { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-fade  { transform: scale(0.96); }

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed,
.reveal-fade.revealed {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* ── Counter Animation ──────────────────────────────────────── */
.counter { display: inline-block; }

/* ── Card hover ─────────────────────────────────────────────── */
.demo-card,
.feature-card,
.step-card,
.why__num-card,
.faq__item {
  will-change: transform;
}

/* ── Particle Canvas ────────────────────────────────────────── */
#particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ── Gradient border on hover ───────────────────────────────── */
.step-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-lg) + 1px);
  background: var(--grad-primary);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition-slow);
}
.step-card:hover::after { opacity: 0.15; }

/* ── Shimmer loading skeleton ────────────────────────────────── */
@keyframes shimmer {
  from { background-position: -400px 0; }
  to   { background-position: 400px 0; }
}
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ── Section entrance animation ─────────────────────────────── */
@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Floating animation (used by mockup cards) ───────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

/* ── Glow pulse (for CTA / badge) ───────────────────────────── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(124,58,237,0.3); }
  50%       { box-shadow: 0 0 40px rgba(124,58,237,0.6); }
}
.btn--primary:focus-visible { animation: glowPulse 2s ease-in-out infinite; }

/* ── Form field focus micro-animation ────────────────────────── */
.form-group input,
.form-group select,
.form-group textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  transform: translateY(-1px);
}

/* ── Button ripple ──────────────────────────────────────────── */
.btn {
  position: relative;
  overflow: hidden;
}
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}
@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ── Progress bar animation (step cards) ────────────────────── */
.step-card .step-card__connector {
  position: absolute;
  top: 50%;
  right: -1.5rem;
  width: 1.5rem;
  height: 2px;
  background: var(--clr-gray-200);
  z-index: 1;
  display: none;
}

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

/* ── Number card pulse (why section) ────────────────────────── */
.why__num-card--highlight {
  animation: cardGlow 3s ease-in-out infinite;
}
@keyframes cardGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(124,58,237,0.2); }
  50%       { box-shadow: 0 8px 40px rgba(124,58,237,0.5); }
}

/* ── Mockup animated elements ───────────────────────────────── */
.mockup__kpi--a {
  animation: kpiGlow 3s ease-in-out infinite alternate;
}
@keyframes kpiGlow {
  from { border-color: rgba(124,58,237,0.2); }
  to   { border-color: rgba(124,58,237,0.5); }
}

.mini-bar {
  animation: barLoad 0.8s ease-out both;
}
.mini-bar:nth-child(1) { animation-delay: 0.1s; }
.mini-bar:nth-child(2) { animation-delay: 0.2s; }
.mini-bar:nth-child(3) { animation-delay: 0.3s; }
.mini-bar:nth-child(4) { animation-delay: 0.4s; }
.mini-bar:nth-child(5) { animation-delay: 0.5s; }
.mini-bar:nth-child(6) { animation-delay: 0.6s; }
.mini-bar:nth-child(7) { animation-delay: 0.7s; }

@keyframes barLoad {
  from { height: 0 !important; opacity: 0; }
  to   { opacity: 1; }
}

/* ── Status badge pulse ─────────────────────────────────────── */
.demo-card__badge.online {
  animation: badgePulse 2.5s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ── Orb animation ──────────────────────────────────────────── */
@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, -20px) scale(1.1); }
}

/* ── Scroll indicator ───────────────────────────────────────── */
@keyframes scrollDot {
  0%   { top: 4px; opacity: 1; }
  100% { top: 22px; opacity: 0; }
}

/* ── Success circle ─────────────────────────────────────────── */
@keyframes successPop {
  0%   { transform: scale(0); opacity: 0; }
  80%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Badge dot pulse ────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
  50%       { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* ── Dotted pulse map ───────────────────────────────────────── */
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.8); opacity: 0; }
}

/* ── Loader progress ────────────────────────────────────────── */
@keyframes loadProgress {
  0%   { width: 0%; }
  60%  { width: 75%; }
  100% { width: 100%; }
}

/* ── Spin ───────────────────────────────────────────────────── */
@keyframes spinAnim {
  to { transform: rotate(360deg); }
}

/* ── Hover glow on feature cards ────────────────────────────── */
.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 0%, rgba(124,58,237,0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-slow);
}
.feature-card:hover::after { opacity: 1; }

/* ── Demo card screen hover ─────────────────────────────────── */
.demo-card:hover .ds-bar { opacity: 1; }
.demo-card:hover .ds-bar:nth-child(odd) { transform: scaleY(1.05); transform-origin: bottom; }

/* ── Navbar link underline ──────────────────────────────────── */
.navbar__link:not(.btn--outline-nav):not(.btn--primary-nav) {
  position: relative;
}
.navbar__link:not(.btn--outline-nav):not(.btn--primary-nav)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--clr-primary);
  border-radius: var(--radius-full);
  transition: left var(--transition), right var(--transition);
  opacity: 0;
}
.navbar.scrolled .navbar__link:not(.btn--outline-nav):not(.btn--primary-nav):hover::after {
  left: 0.5rem;
  right: 0.5rem;
  opacity: 1;
}

/* ── Mobile menu open ───────────────────────────────────────── */
.navbar__menu.open {
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
