/**
 * BitQube Technologies - Creative Animations & Special Effects
 */

/* 1. Cyber Grid & Ambient Canvas Backgrounds */
.hero-canvas-container {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  max-width: 720px;
  overflow: hidden;
  pointer-events: auto;
  z-index: 1;
}

@media (max-width: 991px) {
  .hero-canvas-container {
    position: relative;
    width: 100%;
    height: 380px;
  }
}

#heroQubeCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.cyber-grid {
  position: absolute;
  inset: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 70%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 70%, transparent 100%);
  pointer-events: none;
}

/* 2. Floating Ambient Glow Orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.45;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.glow-orb-primary {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #1d4ed8 0%, rgba(29, 78, 216, 0) 70%);
  top: -120px;
  right: 5%;
}

.glow-orb-accent {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #14b8a6 0%, rgba(20, 184, 166, 0) 70%);
  bottom: 10%;
  right: 35%;
  animation-delay: -5s;
}

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

/* 3. Infinite Marquee Rails */
.marquee-container {
  overflow: hidden;
  position: relative;
  white-space: nowrap;
  width: 100%;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.marquee-track::-webkit-scrollbar {
  display: none;
}

.partner-badge {
  flex: 0 0 auto;
  width: 150px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.partner-badge img {
  max-width: 100%;
  max-height: 44px;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.75);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.partner-badge:hover {
  transform: translateY(-4px) scale(1.04);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(11, 94, 168, 0.12);
}

.partner-badge:hover img {
  filter: grayscale(0%) opacity(1);
}

/* 4. Mouse-Following Ambient Card Glow */
.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, -100px);
  left: var(--mouse-x, -100px);
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, transparent 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.card-glow:hover::before {
  opacity: 1;
}

/* 5. Scroll Reveal Engine */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay helpers */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* 6. Live Telemetry Radar Pulse */
.pulse-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #10b981;
  position: relative;
}

.pulse-indicator::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: radarPing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radarPing {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* 7. Circular Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1030;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.08);
  color: var(--accent);
  box-shadow: 0 12px 30px rgba(11, 94, 168, 0.25);
}

.back-to-top svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.back-to-top circle {
  fill: none;
  stroke-width: 3.5;
}

.progress-bg {
  stroke: rgba(29, 78, 216, 0.15);
}

.progress-bar-circle {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

/* 8. Pulsing highlight for configurator prefill */
.pulse-highlight {
  animation: flashHighlight 1.5s ease-out;
}

@keyframes flashHighlight {
  0% { box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.5); border-color: #14b8a6; }
  100% { box-shadow: none; }
}
