/* ============================================================
   SNVoip Motion Graphics Library
   Award-winning hero animations. CSS-only. GPU-accelerated.
   Respects prefers-reduced-motion.
   ============================================================ */

/* ===== GLOBAL HERO UPGRADE ===== */
.hero {
  background: radial-gradient(ellipse at top left, #1a3768 0%, #0a1f3d 40%, #050d1f 100%);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Animated mesh grid backdrop */
.hero::before {
  content: '';
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(80, 140, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 140, 255, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  animation: meshDrift 60s linear infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes meshDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* Glow orbs floating in hero */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(233, 69, 96, 0.18), transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(80, 140, 255, 0.15), transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.06), transparent 60%);
  animation: orbDrift 14s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes orbDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.08); }
}

.hero > .container { position: relative; z-index: 2; }

/* ===== HERO STAGE — universal frame for visuals ===== */
.hero-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 540px;
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(160deg, #0a1f3d 0%, #050d1f 100%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 120px rgba(233, 69, 96, 0.15);
}

.hero-stage img.product-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

/* Scanline shimmer over product images */
.hero-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 48%, rgba(255, 255, 255, 0.04) 50%, transparent 52%, transparent 100%);
  background-size: 100% 8px;
  pointer-events: none;
  animation: scanlines 6s linear infinite;
  z-index: 3;
  opacity: 0.5;
}

@keyframes scanlines {
  0% { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

/* Corner brackets — "active scan" feel */
.hero-stage::after {
  content: '';
  position: absolute;
  inset: 18px;
  border: 1.5px solid rgba(233, 69, 96, 0.6);
  border-radius: 14px;
  clip-path: polygon(
    0 0, 30px 0, 30px 2px, 2px 2px, 2px 30px, 0 30px,
    0 100%, 30px 100%, 30px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 30px), 0 calc(100% - 30px),
    100% 100%, calc(100% - 30px) 100%, calc(100% - 30px) calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) calc(100% - 30px), 100% calc(100% - 30px),
    100% 0, calc(100% - 30px) 0, calc(100% - 30px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 30px, 100% 30px
  );
  pointer-events: none;
  z-index: 4;
  animation: bracketPulse 3.5s ease-in-out infinite;
}

@keyframes bracketPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.015); }
}

/* ===== FLOATING CALL-OUT CARDS ===== */
.float-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 5;
  font-size: 0.82rem;
  color: var(--navy);
  font-weight: 600;
  white-space: nowrap;
  animation: floatY 4s ease-in-out infinite;
}
.float-card.delay-1 { animation-delay: 0.6s; }
.float-card.delay-2 { animation-delay: 1.2s; }

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.float-card .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  position: relative;
  flex-shrink: 0;
}
.float-card .pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.5;
  animation: pulseRing 1.6s ease-out infinite;
}
.float-card .pulse-dot.red { background: var(--red); }
.float-card .pulse-dot.red::after { background: var(--red); }

@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}

.float-card small { color: var(--slate); font-weight: 400; font-size: 0.72rem; display: block; margin-top: 1px; }

/* Position presets for float cards */
.float-card.tl { top: 8%; left: -8%; }
.float-card.tr { top: 12%; right: -8%; }
.float-card.bl { bottom: 14%; left: -10%; }
.float-card.br { bottom: 8%; right: -6%; }
.float-card.cl { top: 50%; left: -12%; transform: translateY(-50%); }

@media (max-width: 900px) {
  .float-card { font-size: 0.74rem; padding: 8px 11px; }
  .float-card.tl { left: -2%; top: 4%; }
  .float-card.tr { right: -2%; top: 8%; }
  .float-card.bl { left: -2%; bottom: 10%; }
  .float-card.br { right: -2%; bottom: 4%; }
  .float-card.cl { left: -4%; }
}

