@font-face { font-family: "VT323"; src: url("/fonts/vt323.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("/fonts/special-elite.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #16130f;
  --bg2: #221d17;
  --metal-hi: #4a4741;
  --metal-lo: #23221f;
  --metal-edge: #0c0b0a;
  --glass: #06120f;
  --vfd: #7dffd8;
  --vfd-dim: #1f5c4d;
  --amber: #ffb347;
  --red: #ff4b3e;
  --paper: #e9e1cc;
  --paper-ink: #2a2620;
  --muted: #9b9282;
  --focus: #ffd27a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, #3a2f22 0%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 5px),
    var(--bg);
  color: var(--paper);
  font-family: "Special Elite", "Courier New", monospace;
  -webkit-font-smoothing: antialiased;
}

.room {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 16px 24px;
  display: grid;
  gap: 32px;
}

/* ---------- tuner chassis ---------- */
.tuner {
  position: relative;
  padding: 22px 26px 24px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, rgba(0,0,0,.05) 1px 3px),
    linear-gradient(180deg, var(--metal-hi), var(--metal-lo));
  border: 1px solid var(--metal-edge);
  box-shadow:
    0 1px 0 rgba(255,255,255,.12) inset,
    0 -2px 0 rgba(0,0,0,.5) inset,
    0 30px 60px rgba(0,0,0,.6),
    0 6px 0 #0a0908;
}
.screw { position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9a958c, #3b3935 70%);
  box-shadow: 0 1px 1px rgba(0,0,0,.7); }
.screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 5px; height: 2px; background: #2a2825; transform: rotate(35deg); }
.s1 { top: 8px; left: 8px; } .s2 { top: 8px; right: 8px; } .s3 { bottom: 8px; left: 8px; } .s4 { bottom: 8px; right: 8px; }

