/* SPDX-License-Identifier: GPL-3.0-only */
/* DØG-5 simulator page (forked from OberVave's), in the DØG-5 brand: brand/brand.css (fonts, palette, the lockup) */
:root {
  --bg: var(--black);
  --panel: var(--plum);
  --panel2: var(--black);
  --line: var(--violet);
  --fg: var(--white);
  --dim: var(--olive);
  --cyan: var(--acid);          /* (the accent; the name is OberVave's) */
  --led: var(--red);            /* the FM-1's LEDs are red */
  --key-w: #FFFFFF;
  --key-b: #000000;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 300 18px/1.5 var(--body);
}
a { color: var(--cyan); }
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 var(--mono);
  text-align: center;
  color: var(--fg);
}

/* ---- header */
.top { max-width: 1280px; margin: 0 auto; padding: 20px 16px 8px; text-align: center; }
.notice { max-width: 760px; margin: 14px auto 4px; padding: 10px 14px; text-align: left; font-size: 17px; border: 2px solid var(--black);
  border-left: 6px solid var(--acid); background: var(--panel); box-shadow: 5px 5px 0 var(--violet); }
.tag { color: var(--fg); margin: 12px auto 4px; max-width: 640px; }
.links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.links a {
  padding: 8px 16px; border: 2px solid var(--line); text-decoration: none; color: var(--fg); font: 700 13px var(--mono);
  background: var(--black);
}
.links a.cta { border-color: var(--cyan); color: var(--cyan); }
.links a:hover { border-color: var(--cyan); }

main { max-width: 1280px; 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: #0A0A0A;
  border: 2px solid var(--black);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--violet), inset 0 1px 0 rgba(255, 255, 255, .05);
  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: 300px; 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: #000000; border: 6px solid #000000; border-radius: 10px;
  box-shadow: 0 0 0 2px var(--line), 0 0 30px rgba(222, 244, 2, .10);
}
.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(50, 4, 68, .85), rgba(0, 0, 0, .94) 70%);
  font: inherit;
}
.power .p1 {
  font: 700 17px var(--mono); padding: 10px 22px; border: 2px solid var(--black);
  color: var(--black); background: var(--acid); box-shadow: 4px 4px 0 var(--black);
}
.power .p2 { color: var(--glow); font: 400 12px var(--mono); padding: 0 10px; text-align: center; }
.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(--pink); }
.knob .cap.turning { box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 0 0 2px var(--cyan); }
.knob .lab { font: 700 10px/1.2 var(--mono); color: var(--olive); letter-spacing: .04em; white-space: nowrap; }

/* 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: 700 12px/1.15 var(--mono); letter-spacing: .02em;
  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(226, 13, 29, .6); }
.btn.down { transform: translateY(2px); box-shadow: 0 0 0 #0a0809, 0 0 0 1px var(--cyan); }
.btn.lit.down { box-shadow: 0 0 0 2px var(--led), 0 0 14px rgba(226, 13, 29, .6); }

/* 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, #E8E8E8, 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 var(--mono); color: var(--olive); }
.key.b .kl { color: #8a817b; }
.key .dot { width: 7px; height: 7px; border-radius: 50%; margin-bottom: 5px; background: transparent; }
.key.glow .dot { background: rgba(226, 13, 29, .35); }
.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; }

/* ---- the stage: the device, and beside it (wide) or under it the patch list; narrow (980 px and less), sim.js moves the list into
 * the device, above the keys, as its own scrolling box */
.stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; margin: 12px 0 24px; }
.stage .device { margin: 0; }
.patches { background: var(--panel); border: 2px solid var(--black); box-shadow: 5px 5px 0 var(--violet); padding: 12px 14px; }
.patches h2 { margin: 0 0 6px; font: 400 22px/1.2 var(--display); color: var(--yellow); }
.chap h3 { margin: 12px 0 5px; font: 700 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--olive); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 5px; }
.patch {
  display: flex; gap: 8px; align-items: baseline; min-height: 36px; padding: 6px 8px; text-align: left; cursor: pointer;
  border: 2px solid var(--line); background: var(--black); color: var(--fg); font: 400 12px/1.2 var(--mono);
}
.patch .no { font: 700 11px var(--mono); color: var(--olive); }
.patch:hover { border-color: var(--cyan); }
.patch.on { border-color: var(--black); background: var(--acid); color: var(--black); box-shadow: 3px 3px 0 var(--black); }
.patch.on .no { color: var(--black); }
.device .patches { grid-area: patches; max-height: 38vh; overflow-y: auto; overscroll-behavior: contain; padding: 8px 10px; }
.device .patches .patch { touch-action: manipulation; }   /* (the device's buttons take no gestures; this list scrolls) */
.device .patches .hint:empty { display: none; }
@media (min-width: 1240px) {
  .stage { grid-template-columns: minmax(0, 1fr) 270px; }
  .pgrid { grid-template-columns: 1fr 1fr; }
}

