/* Homepage-only interactive circuit diagram (Perceive/Produce/Propel).
   Loaded only by home.html via {% block extra_head %} — no other page pays this cost. */

.circuit-diagram-wrapper {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
}

.circuit-diagram {
  width: 100%;
  height: auto;
  display: block;
}

.node-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  fill: #FFFFFF;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

/* Main oval track and its entry/exit stub */
.oval-track {
  stroke-width: 2.5;
  stroke-dasharray: 6 6;
  opacity: .9;
}
.stub-track {
  stroke-width: 2.5;
  stroke-dasharray: 4 5;
  opacity: .75;
}

/* Port / gateway marker — a railroad-crossing-style arm that lifts open while a dot
   is transiting the port, and lowers shut otherwise (see circuit-hero.js). */
.gate-post {
  stroke: url(#circuitGradient);
  stroke-width: 3;
  stroke-linecap: round;
}
.gate-hinge {
  fill: url(#circuitGradient);
}
.gate-arm {
  fill: url(#circuitGradient);
  transform-box: fill-box;
  transform-origin: top center;
  transform: rotate(0deg);
  transition: transform .5s cubic-bezier(.34, 1.4, .64, 1);
}
.gate-arm.gate-open {
  transform: rotate(-108deg);
}

/* Round white signal dots traveling the circuit — always animating, ambient */
.signal-dots circle {
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, .8));
}
@media (prefers-reduced-motion: reduce) {
  .signal-dots { display: none; }
}

/* Hover/focus emphasis on interactive elements */
.circuit-hoverable .trace-base {
  transition: opacity .15s ease, stroke-width .15s ease;
}
.circuit-hoverable:hover .trace-base,
.circuit-hoverable.is-active .trace-base {
  opacity: 1;
}
.circuit-hoverable:hover circle:not(.hit-area),
.circuit-hoverable.is-active circle:not(.hit-area) {
  filter: drop-shadow(0 0 6px currentColor);
}
.circuit-hoverable {
  cursor: pointer;
  outline: none;
}
.circuit-hoverable:focus-visible circle:not(.hit-area) {
  stroke: #fff;
}
.hit-area {
  cursor: pointer;
}

/* ===== Tooltip — light text only, no background/blur/border ===== */
.circuit-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 240px;
  padding: 0;
  color: #FFFFFF;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .9), 0 0 2px rgba(0, 0, 0, .9);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
  pointer-events: none;
}
.circuit-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Auto-pulse (dot-pass triggered) tooltips fade slower than an instant manual hover */
.circuit-tooltip.auto-pulse {
  transition-duration: .3s;
}