.plate { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 6px 14px; }
.brand { font-size: 28px; letter-spacing: .02em; color: #e9e4d8; text-shadow: 0 1px 0 #000; }
.model { font-family: "VT323", monospace; font-size: 15px; letter-spacing: .18em; color: #b9b2a3; }

/* ---------- display ---------- */
.face { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: stretch; }
.vfd {
  background: radial-gradient(120% 140% at 50% 0%, #0b2520 0%, var(--glass) 60%);
  border: 2px solid #050505;
  border-radius: 6px;
  box-shadow: inset 0 0 22px rgba(0,0,0,.9), inset 0 0 1px rgba(125,255,216,.4);
  padding: 12px 16px;
  font-family: "VT323", monospace;
  color: var(--vfd);
  text-shadow: 0 0 6px rgba(125,255,216,.65);
  min-width: 0;
}
.vfd-row { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.vfd-row.top { font-size: 34px; line-height: 1.05; }
.vfd-row.bottom { font-size: 19px; color: #5fd8b6; justify-content: space-between; margin-top: 6px; }
.ch { flex: none; color: var(--amber); text-shadow: 0 0 6px rgba(255,179,71,.6); }
.marquee { overflow: hidden; white-space: nowrap; flex: 1; min-width: 0; }
.marquee span { display: inline-block; }
.marquee.scroll span { animation: marquee 12s linear infinite; padding-left: 100%; }
@keyframes marquee { to { transform: translateX(-100%); } }
.state { flex: none; }
.state.off { color: var(--vfd-dim); text-shadow: none; }
.state.warn { color: var(--amber); text-shadow: 0 0 6px rgba(255,179,71,.6); }
#meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- VU meters (decorative) ---------- */
.meters { display: flex; gap: 10px; }
.vu {
  position: relative; width: 112px; height: 78px; border-radius: 4px; overflow: hidden;
  background: linear-gradient(180deg, #f3e3b4, #d9c48d);
  border: 2px solid #050505; box-shadow: inset 0 0 12px rgba(120,80,0,.45);
}
.vu-scale { position: absolute; inset: 10px 10px auto 10px; height: 46px; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border-top: 2px solid #2a2620;
  background: conic-gradient(from 300deg at 50% 100%, transparent 0 84deg, #c0392b 84deg 120deg, transparent 120deg);
  -webkit-mask: radial-gradient(circle at 50% 100%, transparent 38px, #000 39px, #000 46px, transparent 47px);
          mask: radial-gradient(circle at 50% 100%, transparent 38px, #000 39px, #000 46px, transparent 47px); }
.needle { position: absolute; left: 50%; bottom: 12px; width: 2px; height: 54px; background: #1a1a1a; transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(-48deg); transition: transform .12s ease-out; }
.vu span { position: absolute; bottom: 2px; right: 6px; font-family: "VT323", monospace; font-size: 14px; color: #2a2620; }

/* ---------- dial ---------- */
.dial {
  position: relative; height: 54px; margin: 18px 0 14px; border-radius: 4px;
  background: linear-gradient(180deg, #0d0c0b, #1b1916);
  border: 2px solid #050505; box-shadow: inset 0 2px 8px rgba(0,0,0,.8);
  overflow: hidden;
}
.ticks { position: absolute; inset: 0 24px; }
.tick { position: absolute; top: 6px; width: 2px; height: 14px; background: #8d8676; transform: translateX(-1px); }
.tick.minor { height: 7px; background: #5a554b; }
.tick b { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font: 16px "VT323", monospace; color: #d9d1bf; font-weight: normal; }
.pointer { position: absolute; top: 2px; bottom: 2px; width: 3px; left: 24px; background: var(--red);
  box-shadow: 0 0 8px rgba(255,75,62,.8); transition: left .45s cubic-bezier(.2,.8,.2,1); }

/* ---------- controls ---------- */
.controls { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.leds { display: grid; grid-template-columns: auto auto; gap: 6px 8px; align-items: center; font: 15px "VT323", monospace; color: #c8c0ae; letter-spacing: .1em; }
.led { width: 10px; height: 10px; border-radius: 50%; background: #3a1612; box-shadow: inset 0 1px 2px rgba(0,0,0,.8); }
.led.amber { background: #3a2a10; }
.led.on { background: var(--red); box-shadow: 0 0 10px var(--red); }
.led.amber.on { background: var(--amber); box-shadow: 0 0 10px var(--amber); }

.buttons { display: flex; justify-content: center; gap: 10px; }
.key {
  font: 18px "VT323", monospace; color: #e8e2d4; min-width: 64px; height: 44px; padding: 0 14px; cursor: pointer;
  background: linear-gradient(180deg, #3d3b37, #1d1c1a); border: 1px solid #050505; border-radius: 4px;
  box-shadow: 0 3px 0 #050505, inset 0 1px 0 rgba(255,255,255,.12);
}
.key:active, .key.down { transform: translateY(2px); box-shadow: 0 1px 0 #050505, inset 0 1px 0 rgba(255,255,255,.08); }
.key.power { min-width: 84px; color: #ffd9d5; }
.key.power.on { color: var(--red); text-shadow: 0 0 8px rgba(255,75,62,.8); }

.knobs { display: flex; align-items: center; gap: 18px; }
.knob {
  width: 64px; height: 64px; border-radius: 50%; border: 1px solid #050505; cursor: pointer; padding: 0; position: relative;
  background: repeating-conic-gradient(#2e2c29 0 6deg, #3c3a36 6deg 12deg);
  box-shadow: 0 4px 8px rgba(0,0,0,.7), inset 0 0 0 7px #1b1a18, inset 0 2px 0 rgba(255,255,255,.1);
  transition: transform .35s ease;
}
.grip { position: absolute; top: 9px; left: 50%; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: #e8e2d4; }
.fader { display: grid; gap: 4px; font: 14px "VT323", monospace; letter-spacing: .15em; color: #c8c0ae; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 140px; height: 8px; border-radius: 4px; background: #0c0b0a; border: 1px solid #050505; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 26px; border-radius: 3px; background: linear-gradient(180deg, #d8d2c4, #8e887b); border: 1px solid #050505; cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 16px; height: 26px; border-radius: 3px; background: linear-gradient(180deg, #d8d2c4, #8e887b); border: 1px solid #050505; cursor: pointer; }

.linkout { display: inline-block; margin: 14px 6px 0; font: 18px "VT323", monospace; color: var(--amber); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---------- preset card ---------- */
.card {
  position: relative; background: var(--paper); color: var(--paper-ink);
  padding: 30px 28px 20px; border-radius: 2px; transform: rotate(-.4deg);
  box-shadow: 0 18px 40px rgba(0,0,0,.55);
  background-image:
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(60,90,160,.18) 31px 32px),
    radial-gradient(circle at 20% 30%, rgba(120,90,40,.10), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(120,90,40,.08), transparent 45%);
}
.tape { position: absolute; top: -12px; left: 50%; width: 120px; height: 26px; margin-left: -60px; transform: rotate(2deg);
  background: rgba(230,220,180,.55); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.card h2 { margin: 0 0 10px; font-size: 22px; font-weight: normal; letter-spacing: .08em; }
.card ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.card li { break-inside: avoid; display: flex; align-items: baseline; gap: 10px; line-height: 32px; min-width: 0; }
.card li .n { flex: none; width: 26px; color: #8a3b2b; }
.card li button { all: unset; cursor: pointer; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card li button:hover, .card li.active button { text-decoration: underline; text-decoration-thickness: 2px; }
.card li.active .n::before { content: "\25B6"; font-size: 12px; margin-left: -14px; position: absolute; }
.card li .cc { flex: none; font-size: 13px; color: #6f675a; }
.card li a { flex: none; color: #6f675a; text-decoration: none; font-size: 14px; }
.card li a:hover { color: var(--paper-ink); }
.card li button:focus-visible { outline: 2px solid #8a3b2b; }
.snap { margin: 12px 0 0; font-size: 13px; color: #6f675a; }

/* ---------- footer ---------- */
.foot { max-width: 980px; margin: 0 auto; padding: 8px 16px 40px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.foot a { color: #c9bfa9; }
.avail { font-size: 14px; color: #c9bfa9; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .room { padding-top: 20px; gap: 26px; }
  .tuner { padding: 18px 14px 20px; }
  .face { grid-template-columns: 1fr; }
  .meters { justify-content: center; }
  .vfd-row.top { font-size: 28px; }
  .vfd-row.bottom { font-size: 17px; }
  .controls { grid-template-columns: 1fr; justify-items: center; gap: 16px; }
  .leds { grid-auto-flow: column; grid-template-columns: none; }
  .card { padding: 26px 18px 16px; transform: none; }
  .card ol { columns: 1; }
  .brand { font-size: 24px; }
  .model { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee.scroll span { animation: none; padding-left: 0; }
  .pointer, .needle, .knob { transition: none; }
}

/* fixes */
.linkout[hidden] { display: none; }
.room > * { min-width: 0; }
.card ol { max-width: 100%; }

/* volume and tuning labels */
.knob-wrap { display: grid; justify-items: center; gap: 4px; font: 13px "VT323", monospace; letter-spacing: .15em; color: #c8c0ae; }
.fader-note { display: none; font-size: 13px; letter-spacing: .05em; max-width: 140px; line-height: 1.2; }
.fader.locked input { display: none; }
.fader.locked .fader-note { display: block; }

/* heading reset: the brand is the page h1 but must look exactly like the old div */
h1.brand { margin: 0; font-weight: normal; line-height: normal; }

/* dot-matrix display: vfd.js paints the text as 5x7 square pixels; the real text stays in place, invisible */
.vfd { position: relative; }
.vfd.dm .vfd-row, .vfd.dm .ch, .vfd.dm .state { color: transparent; text-shadow: none; }
.vfd.dm .marquee.scroll span { animation: none; }
.vfd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 4px; pointer-events: none; }
