/* Valence's headlamp bench. The original workshop exposures share one optical frame. */
#theater[data-project=valence] { --join-foot: #191b18; }
#theater #stage .wk-valence { background: var(--join-foot); }
@media (min-width: 1021px) {
  #theater #stage .wk-valence { grid-template-columns: minmax(0,1.35fr) minmax(355px,1fr); }
}
@media (max-width: 1020px) {
  #theater #stage .wk-valence { grid-template-columns: minmax(0,1fr); }
  #theater #stage .wk-valence .va-stage { height: clamp(245px,52vw,420px); min-height: 0; }
}
#theater #stage .wk-valence .va-console.vb-instrument,
.vm-lamp-bench .vb-instrument {
  --bench-ivory: #eae4d4;
  --bench-metal: #b4b1a1;
  --bench-amber: #e7ae70;
  position: relative;
  isolation: isolate;
  container: beam-bench / inline-size;
  display: block;
  box-sizing: border-box;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: var(--bench-ivory);
  background: linear-gradient(120deg, #191c1af5, #181a18ef 53%, #111311f5), url("brushed-palladium.webp") center / cover;
  border: 1px solid #5c5b50;
  border-radius: 7px;
  box-shadow: inset 0 1px #b2ae975c, inset 0 -2px #070908, 0 6px 16px #05060555;
  font: 400 15px/1.45 Arial, sans-serif;
  text-align: left;
}
#theater #stage .wk-valence .va-console.vb-instrument {
  align-self: center;
  justify-self: stretch;
  margin: clamp(14px,2vw,30px) clamp(12px,1.8vw,27px);
}
#theater #stage .wk-valence .va-console.vb-instrument::before,
#theater #stage .wk-valence .va-console.vb-instrument::after { content: none; }
.vm-lamp-bench { padding: clamp(24px,4vw,64px) clamp(14px,5vw,72px); }
.vm-lamp-bench .vb-instrument { width: 100%; max-width: 1180px; margin: 0 auto; }
.vb-instrument *, .vb-instrument *::before, .vb-instrument *::after { box-sizing: border-box; }

