/* Nodal · a small hardware instrument: anodised chassis, raised keys with LEDs,
   rotary knobs, a recessed black screen. Orange is reserved for play, record,
   the playhead and lit LEDs. */
:root {
  --desk: #c3c4bf;
  --chassis: #e4e4e0;
  --chassis-hi: #f3f3f0;
  --chassis-lo: #d2d2cd;
  --ink: #151515;
  --ink-2: #5a5a55;
  --ink-3: #8e8e88;
  --rule: rgba(0, 0, 0, 0.1);
  --key-top: #f7f7f4;
  --key-bot: #e0e0dc;
  --key-edge: #a6a6a0;
  --well: #0a0a0a;
  --orange: #ff4d00;
  --orange-lo: #c23a00;
  --focus: #2f62e8;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh; font: 14px/1.4 var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased;
  background: radial-gradient(120% 90% at 50% 0%, #d3d4cf 0%, var(--desk) 60%, #b4b5b0 100%);
  display: grid; place-items: center; padding: 18px;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--ink-3); }
.note { color: var(--ink-2); font-size: 12px; line-height: 1.45; margin: 8px 0 0; text-wrap: pretty; }
.label-sm { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- the device ---------- */
.device {
  position: relative; width: min(1520px, 100%); height: calc(100dvh - 36px); min-height: 540px;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 28vw, 410px); grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top" "screen side" "transport transport";
  gap: 14px 20px; padding: 16px 26px 18px; border-radius: 28px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, rgba(0,0,0,.018) 1px 3px),
    linear-gradient(180deg, var(--chassis-hi) 0%, var(--chassis) 40%, var(--chassis-lo) 100%);
  box-shadow:
    inset 0 1px 0 #fff, inset 0 -2px 0 rgba(0,0,0,.07), inset 0 0 0 1px rgba(0,0,0,.05),
    0 1px 1px rgba(0,0,0,.18), 0 8px 18px -6px rgba(0,0,0,.25), 0 40px 80px -30px rgba(0,0,0,.45);
}
.screw { position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fbfbf9, #b9b9b3 70%); box-shadow: inset 0 -1px 1px rgba(0,0,0,.25), 0 1px 0 #fff; }
.screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 5px; height: 1.5px; background: rgba(0,0,0,.35); transform: rotate(35deg); border-radius: 1px; }
.screw.tl { top: 9px; left: 9px; } .screw.tr { top: 9px; right: 9px; } .screw.bl { bottom: 9px; left: 9px; } .screw.br { bottom: 9px; right: 9px; }
.screw.tr::after { transform: rotate(-20deg); } .screw.bl::after { transform: rotate(80deg); }

