/* Drawing sheets of the home (REQ-126, WEB-HOME-033): the drawing-sheet contract of REQ-125 section 9.
   Drawing colours are their own tokens, independent of the UI colours of design-system.css (AGENTS.md). They live
   here, not in design-system.css, because the token core must stay identical to the configurator copy. Component
   rules below read tokens only. */
:root {
  --bc-draw-ink: #26343e;
  --bc-draw-fine: #8496a2;
  --bc-draw-hatch: #9fb3bf;
  --bc-draw-glass: #e4edf1;
  --bc-draw-dim: #2456c6;
  --bc-draw-dim-soft: #6f8fd8;
  --bc-draw-label: #4f5e68;
  --bc-draw-sheet: #fbfbfa;
  --bc-draw-grid: #eef1f2;
  --bc-draw-rule: #dfe5e8;
  --bc-draw-face-side: #eef2f3;
  --bc-draw-face-top: #f7f8f7;
  --bc-draw-fit: #5d6b75;
  --bc-draw-member: #dfe6e9;
  --bc-draw-highlight: rgba(36, 86, 198, .06);
  --bc-draw-faded: #d9e0e4;
  --bc-draw-faded-fill: #f2f5f6;
  /* Faded labels stay readable: 4.7:1 on the sheet (WCAG AA); the chosen stage reads in ink. */
  --bc-draw-faded-text: #66737c;
  --bc-draw-node: #b8c4cb;
  --bc-draw-node-on: #eef3fb;
  --bc-draw-node-off: #e3e8eb;
  --bc-draw-link-off: #e8ecee;
  --bc-draw-sub: #5d6b75;
  --bc-draw-sub-off: #66737c;
  --bc-draw-wire: #98a9ba;
}

.hb-drawing .ink { fill: none; stroke: var(--bc-draw-ink); stroke-width: .9; stroke-linejoin: round; }
.hb-drawing .fine { fill: none; stroke: var(--bc-draw-fine); stroke-width: .5; }
.hb-drawing .dash { fill: none; stroke: var(--bc-draw-fine); stroke-width: .5; stroke-dasharray: 3 3; }
.hb-drawing .hatch { fill: none; stroke: var(--bc-draw-hatch); stroke-width: .4; }
.hb-drawing .glass { fill: var(--bc-draw-glass); stroke: none; }
.hb-drawing .dim { fill: none; stroke: var(--bc-draw-dim); stroke-width: .6; }
.hb-drawing .hl { fill: var(--bc-draw-highlight); stroke: var(--bc-draw-dim); stroke-width: 1.1; }
.hb-drawing .f-glass { fill: var(--bc-draw-glass); fill-opacity: .72; stroke: var(--bc-draw-ink); stroke-width: .5;
  stroke-linejoin: round; }
.hb-drawing .f-front { fill: var(--bc-draw-sheet); stroke: var(--bc-draw-ink); stroke-width: .7;
  stroke-linejoin: round; }
.hb-drawing .f-side { fill: var(--bc-draw-face-side); stroke: var(--bc-draw-ink); stroke-width: .7;
  stroke-linejoin: round; }
.hb-drawing .f-top { fill: var(--bc-draw-face-top); stroke: var(--bc-draw-ink); stroke-width: .7;
  stroke-linejoin: round; }
.hb-drawing .f-fit { fill: var(--bc-draw-sheet); stroke: var(--bc-draw-fit); stroke-width: .5; stroke-linejoin: round; }
.hb-drawing .f-member { fill: var(--bc-draw-member); stroke: var(--bc-draw-ink); stroke-width: .6;
  stroke-linejoin: round; }
.hb-drawing .lbl { font: 9px var(--bc-mono); fill: var(--bc-draw-label); letter-spacing: .06em; }
.hb-drawing .dimt { font: 10px var(--bc-mono); fill: var(--bc-draw-dim); }
.hb-drawing .bub { fill: var(--bc-surface); stroke: var(--bc-draw-dim); stroke-width: .9; }
.hb-drawing .bubt { font: 500 11px var(--bc-mono); fill: var(--bc-draw-dim); }
.hb-drawing .sheet-grid { fill: none; stroke: var(--bc-draw-grid); stroke-width: .5; }

/* Parts of another stage than the one chosen in FIG. 03: drawn faded but still opaque. */
.hb-drawing path, .hb-drawing text { transition: stroke .45s ease, fill .45s ease; }
.hb-drawing .off { stroke: var(--bc-draw-faded); }
.hb-drawing .glass.off { fill: var(--bc-draw-faded-fill); }
.hb-drawing .f-member.off { fill: var(--bc-draw-faded-fill); }
.hb-drawing .f-side.off, .hb-drawing .f-top.off, .hb-drawing .f-front.off, .hb-drawing .f-fit.off {
  fill: var(--bc-draw-sheet);
}
.hb-drawing text.off { fill: var(--bc-draw-faded-text); stroke: none; }

