/* =============================================================================
   ROBONIX CAPABILITY DIGITAL-LINE SYSTEM
   Shared Interaction System with Three Capability-Specific Configurations:
   1. GEARS & BRAINS (#gearsCardsStage - 4 cards)
   2. PHYSICAL AI R&D (#rndCardsStage - 5 cards)
   3. CONSULTING (#consultingCardsStage - 5 cards)
   ============================================================================= */

/* Ensure relative positioning for accurate SVG datum overlay */
.rnd-cards-stage {
  position: relative !important;
}

/* Digital Line Canvas Overlay */
.cap-digital-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

/* Background Guide/Track Line */
.cap-track-line {
  fill: none !important;
  stroke: rgba(15, 123, 95, 0.16);
  stroke-width: 2px;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Active Flowing Digital Beam */
.cap-active-line {
  fill: none !important;
  stroke: #00FFB2;
  stroke-width: 2.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px #00FFB2) drop-shadow(0 0 8px rgba(0, 255, 178, 0.55));
  will-change: stroke-dashoffset;
}

/* Completed Pathway Pulse/Shimmer */
.cap-shimmer-line {
  fill: none !important;
  stroke: url(#capBeamShimmer);
  stroke-width: 3.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
}

.rnd-cards-stage.is-sequence-complete .cap-shimmer-line {
  opacity: 0;
  animation: none;
}

@keyframes capShimmerTravel {
  0% {
    stroke-dashoffset: 2000;
  }
  100% {
    stroke-dashoffset: -2000;
  }
}

/* Connection Anchor Nodes in SVG */
.cap-node {
  pointer-events: none;
}

.cap-node-halo {
  fill: none;
  stroke: rgba(0, 255, 178, 0.35);
  stroke-width: 1.5px;
  opacity: 0;
  transform-origin: center;
  transition: opacity 0.35s ease;
}

.cap-node-core {
  fill: rgba(15, 123, 95, 0.4);
  transition: fill 0.35s ease, filter 0.35s ease, r 0.35s ease;
}

.cap-node-inner {
  fill: #FFFFFF;
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Activated Node */
.cap-node.is-active .cap-node-halo {
  opacity: 1;
  animation: capNodeHaloPulse 2.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.cap-node.is-active .cap-node-core {
  fill: #00FFB2;
  filter: drop-shadow(0 0 5px #00FFB2) drop-shadow(0 0 10px rgba(0, 255, 178, 0.6));
  r: 4.5px;
}

.cap-node.is-active .cap-node-inner {
  opacity: 1;
}

@keyframes capNodeHaloPulse {
  0% {
    r: 6px;
    opacity: 0.85;
    stroke-width: 1.8px;
  }
  70% {
    r: 13px;
    opacity: 0;
    stroke-width: 0.8px;
  }
  100% {
    r: 13px;
    opacity: 0;
  }
}

/* Origin & Terminus Nodes */
.cap-origin-node,
.cap-terminal-node {
  fill: #00FFB2;
  filter: drop-shadow(0 0 4px #00FFB2);
  transition: opacity 0.4s ease;
}

/* Card Reveals & States */
.rnd-cards-stage.has-digital-line .rnd-float-card {
  opacity: 0.68;
  position: relative;
  z-index: 2; /* Sits above SVG line canvas so text and clicks are completely free */
  transition:
    opacity 480ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 480ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 400ms ease,
    box-shadow 400ms ease;
}

.rnd-cards-stage.has-digital-line .rnd-float-card.is-connected {
  opacity: 1;
}

/* Restrained green edge highlight on arrival */
.rnd-cards-stage.has-digital-line .rnd-float-card.is-active-pulse {
  border-color: #00FFB2 !important;
  box-shadow:
    0 0 0 1px rgba(0, 255, 178, 0.45),
    0 12px 28px -6px rgba(0, 255, 178, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

/* Subtle badge illumination when card is connected */
.rnd-cards-stage.has-digital-line .rnd-float-card.is-connected .rnd-card-num {
  border-color: rgba(0, 255, 178, 0.4);
  box-shadow: 0 0 8px rgba(0, 255, 178, 0.18);
  background: rgba(0, 255, 178, 0.08);
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .cap-active-line {
    transition: none !important;
    stroke-dashoffset: 0 !important;
  }
  .cap-shimmer-line {
    animation: none !important;
    display: none !important;
  }
  .cap-node-halo {
    animation: none !important;
  }
  .rnd-cards-stage.has-digital-line .rnd-float-card {
    opacity: 1 !important;
    transition: none !important;
  }
}
