/* UMBILICAL's page: the shared skin is ../module.css (site/public/module.css), which lays out the stage and draws its
   controls, gold like every page. This is only what UMBILICAL's stage has of its own: the cable hanging out of the
   panel, the screen's light over the face (js/panel2d.js, the face at full brightness under it), and the readouts in
   the scope box (js/stage.js), drawn as the other pages' screens are: Space Mono labels in the dim grey, values in
   ink and gold. The screen's amber and red are the module's own lights, on its panel only. */

/* ---------- the panel, with the cable hanging out of it ----------
   The wrap is the panel's width (module.css's .panel2d sizes, moved out to it) so the cable's drawing, over the wrap,
   lines up with the panel; it leaves room under the panel for the cable to hang into. */
.panel-wrap {
  position: relative; margin: 0 auto 14%;
  width: min(100%, calc(80vh * var(--panel-ratio, 101.3 / 128.5)), var(--panel-max, 560px));
}
.panel-wrap .panel2d { width: 100%; }
@media (max-width: 900px) {
  .panel-wrap { width: min(100%, calc(80vh * var(--panel-ratio, 101.3 / 128.5)), var(--panel-max-narrow, 520px)); }
}

/* the screen's light, over the face's screen rows, and a bloom round it */
.p2-light { position: absolute; left: 0; width: 100%; pointer-events: none; }
.p2-light canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.p2-light .p2-bloom { filter: blur(3px); opacity: 0.7; mix-blend-mode: screen; }
.p2-pot { z-index: 2; }
.p2-jack { z-index: 1; }

/* the cable in UMBILICAL: hangs out of the panel's bottom edge, fading */
.p2-cable { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 101.3 / 128.5; overflow: visible; pointer-events: none; z-index: 3; }
.p2-cable .cable-shadow { stroke-width: 4.3; stroke-linecap: round; }
.p2-cable .cable-line { stroke-width: 3.3; stroke-linecap: round; }
.p2-cable .cable-shine { stroke-width: 0.9; stroke-linecap: round; transform: translate(-0.55px, -0.2px); }
.p2-cable .plug { pointer-events: auto; cursor: grab; touch-action: none; outline: none; }
.p2-cable .plug:active { cursor: grabbing; }
.p2-cable .plug:focus-visible .plug-front circle:first-child,
.p2-cable .plug:focus-visible .plug-side rect:nth-of-type(3) { stroke: var(--gold); stroke-width: 0.6; }
.p2-cable .cable-socket { pointer-events: none; }
.pulled .p2-cable .cable-socket { pointer-events: auto; }

/* ---------- the readouts: the outputs, then the knobs, then what it's doing ---------- */
.ro { display: grid; grid-template-columns: 6.4rem minmax(0, 1fr); gap: 5px 0.7rem; align-items: center; }
.ro + .ro { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--s-line); }
.ro dt, .ro dd { font: 400 0.72rem/1.45 "Space Mono", ui-monospace, monospace; }
.ro dt { color: var(--dim); white-space: nowrap; }
.ro dd { color: var(--ink); min-width: 0; }
/* a gate: a square that lights while it's high */
.gate { color: var(--dim); }
.gate::before {
  content: ""; display: inline-block; width: 0.6em; height: 0.6em; margin-right: 0.55em; vertical-align: 0.02em;
  background: rgba(163, 160, 148, 0.22);
}
.gate.on { color: var(--gold-hi); }
.gate.on::before { background: var(--gold-hi); box-shadow: 0 0 6px rgba(240, 216, 120, 0.7); }
.power { display: grid; grid-template-columns: minmax(0, 1fr) 3.4rem; gap: 0.6rem; align-items: center; }
.power-bar { position: relative; height: 0.62rem; background: rgba(163, 160, 148, 0.1); }
.power-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--gold); }
.power-volts { color: var(--gold-hi); text-align: right; font-variant-numeric: tabular-nums; }
.readouts .scope-status { margin-top: 10px; min-height: 2.8em; }
#patch-note { min-height: 4.8em; }
.stage.no-js .stage-side { display: none; }

/* ---------- inside: the 3D model ---------- */
.inside-model { margin-top: 2rem; }

@media (max-width: 520px) {
  .ro { grid-template-columns: 5.6rem minmax(0, 1fr); }
}