/* ---- info boxes */
.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.box { background: var(--panel); border: 2px solid var(--black); box-shadow: 5px 5px 0 var(--violet); padding: 14px 18px; }
.box h2 { margin: 0 0 8px; font: 400 22px/1.2 var(--display); color: var(--yellow); }
b, strong { font-weight: 600; }
.box ul { margin: 0; padding-left: 18px; }
.box li { margin: 4px 0; }
.box p { margin: 6px 0; }
.hint { color: var(--glow); font-size: 16px; }
.map { border-collapse: collapse; width: 100%; }
.map th { text-align: left; font: 700 12px var(--mono); color: var(--olive); 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: 2px solid var(--white); background: var(--black); color: var(--fg);
  font: 700 13px var(--mono); cursor: pointer;
}
.small:hover { border-color: var(--cyan); }
select {
  padding: 6px 8px; border: 2px solid var(--line); background: var(--black); color: var(--fg);
  font: 400 13px var(--mono); max-width: 100%;
}

footer { max-width: 1280px; margin: 0 auto; padding: 14px 16px 32px; color: var(--olive); font-size: 16px; text-align: center; border-top: 2px solid var(--violet); }

/* ---- 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" "patches patches" "keys keys"; }
  .screenbox { justify-self: center; }
}
@media (max-width: 640px) {
  .device { grid-template-columns: 1fr; grid-template-areas: "screen" "right" "left" "patches" "keys"; padding: 14px 10px 16px; gap: 14px; border-radius: 16px; }
  .screenbox { width: 100%; max-width: 360px; }
  .pgrid { grid-template-columns: 1fr 1fr; }
  .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; }
  .info { grid-template-columns: 1fr; }
}
body { overflow-x: hidden; }

/* ---- the voice card (Batch 28): under the patch list; on a narrow screen, under the device */
.toplinks { margin: 10px 0 4px; }
.vcard { margin: 14px 0 0; border: 2px solid var(--black); background: var(--panel); box-shadow: 5px 5px 0 var(--violet);
  border-left: 6px solid var(--acid); }
.vcard[hidden] { display: none; }
.vcard.pop { animation: vpop .28s ease-out; }
@keyframes vpop { from { transform: translateY(8px); opacity: .2; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vcard.pop { animation: none; } }
.vcard header { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px 6px; border-bottom: 1px solid var(--line); }
.vcard .vno { font: 700 22px/1 var(--mono); color: var(--acid); padding-top: 4px; }
.vcard .vhead { flex: 1; min-width: 0; }
.vcard h3 { margin: 0; font: 700 26px/1.15 var(--body); color: var(--ch, var(--fg)); }   /* the body face: the display face reads z as 3 */
.vcard .vchap { margin: 2px 0 0; font: 400 11px/1.3 var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.vcard .vclose { background: none; border: 2px solid var(--line); color: var(--fg); font: 700 18px/1 var(--mono); width: 32px; height: 32px;
  cursor: pointer; flex: none; }
.vcard .vclose:hover, .vcard .vclose:focus-visible { border-color: var(--acid); color: var(--acid); }
.vcard .vbody { padding: 4px 12px 8px; max-height: 420px; overflow: auto; font-size: 16px; line-height: 1.45; }
.vcard h4 { margin: 10px 0 4px; font: 700 11px/1.3 var(--mono); color: var(--yellow); text-transform: uppercase; letter-spacing: .05em; }
.vcard p { margin: 0 0 8px; }
.vcard ul { margin: 0 0 8px; padding-left: 18px; }
.vcard li { margin: 0 0 6px; }
.vcard code { font: 12px var(--mono); color: var(--glow); }
.vcard details { margin: 8px 0 4px; }
.vcard summary { cursor: pointer; font: 700 11px/1.6 var(--mono); color: var(--turq); text-transform: uppercase; letter-spacing: .05em; }
.vcard .vsmall { color: var(--dim); text-transform: none; letter-spacing: 0; font-weight: 400; }
.vcard .vfoot { margin: 0; padding: 6px 12px 10px; border-top: 1px solid var(--line); font-size: 14px; }
.vcard { margin: 0; }
.vcard .vbody { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 4px 22px; max-height: 360px; }
@media (min-width: 1240px) {
  .stage { grid-template-areas: "dev list" "card list"; }
  .stage > .device { grid-area: dev; } .stage > .vcard { grid-area: card; } .stage > .patches { grid-area: list; }
}
@media (max-width: 760px) { .vcard .vbody { grid-template-columns: minmax(0, 1fr); max-height: none; } }
@media (max-width: 980px) { .vcard { margin: 0 auto 20px; } }

/* Batch 30: the card in its chapter's colour, labels as in the manual */
.vcard { --ch: var(--acid); border-top: 4px solid var(--ch); }
.vcard[data-ch="1"] { --ch: var(--yellow); } .vcard[data-ch="2"] { --ch: var(--turq); }
.vcard[data-ch="3"] { --ch: var(--white); } .vcard[data-ch="4"] { --ch: var(--acid); }
.vcard .vno { align-self: center; padding: 4px 7px; font-size: 15px; color: var(--black); background: var(--ch); }
.vcard h4, .vcard summary { color: var(--ch); letter-spacing: .12em; }
.vcard li::marker { color: var(--violet); }
.vcard li strong { color: #fff; }