/* Sheets of a figure that zooms or reveals: one group per sheet, moved and faded by the page script. */
.hb-drawing .hb-layer { transition: transform 1.1s cubic-bezier(.3, .6, .2, 1), opacity .8s ease; }

/* Connections graphic of the ecosystem. */
.hb-graph-svg .eg-col { font: 11px var(--bc-mono); letter-spacing: .1em; fill: var(--bc-muted); }
.hb-graph-svg .eg-node { fill: var(--bc-draw-sheet); stroke: var(--bc-draw-node); stroke-width: .8; }
.hb-graph-svg .eg-node-on { fill: var(--bc-draw-node-on); stroke: var(--bc-draw-dim); stroke-width: 1.3; }
.hb-graph-svg .eg-node-off { fill: var(--bc-draw-sheet); stroke: var(--bc-draw-node-off); }
.hb-graph-svg .eg-name { font: 500 11px var(--bc-mono); fill: var(--bc-draw-label); letter-spacing: .04em; }
.hb-graph-svg .eg-name-on { fill: var(--bc-ink); }
.hb-graph-svg .eg-name-off { fill: var(--bc-draw-faded-text); }
.hb-graph-svg .eg-sub { font: 10px var(--bc-mono); fill: var(--bc-draw-sub); letter-spacing: .06em; }
.hb-graph-svg .eg-sub-off { fill: var(--bc-draw-sub-off); }
.hb-graph-svg .eg-spec { font: 10px var(--bc-mono); fill: var(--bc-draw-label); letter-spacing: .06em; }
.hb-graph-svg .eg-spec-on { fill: var(--bc-ink); font-weight: 500; }
.hb-graph-svg .eg-spec-off { fill: var(--bc-draw-faded-text); }
.hb-graph-svg .eg-port { fill: var(--bc-draw-node); }
.hb-graph-svg .eg-port-on { fill: var(--bc-draw-dim); }
.hb-graph-svg .eg-port-off { fill: var(--bc-draw-node-off); }
.hb-graph-svg .eg-link { fill: none; stroke: var(--bc-draw-node); stroke-width: .8; }
.hb-graph-svg .eg-link-off { stroke: var(--bc-draw-link-off); }
.hb-graph-svg .eg-link-on { stroke: var(--bc-draw-dim); stroke-width: 1.2; stroke-dasharray: 3 7;
  animation: hb-flow 1.1s linear 4; }
.hb-graph-svg .eg-back.eg-link-on { animation-direction: reverse; stroke: var(--bc-draw-dim-soft); }
.hb-graph-svg .eg-bus { fill: var(--bc-draw-faded-fill); stroke: var(--bc-draw-ink); stroke-width: .8; }
.hb-graph-svg .eg-bus-hatch { fill: none; stroke: var(--bc-line); stroke-width: .5; }
.hb-graph-svg .eg-hit { cursor: pointer; outline: none; }
.hb-graph-svg .eg-hit:hover rect { stroke: var(--bc-draw-dim); }
.hb-graph-svg .eg-hit:focus-visible rect { stroke: var(--bc-ink); stroke-width: 2; stroke-dasharray: 4 2; }

/* FIG. 01 frame: data flowing from the inputs into the configuration box and out to the outputs. */
.hb-sys-wire { fill: none; stroke: var(--bc-draw-wire); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hb-sys-data { fill: none; stroke: var(--bc-draw-dim); stroke-width: 1.6; stroke-dasharray: 3 13;
  vector-effect: non-scaling-stroke; animation: hb-flow-wire 1.4s linear infinite; }
/* Owner decision (REQ-134): A-000 keeps its data flowing from the inputs through the system to the outputs while it
   is on screen; it stops off screen, in a hidden tab and with reduced motion. */

/* Data flows for under 5 s and then rests (WCAG 2.2.2, no pause control needed); choosing a stage redraws the
   graph, so its links flow again. */
@keyframes hb-flow { to { stroke-dashoffset: -20; } }
@keyframes hb-flow-wire { to { stroke-dashoffset: -16; } }

/* While the page is hidden or a drawing is off screen, nothing moves. */
.hb-paused .eg-link-on, .hb-paused .hb-sys-data { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .hb-drawing .hb-layer, .hb-drawing path, .hb-drawing text { transition: none; }
  .hb-graph-svg .eg-link-on { animation: none; stroke-dasharray: none; }
  .hb-sys-data { animation: none; stroke-dasharray: none; opacity: .35; }
}