/* ===== HERO TITLE GRADIENT ANIMATION ===== */
.hero h1 .gradient-text {
  background: linear-gradient(110deg, #ffffff 0%, #e94560 30%, #ff8aa3 50%, #e94560 70%, #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Award badge floating in hero */
.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 0.05em;
  margin-bottom: 18px;
  backdrop-filter: blur(6px);
}
.award-badge i { color: #ffd700; }

/* ===== SERVICE-SPECIFIC MOTION OVERLAYS ===== */
/* These sit ON TOP of hero-stage product images to add live motion */

/* RADAR (Cybersecurity) */
.motion-radar {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.motion-radar .radar-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 60%; height: 60%;
  transform: translate(-50%, -50%);
  border: 1.5px solid rgba(233, 69, 96, 0.5);
  border-radius: 50%;
  animation: radarExpand 2.6s ease-out infinite;
  opacity: 0;
}
.motion-radar .radar-ring:nth-child(2) { animation-delay: 0.6s; }
.motion-radar .radar-ring:nth-child(3) { animation-delay: 1.2s; }
.motion-radar .radar-ring:nth-child(4) { animation-delay: 1.8s; }

@keyframes radarExpand {
  0% { width: 0; height: 0; opacity: 1; border-width: 2px; }
  100% { width: 90%; height: 90%; opacity: 0; border-width: 0.5px; }
}

.motion-radar .radar-sweep {
  position: absolute;
  top: 50%; left: 50%;
  width: 60%; height: 60%;
  transform-origin: 0 0;
  background: conic-gradient(from 0deg, transparent 0%, rgba(233, 69, 96, 0.4) 12%, transparent 25%);
  border-radius: 50%;
  animation: radarSweep 3.5s linear infinite;
  mix-blend-mode: screen;
}
@keyframes radarSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* CAMERA — RECORDING DOT + GRID HIGHLIGHT */
.motion-rec {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 100px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}
.motion-rec::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* DATA STREAM (Cloud) */
.motion-stream {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.motion-stream .stream-line {
  position: absolute;
  width: 2px;
  height: 60%;
  background: linear-gradient(180deg, transparent 0%, rgba(80, 200, 255, 0.8) 50%, transparent 100%);
  top: -60%;
  animation: streamFall 3s linear infinite;
  filter: drop-shadow(0 0 4px rgba(80, 200, 255, 0.8));
}
@keyframes streamFall {
  0% { top: -60%; }
  100% { top: 100%; }
}

/* BIOMETRIC SCAN (Access Control) */
.motion-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.motion-scan .scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #10b981 50%, transparent 100%);
  filter: blur(1px) drop-shadow(0 0 8px #10b981);
  animation: scanY 2.8s ease-in-out infinite;
}
@keyframes scanY {
  0%, 100% { top: 10%; opacity: 0.4; }
  50% { top: 88%; opacity: 1; }
}

/* NOC DASHBOARD MOTION */
.motion-bars {
  position: absolute;
  bottom: 20px; left: 20px;
  z-index: 5;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 40px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}
.motion-bars .bar {
  width: 4px;
  background: linear-gradient(180deg, var(--red), #ff8aa3);
  border-radius: 2px;
  animation: barWave 1.4s ease-in-out infinite;
}
.motion-bars .bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.motion-bars .bar:nth-child(2) { height: 80%; animation-delay: 0.1s; }
.motion-bars .bar:nth-child(3) { height: 50%; animation-delay: 0.2s; }
.motion-bars .bar:nth-child(4) { height: 90%; animation-delay: 0.3s; }
.motion-bars .bar:nth-child(5) { height: 70%; animation-delay: 0.4s; }
.motion-bars .bar:nth-child(6) { height: 40%; animation-delay: 0.5s; }
.motion-bars .bar:nth-child(7) { height: 85%; animation-delay: 0.6s; }

@keyframes barWave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* CALL WAVES (Home / Phone) */
.motion-waves {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.motion-waves .wave {
  position: absolute;
  top: 40%;
  left: 20%;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(16, 185, 129, 0.6);
  border-radius: 50%;
  animation: waveExpand 2s ease-out infinite;
  opacity: 0;
}
.motion-waves .wave:nth-child(2) { animation-delay: 0.5s; }
.motion-waves .wave:nth-child(3) { animation-delay: 1s; }
@keyframes waveExpand {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

/* ===== TRUST STRIP — LOGO MARQUEE ===== */
.trust-strip {
  overflow: hidden;
  padding: 36px 0;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trust-strip .trust-eyebrow {
  text-align: center;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--slate);
  margin-bottom: 18px;
  font-weight: 700;
}
.marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
}
.marquee-track {
  display: flex;
  gap: 60px;
  animation: marquee 28s linear infinite;
  width: max-content;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: #94a3b8;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.marquee-item:hover { color: var(--navy); }
.marquee-item .brand-dot { width: 8px; height: 8px; background: var(--red); border-radius: 50%; opacity: 0.7; }
.marquee-item .tld { color: #cbd5e1; font-weight: 600; }

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== RESPECT REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after,
  .float-card,
  .motion-radar .radar-ring, .motion-radar .radar-sweep,
  .motion-rec::before,
  .motion-stream .stream-line,
  .motion-scan .scan-line,
  .motion-bars .bar,
  .motion-waves .wave,
  .marquee-track,
  .hero-stage::before, .hero-stage::after,
  .hero h1 .gradient-text {
    animation: none !important;
  }
  .hero h1 .gradient-text { -webkit-text-fill-color: var(--red); color: var(--red); }
}

/* ===== MOBILE-FIRST RESPONSIVE TUNING ===== */
@media (max-width: 900px) {
  .hero { padding: 56px 0 48px; }
  .hero-stage { max-width: 88vw; }
  .hero-grid { gap: 36px !important; }
}

@media (max-width: 600px) {
  .hero-stage { max-width: 92vw; border-radius: 22px; }
  .hero h1 { font-size: clamp(1.8rem, 7vw, 2.6rem) !important; }
  .float-card { font-size: 0.7rem; padding: 7px 10px; gap: 7px; }
  .float-card small { font-size: 0.66rem; }
}
