/* SPDX-License-Identifier: GPL-3.0-only */
/* zp12 simulator: thefirmwarehub.com's layout (after OberVave's web/sim/sim.css) in zp12's colours (docs/: the
 * panel's navy, the printed red rule, the grey frame, the LED red) */
:root {
  --bg: #121c33;
  --panel: #1d3160;
  --panel2: #172848;
  --line: #34497a;
  --fg: #eef1f8;
  --dim: #a9b6d4;
  --cyan: #e4e5df;
  --accent: #ff5a4a;
  --red: #c82e32;
  --blue: #263e70;
  --blue-hi: #a9b6d4;
  --led: #ff3424;
  --key-w: #e9eae4;
  --key-b: #10131c;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 .35em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel2);
  font: 12px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-align: center;
  color: var(--fg);
}

/* ---- header: the wordmark over the printed rule (red over navy, as the panel and the site) */
.top { max-width: 1100px; margin: 0 auto; padding: 20px 16px 8px; text-align: center; }
.logo { display: inline-block; margin: 0 auto; font: italic 900 64px/1 "Helvetica Neue", Arial, sans-serif; letter-spacing: -2px; color: var(--fg); text-decoration: none; }
.logo small { font: italic 400 20px/1 "Helvetica Neue", Arial, sans-serif; letter-spacing: 0; margin-left: 10px; color: var(--dim); }
.rule { height: 6px; max-width: 360px; margin: 10px auto 0; border-top: 2px solid var(--red); border-bottom: 2px solid var(--frame, #cecfc9); }
.tag { color: var(--dim); margin: 6px auto 12px; max-width: 640px; }
.links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.links a {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--fg);
  background: var(--panel);
}
.links a.cta { border-color: var(--red); background: var(--red); color: #fff; font-weight: 600; }
.links a:hover { border-color: var(--accent); }

main { max-width: 1100px; margin: 0 auto; padding: 8px 16px 24px; }

/* ---- the device */
.device {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-areas: "left screen right" "keys keys keys";
  gap: 18px 22px;
  align-items: center;
  margin: 12px auto 24px;
  padding: 20px 22px 22px;
  background: linear-gradient(180deg, #d4d5cf, #c3c5bd);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.device button, .device .knob, .keys { touch-action: none; }
.left { grid-area: left; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.right { grid-area: right; display: flex; flex-direction: column; gap: 16px; align-items: stretch; min-width: 0; }
.screenbox { grid-area: screen; position: relative; width: 360px; max-width: 100%; }
.knobrow { display: flex; gap: 14px; justify-content: center; }
.knobrow.four { justify-content: space-between; }

#screen {
  display: block; width: 100%; height: auto; aspect-ratio: 1;
  image-rendering: pixelated; image-rendering: crisp-edges;
  background: #0b0e16; border: 6px solid #050405; border-radius: 10px;
  box-shadow: 0 0 0 1px #8d9088, 0 0 30px rgba(38, 62, 112, .25);
}
.power {
  position: absolute; inset: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; border: 0; border-radius: 6px; cursor: pointer; color: var(--fg);
  background: radial-gradient(circle at 50% 45%, rgba(200, 46, 50, .28), rgba(16, 20, 28, .92) 70%);
  font: inherit;
}
.power .p1 {
  font-size: 20px; font-weight: 600; padding: 10px 22px; border: 1px solid var(--red); border-radius: 999px;
  color: #fff; background: var(--red);
}
.power .p2 { color: var(--dim); font-size: 13px; }
.power[hidden] { display: none; }

/* knobs: a black cap with a light pointer, the label under it */
.knob { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: ns-resize; width: 64px; }
.knob .cap {
  position: relative; width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a3536, #121011 70%);
  border: 2px solid #0a0809; box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 0 0 1px var(--line);
}
.knob .cap::after {
  content: ""; position: absolute; left: 50%; top: 5px; width: 3px; height: 15px; margin-left: -1.5px;
  border-radius: 2px; background: var(--fg);
}
.knob[data-id="master"] .cap::after { background: var(--red); }
.knob .cap.turning { box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 0 0 2px var(--red); }
.knob .lab { font: 600 10px/1.2 ui-monospace, Menlo, Consolas, monospace; color: var(--blue); letter-spacing: .04em; white-space: nowrap; }
.knob .lab i { display: block; font-style: normal; font-weight: 400; color: #5d6476; text-align: center; }

/* buttons: dark, the LED lights the edge (as the FM-1's lit buttons) */
.btngrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.octs { display: flex; gap: 10px; }
.btn {
  position: relative; min-height: 44px; min-width: 52px; padding: 4px 6px; border-radius: 9px; cursor: pointer;
  border: 1px solid #0a0809; background: linear-gradient(180deg, #2c2728, #1a1718);
  color: var(--fg); font: 600 12px/1.15 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .03em;
  box-shadow: 0 2px 0 #0a0809, 0 0 0 1px var(--line);
}
.btn .kb { position: absolute; right: 4px; top: 2px; font-size: 9px; color: #6f6662; font-weight: 400; }
.btn.lit { box-shadow: 0 2px 0 #0a0809, 0 0 0 2px var(--led), 0 0 14px rgba(255, 74, 56, .55); }
.btn.down { transform: translateY(2px); box-shadow: 0 0 0 #0a0809, 0 0 0 1px var(--red); }
.btn.lit.down { box-shadow: 0 0 0 2px var(--led), 0 0 14px rgba(255, 74, 56, .55); }

/* the keys: 16 white, 11 black, F3 .. G5 */
.keys { grid-area: keys; position: relative; height: 150px; margin-top: 4px; }
.key { position: absolute; top: 0; border-radius: 0 0 6px 6px; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 6px; }
.key.w { height: 100%; background: linear-gradient(180deg, #d9d3cb, var(--key-w)); border: 1px solid #0a0809; z-index: 1; }
.key.b { height: 60%; background: linear-gradient(180deg, #2a2526, var(--key-b)); border: 1px solid #000; z-index: 2; }
.key .kl { font: 11px/1 ui-monospace, Menlo, Consolas, monospace; color: #7a716b; }
.key.b .kl { color: #8a817b; }
.key .pad { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font: 600 10px/1 ui-monospace, Menlo, Consolas, monospace; color: var(--red); }
.key.b .pad { color: #c9cfdd; }
.key .dot { width: 7px; height: 7px; border-radius: 50%; margin-bottom: 5px; background: transparent; }
.key.glow .dot { background: rgba(255, 74, 56, .3); }
.key.lit .dot { background: var(--led); box-shadow: 0 0 8px var(--led); }
.key.w.down { background: linear-gradient(180deg, #bfb8af, #cfc8bf); }
.key.b.down { background: #3a3435; }

/* ---- info boxes */
.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.box h2 { margin: 0 0 8px; font-size: 16px; color: var(--fg); border-bottom: 2px solid var(--red); padding-bottom: 4px; font-weight: 600; letter-spacing: .02em; }
.box ul { margin: 0; padding-left: 18px; }
.box li { margin: 4px 0; }
.box p { margin: 6px 0; }
.hint { color: var(--dim); font-size: 13px; }
.map { border-collapse: collapse; width: 100%; }
.map th { text-align: left; font-weight: 500; color: var(--dim); padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap; font-size: 13px; }
.map td { padding: 4px 0; line-height: 1.9; }
.midirow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.small {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--fg);
  font: inherit; cursor: pointer;
}
.small:hover { border-color: var(--accent); }
select {
  padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--fg);
  font: inherit; max-width: 100%;
}

footer { max-width: 1100px; margin: 0 auto; padding: 12px 16px 32px; color: var(--dim); font-size: 13px; text-align: center; border-top: 1px solid var(--line); }

/* ---- narrower: the screen on top, the knobs and buttons under it, then the keys */
@media (max-width: 980px) {
  .device { grid-template-columns: 1fr 1fr; grid-template-areas: "screen screen" "left right" "keys keys"; }
  .screenbox { justify-self: center; }
}
@media (max-width: 640px) {
  .device { grid-template-columns: 1fr; grid-template-areas: "screen" "right" "left" "keys"; padding: 14px 10px 16px; gap: 14px; border-radius: 16px; }
  .screenbox { width: 100%; max-width: 360px; }
  .left { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .knob { width: 58px; }
  .knob .cap { width: 44px; height: 44px; }
  .btngrid { gap: 6px; }
  .btn { min-width: 0; font-size: 11px; }
  .btn .kb { display: none; }
  .keys { height: 120px; }
  .key .kl { display: none; }
  .key.w .pad { top: auto; bottom: 8px; font-size: 9px; }
  .key.b .pad { display: none; }
  .info { grid-template-columns: 1fr; }
}