/* ---------- top ---------- */
.top { grid-area: top; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.brand { display: flex; align-items: center; gap: 14px; }
.grille { width: 58px; height: 34px; border-radius: 6px;
  background: radial-gradient(circle, #2a2a2a 1.6px, transparent 2px) 0 0 / 7px 7px, linear-gradient(#d6d6d1, #e6e6e2);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.25), 0 1px 0 #fff; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark b { font-size: 24px; font-weight: 200; letter-spacing: -0.01em; }
.wordmark em { font-style: normal; font-size: 10px; color: var(--orange); letter-spacing: .2em; margin-top: 3px; }
.wordmark span { font-size: 9px; font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); margin-top: 3px; }
.lcd { min-width: 0; padding: 8px 14px; border-radius: 8px; background: linear-gradient(#151515, #070707);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 1px 0 #fff, 0 -1px 0 rgba(0,0,0,.15); color: #e9e9e4; }
.lcd-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcd-meta { font: 11px var(--mono); color: #8a8a85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.actions { display: flex; gap: 10px; }

/* ---------- keys ---------- */
.key {
  appearance: none; border: 0; position: relative; cursor: pointer; min-height: 40px; padding: 10px 14px 9px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
  border-radius: 8px; background: linear-gradient(var(--key-top), var(--key-bot));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 0 rgba(0,0,0,.05), 0 2px 0 var(--key-edge), 0 3px 1px rgba(0,0,0,.12), 0 5px 8px -2px rgba(0,0,0,.2);
  transition: transform .06s ease, box-shadow .06s ease; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.key .lbl { position: relative; }
.key small { display: block; font-size: 9px; letter-spacing: 0.1em; color: var(--ink-3); margin-top: 3px; font-weight: 600; }
.key:active:not(:disabled), .key[aria-checked="true"], .key[aria-pressed="true"], .key.on {
  transform: translateY(2px); background: linear-gradient(#ebebe7, #dcdcd7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 1px 3px rgba(0,0,0,.12), 0 0 0 var(--key-edge), 0 1px 1px rgba(0,0,0,.18);
}
.key:disabled { cursor: default; opacity: .45; }
.key .led, .mode .led { position: absolute; top: 6px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: #b8b8b2; box-shadow: inset 0 1px 1px rgba(0,0,0,.35); }
.key[aria-checked="true"] .led, .key[aria-pressed="true"] .led, .mode[aria-selected="true"] .led { background: var(--orange); box-shadow: 0 0 6px 1px rgba(255,77,0,.7), inset 0 0 1px #ffd0b8; }
.key.orange { color: #fff; background: linear-gradient(#ff6a26, var(--orange)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 0 var(--orange-lo), 0 3px 1px rgba(0,0,0,.15), 0 6px 10px -2px rgba(255,77,0,.45); }
.key.orange:active { box-shadow: inset 0 1px 3px rgba(0,0,0,.2), 0 0 0 var(--orange-lo); }
.key.round { width: 40px; padding: 0; border-radius: 50%; font-size: 15px; letter-spacing: 0; }
.key.small { min-height: 32px; padding: 7px 10px 6px; font-size: 9.5px; }
.keys { display: flex; gap: 8px; flex-wrap: wrap; }
.keys.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.keys.seg + .keys.seg, .keys.seg + .note, .palettes + .swatch-row { margin-top: 12px; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ---------- screen ---------- */
.screen-wrap { grid-area: screen; min-height: 0; min-width: 0; display: grid; place-items: center; overflow: hidden; padding-bottom: 6px; }
/* --sq is set from the space the screen actually has (see fitScreen in app.js) */
.bezel { width: var(--sq, 100%); max-width: 100%; aspect-ratio: 1; padding: 12px; border-radius: 20px;
  background: linear-gradient(160deg, #3a3a3a, #121212 45%, #050505);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -1px 0 rgba(0,0,0,.6), 0 1px 0 #fff, 0 -1px 0 rgba(0,0,0,.12), 0 10px 24px -10px rgba(0,0,0,.5); }
.screen { position: relative; width: 100%; height: 100%; container-type: inline-size; border-radius: 9px; overflow: hidden; background: #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#preview { object-fit: contain; background: #050505; }
.glass { position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(125deg, rgba(255,255,255,.075) 0%, rgba(255,255,255,.02) 28%, transparent 42%), radial-gradient(120% 120% at 50% 50%, transparent 62%, rgba(0,0,0,.4) 100%);
  box-shadow: inset 0 0 18px rgba(0,0,0,.6); }
.hud { position: absolute; left: 14px; right: 14px; top: 11px; display: flex; justify-content: space-between; gap: 12px; pointer-events: none;
  font: 10.5px var(--mono); letter-spacing: .04em; color: rgba(235,235,230,.6); text-transform: uppercase; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: clamp(18px, 5cqw, 44px);
  color: #f2f2ee; background: linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,.8) 55%); }
.empty h1 { margin: 0; font-size: clamp(30px, 7cqw, 68px); line-height: .95; letter-spacing: -0.035em; text-wrap: balance; }
.empty p { margin: 0; max-width: 34em; color: rgba(242,242,238,.72); text-wrap: pretty; }
.empty .fine { font-size: 12px; color: rgba(242,242,238,.5); }
.hud-tag { font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: rgba(242,242,238,.5); }
.empty .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- side ---------- */
.side { grid-area: side; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.modes-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode { appearance: none; border: 0; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 70px; border-radius: 12px; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  background: linear-gradient(#f8f8f5, #dededa);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 var(--key-edge), 0 4px 2px rgba(0,0,0,.12), 0 8px 12px -4px rgba(0,0,0,.25);
  transition: transform .06s, box-shadow .06s; }
.mode svg { width: 22px; height: 22px; }
.mode[aria-selected="true"] { transform: translateY(3px); background: linear-gradient(#232323, #111); color: #f2f2ee;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 2px 5px rgba(0,0,0,.5), 0 0 0 var(--key-edge), 0 1px 1px rgba(0,0,0,.2); }
.mode:disabled { opacity: .45; cursor: default; }
.pane { flex: 1; min-height: 0; overflow: auto; padding: 2px 4px 8px; margin: 0 -4px; scrollbar-width: thin; }
.block { padding: 14px 0 16px; border-top: 1px solid var(--rule); }
.block:first-child { border-top: 0; padding-top: 4px; }
.label { display: flex; align-items: baseline; gap: 8px; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
.label b { font: 600 10px var(--mono); letter-spacing: 0; padding: 2px 4px; border-radius: 3px; background: var(--ink); color: var(--chassis-hi); }
.label .dim { margin-left: auto; font-weight: 600; letter-spacing: .08em; }

#disc { width: 100%; height: 210px; display: block; }
.picture { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: start; }
.tile-well { padding: 6px; border-radius: 8px; background: var(--well); box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 1px 0 #fff; }
#tile { width: 80px; height: 80px; display: block; image-rendering: pixelated; border-radius: 3px; }
.big { font-size: 15px; margin-top: 2px; }
.shapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.shapes li { display: grid; grid-template-columns: 26px 56px 50px 1fr; gap: 10px; align-items: center; font-size: 12px; }
.shapes li.note { display: block; }
.shapes img { width: 26px; height: 26px; border-radius: 4px; display: block; box-shadow: 0 1px 0 #fff; }
.shapes .hz { color: var(--ink-2); text-align: right; }
.shapes .meter { height: 6px; border-radius: 3px; background: rgba(0,0,0,.08); box-shadow: inset 0 1px 1px rgba(0,0,0,.15); overflow: hidden; }
.shapes .meter i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

.fid-row { display: flex; align-items: flex-end; gap: 14px; }
.fid-val { font: 600 34px/1 var(--mono); letter-spacing: -.03em; }
.fid-val small { font-size: 13px; margin-left: 4px; color: var(--ink-2); }
.fid-sub { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--ink-2); padding-bottom: 3px; }
.scale { position: relative; height: 34px; margin-top: 26px; }
.scale .tick.up span { top: -16px; }
.scale .axis { position: absolute; left: 0; right: 0; top: 8px; height: 6px; border-radius: 3px; background: rgba(0,0,0,.09); box-shadow: inset 0 1px 1px rgba(0,0,0,.15); }
.scale .tick { position: absolute; top: 4px; width: 1px; height: 14px; background: var(--ink-3); }
.scale .tick span { position: absolute; top: 17px; left: 50%; transform: translateX(-50%); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.scale .mark { position: absolute; top: 3px; width: 6px; height: 16px; margin-left: -3px; border-radius: 2px; background: var(--ink-3); }
.scale .mark.hot { background: var(--orange); box-shadow: 0 0 6px rgba(255,77,0,.6); }

/* look */
.carts { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.cart { appearance: none; border: 0; cursor: pointer; position: relative; padding: 5px 5px 7px; border-radius: 9px;
  background: linear-gradient(#f7f7f4, #dededa); box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--key-edge), 0 4px 6px -2px rgba(0,0,0,.22);
  display: flex; flex-direction: column; gap: 5px; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; transition: transform .06s; }
.cart canvas { width: 100%; aspect-ratio: 1; display: block; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.cart[aria-checked="true"] { transform: translateY(2px); box-shadow: inset 0 1px 3px rgba(0,0,0,.15), 0 0 0 var(--key-edge), 0 1px 1px rgba(0,0,0,.2); }
.cart[aria-checked="true"]::after { content: ""; position: absolute; top: 9px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 6px 1px rgba(255,77,0,.8); }
.palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.palettes.off { opacity: .4; }
.pal { appearance: none; border: 0; cursor: pointer; height: 30px; border-radius: 6px; position: relative; display: flex; align-items: flex-end; padding: 0 7px 4px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 1px 0 #fff; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.pal[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 2px var(--chassis), 0 0 0 3.5px var(--ink); }
.swatch-row { display: flex; align-items: center; justify-content: space-between; }
.swatch-row input { width: 46px; height: 30px; border: 0; padding: 0; border-radius: 6px; background: none; cursor: pointer; }

/* knobs */
.knobs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 14px; }
.knob { display: flex; flex-direction: column; align-items: center; gap: 7px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: ns-resize; border-radius: 10px; padding: 4px 0; }
.dial { --v: .5; position: relative; width: 52px; height: 52px; border-radius: 50%; margin: 6px; }
.dial::before { content: ""; position: absolute; inset: -7px; border-radius: 50%;
  background: conic-gradient(from 225deg, var(--ink) 0 calc(var(--v) * 270deg), rgba(0,0,0,.14) 0 270deg, transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 30px, #000 31px, #000 33px, transparent 34px); mask: radial-gradient(circle, transparent 30px, #000 31px, #000 33px, transparent 34px); }
.dial .body { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #fbfbf9, #d4d4cf 62%, #b0b0aa);
  box-shadow: 0 3px 0 #96968f, 0 5px 3px rgba(0,0,0,.15), 0 10px 14px -4px rgba(0,0,0,.35), inset 0 -2px 3px rgba(0,0,0,.12); }
.dial .cap { position: absolute; inset: 8px; border-radius: 50%; background: var(--cap, #f2f2ee); transform: rotate(calc(-135deg + var(--v) * 270deg));
  box-shadow: inset 0 2px 2px rgba(255,255,255,.45), inset 0 -3px 4px rgba(0,0,0,.25), 0 1px 1px rgba(0,0,0,.25); }
.dial .cap::after { content: ""; position: absolute; left: 50%; top: 3px; width: 3px; height: 10px; margin-left: -1.5px; border-radius: 2px; background: rgba(0,0,0,.72); }
.dial.dark-cap .cap::after { background: rgba(255,255,255,.9); }
.knob .k-name { font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.knob .k-val { font: 10.5px var(--mono); color: var(--ink-2); margin-top: -4px; }

/* export */
.clip { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.clip-time { padding: 6px 10px; border-radius: 7px; background: var(--well); color: #eee; box-shadow: inset 0 2px 3px rgba(0,0,0,.6), 0 1px 0 #fff; }
.clip-time .label-sm { color: #7c7c77; display: block; font-size: 8.5px; }
.clip-time b { font-size: 15px; color: var(--orange); font-weight: 500; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field input { font: 13px var(--sans); padding: 8px 10px; border: 0; border-radius: 7px; color: var(--ink); background: #f8f8f6; box-shadow: inset 0 1px 3px rgba(0,0,0,.2), 0 1px 0 #fff; min-width: 0; }
.toggles { display: flex; gap: 14px; margin: 12px 0; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { width: 30px; height: 16px; border-radius: 9px; position: relative; background: #c9c9c4; box-shadow: inset 0 1px 3px rgba(0,0,0,.3); transition: background .12s; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(#fff, #ddd); box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .12s; }
.toggle input:checked + i { background: var(--ink); }
.toggle input:checked + i::after { transform: translateX(14px); }
.toggle input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 2px; }
.out-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.big-key { appearance: none; border: 0; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 12px 11px; min-height: 92px; border-radius: 12px; text-align: left;
  background: linear-gradient(#f8f8f5, #dededa); box-shadow: inset 0 1px 0 #fff, 0 3px 0 var(--key-edge), 0 4px 2px rgba(0,0,0,.12), 0 8px 12px -4px rgba(0,0,0,.25); transition: transform .06s, box-shadow .06s; }
.big-key svg { width: 22px; height: 22px; margin-bottom: auto; }
.big-key b { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-top: 10px; }
.big-key span { font-size: 10px; color: var(--ink-3); letter-spacing: .04em; }
.big-key:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 1px 3px rgba(0,0,0,.15), 0 0 0 var(--key-edge), 0 1px 1px rgba(0,0,0,.2); }
.big-key:disabled { opacity: .45; cursor: default; }
.big-key.song { background: linear-gradient(#2a2a2a, #121212); color: #f2f2ee; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 3px 0 #000, 0 4px 2px rgba(0,0,0,.2), 0 8px 12px -4px rgba(0,0,0,.4); }
.big-key.song span { color: #8d8d88; }
.rec-dot { width: 18px; height: 18px; border-radius: 50%; margin-bottom: auto; background: radial-gradient(circle at 40% 35%, #ff8a50, var(--orange) 55%, var(--orange-lo)); box-shadow: 0 0 0 3px rgba(255,77,0,.15); }
.more { margin-top: 12px; }
.more summary { cursor: pointer; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); padding: 6px 0; }
.files { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.file { appearance: none; border: 0; cursor: pointer; text-align: left; padding: 9px 11px; border-radius: 8px; display: flex; flex-direction: column; gap: 1px;
  background: rgba(255,255,255,.45); box-shadow: inset 0 0 0 1px var(--rule); }
.file b { font-size: 12px; } .file span { font-size: 10.5px; color: var(--ink-2); }
.file:active { background: rgba(0,0,0,.05); }

/* ---------- transport ---------- */
.transport { grid-area: transport; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.play { appearance: none; border: 0; cursor: pointer; width: 64px; height: 64px; margin: 6px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 45% 30%, #ff8c55, var(--orange) 50%, #d83f00);
  box-shadow: inset 0 2px 2px rgba(255,255,255,.4), inset 0 -3px 5px rgba(0,0,0,.2), 0 0 0 5px #d9d9d4, 0 0 0 6px rgba(0,0,0,.12), 0 4px 0 6px #b4b4ae, 0 12px 18px 2px rgba(0,0,0,.25);
  transition: transform .06s, box-shadow .06s; touch-action: manipulation; }
.play:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 5px rgba(0,0,0,.25), 0 0 0 5px #d9d9d4, 0 0 0 6px rgba(0,0,0,.12), 0 2px 0 6px #b4b4ae, 0 4px 8px 2px rgba(0,0,0,.25); }
.play:disabled { filter: grayscale(1) brightness(1.15); opacity: .55; cursor: default; }
.play svg { width: 24px; height: 24px; }
.src { flex-wrap: nowrap; }
.tl-well, .clock-well { padding: 6px; border-radius: 10px; background: var(--well); box-shadow: inset 0 2px 5px rgba(0,0,0,.7), 0 1px 0 #fff, 0 -1px 0 rgba(0,0,0,.1); }
#timeline { width: 100%; height: 50px; display: block; cursor: pointer; touch-action: none; }
.clock { width: 150px; height: 35px; display: block; }

/* ---------- dialogs & overlays ---------- */
#how { border: 0; border-radius: 18px; padding: 26px 28px; max-width: 580px; color: var(--ink);
  background: linear-gradient(var(--chassis-hi), var(--chassis)); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5), inset 0 1px 0 #fff; }
#how::backdrop { background: rgba(30,30,28,.4); backdrop-filter: blur(3px); }
#how ol { padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; }
.busy { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(30,30,28,.3); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.busy-card { width: min(380px, calc(100% - 32px)); padding: 18px 20px; border-radius: 14px; background: linear-gradient(#1b1b1b, #0c0c0c); color: #eee;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 30px 60px -20px rgba(0,0,0,.6); display: grid; gap: 10px; }
.busy-card .label-sm { color: #7d7d78; }
.busy-stage { font-size: 14px; min-height: 1.4em; }
.meter-dots { --p: 0; height: 8px;
  background: linear-gradient(90deg, var(--orange) calc(var(--p) * 100%), #333 0);
  -webkit-mask: radial-gradient(circle 3px, #000 95%, transparent) 0 0 / 9px 8px repeat-x; mask: radial-gradient(circle 3px, #000 95%, transparent) 0 0 / 9px 8px repeat-x; }
.busy-card .key { justify-self: start; }
.busy.exporting { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; place-items: end center; padding-bottom: 28px; pointer-events: none; }
.busy.exporting .busy-card { pointer-events: auto; }
.drop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(255,77,0,.12); border: 3px dashed var(--orange); pointer-events: none; }
.drop div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 26px; border-radius: 14px; background: var(--ink); color: #fff; }
.drop b { font-size: 18px; }
.drop .label-sm { color: #999; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 50; max-width: min(560px, calc(100% - 32px)); padding: 11px 16px; border-radius: 10px;
  background: #151515; color: #f0f0ec; font-size: 13px; box-shadow: 0 14px 30px -10px rgba(0,0,0,.5); }
.toast.bad { background: #3a0f00; box-shadow: 0 0 0 1px var(--orange), 0 14px 30px -10px rgba(0,0,0,.5); }

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) {
  .transport { grid-template-columns: auto minmax(0, 1fr) auto; }
  .src { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 860px) {
  body { padding: 0; display: block; }
  .device { height: auto; min-height: 100dvh; border-radius: 0; padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto; grid-template-areas: "top" "screen" "transport" "side"; gap: 14px; }
  .screw { display: none; }
  .top { grid-template-columns: auto 1fr; gap: 10px 12px; }
  .lcd { grid-column: 1 / -1; grid-row: 2; }
  .actions { justify-self: end; }
  .grille { width: 40px; height: 28px; }
  .screen-wrap { overflow: visible; padding-bottom: 0; }
  .bezel { width: 100%; padding: 8px; }
  .transport { grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; }
  .tl-well { grid-column: 1 / -1; grid-row: 2; }
  .src { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(3, 1fr); }
  .clock-well { justify-self: end; }
  .play { width: 58px; height: 58px; }
  .side { gap: 12px; }
  .modes-keys { position: sticky; top: 0; z-index: 5; padding: 10px 0 12px; margin: -10px 0 0; background: linear-gradient(var(--chassis) 82%, transparent); }
  .mode { height: 58px; }
  .pane { overflow: visible; }
  .dial { width: 46px; height: 46px; }
  .dial::before { -webkit-mask: radial-gradient(circle, transparent 26px, #000 27px, #000 29px, transparent 30px); mask: radial-gradient(circle, transparent 26px, #000 27px, #000 29px, transparent 30px); }
  .out-keys { gap: 8px; }
  .big-key { min-height: 84px; padding: 10px; }
  .clip { grid-template-columns: 1fr 1fr; }
  .key { min-height: 44px; }
  .key.small { min-height: 38px; }
  .key.round { width: 44px; }
}
@media (max-width: 400px) {
  .wordmark span { display: none; }
  .knobs { grid-template-columns: repeat(3, 1fr); row-gap: 10px; }
  .out-keys { grid-template-columns: 1fr 1fr; }
  .big-key.song { grid-column: 1 / -1; min-height: 70px; }
}

/* ---------- the device: small physical touches ---------- */
.key.dark { color: #ecece8; background: linear-gradient(#3a3a3a, #232323);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 2px 0 #0e0e0e, 0 3px 1px rgba(0,0,0,.15), 0 5px 8px -2px rgba(0,0,0,.3); }
.key.dark:active:not(:disabled) { background: linear-gradient(#2c2c2c, #1d1d1d); box-shadow: inset 0 1px 3px rgba(0,0,0,.5), 0 0 0 #0e0e0e; }
.key svg { width: 16px; height: 16px; display: block; }
#btn-eject { padding: 0 13px; }
.dev-ports { position: absolute; top: -15px; left: 64px; height: 15px; font-size: 8.5px; z-index: 0; }
.wordmark { gap: 0; }

/* the listen overlay, over the live plate */
.listen { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: clamp(18px, 5cqw, 44px);
  color: #f2f2ee; background: linear-gradient(transparent 35%, rgba(0,0,0,.82)); }
.listen .hud-tag { display: flex; align-items: center; gap: 8px; }
.rec-led { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 8px 2px rgba(255,77,0,.7); animation: blink 1s steps(2, jump-none) infinite; }
.listen-time { font-size: clamp(34px, 8cqw, 64px); line-height: 1; letter-spacing: -.03em; color: var(--orange); }
.listen p { margin: 0; max-width: 34em; color: rgba(242,242,238,.72); text-wrap: pretty; }
.listen .row { display: flex; gap: 10px; flex-wrap: wrap; }
.vu { --l: 0; height: 10px; max-width: 420px;
  background: linear-gradient(90deg, #f2f2ee calc(var(--l) * 75%), var(--orange) calc(var(--l) * 75%) calc(var(--l) * 100%), #2b2b2b 0);
  -webkit-mask: linear-gradient(90deg, #000 70%, transparent 0) 0 0 / 10px 100%; mask: linear-gradient(90deg, #000 70%, transparent 0) 0 0 / 10px 100%; }

/* busy: a small record that turns */
.busy-top { display: flex; align-items: center; gap: 10px; }
.busy-disc { width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, var(--orange) 0 3px, #0b0b0b 3.5px 4.5px, transparent 5px), repeating-radial-gradient(circle, #1d1d1d 0 1px, #2c2c2c 1px 2px);
  box-shadow: 0 0 0 1px #3a3a3a; position: relative; animation: spin 1.6s linear infinite; }
.busy-disc::after { content: ""; position: absolute; left: 50%; top: 2px; width: 1.5px; height: 6px; background: #8a8a86; }

/* shared parts: port tabs, square keys, dot-matrix readout */
.ports { display: flex; align-items: flex-end; gap: 4px; padding: 0 14px; height: 1.9em; text-transform: uppercase; letter-spacing: .05em; }
.ports span { padding: .45em 1em .35em; line-height: 1; background: #efefec; color: #8b8b87; border-radius: 3px 3px 0 0; box-shadow: inset 0 1px 0 #fff; }
.ports .o { background: var(--orange); color: #fff; box-shadow: none; }
.ports .k { background: #1d1d1d; color: #9a9a96; box-shadow: none; margin-right: auto; }
.ports .g { background: #a2a29f; color: #f0f0ec; box-shadow: none; }
.ports .pled { width: .7em; height: 1.1em; margin-left: .6em; align-self: center; background: var(--orange); box-shadow: 0 0 6px rgba(255,77,0,.8); animation: breathe 3.2s ease-in-out infinite; }
.ro-tags { display: flex; gap: .35em; flex-wrap: wrap; }
.ro-tags span { font-size: .85em; line-height: 1; text-transform: uppercase; padding: .3em .5em .25em; background: #e9e9e5; color: #111; border-radius: .15em; }
.ro-tags .o { background: var(--orange); color: #fff; }
.ro-big { min-height: 6em; display: flex; align-items: center; }
.ro-big svg { width: 100%; height: auto; max-height: 6em; display: block; color: #f4f4f0; }
.ro-unit { display: flex; justify-content: space-between; gap: .5em; font: 1em var(--mono); text-transform: uppercase; color: #8b8b86; }
.ro-meter { display: grid; grid-template-columns: repeat(8, 1fr); gap: .3em; height: 4.4em; align-items: end; margin-top: auto; }
.ro-meter i { height: calc(8% + var(--h, 0) * 92%); background: #3a3a3a; border-radius: .1em; transition: height .12s linear; }
.ro-meter i.on { background: var(--orange); box-shadow: 0 0 .6em rgba(255,77,0,.5); }
.ro-icons { display: flex; gap: .8em; align-items: center; }
.ro-icons i { width: 1.2em; height: 1.2em; display: block; background: #e9e9e5; }
.ro-icons .ic-rec { border-radius: 50%; background: var(--orange); }
.ro-icons .ic-play { clip-path: polygon(10% 0, 100% 50%, 10% 100%); }
.ro-icons .ic-grid { background: repeating-linear-gradient(90deg, #e9e9e5 0 .25em, transparent .25em .45em); }
.ro-icons .ic-wave { background: none; border-bottom: .2em solid #e9e9e5; border-radius: 0 0 50% 50%; height: .8em; }
.pk { appearance: none; border: 0; cursor: pointer; position: relative; aspect-ratio: 1; padding: .55em .6em; border-radius: .45em; font: inherit; font-size: 1em;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left; text-transform: uppercase; touch-action: manipulation;
  color: #dcdcd8; background: linear-gradient(#3c3c3c, #252525);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 .32em 0 #111, 0 .55em .7em rgba(0,0,0,.35);
  transition: transform .07s ease, box-shadow .07s ease, filter .2s; -webkit-user-select: none; user-select: none; }
.pk b { font-weight: 300; font-size: 1.45em; line-height: 1; }
.pk span, .pk small { font-size: .78em; letter-spacing: .04em; line-height: 1; }
.pk small { color: #8f8f8a; }
.pk.white { color: #232323; background: linear-gradient(#f7f7f4, #dcdcd8); box-shadow: inset 0 1px 0 #fff, 0 .32em 0 #9a9a96, 0 .55em .7em rgba(0,0,0,.3); }
.pk.orange { color: #fff; background: linear-gradient(#ff6d2e, #f04800); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 .32em 0 #a83300, 0 .55em .9em rgba(255,77,0,.4); }
.pk.grey { color: #f0f0ec; background: linear-gradient(#7d7d7a, #616160); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 .32em 0 #3b3b3a, 0 .55em .7em rgba(0,0,0,.3); }
.pk:hover { filter: brightness(1.06); }
.pk:active, .pk.down { transform: translateY(.28em); box-shadow: inset 0 .1em .25em rgba(0,0,0,.35), 0 .04em 0 #111, 0 .1em .2em rgba(0,0,0,.3); }
.pk .pled { position: absolute; left: 50%; bottom: -1.15em; width: .5em; height: .5em; margin-left: -.25em; border-radius: 50%; background: #8d8d89; box-shadow: inset 0 1px 1px rgba(0,0,0,.3); transition: background .15s, box-shadow .15s; }
.pk.lit .pled { background: var(--orange); box-shadow: 0 0 .5em .1em rgba(255,77,0,.8); }

/* ======================= the SR-1: the whole site is the instrument =======================
   K.O.-style: a grey anodised body, a white faceplate with a dot grille, one
   black display band, dark square keys with tiny labels and orange LEDs. */
:root { --body-hi: #d8d8d5; --body: #cbcbc8; --body-lo: #bcbcb9; --face: #f3f3f1; --hair: rgba(0,0,0,.12); }
body { background: radial-gradient(130% 100% at 50% 0%, #e4e4e1 0%, #d6d6d3 55%, #c7c7c3 100%); }
.device { border-radius: 10px; padding: 18px 22px 12px; grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "top top" "screen side" "transport side" "silk silk"; gap: 14px 18px;
  background: linear-gradient(180deg, var(--body-hi) 0%, var(--body) 45%, var(--body-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(0,0,0,.08), 0 1px 1px rgba(0,0,0,.18), 0 30px 60px -24px rgba(0,0,0,.45); }
.screw { display: none; }
.dev-ports { position: absolute; top: -15px; left: 60px; right: 60px; height: 15px; font-size: 8.5px; padding: 0; }

/* faceplate */
.top { grid-template-columns: minmax(0, 1fr) clamp(110px, 12vw, 170px); gap: 0; align-items: stretch; border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.6), 0 0 0 1px rgba(0,0,0,.06); }
.faceplate { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 12px 18px; background: linear-gradient(#f7f7f5, #ecece9); }
.top > .grille { width: auto; height: auto; border-radius: 0; background: radial-gradient(circle, #2c2c2c 2.6px, transparent 3px) 4px 4px / 9px 9px, linear-gradient(#aaaaa7, #989895); box-shadow: inset 0 2px 3px rgba(0,0,0,.15); }
.wordmark { margin: 0; font-weight: 400; display: grid; grid-template-columns: auto auto; column-gap: 12px; align-items: end; }
.wordmark b { grid-row: span 2; font-size: 40px; font-weight: 200; line-height: .9; letter-spacing: -.02em; color: #262626; }
.wordmark em { margin: 0; font-size: 11px; }
.wordmark span { margin: 0; font-size: 9px; }
.lcd { border-radius: 4px; }
.actions .key { min-height: 36px; }

/* keys: rounded squares, flatter, like the K.O. */
.key { border-radius: 5px; }
.key.round { border-radius: 50%; }
.mode { height: 64px; border-radius: 7px; color: #e9e9e5; background: linear-gradient(#3b3b3b, #262626);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 3px 0 #111, 0 5px 8px -2px rgba(0,0,0,.35); }
.mode[aria-selected="true"] { color: var(--ink); background: linear-gradient(#f4f4f1, #dcdcd8); box-shadow: inset 0 1px 3px rgba(0,0,0,.18), 0 0 0 #111, 0 1px 1px rgba(0,0,0,.2); }
.mode .led { background: #5a5a57; }
.modes-keys { grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mode svg { width: 20px; height: 20px; }

/* the display band: plate + readout in one black window */
.screen-wrap { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 12px; border-radius: 6px; overflow: hidden;
  background: #0b0b0b; box-shadow: inset 0 2px 8px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.55); }
.bezel { flex: none; width: var(--sq, 100%); padding: 0; border-radius: 3px; background: #000; box-shadow: 0 0 0 1px rgba(255,255,255,.05); }
.screen { border-radius: 3px; }
.readout { flex: none; width: var(--ro, 0px); align-self: stretch; display: flex; flex-direction: column; gap: 1em; padding: .4em 0; color: #f2f2ee; font-size: 10px; min-width: 0; }
.readout[hidden] { display: none !important; }
.ro-big { min-height: 0; }
.ro-big svg { max-height: 7em; }
.ro-unit span:last-child { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro-meter { height: 6em; }
.empty { inset: auto 0 0 0; padding: 12px 14px; background: none; display: block; }
.empty .hud-tag { color: rgba(242,242,238,.45); }

/* transport: the big orange key */
.play { width: 62px; height: 62px; margin: 0 6px 4px; border-radius: 9px; background: linear-gradient(#ff6d2e, #f04800);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 0 #a83300, 0 8px 14px -4px rgba(255,77,0,.5); }
.play:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 0 #a83300; }
.transport { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.tl-well, .clock-well { border-radius: 5px; }

/* the silkscreen strip along the bottom edge */
.silk { grid-area: silk; display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: #6e6e6a; padding: 2px 2px 0; }
.silk a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.silk a:hover { color: var(--orange); border-bottom-color: currentColor; }
.silk .credit { margin-left: auto; text-transform: none; letter-spacing: .02em; }

/* home: the keypad */
.keypad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 12px; font-size: 11px; padding: 2px 2px 14px; }
.keypad .pk { aspect-ratio: 1.1; }
.legend { margin: 6px 0 0; display: grid; gap: 4px; font-size: 11.5px; }
.legend div { display: flex; gap: 10px; }
.legend dt { font: 600 10px var(--mono); width: 16px; color: var(--orange); }
.legend dd { margin: 0; color: var(--ink-2); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
a.key { text-decoration: none; display: inline-flex; align-items: center; }

/* make: the step sequencer */
.seq { --cell: 1fr; display: grid; grid-template-columns: 40px repeat(16, minmax(0, 1fr)); gap: 3px; touch-action: none; user-select: none; -webkit-user-select: none; }
.seq .rl { font: 600 8.5px/1 var(--mono); text-transform: uppercase; color: var(--ink-2); align-self: center; white-space: nowrap; overflow: hidden; }
.seq .rl.note { color: var(--ink-3); }
.seq .cell { appearance: none; border: 0; padding: 0; min-width: 0; aspect-ratio: 1; border-radius: 3px; cursor: pointer;
  background: linear-gradient(#3a3a3a, #2a2a2a); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 0 rgba(0,0,0,.4); transition: background .08s; }
.seq .cell.beat { background: linear-gradient(#4a4a4a, #363636); }
.seq .cell[aria-pressed="true"] { background: linear-gradient(#ff6d2e, #f04800); box-shadow: 0 0 6px rgba(255,77,0,.45); }
.seq .cell.drum[aria-pressed="true"] { background: linear-gradient(#fafaf7, #dcdcd8); box-shadow: 0 0 4px rgba(255,255,255,.4); }
.seq .cell.now { outline: 2px solid rgba(255,255,255,.85); outline-offset: -1px; }
.seq .gap { grid-column: 1 / -1; height: 4px; }
.knobs-3 { grid-template-columns: repeat(3, 1fr); }
.out-keys.two { grid-template-columns: 1fr 1fr; margin-top: 12px; }
#jam-voice, #jam-scale { margin-top: 10px; }

/* listen */
.listen-pick h2 { margin: 0; font-size: clamp(24px, 5cqw, 44px); line-height: 1; letter-spacing: -.03em; }
.listen-pick, .listen-rec { display: flex; flex-direction: column; gap: 12px; }
.listen-src { font: 11px var(--mono); color: rgba(242,242,238,.55); }
.listen-warn { color: #ffb38f; font-size: 13px; }

@keyframes deviceIn { from { opacity: 0; transform: translateY(26px) scale(.965); } to { opacity: 1; transform: none; } }
@keyframes crt { 0% { filter: brightness(0); clip-path: inset(50% 0 50% 0); } 30% { filter: brightness(3); clip-path: inset(49.4% 0 49.4% 0); } 55% { filter: brightness(1.6); clip-path: inset(0); } 100% { filter: none; clip-path: inset(0); } }
@keyframes ledBoot { from { background: var(--orange); box-shadow: 0 0 8px 2px rgba(255,77,0,.8); } }
@keyframes paneIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(var(--tx, 0), 10px) scale(.98); } to { opacity: 1; transform: translate(var(--tx, 0), 0); } }
@keyframes blink { 50% { opacity: .15; } }
@keyframes breathe { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }

.device.power { animation: deviceIn .9s cubic-bezier(.2, .8, .2, 1) both; }
.device.power .screen { animation: crt 1s .35s both; }
.device.power .mode .led { animation: ledBoot .5s steps(2, jump-none) both; }
.device.power .mode:nth-child(1) .led { animation-delay: .6s; }
.device.power .mode:nth-child(2) .led { animation-delay: .7s; }
.device.power .mode:nth-child(3) .led { animation-delay: .8s; }
.device.power .mode:nth-child(4) .led { animation-delay: .9s; }
.device.power .mode:nth-child(5) .led { animation-delay: 1s; }
.device.power .keypad .pk { animation: keyIn .45s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(.5s + var(--k, 0) * 35ms); }
.pane:not([hidden]) { animation: paneIn .28s cubic-bezier(.2, .8, .2, 1) both; }
.toast:not([hidden]) { animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2) both; }
.busy:not([hidden]) .busy-card { animation: toastIn .25s cubic-bezier(.2, .9, .3, 1.2) both; }
.toast { --tx: -50%; }
@keyframes keyIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .silk .credit { margin-left: 0; }
}
@media (max-width: 860px) {
  .dev-ports { display: none; }
  .device { border-radius: 0; padding: max(14px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); grid-template-areas: "top" "screen" "transport" "side" "silk"; grid-template-rows: auto; }
  .top { grid-template-columns: minmax(0, 1fr); }
  .top > .grille { display: none; }
  .wordmark { grid-template-columns: auto; }
  .wordmark b { grid-row: auto; }
  .wordmark span { display: none; }
  .hud { font-size: 9.5px; gap: 8px; }
  .hud span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .faceplate { grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; padding: 10px 12px; }
  .faceplate .lcd { grid-column: 1 / -1; grid-row: 2; }
  .faceplate .actions { justify-self: end; }
  .wordmark b { font-size: 30px; }
  .screen-wrap { flex-direction: column; gap: 10px; padding: 8px; overflow: visible; }
  .bezel { width: 100%; }
  .readout { width: 100%; flex-direction: row; align-items: center; gap: 12px; padding: 0 4px 2px; font-size: 8px; }
  .readout .ro-tags, .readout .ro-icons { display: none; }
  .readout .ro-big { width: 34%; }
  .readout .ro-unit { flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .readout .ro-meter { width: 30%; height: 4em; margin: 0; }
  .modes-keys { grid-template-columns: repeat(5, 1fr); gap: 6px; background: linear-gradient(var(--body) 82%, transparent); }
  .mode { height: 54px; font-size: 9px; letter-spacing: .08em; }
  .silk { justify-content: center; text-align: center; }
  .silk .credit { width: 100%; text-align: center; }
  .seq { grid-template-columns: 34px repeat(16, minmax(0, 1fr)); gap: 2px; }
}
@media (max-width: 400px) {
  .keypad { gap: 18px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ======================= physical finish =======================
   A molded body with a visible side wall, anodised grain, glossy glass over
   every display, and domed key caps. */
.device {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 180px 180px,
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--body-hi) 0%, var(--body) 45%, var(--body-lo) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 0 rgba(0,0,0,.14), inset 1px 0 0 rgba(255,255,255,.4), inset -1px 0 0 rgba(0,0,0,.06),
    0 1px 0 #b7b7b3, 0 2px 0 #b0b0ac, 0 3px 0 #a9a9a5, 0 4px 0 #a2a29e, 0 5px 0 #9b9b97, 0 6px 0 #93938f, 0 7px 0 #8b8b87,
    0 9px 3px rgba(0,0,0,.2), 0 20px 26px -8px rgba(0,0,0,.3), 0 56px 80px -34px rgba(0,0,0,.55);
}
.faceplate { background: linear-gradient(#fbfbf9, #ebebe8); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0,0,0,.07); }
.top > .grille { box-shadow: inset 0 3px 5px rgba(0,0,0,.22), inset 0 -1px 0 rgba(255,255,255,.3); }

/* glass: a recessed window with a gloss reflection */
.screen-wrap, .lcd, .tl-well, .clock-well { position: relative; }
.screen-wrap { box-shadow: inset 0 3px 10px rgba(0,0,0,.95), 0 1px 0 rgba(255,255,255,.75), 0 -1px 0 rgba(0,0,0,.25), 0 0 0 3px rgba(0,0,0,.06); }
.screen-wrap::after, .lcd::after, .tl-well::after, .clock-well::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 4;
  background:
    linear-gradient(168deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.045) 24%, rgba(255,255,255,0) 24.3%),
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,0) 7%),
    radial-gradient(120% 70% at 50% 125%, rgba(255,255,255,.05), transparent 60%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 1px rgba(255,255,255,.05);
}
.lcd::after, .tl-well::after, .clock-well::after {
  background: linear-gradient(165deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.05) 38%, rgba(255,255,255,0) 38.5%), linear-gradient(180deg, rgba(255,255,255,.1), transparent 30%);
}

/* domed caps: a soft specular highlight on every key */
.play { position: relative; }
.key::after, .mode::after, .pk::after, .big-key::after, .play::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 1px; height: 46%; pointer-events: none;
  border-radius: inherit; border-bottom-left-radius: 50% 22%; border-bottom-right-radius: 50% 22%;
  background: linear-gradient(rgba(255,255,255,.3), rgba(255,255,255,0));
}
.key.round::after { border-radius: 50% 50% 45% 45%; }
.mode[aria-selected="true"]::after, .key[aria-checked="true"]::after, .key[aria-pressed="true"]::after { opacity: .45; }

/* home: four big keys */
.keypad { font-size: 13px; gap: 22px 12px; }
.keypad .pk { aspect-ratio: .95; }

/* the faceplate byline and the plaques along the bottom edge */
.brandbox { display: flex; flex-direction: column; gap: 6px; }
.byline { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); text-decoration: none; white-space: nowrap; }
.byline:hover { text-decoration: underline; }
.silk { gap: 10px 14px; padding: 6px 2px 2px; }
.silk a.plaque { border: 0; }
.plaque { display: grid; grid-template-columns: auto auto; column-gap: 14px; row-gap: 1px; align-items: center; padding: 8px 14px; border-radius: 7px; text-decoration: none; text-transform: none; letter-spacing: 0;
  color: var(--ink); background: linear-gradient(#fbfbf9, #e4e4e0); box-shadow: inset 0 1px 0 #fff, 0 2px 0 #a3a39d, 0 4px 8px -2px rgba(0,0,0,.28); transition: transform .08s, box-shadow .08s; }
.plaque .plaque-k { grid-column: 1; font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.plaque b { grid-column: 1; font-size: 16px; letter-spacing: -.01em; line-height: 1.1; }
.plaque .plaque-u { grid-column: 2; grid-row: 1 / span 2; font: 11.5px var(--mono); color: var(--orange); }
.plaque.dark { grid-template-columns: auto auto auto; color: #f2f2ee; background: linear-gradient(#363636, #1c1c1c); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 2px 0 #0a0a0a, 0 4px 8px -2px rgba(0,0,0,.4); }
.plaque.dark svg { grid-column: 1; grid-row: 1 / span 2; width: 24px; height: 24px; }
.plaque.dark .plaque-k, .plaque.dark b { grid-column: 2; }
.plaque.dark .plaque-k { color: #8f8f8a; }
.plaque.dark .plaque-u { grid-column: 3; }
.silk a.plaque:hover { color: inherit; transform: translateY(-1px); }
.silk a.plaque.dark:hover { color: #f2f2ee; }
.plaque:active { transform: translateY(2px); box-shadow: inset 0 1px 3px rgba(0,0,0,.2), 0 0 0 #a3a39d; }
.silk .credit { line-height: 1.55; text-align: right; }

@media (max-width: 860px) {
  body { padding: max(10px, env(safe-area-inset-top)) 10px max(22px, env(safe-area-inset-bottom)); }
  .device { border-radius: 16px; padding: 14px 12px 16px; }
  .silk { flex-direction: column; align-items: stretch; }
  .plaque { grid-template-columns: 1fr auto; }
  .plaque.dark { grid-template-columns: auto 1fr auto; }
  .silk .credit { text-align: center; margin: 4px 0 0; }
  .byline { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
