/* ============================================
   Tracing Beam — Scroll-animated vertical beam
   ============================================ */

.tracing-beam-wrapper {
  position: relative;
  padding-left: 48px;
}

/* The beam track + fill container */
.tracing-beam {
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  pointer-events: none;
  z-index: 1;
}

/* Background track (subtle line) */
.tracing-beam-track {
  position: absolute;
  inset: 0;
  width: 100%;
  background: var(--border);
  border-radius: 1px;
}

/* Animated gradient fill — grows as you scroll */
.tracing-beam-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent),
    var(--accent-light),
    transparent
  );
  border-radius: 1px;
  transition: height 0.05s linear;
}

/* Glow effect on the fill */
.tracing-beam-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  filter: blur(6px);
  opacity: 0.6;
}

/* Dot indicator at the current position */
.tracing-beam-dot {
  position: absolute;
  left: -5px;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  z-index: 2;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.05s linear;
  transform: translateY(0);
}

.tracing-beam-dot.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow-strong), 0 0 4px var(--accent);
}

/* Inner dot glow */
.tracing-beam-dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.3s ease;
}

.tracing-beam-dot.active::after {
  background: var(--accent);
}

/* Step markers along the beam */
.tracing-beam-marker {
  position: absolute;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  z-index: 2;
  transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
}

.tracing-beam-marker.reached {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow-strong);
}

/* Responsive — hide beam on small screens, show simpler layout */
@media (max-width: 640px) {
  .tracing-beam-wrapper {
    padding-left: 32px;
  }

  .tracing-beam {
    left: 6px;
  }

  .tracing-beam-dot {
    width: 10px;
    height: 10px;
    left: -4px;
  }

  .tracing-beam-marker {
    width: 6px;
    height: 6px;
    left: -2px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tracing-beam-fill {
    transition: none;
  }

  .tracing-beam-dot {
    transition: none;
  }

  .tracing-beam-marker {
    transition: none;
  }
}