.vb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px 8px;
  min-height: 59px;
  padding: 7px clamp(12px,2.6cqi,23px);
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 1px #d5cdb342, inset 0 -1px #000a;
  background: linear-gradient(110deg, #202421ed, #31332fdc 70%, #252824e8), url("brushed-palladium.webp") center / cover;
}
.vb-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vb-instrument .vb-mark { display: block; width: 28px; height: 28px; flex: none; }
.vb-instrument .vb-heading :is(h2,h3) {
  margin: 0;
  color: #f0eadb;
  font: italic 400 clamp(21px,4.8cqi,32px)/1.1 Georgia, serif;
  letter-spacing: -.03em;
  text-transform: none;
}
.vb-instrument button.vb-compare {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; min-height: 44px; margin: 0; padding: 4px 9px; width: auto;
  border: 0; border-radius: 1px; color: #e6e0d1; background: transparent; box-shadow: none;
  position: relative; isolation: isolate; flex: none; -webkit-tap-highlight-color: transparent;
  font: 600 12px/1.2 Arial, sans-serif; letter-spacing: .015em; text-transform: none;
}
.vb-instrument button.vb-compare::after {
  content: ""; position: absolute; inset: 6px -1px; z-index: -1; pointer-events: none;
  border-radius: 3px; background: linear-gradient(#393c37,#2c2f2a);
  box-shadow: inset 0 1px #a19e8c38, inset 0 -1px #111310, 0 0 0 1px #151814;
}
.vb-instrument button.vb-compare[aria-pressed=true]::after {
  background:#242720; box-shadow:inset 0 1px 3px #0a0b09, 0 0 0 1px #79705b;
}
.vb-instrument button.vb-compare::before {
  content: ""; width: 21px; height: 14px; flex: none;
  border: 1px solid currentColor; border-radius: 2px;
  background: linear-gradient(to right, transparent 43%, currentColor 43% 51%, transparent 51%),
    linear-gradient(115deg, #bfbdae55 0 49%, #10121066 50%);
}
.vb-instrument button.vb-compare[aria-pressed=true] { color: #f4bf84; }
.vb-body { display: grid; align-items: start; gap: 0; padding: clamp(10px,2cqi,18px); }
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-window {
  display: block; grid-area: auto; align-self: start; justify-self: stretch;
  width: 100%; min-width: 0; max-width: none; margin: 0; padding: 5px;
  border: 1px solid #10120f; border-radius: 4px; background: #0d0f0d;
  box-shadow: inset 1px 2px 4px #000b, 0 1px #a7a39055, 0 0 0 1px #494c43;
}
.vb-screen { position: relative; isolation: isolate; overflow: hidden; width: 100%; aspect-ratio: 1440 / 613; background: #171816; }
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-window .vb-screen img {
  position: absolute; inset: 0; display: block; margin: 0; width: 100%; height: 100%;
  min-height: 0; max-height: none; border: 0; border-radius: 0; box-shadow: none; object-fit: contain;
}
/* The glass, index, and legends follow the pointer in the same paint. */
.vb-instrument :is(.vb-reference,.vb-split,.vb-tags,.vb-tag-slot) { transition: none !important; }
.vb-screen .vb-reference { clip-path: inset(0 0 0 var(--split,50%)); }
.vb-split { position: absolute; inset-block: 0; left: var(--split,50%); width: 1px; background: #f1e6ce; box-shadow: 1px 0 1px #221f18aa; pointer-events: none; }
.vb-split::after {
  content: ""; position: absolute; left: -7px; top: 47%; width: 15px; height: 23px;
  border: 1px solid #dcd1bc; border-radius: 4px; box-shadow: 0 1px 4px #0a0908aa;
  background: repeating-linear-gradient(to right,#45473f 0 2px,#b1ab99 2px 3px) center / 8px 9px no-repeat, #393c34;
}
.vb-instrument input.vb-sweep {
  position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0;
  appearance: none; -webkit-appearance: none; background: transparent;
  cursor: ew-resize; touch-action: pan-y; z-index: 2;
}
/* Measure the split across the whole glass, including its first and last pixels. */
.vb-instrument .vb-sweep::-webkit-slider-thumb { -webkit-appearance: none; width: 1px; height: 1px; }
.vb-instrument .vb-sweep::-moz-range-thumb { width: 1px; height: 1px; border: 0; }
.vb-window:has(.vb-sweep:focus-visible) { outline: 2px solid var(--bench-amber); outline-offset: 3px; }
.vb-tags { position: absolute; inset: 0; display: grid; grid-template-columns: var(--split,50%) minmax(0,1fr); align-items: start; pointer-events: none; }
.vb-tag-slot { container: beam-tag / inline-size; display: flex; overflow: hidden; }
.vb-tag-slot:last-child { justify-content: flex-end; }
.vb-tags span { white-space: nowrap; }
@container beam-tag (max-width: 64px) {
  .vb-tags span { visibility: hidden; }
}
.vb-tags span {
  margin: 6px; padding: 3px 5px; background: #141713e8; color: #eee8d8;
  font: 600 11px/1.2 Arial,sans-serif; letter-spacing: .035em;
}
.vb-instrument [hidden] { display: none !important; }

.vb-controls { min-width: 0; padding: clamp(13px,3cqi,25px) clamp(4px,1cqi,14px) 4px; }
.vb-dial-bank { display: flex; align-items: center; gap: clamp(10px,3.4cqi,25px); }
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-instrument .va-dial-mount {
  position: relative; display: grid; place-items: center; flex: 0 0 auto;
  width: clamp(64px,17cqi,90px); height: auto; aspect-ratio: 1; padding: 6px; margin: 0;
  background: radial-gradient(ellipse,#10120f 50%,#272923 62%,transparent 65%); box-shadow: none; border: 0;
}
.vb-dial-bank .va-dial-mount::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(#dfb780 0deg 1.5deg,transparent 1.5deg 51.5deg,#c5bca7 51.5deg 54.5deg,transparent 54.5deg 305.5deg,#c5bca7 305.5deg 308.5deg,transparent 308.5deg 358.5deg,#dfb780 358.5deg);
  mask-image: radial-gradient(circle closest-side,transparent calc(100% - 5px),#000 calc(100% - 4px));
}
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-instrument button.va-dial {
  display: block; position: relative; width: 100%; height: auto; aspect-ratio: 1;
  border: 0; border-radius: 50%; box-shadow: none; background: none; margin: 0; padding: 0; touch-action: none;
}
.vb-instrument .va-dial img {
  /* The face catches a fixed workshop light. Move only the ivory index around its spindle. */
  position: relative;
  display: block; width: 100%; height: 100%; user-select: none; pointer-events: none;
  transform: none; filter: drop-shadow(0 2px 2px #060706);
}
.vb-instrument .va-dial::before, .vb-instrument .va-dial::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("workshop/headlamp-knob.webp") center / 100% 100% no-repeat;
}
.vb-instrument .va-dial::before {
  z-index: 1; transform: translateX(8%);
  mask-image: linear-gradient(90deg,transparent 35%,#000 38% 46%,transparent 49%),
    linear-gradient(transparent 5%,#000 7% 41%,transparent 44%);
  mask-composite: intersect;
}
.vb-instrument .va-dial::after {
  z-index: 2; clip-path: inset(7.5% 47.5% 59.2% 47.5% round 50% / 8%);
  transform: rotate(var(--knob-angle,0deg));
}
.vb-switches { flex: 1; min-width: 0; }
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-switches .va-caption {
  display: block; margin: 0 0 6px; color: #cbc8b9; font: 600 11px/1.2 Arial,sans-serif; letter-spacing: .10em; text-transform: uppercase;
}
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch;
  width: 100%; max-width: 36rem; box-sizing: border-box;
  padding: 4px 5px 7px; gap: 4px; border: 2px solid #716d5e; border-radius: 9px;
  background: #131611;
  box-shadow: inset 0 2px 4px #000, 0 -1px #c1b8a0, 0 2px 1px #090a08, 0 3px 5px #0006;
}
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets label {
  position: relative; display: grid; width: 100%; min-width: 0;
  min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent;
}
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets :is(label span,button) {
  --pilot: radial-gradient(circle at 36% 30%,#c19a61 1%,#715137 22%,#4a3522 54%,#231b15 82%);
  position: relative; display: grid; align-content: center; justify-items: center; gap: 1px;
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 3px 2px 7px;
  border: 1px solid; border-color: #78796a #41443b #141611 #51554a; border-radius: 5px 5px 7px 7px;
  color: #e9e2cd; text-shadow: 0 1px 1px #10120e;
  font: 600 clamp(12px,2.65cqi,14px)/1.1 Arial,sans-serif; letter-spacing: .035em; text-transform: none;
  background:
    linear-gradient(90deg,transparent,#b8b49c88 18%,#dbd5bb88 50%,#aaa58a77 82%,transparent) center calc(100% - 2px) / 36% 1px no-repeat,
    linear-gradient(112deg,#d8cfaa10,transparent 47%),
    linear-gradient(#52554a,#34392f 17%,#282d25 56%,#353a30 86%,#272a23 89%,#191b16);
  box-shadow: inset 0 1px 1px #dcd9be44, inset 1px 0 1px #b3b19b2b, 0 3px #141610, 0 4px 2px #000b;
}
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets :is(input:checked + span,button[aria-pressed=true]) {
  --pilot: radial-gradient(circle at 36% 30%,#fff5ce 6%,#ffe294 24%,#edab48 52%,#875322 88%);
  --halo: 0 0 5px 1px #eda84a79;
  transform: translateY(2px); color: #ffdfaa; border-color: #44463a #575746 #807b61;
  background: linear-gradient(135deg,#141911,#33382c 60%,#424436);
  box-shadow: inset 0 3px 5px #080b07bb, inset 0 -1px #d9d1a927, 0 1px 2px #000a;
}
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets :is(label:active span,button:active) { transform: translateY(3px); }
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets :is(label span,button)::after {
  content: ""; position: absolute; inset: 6px 7px auto auto; width: 5px; height: 5px; margin: 0;
  box-sizing: content-box; border: 1px solid #221e15; border-radius: 50%; background: var(--pilot);
  box-shadow: 0 1px 0 #d2c9ac65, var(--halo,0 0 transparent); pointer-events: none;
}
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets input {
  position: absolute; inset: 0; z-index: 1; margin: 0; width: 100%; height: 100%; opacity: 0; 
}
.vb-reading { margin-top: 10px; padding: 12px 10px 5px; border-radius: 2px; background: linear-gradient(120deg,#131613b5,transparent 90%); }
.vb-instrument .vb-state { display: block; color: #ece5d2; font: 400 clamp(18px,3.5cqi,22px)/1.15 Georgia,serif; letter-spacing: -.02em; }
:is(#theater #stage .wk-valence,.vm-lamp-bench) :is(.vb-note,.vb-against) {
  margin: 5px 0 0; min-height: 3lh; max-width: 49ch; color: #c1c3b8;
  font: 400 clamp(13px,2.7cqi,15px)/1.45 Arial,sans-serif; letter-spacing: 0;
}
.vb-against {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
}
.vb-instrument :is(button,input,select):focus-visible, .vb-presets input:focus-visible + span { outline: 2px solid #f5c58c; outline-offset: 2px; }
@container beam-bench (min-width: 660px) {
  .vb-body {
    grid-template-columns: minmax(0,1.5fr) minmax(0,1fr);
    grid-template-areas: "road specimen" "switch specimen";
    align-items: center;
    gap: clamp(10px,1.5cqi,18px) clamp(15px,2cqi,25px);
  }
  .vb-body .vb-controls { display: contents; }
  :is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-body .vb-window { grid-area:road; align-self:end; }
  .vb-body .vb-dial-bank { grid-area:switch; align-self:start; }
  .vb-body .vb-reading { grid-area:specimen; }
}

/* The engravings distinguish the three keys even with the bench lights dimmed. */
.vb-presets > :nth-child(1) { --lamp-symbol: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2016%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.45%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10%204a4%204%200%200%200%200%208zm4%200a4%204%200%200%201%200%208zM2%206H0m2%204H0m21-4h2m-2%204h2%22%2F%3E%3C%2Fsvg%3E"); }
.vb-presets > :nth-child(2) { --lamp-symbol: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2016%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.45%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%203.5c4%200%207%201.8%207%204.5s-3%204.5-7%204.5c-1.2-2.7-1.2-6.3%200-9zm-4%20.7L2%206.5m8%201L2%209.8m8%20.9L2%2013%22%2F%3E%3C%2Fsvg%3E"); }
.vb-presets > :nth-child(3) { --lamp-symbol: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2016%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.45%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%203.5c4%200%207%201.8%207%204.5s-3%204.5-7%204.5c-1.2-2.7-1.2-6.3%200-9zM10%204.7H1m9%203.3H1m9%203.3H1%22%2F%3E%3C%2Fsvg%3E"); }
:is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets :is(label span,button)::before {
  content: ""; display: block; position: static; width: 24px; height: 15px;
  margin: 0; border: 0; border-radius: 0; box-shadow: none; background: currentColor;
  mask: var(--lamp-symbol) center / contain no-repeat;
}
@container beam-bench (min-width: 660px) and (max-width: 860px) {
  .vb-dial-bank { gap: 8px; }
  :is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-instrument .va-dial-mount { width: 62px; }
}

@container beam-bench (max-width: 365px) {
  .vb-head { padding-inline: 9px; gap: 2px 5px; }
  .vb-heading { gap: 6px; }
  .vb-instrument .vb-mark { width: 21px; height: 21px; }
  .vb-instrument .vb-heading :is(h2,h3) { font-size: 20px; }
  .vb-instrument button.vb-compare { font-size: 11px; gap: 4px; }
  .vb-instrument button.vb-compare::before { width: 16px; height: 12px; }
  .vb-controls { padding-inline: 0; }
}
@media (hover: hover) {
  .vb-instrument button.vb-compare:hover::after { background: linear-gradient(#4a4d46,#383a34); }
  :is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets :is(label:hover input:not(:checked) + span, button[aria-pressed=false]:hover) {
    filter: brightness(1.14);
  }
}
@media (prefers-reduced-motion: no-preference) {
  :is(#theater #stage .wk-valence,.vm-lamp-bench) .vb-presets :is(label span,button) { transition: transform 100ms ease-out, box-shadow 100ms ease-out; }
  .vb-instrument .va-dial::after { transition: transform 150ms ease-out; }
}
@media (forced-colors: active) {
  .vb-instrument .vb-split { background: CanvasText; }
  .vb-instrument .vb-presets :is(input:checked + span,button[aria-pressed=true]) { outline: 2px solid Highlight; outline-offset: -3px; }
}
