/* ============================================================
   iGlutek — animations.css
   Keyframes, scroll-reveal, hover effects, device visuals
   ============================================================ */

/* ─── KEYFRAMES ──────────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeRight {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.7); }
}
@keyframes pulse-ring {
  0%   { transform: scale(0.95); opacity: 0.6; }
  50%  { transform: scale(1.04); opacity: 0.3; }
  100% { transform: scale(0.95); opacity: 0.6; }
}
@keyframes orbit {
  from { transform: rotate(0deg) translateX(var(--orbit-r,80px)) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(var(--orbit-r,80px)) rotate(-360deg); }
}
@keyframes float {
  0%,100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}
@keyframes float-slow {
  0%,100% { transform: translateY(0px) rotate(0deg); }
  33%      { transform: translateY(-8px) rotate(0.5deg); }
  66%      { transform: translateY(-4px) rotate(-0.5deg); }
}
@keyframes orb-float {
  0%,100% { transform: translate(0,0) scale(1); }
  25%      { transform: translate(20px,-30px) scale(1.04); }
  50%      { transform: translate(-10px,-20px) scale(0.97); }
  75%      { transform: translate(15px,10px) scale(1.02); }
}
@keyframes orb-float2 {
  0%,100% { transform: translate(0,0) scale(1); }
  30%      { transform: translate(-25px,20px) scale(1.03); }
  60%      { transform: translate(15px,-15px) scale(0.98); }
}
@keyframes ecg-wave {
  0%   { stroke-dashoffset: 300; }
  100% { stroke-dashoffset: 0; }
}
@keyframes data-stream {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
@keyframes glow-pulse {
  0%,100% { box-shadow: 0 0 20px rgba(76,126,255,0.25), 0 0 60px rgba(76,126,255,0.1); }
  50%      { box-shadow: 0 0 40px rgba(76,126,255,0.45), 0 0 100px rgba(76,126,255,0.2); }
}
@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes rotate-counter {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes scanLine {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(400%); opacity: 0; }
}
@keyframes counter-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes nav-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hero-in {
  0%   { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes dot-appear {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes ring-expand {
  0%   { transform: scale(0.8); opacity: 0; }
  50%  { opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}
@keyframes spin-arc {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -100; }
}

/* ─── SCROLL REVEAL ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal-left.revealed { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal-right.revealed { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.65s cubic-bezier(0.16,1,0.3,1),
              transform 0.65s cubic-bezier(0.16,1,0.3,1);
}
.reveal-scale.revealed { opacity: 1; transform: scale(1); }

/* Stagger delays */
.delay-1 { transition-delay: 0.05s; }
.delay-2 { transition-delay: 0.12s; }
.delay-3 { transition-delay: 0.19s; }
.delay-4 { transition-delay: 0.26s; }
.delay-5 { transition-delay: 0.33s; }
.delay-6 { transition-delay: 0.40s; }
.delay-7 { transition-delay: 0.47s; }
.delay-8 { transition-delay: 0.54s; }

/* ─── BACKGROUND ORBS ────────────────────────────────────── */
.orb-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.50;
}
.orb-1 {
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(76,126,255,0.28) 0%, rgba(139,114,255,0.12) 50%, transparent 70%);
  top: -20%; left: -10%;
  animation: orb-float 18s ease-in-out infinite;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,217,196,0.18) 0%, rgba(76,126,255,0.08) 55%, transparent 70%);
  bottom: -10%; right: -5%;
  animation: orb-float2 22s ease-in-out infinite;
}
.orb-3 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(139,114,255,0.14) 0%, transparent 70%);
  top: 40%; left: 50%;
  animation: orb-float 28s ease-in-out infinite reverse;
}

/* ─── HERO DEVICE VISUALIZATION ──────────────────────────── */
.device-vis {
  position: relative;
  width: 420px;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Outer pulsing rings */
.device-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(76,126,255,0.15);
}
.device-ring-1 {
  width: 100%; height: 100%;
  animation: pulse-ring 4s ease-in-out infinite;
}
.device-ring-2 {
  width: 82%; height: 82%;
  border-color: rgba(76,126,255,0.2);
  animation: pulse-ring 4s ease-in-out infinite 0.5s;
}
.device-ring-3 {
  width: 64%; height: 64%;
  border-color: rgba(76,126,255,0.28);
  animation: pulse-ring 4s ease-in-out infinite 1s;
}

/* Rotating arc track */
.device-track {
  position: absolute;
  width: 90%; height: 90%;
  border-radius: 50%;
  border: 1px dashed rgba(76,126,255,0.12);
}
.device-track-arc {
  position: absolute;
  width: 88%; height: 88%;
  border-radius: 50%;
}
.device-track-arc svg {
  width: 100%; height: 100%;
  animation: rotate-slow 12s linear infinite;
}
.device-track-arc-r svg {
  animation: rotate-counter 18s linear infinite;
}

/* Center device body */
.device-body {
  position: relative;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0D1A35 0%, #091020 100%);
  border: 1.5px solid rgba(76,126,255,0.35);
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 0 0 8px rgba(76,126,255,0.04),
    0 0 40px rgba(76,126,255,0.25),
    inset 0 1px 0 rgba(255,255,255,0.08);
  animation: float-slow 6s ease-in-out infinite, glow-pulse 4s ease-in-out infinite;
  flex-direction: column;
  gap: 6px;
}

