/* phunction.sh — canon v2: HERMETIC FORMALISM (design process rounds 1–4,
   record on /design; full rationale in docs/aesthetic.md).

   COLOR IS PHASE, and the wheel has eight named stations — the 8th roots of
   unity rotated 10°: blood·rust·phosphor·ichor·verdigris·aether·sigil·
   philtre. Each station owns things; any other hue must state its angle.
   Ground: synthwave midnight purple (round 1). Type: Redaction speaks,
   Iosevka operates, Computer Modern typesets mathematics only (round 3).
   Textures: noise/scanlines/vignette, deliberately present (round 2).
   Everything legible on a 1080p screenshare. */

/* ---- faces ---- */
@font-face {
  font-family: "Redaction 20";
  src: url("/fonts/redaction-20-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Redaction 50";
  src: url("/fonts/redaction-50-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Paper";
  src: url("/fonts/KaTeX_Main-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Paper";
  src: url("/fonts/KaTeX_Main-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "PaperMath";
  src: url("/fonts/KaTeX_Math-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Iosevka";
  src: url("/fonts/iosevka-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Iosevka";
  src: url("/fonts/iosevka-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Iosevka";
  src: url("/fonts/iosevka-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- tokens ---- */
:root {
  /* ground — midnight purple, the old site's signature */
  --plane: #1a1428;
  --surface: #221830;
  --line: #382e4a;
  /* ink */
  --ink: #f4f2fb;
  --annot: #b3accc;
  --faint: #6e6790;
  /* the eight stations — 8th roots of unity, +10° */
  --blood:     oklch(70% 0.19 10);
  --rust:      oklch(74% 0.16 55);
  --phosphor:  oklch(84% 0.15 100);
  --ichor:     oklch(80% 0.16 145);
  --verdigris: oklch(80% 0.12 190);
  --aether:    oklch(76% 0.12 235);
  --sigil:     oklch(70% 0.17 280);
  --philtre:   oklch(74% 0.17 325);
  /* type roles */
  --display: "Redaction 20", "IM Fell English", Georgia, serif;
  --prose: "Redaction 50", "IM Fell English", Georgia, serif;
  --math: "PaperMath", "Paper", Georgia, serif;
  --paper: "Paper", "STIX Two Text", Georgia, serif;
  --term: "Iosevka", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  /* vignette + the faint ruled grid + the plane */
  background:
    radial-gradient(ellipse at 50% 28%, transparent 24%, rgba(8, 5, 16, 0.78) 100%),
    linear-gradient(rgba(138, 108, 255, 0.045) 1px, transparent 1px) 0 0 / 100% 2.4rem,
    linear-gradient(90deg, rgba(138, 108, 255, 0.045) 1px, transparent 1px) 0 0 / 2.4rem 100%,
    var(--plane);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--term);
  font-size: 15px;
  line-height: 1.55;
}

/* print grain + scanlines over everything except the lab (z-order exempts) */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.10;
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.45) 0 1px, transparent 1px 3px);
  opacity: 0.13;
}

a { color: var(--aether); text-decoration: none; }
a:hover { color: var(--philtre); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- the sigil ---- */
.sigil { display: inline-block; vertical-align: middle; overflow: visible; }
.sigil .sigil-ring path { stroke: var(--annot); stroke-width: 1; fill: none; opacity: 0.9; }
.sigil .sigil-hepta polygon {
  stroke: var(--ink); stroke-width: 1.6; fill: none;
  stroke-linejoin: round; opacity: 0.85;
}
.sigil .sigil-inner { stroke: var(--faint); stroke-width: 1; fill: none; }
.sigil .sigil-phi {
  font-family: var(--math); font-style: italic; font-size: 15px;
  fill: var(--phosphor); stroke: none;
}
.sigil .sigil-ring, .sigil .sigil-hepta { transform-origin: 50% 50%; }
.sigil.spin .sigil-ring { animation: sigil-cw 240s linear infinite; }
.sigil.spin .sigil-hepta { animation: sigil-ccw 360s linear infinite; }
@keyframes sigil-cw { to { transform: rotate(1turn); } }
@keyframes sigil-ccw { to { transform: rotate(-1turn); } }

/* ---- chrome ---- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 1.4rem;
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 2;
}
.brand { color: var(--ink); font-weight: 700; display: inline-flex; align-items: center; gap: 0.55rem; }
.brand .brand-path::before { content: "~/"; color: var(--faint); font-weight: 400; }
.brand:hover { color: var(--phosphor); }
.links { display: flex; gap: 1.4rem; }

/* ---- landing ---- */
.hero { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; position: relative; z-index: 2; }
.wordmark {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 1.05;
  margin: 1.2rem 0 0.4rem;
  color: var(--ink);
  animation: breathe 11s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.92; } }
.theorem {
  font-family: var(--prose);
  font-size: 1.2rem;
  max-width: 42rem;
  margin: 0 0 3rem;
}
.theorem .thm-label { font-weight: 700; }
.theorem em { font-style: italic; }
.theorem .qed { color: var(--phosphor); }

/* fig. 0 — the phasor (hue = argument, station origin at blood 10°) */
.phasor-fig { margin: 1.5rem 0 0; }
.phasor-fig svg { width: 100%; height: auto; display: block; }
.phasor-fig .axis { stroke: var(--line); stroke-width: 1; }
.phasor-fig .unit { fill: none; stroke: var(--line); stroke-width: 1.5; }
.phasor-fig .radius {
  stroke: oklch(76% 0.16 var(--phase, 10)); stroke-width: 2.5; stroke-linecap: round;
}
.phasor-fig .tip { fill: oklch(80% 0.17 var(--phase, 10)); }
.phasor-fig .projection { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.phasor-fig .trace {
  fill: none; stroke: oklch(74% 0.15 var(--phase, 10));
  stroke-width: 2; stroke-linecap: round;
}
.figcaption, .phasor-fig figcaption {
  font-family: var(--term); font-size: 0.8rem; color: var(--faint); margin-top: 0.4rem;
}

/* exhibits — phazor wears philtre, the lab wears aether */
.figs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.2rem; margin: 0 0 3rem;
}
.fig {
  --w: var(--aether);
  display: block;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  padding: 1.1rem 1.2rem 1.3rem;
  color: var(--ink);
  transition: border-color 0.15s, transform 0.2s;
}
.fig:hover { border-color: var(--w); transform: translateY(-3px) rotate(-0.4deg); color: var(--ink); }
.fig.hot { --w: var(--philtre); }
.fig.warm { --w: var(--phosphor); }
.fig .fig-label { font-size: 0.8rem; color: var(--faint); display: block; }
.fig .fig-name {
  font-family: var(--display); font-size: 1.5rem;
  color: var(--w); display: block; margin: 0.15rem 0 0.35rem;
}
.fig .fig-glyph { float: right; font-size: 1.6rem; color: var(--w); opacity: 0.4; }
.fig .fig-desc { color: var(--annot); font-size: 0.9rem; display: block; }

.colophon { border-top: 1px solid var(--line); padding-top: 1rem; color: var(--faint); font-size: 0.8rem; }

/* ---- phazor panel ---- */
.panel { max-width: 62rem; margin: 0 auto; padding: 2rem 1.5rem; position: relative; z-index: 2; }
.panel-head h1 { font-family: var(--display); font-weight: 400; font-size: 2.6rem; margin: 0; }
.panel-head .sub { color: var(--faint); font-size: 0.85rem; }

.power {
  display: block; margin: 4rem auto;
  padding: 1.1rem 2.4rem;
  font-family: var(--term); font-size: 1.2rem;
  color: var(--plane); background: var(--phosphor);
  border: none; cursor: pointer;
}
.power:hover { background: var(--ichor); }

.transport { display: flex; gap: 0.8rem; align-items: center; margin: 1.6rem 0; flex-wrap: wrap; }
.xport {
  font-family: var(--term); font-size: inherit;
  padding: 0.45rem 1.1rem; cursor: pointer;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line);
}
.xport:hover { border-color: var(--ink); }
.xport.lit { color: var(--plane); background: var(--phosphor); border-color: var(--phosphor); }
.xport.panic { border-color: var(--blood); color: var(--blood); }
.tempo { margin-left: auto; display: flex; gap: 0.6rem; align-items: center; color: var(--annot); }
.tempo .val { color: var(--phosphor); min-width: 3ch; }

/* the step row is the unit circle unrolled from station zero:
   step i sounds at phase 2πi/16 and wears hue 10° + i·22.5°. */
.steps { display: grid; grid-template-columns: repeat(16, 1fr); gap: 0.35rem; margin: 1.4rem 0; }
.step {
  aspect-ratio: 1 / 1.4; cursor: pointer; position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  color: transparent;
  font-family: var(--term);
}
.step:nth-child(4n + 1) { border-color: color-mix(in oklab, var(--line) 40%, var(--ink)); }
.step:hover { border-color: var(--ink); }
.step.on {
  background: oklch(74% 0.16 calc(10deg + var(--i) * 22.5deg));
  border-color: transparent;
  color: var(--plane);
}
.step.on .note { font-size: 0.7rem; }
.step.now { outline: 2px solid var(--ink); outline-offset: 1px; }

.knobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 1.6rem 0; }
.param { display: grid; grid-template-columns: 6.5rem 1fr 5.5rem; gap: 0.6rem; align-items: center; }
.param .name { color: var(--annot); }
.param .val { color: var(--phosphor); font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }

input[type="range"] { accent-color: var(--philtre); width: 100%; }

.readout { display: flex; gap: 1.4rem; align-items: center; margin-top: 1.8rem; flex-wrap: wrap; }
.meter { display: flex; gap: 0.5rem; align-items: center; flex: 1; min-width: 14rem; }
.meter .ch { color: var(--annot); }
.meter .bar {
  position: relative; flex: 1; height: 0.7rem;
  background: var(--surface); border: 1px solid var(--line);
  overflow: hidden;
}
.meter .rms {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg in oklch, var(--verdigris), var(--phosphor));
}
.meter .peak { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--blood); }
.stats { display: flex; gap: 1.2rem; color: var(--annot); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.stats .warn { color: var(--blood); }

/* ---- lab ---- */
.lab-head { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1.5rem 0; position: relative; z-index: 2; }
.lab-head h1 { font-family: var(--display); font-weight: 400; font-size: 2.6rem; margin: 0 0 0.2rem; }
.lab-head .tagline { color: var(--annot); margin: 0 0 2rem; }
.lab-figs { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem 4rem; position: relative; z-index: 2; }

/* the lab viewer sits ABOVE the texture layers: shaders arrive unfiltered */
.labview { position: fixed; inset: 0; background: #000; z-index: 5; }
.labcanvas { width: 100%; height: 100%; display: block; touch-action: none; }
.labhud {
  position: absolute; left: 0.9rem; bottom: 0.7rem;
  display: flex; gap: 1.2rem; align-items: baseline;
  color: var(--annot); font-size: 0.8rem;
  text-shadow: 0 0 6px #000;
}
.labhud .hint { opacity: 0.7; }
.gfx-error { position: absolute; top: 40%; width: 100%; text-align: center; color: var(--blood); z-index: 6; }

/* ---- 404 ---- */
.nothing { text-align: center; padding: 5rem 1.5rem; position: relative; z-index: 2; }
.nothing .sigil { opacity: 0.55; margin-bottom: 1.4rem; }
.nothing h1 { font-family: var(--math); font-size: 4.5rem; margin: 0; color: var(--philtre); }
.nothing p { color: var(--annot); font-family: var(--prose); }

/* ---- debug HUD (ships to production, on purpose) ---- */
.hud {
  position: fixed; right: 0.8rem; bottom: 0.8rem; z-index: 99;
  width: min(38rem, calc(100vw - 2rem)); max-height: 45vh;
  display: flex; flex-direction: column;
  background: color-mix(in oklab, var(--plane) 95%, transparent);
  border: 1px solid var(--aether);
  font-size: 0.75rem;
}
.hud header { display: flex; justify-content: space-between; padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--line); color: var(--aether); }
.hud .hud-build { color: var(--phosphor); }
.hud .hud-log { flex: 1; overflow: auto; margin: 0; padding: 0.5rem 0.7rem; color: var(--ink); white-space: pre-wrap; }
.hud footer { padding: 0.3rem 0.7rem; color: var(--faint); border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  .fig, .fig:hover { transition: none; transform: none; }
  .wordmark { animation: none; }
  .sigil.spin .sigil-ring, .sigil.spin .sigil-hepta { animation: none; }
}

/* ---- the fun layer (canon addendum: the site plays back) ---- */
.transmission {
  overflow: hidden; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem; color: var(--faint);
  position: relative; z-index: 2;
  padding: 0.25rem 0;
}
.transmission-track { display: inline-block; animation: transmit 150s linear infinite; }
@keyframes transmit { to { transform: translateX(-50%); } }

.wordmark.playable { display: flex; flex-wrap: wrap; }
.wordmark .key {
  all: unset; cursor: pointer; display: inline-block;
  font: inherit; color: inherit;
  transition: transform 0.12s, color 0.12s;
}
.wordmark .key:hover, .wordmark .key:focus-visible {
  color: oklch(78% 0.17 calc(var(--kh) * 1deg));
  transform: translateY(-0.08em) rotate(-2deg);
}
.wordmark .key:active { transform: translateY(0.05em) scale(0.97); }

.comet-dot {
  position: fixed; z-index: 3; pointer-events: none;
  width: 5px; height: 5px; border-radius: 50%;
  background: oklch(78% 0.17 calc(var(--h) * 1deg));
  transform: translate(-50%, -50%);
  animation: comet-fade 0.6s ease-out forwards;
}
@keyframes comet-fade { to { opacity: 0; transform: translate(-50%, -50%) scale(0.2); } }

html.ignite body { animation: ignition 1.4s ease-out; }
@keyframes ignition {
  0% { filter: none; }
  18% { filter: hue-rotate(140deg) brightness(1.35); }
  45% { filter: hue-rotate(300deg) brightness(1.1); }
  100% { filter: none; }
}
html.ignite .sigil.spin .sigil-ring { animation-duration: 3s; }
html.ignite .sigil.spin .sigil-hepta { animation-duration: 4s; }

html.fnord body { animation: fnord-storm 4s ease-in-out; }
@keyframes fnord-storm {
  0%, 100% { filter: none; }
  20% { filter: hue-rotate(90deg) saturate(1.6); }
  40% { filter: hue-rotate(200deg) saturate(2) contrast(1.1); }
  60% { filter: hue-rotate(280deg) saturate(1.8); }
  80% { filter: hue-rotate(350deg) saturate(1.4); }
}

.fortune {
  all: unset; cursor: pointer; font: inherit; color: var(--faint);
  font-style: italic;
}
.fortune:hover { color: var(--phosphor); }

@media (prefers-reduced-motion: reduce) {
  .transmission-track { animation: none; }
  html.ignite body, html.fnord body { animation: none; }
  .comet-dot { display: none; }
}

/* ---- the substrate: the field every page floats on ---- */
.substrate {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%;
}

/* ---- the mark: sigil behind, playable name, .sh dangling ---- */
@font-face {
  font-family: "Redaction 20";
  src: url("/fonts/redaction-20-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
.mark-stack { position: relative; padding: 2.6rem 0 0.5rem; }
.mark-sigil {
  position: absolute; left: -3.2rem; top: -1.6rem;
  opacity: 0.5; filter: drop-shadow(0 0 22px oklch(70% 0.17 280 / 0.5));
  pointer-events: none;
}
.wordmark.playable { align-items: baseline; }
.wordmark .key.ph {
  font-style: italic;
  color: oklch(72% 0.19 300);
  text-shadow: 0 0 26px oklch(70% 0.17 280 / 0.75);
}
.wordmark .tld {
  font-family: var(--term); font-size: 0.32em;
  color: var(--aether);
  align-self: flex-end; margin-left: 0.18em; padding-bottom: 0.22em;
}
.wordmark .tld::before { content: "·"; margin-right: 0.2em; color: var(--faint); }

/* ---- aphorism: a stamped, tilted citation ---- */
.aphor {
  position: relative;
  max-width: 36rem;
  margin: 3.2rem 0 3.4rem;
  padding: 1.2rem 0.4rem;
  transform: rotate(-1.2deg);
  cursor: pointer;
  border-top: 1px solid;
  border-bottom: 1px solid;
  border-image: linear-gradient(90deg, var(--sigil), var(--verdigris), transparent) 1;
  user-select: none;
}
.aphor:hover { border-image: linear-gradient(90deg, var(--philtre), var(--phosphor), transparent) 1; }
.aphor-glyph {
  position: absolute; top: -0.85rem; left: -0.3rem;
  color: var(--phosphor); font-size: 1.1rem;
  background: var(--plane); padding: 0 0.3rem;
}
.aphor-q {
  margin: 0; font-family: var(--prose); font-size: 1.3rem; line-height: 1.45;
  color: var(--ink);
}
.aphor-by {
  margin-top: 0.55rem;
  font-family: var(--term); font-size: 0.72rem; letter-spacing: 0.14em;
  color: var(--faint);
}

@media (prefers-reduced-motion: reduce) {
  .aphor { transform: none; }
}

/* ---- the rack: machined modular-synth components ---- */
.rack { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.9rem; margin: 1.6rem 0; }
.rack-panel {
  position: relative;
  grid-column: span 12;
  padding: 0.85rem 1.1rem 1.1rem;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #2b2240, #211a34 55%, #1d1630);
  border: 1px solid #0d0a16;
  border-top-color: #4a3f64;
  box-shadow:
    inset 0 1px 0 rgba(244, 242, 251, 0.07),
    inset 0 -2px 6px rgba(0, 0, 0, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.5);
}
@media (min-width: 860px) {
  .rack .span3 { grid-column: span 3; }
  .rack .span4 { grid-column: span 4; }
  .rack .span5 { grid-column: span 5; }
}
.rack-title {
  margin: 0 0 0.7rem;
  font-family: var(--term); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--annot);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 -1px 0 rgba(255, 255, 255, 0.05);
}
.rack-body { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; }

.screw {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7a7295, #262038 72%);
  border: 1px solid #0d0a16;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.6);
}
.screw::after {
  content: ""; position: absolute; left: 1px; right: 1px; top: 4px; height: 1.6px;
  background: rgba(10, 6, 18, 0.85); transform: rotate(var(--a, 20deg));
}
.screw.tl { top: 6px; left: 6px; --a: 14deg; }
.screw.tr { top: 6px; right: 6px; --a: -38deg; }
.screw.bl { bottom: 6px; left: 6px; --a: 64deg; }
.screw.br { bottom: 6px; right: 6px; --a: -11deg; }

/* knob */
.knob { display: flex; flex-direction: column; align-items: center; width: 5.6rem; user-select: none; }
.knob svg { width: 100%; height: auto; cursor: grab; touch-action: none; display: block; }
.knob svg:active { cursor: grabbing; }
.knob-tick { stroke: #55496f; stroke-width: 1; }
.knob-arc-bg { fill: none; stroke: #0e0a18; stroke-width: 3.5; stroke-linecap: round; }
.knob-arc {
  fill: none; stroke: oklch(76% 0.16 calc(var(--hue) * 1deg)); stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px oklch(76% 0.16 calc(var(--hue) * 1deg) / 0.8));
}
.knob-shadow { fill: rgba(0, 0, 0, 0.5); }
.knob-body { fill: #2f2545; stroke: #0d0a16; stroke-width: 1; }
.knob-knurl { fill: none; stroke: #171126; stroke-width: 2.6; stroke-dasharray: 1.7 2.5; }
.knob-cap {
  fill: #3b3054; stroke: rgba(244, 242, 251, 0.1); stroke-width: 1;
}
.knob-rotor { transform-box: view-box; transform-origin: center; }
.knob-needle { stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.knob-label {
  margin-top: 0.15rem;
  font-family: var(--term); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--annot);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 -1px 0 rgba(255, 255, 255, 0.05);
}
.knob-value {
  font-family: var(--term); font-size: 0.78rem; font-variant-numeric: tabular-nums;
  color: oklch(82% 0.13 calc(var(--hue) * 1deg));
}

/* lamps */
.led-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.led {
  width: 11px; height: 11px; border-radius: 50%;
  background: #171126; border: 1px solid #0d0a16;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.85);
}
.led.lit {
  background: oklch(78% 0.17 calc(var(--hue) * 1deg));
  box-shadow:
    0 0 9px oklch(78% 0.17 calc(var(--hue) * 1deg) / 0.9),
    inset 0 0 2px rgba(255, 255, 255, 0.55);
}
.led-label {
  font-family: var(--term); font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--faint);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
}

/* LED ladder meter */
.ledmeter { display: inline-flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.ledmeter-col {
  display: flex; flex-direction: column; gap: 3px;
  padding: 5px; background: #120d1e;
  border: 1px solid #0d0a16;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.65);
}
.seg { width: 1.6rem; height: 6px; background: #1e1731; }
.seg.lit {
  background: oklch(75% 0.17 calc(var(--hue) * 1deg));
  box-shadow: 0 0 6px oklch(75% 0.17 calc(var(--hue) * 1deg) / 0.8);
}
.ledmeter-label { font-family: var(--term); font-size: 0.62rem; letter-spacing: 0.18em; color: var(--faint); text-transform: uppercase; }

/* digital readout */
.lcd {
  display: inline-flex; gap: 1.1rem;
  padding: 0.35rem 0.7rem;
  background: #120d1e; border: 1px solid #0d0a16;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
  font-family: var(--term); font-size: 0.8rem; font-variant-numeric: tabular-nums;
  color: var(--phosphor);
  text-shadow: 0 0 6px oklch(84% 0.15 100 / 0.55);
}
.lcd .warn { color: var(--blood); text-shadow: 0 0 6px oklch(70% 0.19 10 / 0.7); }

/* machined buttons (restyle of .xport) */
.xport {
  background: linear-gradient(180deg, #342a4a, #251c38);
  border: 1px solid #0d0a16; border-top-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 0 #0d0a16, inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.xport:hover { border-color: #0d0a16; border-top-color: rgba(255, 255, 255, 0.2); color: var(--ink); }
.xport:active { transform: translateY(1px); box-shadow: 0 1px 0 #0d0a16; }
.xport.lit { box-shadow: 0 2px 0 #0d0a16, 0 0 14px oklch(84% 0.15 100 / 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2); }

/* mechanical step pads */
.step {
  border: 1px solid #0d0a16; border-top-color: rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, #2c2340, #211a34);
  box-shadow: 0 2px 0 #0d0a16, inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.step:hover { border-color: #0d0a16; border-top-color: rgba(255, 255, 255, 0.2); }
.step:active { transform: translateY(1px); box-shadow: 0 1px 0 #0d0a16; }
.step.on {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 40%),
    oklch(66% 0.15 calc(10deg + var(--i) * 22.5deg));
  border-color: #0d0a16;
  box-shadow:
    0 2px 0 #0d0a16,
    0 0 16px oklch(70% 0.16 calc(10deg + var(--i) * 22.5deg) / 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.step.now { outline-offset: 2px; }

/* key hints (stolen with love from qualia's bottom bar) */
.keyhints {
  display: flex; gap: 1.1rem; flex-wrap: wrap;
  margin-top: 1rem;
  font-size: 0.72rem; color: var(--faint);
}
.keyhints kbd {
  font-family: var(--term);
  padding: 0 0.35rem;
  background: #241b36; border: 1px solid #0d0a16; border-top-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 0 #0d0a16;
  color: var(--annot);
}
