/* ==========================================================================
   Trade-off graph (notes/input-controls-for-refinement.html, Prototype 1)

   The spider graph itself. Cards, buttons and badges come from proto-ui.css;
   behaviour lives in js/tradeoff-graph.js.
   ========================================================================== */

/* The graph */
.tradeoff-graph .bd-graph {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.tradeoff-graph .bd-graph--wide {
  max-width: 420px;
  margin: 0 auto;
}

.tradeoff-graph .bd-grid { fill: none; stroke: var(--bd-border); stroke-width: 1; }
.tradeoff-graph .bd-track { stroke: var(--bd-muted); stroke-width: 6; stroke-linecap: round; }
.tradeoff-graph .bd-shape {
  fill: color-mix(in oklch, var(--bd-primary) 10%, transparent);
  stroke: var(--bd-primary);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.tradeoff-graph .bd-ghost {
  fill: none;
  stroke: var(--bd-muted-foreground);
  stroke-width: 1.25;
  stroke-dasharray: 4 4;
  transition: opacity 150ms ease-out;
}
.tradeoff-graph .bd-knob { fill: var(--bd-background); stroke: var(--bd-primary); stroke-width: 1.5; }
.tradeoff-graph .bd-handle { cursor: grab; outline: none; }

/* Drag affordance: each point sits in a soft halo that darkens under the
   pointer, and until a point is first moved, a ring pulses out of each one. */
.tradeoff-graph .bd-halo {
  fill: var(--bd-primary);
  fill-opacity: 0.08;
  transition: fill-opacity 150ms ease-out;
}
.tradeoff-graph .bd-handle:hover .bd-halo,
.tradeoff-graph .bd-graph.is-dragging .bd-halo { fill-opacity: 0.16; }
.tradeoff-graph .bd-pulse {
  fill: none;
  stroke: var(--bd-primary);
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.tradeoff-graph .bd-graph.is-untouched .bd-pulse {
  animation: bd-pulse 1.8s ease-out infinite;
}
@keyframes bd-pulse {
  0% { transform: scale(1); opacity: 0.5; }
  70%, 100% { transform: scale(2.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tradeoff-graph .bd-graph.is-untouched .bd-pulse { animation: none; }
}
.tradeoff-graph .bd-graph.is-dragging,
.tradeoff-graph .bd-graph.is-dragging .bd-handle { cursor: grabbing; }
.tradeoff-graph .bd-handle:focus-visible .bd-knob { stroke: var(--bd-ring); stroke-width: 4; }

/* Text keeps its pixel size however small the graph is drawn (--k is set
   from the graph's drawn width). */
.tradeoff-graph .bd-label {
  fill: var(--bd-foreground);
  font-size: calc(12px / var(--k, 1));
  font-weight: 500;
}
.tradeoff-graph .bd-delta {
  fill: var(--bd-muted-foreground);
  font-size: calc(11px / var(--k, 1));
  font-variant-numeric: tabular-nums;
  transition: opacity 150ms ease-out;
}