/* Scan line inside device */
.device-scan {
  position: absolute;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(76,126,255,0.5), rgba(0,217,196,0.5), transparent);
  animation: scanLine 3s ease-in-out infinite;
  border-radius: 2px;
}

/* Inner display elements */
.device-display {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(76,126,255,0.06);
  border: 1px solid rgba(76,126,255,0.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  position: relative;
}
.device-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}
.device-metric-label {
  font-family: var(--font-display);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(76,126,255,0.8);
}

/* ECG Wave SVG below value */
.device-ecg {
  width: 80px;
  height: 24px;
  position: relative;
}
.device-ecg svg {
  width: 100%; height: 100%;
  overflow: visible;
}
.ecg-path {
  fill: none;
  stroke: rgba(76,126,255,0.8);
  stroke-width: 1.5;
  stroke-dasharray: 300;
  animation: ecg-wave 2s linear infinite;
}

/* Orbiting data points */
.orbit-dot {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 12px rgba(76,126,255,0.8);
}
.orbit-dot-container {
  position: absolute;
  width: 100%; height: 100%;
  top: 0; left: 0;
}
.orbit-dot-1 {
  --orbit-r: 200px;
  animation: orbit 8s linear infinite;
  animation-delay: 0s;
  background: var(--blue-bright);
}
.orbit-dot-2 {
  --orbit-r: 180px;
  animation: orbit 12s linear infinite;
  animation-delay: -4s;
  background: var(--teal-light);
  width: 8px; height: 8px;
}
.orbit-dot-3 {
  --orbit-r: 195px;
  animation: orbit 16s linear infinite;
  animation-delay: -8s;
  background: rgba(255,255,255,0.6);
  width: 6px; height: 6px;
}

/* Mini data cards floating around device */
.device-mini-card {
  position: absolute;
  background: rgba(9,18,36,0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(76,126,255,0.3);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  white-space: nowrap;
  animation: float 5s ease-in-out infinite;
}
.device-mini-card-1 { top: 8%; right: -5%; animation-delay: 0s; }
.device-mini-card-2 { bottom: 15%; left: -8%; animation-delay: 1.5s; }
.device-mini-card-3 { top: 50%; right: -10%; animation-delay: 3s; }

.mini-card-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}
.mini-card-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  display: block;
}
.mini-card-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  display: block;
  line-height: 1.1;
}

/* ─── AI DIAGRAM ─────────────────────────────────────────── */
.ai-diagram {
  position: relative;
  width: 100%;
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-node {
  position: absolute;
  background: var(--glass-bg);
  border: 1px solid var(--border-blue);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  text-align: center;
  backdrop-filter: blur(16px);
  transition: var(--t-base);
  min-width: 120px;
}
.ai-node:hover { transform: scale(1.05); border-color: var(--blue); box-shadow: var(--shadow-blue); }
.ai-node-icon { font-size: 1.8rem; margin-bottom: 6px; }
.ai-node-label { font-family: var(--font-display); font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); }
.ai-node-center {
  background: var(--grad-blue);
  border: none;
  border-radius: 50%;
  width: 100px; height: 100px;
  padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  box-shadow: var(--shadow-blue-lg);
}
.ai-node-center .ai-node-label { color: rgba(255,255,255,0.9); }

/* ─── ANIMATED LINE CONNECTOR ────────────────────────────── */
.connector-line {
  stroke: rgba(76,126,255,0.3);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  fill: none;
  animation: spin-arc 3s linear infinite;
}

/* ─── HERO SECTION ANIMATION ─────────────────────────────── */
.hero-animate-1 { animation: fadeUp 0.9s cubic-bezier(0.16,1,0.3,1) both; }
.hero-animate-2 { animation: fadeUp 0.9s cubic-bezier(0.16,1,0.3,1) 0.15s both; }
.hero-animate-3 { animation: fadeUp 0.9s cubic-bezier(0.16,1,0.3,1) 0.28s both; }
.hero-animate-4 { animation: fadeUp 0.9s cubic-bezier(0.16,1,0.3,1) 0.42s both; }
.hero-animate-dev { animation: scaleIn 1.1s cubic-bezier(0.16,1,0.3,1) 0.3s both; }

/* ─── SECTION TRANSITION BG ──────────────────────────────── */
.section-transition {
  position: relative;
}
.section-transition::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, var(--bg-secondary));
  pointer-events: none;
}

/* ─── PROGRESS ANIMATE ───────────────────────────────────── */
.progress-animate .progress-bar {
  transition: width 1.6s cubic-bezier(0.16,1,0.3,1);
}

/* ─── COUNTER ANIMATION ──────────────────────────────────── */
.counter-anim {
  display: inline-block;
  transition: all 0.5s;
}

/* ─── HOVER GLOW EFFECT ──────────────────────────────────── */
.hover-glow {
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.hover-glow:hover {
  box-shadow: var(--shadow-blue-lg);
  transform: translateY(-3px);
}

/* ─── SHIMMER TEXT ───────────────────────────────────────── */
.shimmer-text {
  background: linear-gradient(
    90deg,
    #fff 25%,
    rgba(76,126,255,0.9) 50%,
    #fff 75%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ─── DEVICE PAGE LARGE VIS ──────────────────────────────── */
.device-large-vis {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}

/* ─── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
  }
}
