/* Circuit Board Background — Production Styles
   Drop <div class="background"></div> anywhere in your HTML.
   Use position: absolute instead of fixed if scoping to a parent container. */

.background {
  color-scheme: var(--scheme, dark light);
  --_color: var(--circuit-color, initial);

  /* Default: Dark Theme */
  --circuit-bg: light-dark(#f5f7fa, #0a0a0a);
  --circuit-thread: light-dark(#dce1e8, #202428);
  --circuit-electron: light-dark(#64748b, #d8dee9);
  --circuit-electron-opacity: 0.42;
  --circuit-thread-width: 4.0;

  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--circuit-bg);
  pointer-events: none;
  z-index: -10;
}

@container not style(--_color: initial) {
  .background>* {
    --circuit-electron: light-dark(
      oklch(from var(--_color) 0.65 0.14 h),
      oklch(from var(--_color) 0.58 0.16 h)
    );
    --circuit-electron-opacity: 0.58;
  }
}

.background .circuit-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.background .thread-line {
  fill: none;
  stroke: var(--circuit-thread);
  stroke-width: var(--circuit-thread-width);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.background .electron-pulse {
  opacity: var(--circuit-electron-opacity);
}

.background .electron-seg {
  fill: none;
  stroke: var(--circuit-electron);
  stroke-width: var(--circuit-thread-width);
  stroke-linecap: round;
  stroke-linejoin: round;
  will-change: stroke-dashoffset;
}

@media (prefers-reduced-motion: reduce) {
  .background .electrons-layer {
    display: none;
  }
}
