/* ================================================================
   VAPOR-77 — cassette futurism synthesizer
   Panel: cream plastic, orange/brown/sage accents, walnut cheeks
   ================================================================ */

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../vendor/fonts/ibm-plex-mono-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../vendor/fonts/ibm-plex-mono-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../vendor/fonts/ibm-plex-mono-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../vendor/fonts/ibm-plex-mono-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'Archivo';
  src: url('../vendor/fonts/archivo-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'Archivo';
  src: url('../vendor/fonts/archivo-800.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'Archivo';
  src: url('../vendor/fonts/archivo-900.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: block;
}

:root {
  --crema:      #ece5d3;
  --crema-alto: #f4eee0;
  --crema-ombra:#d9d0b9;
  --arancio:    #E8590C;
  --arancio-luce:#ff7b2e;
  --marrone:    #4a3527;
  --noce:       #5d4130;
  --salvia:     #8ea48b;
  --salvia-scuro:#6d8069;
  --ink:        #3b3a33;
  --ink-soft:   #6d6a5d;
  --fosforo:    #5cffa8;
  --fosforo-dim:#1c4a33;
  --alluminio:  #c9c9c9;
  --desk:       #16110d;
  --led-off:    #4c2318;

  --ff-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --ff-disp: 'Archivo', 'Arial Black', sans-serif;

  --spring: cubic-bezier(.3, 1.9, .45, .95);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--ff-mono);
  background: var(--desk);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

/* ---------------- desk / ambience ---------------- */

.desk {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 90% at 50% 18%, #2b211a 0%, #1d1611 42%, #120d09 78%, #0a0705 100%);
}

.desk::before { /* warm lamp glow from above */
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(60% 42% at 50% 6%, rgba(255,170,90,.14), transparent 70%);
  pointer-events: none;
}

.desk-noise {
  position: absolute; inset: 0;
  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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .05;
  mix-blend-mode: overlay;
  pointer-events: none;
}

#stage {
  transform-origin: center center;
  filter: drop-shadow(0 46px 60px rgba(0,0,0,.75));
}

.desk-foot {
  position: fixed; left: 24px; bottom: 18px; z-index: 5;
  display: flex; gap: 16px; align-items: baseline;
  font-size: 11px; letter-spacing: .08em;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.gallery-link { color: #c9b394; text-decoration: none; transition: color .2s; }
.gallery-link:hover, .gallery-link:focus-visible { color: var(--crema); }
.signature { color: #9b866c; font-size: 10px; }

/* ---------------- unit: cheeks + panel ---------------- */

.unit { display: flex; align-items: stretch; }

.cheek {
  width: 34px;
  border-radius: 10px 4px 4px 10px;
  background:
    repeating-linear-gradient(94deg, rgba(0,0,0,.14) 0 2px, transparent 2px 5px, rgba(255,255,255,.05) 5px 6px, transparent 6px 11px),
    linear-gradient(180deg, #7a5638 0%, #63432a 12%, #543823 55%, #3f2917 92%, #331f10 100%);
  box-shadow:
    inset 2px 0 3px rgba(255,224,178,.28),
    inset -3px 0 6px rgba(0,0,0,.5),
    inset 0 3px 4px rgba(255,224,178,.18),
    inset 0 -4px 6px rgba(0,0,0,.55);
}
.cheek-r {
  border-radius: 4px 10px 10px 4px;
  box-shadow:
    inset 3px 0 6px rgba(255,224,178,.15),
    inset -2px 0 3px rgba(0,0,0,.55),
    inset 0 3px 4px rgba(255,224,178,.18),
    inset 0 -4px 6px rgba(0,0,0,.55);
}

.panel {
  position: relative;
  width: 1332px;
  padding: 24px 30px 12px;
  display: flex; flex-direction: column; gap: 12px;
  border-radius: 4px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E"),
    linear-gradient(178deg, var(--crema-alto) 0%, var(--crema) 34%, #e4dcc7 72%, var(--crema-ombra) 100%);
  background-blend-mode: soft-light, normal;
  box-shadow:
    0 0 0 1px rgba(58,48,30,.55),
    inset 0 2px 2px rgba(255,255,255,.85),
    inset 0 -3px 5px rgba(97,84,58,.35),
    inset 3px 0 4px rgba(255,255,255,.4),
    inset -3px 0 5px rgba(97,84,58,.25);
}

/* subtle top-light on the whole faceplate */
.panel::after {
  content: '';
  position: absolute; inset: 0; border-radius: 4px;
  background: linear-gradient(165deg, rgba(255,255,255,.18) 0%, transparent 28%, transparent 78%, rgba(60,45,25,.10) 100%);
  pointer-events: none;
}

.screw {
  position: absolute; width: 15px; height: 15px; border-radius: 50%; z-index: 3;
  background:
    radial-gradient(circle at 34% 30%, #f5f5f0 0%, #c9c7bd 34%, #8f8d82 68%, #6c6a60 100%);
  box-shadow:
    inset 0 -1.5px 2px rgba(0,0,0,.45),
    inset 0 1px 1px rgba(255,255,255,.9),
    0 1px 2px rgba(60,50,30,.5);
}
.screw::after { /* slot */
  content: '';
  position: absolute; left: 15%; top: 46%; width: 70%; height: 2px;
  background: linear-gradient(180deg, #4b4a43, #75736a);
  border-radius: 1px;
  box-shadow: 0 1px 0 rgba(255,255,255,.55);
}
.screw-tl { left: 10px; top: 10px; }   .screw-tl::after { transform: rotate(23deg); }
.screw-tr { right: 10px; top: 10px; }  .screw-tr::after { transform: rotate(-64deg); }
.screw-bl { left: 10px; bottom: 10px; }  .screw-bl::after { transform: rotate(81deg); }
.screw-br { right: 10px; bottom: 10px; } .screw-br::after { transform: rotate(-12deg); }

/* ---------------- serigraphy / labels ---------------- */

.mini-label {
  font-size: 8.5px; font-weight: 600; letter-spacing: .14em;
  color: var(--ink-soft); text-transform: uppercase;
}

.sect {
  border: 1px solid rgba(59,58,51,.5);
  border-radius: 6px;
  padding: 13px 9px 9px;
  position: relative;
  min-width: 0;
}
.sect legend {
  font-size: 10px; font-weight: 700; letter-spacing: .22em;
  color: var(--ink);
  padding: 0 7px; margin-left: 6px;
}

/* ================= HEADER ================= */

.row-head {
  display: flex; gap: 22px; align-items: stretch;
  padding-bottom: 2px;
}

.brand { width: 252px; flex: 0 0 auto; display: flex; flex-direction: column; }

.brand-logo {
  font-family: var(--ff-disp); font-weight: 900;
  font-size: 44px; letter-spacing: .01em; line-height: 1;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
}
.brand-num { color: var(--arancio); }

.brand-sub {
  margin-top: 6px;
  font-size: 8.5px; font-weight: 600; letter-spacing: .18em; line-height: 1.7;
  color: var(--ink-soft);
}

.brand-stripes { margin-top: 12px; display: flex; flex-direction: column; gap: 3px; }
.brand-stripes span { height: 5px; border-radius: 1px; box-shadow: 0 1px 0 rgba(255,255,255,.5); }
.brand-stripes span:nth-child(1) { width: 100%; background: linear-gradient(180deg, var(--arancio-luce), var(--arancio)); }
.brand-stripes span:nth-child(2) { width: 74%; background: linear-gradient(180deg, #9db79a, var(--salvia-scuro)); }
.brand-stripes span:nth-child(3) { width: 48%; background: linear-gradient(180deg, #6b5a45, var(--marrone)); }

.brand-schema { width: 232px; margin-top: 12px; opacity: .9; }

.power-block { margin-top: auto; display: flex; align-items: flex-end; gap: 18px; }

/* --- power rocker --- */
.power-wrap { display: flex; flex-direction: column; gap: 4px; }
.power {
  border: 0; padding: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.power:focus-visible .power-well { outline: 2px solid var(--arancio); outline-offset: 3px; }
.power-well {
  display: block; width: 84px; height: 34px; border-radius: 6px;
  background: linear-gradient(180deg, #b8b099 0%, #8f8871 8%, #565144 50%, #3c382e 100%);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,.75),
    inset 0 -1px 1px rgba(255,255,255,.25),
    0 1px 0 rgba(255,255,255,.7);
  padding: 3px; position: relative;
}
.power-lever {
  display: block; width: 40px; height: 28px; border-radius: 4px;
  background: linear-gradient(180deg, #fdfaf1 0%, #e8e1cd 45%, #c9c0a6 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.95),
    inset 0 -2px 3px rgba(90,75,45,.5),
    0 2px 3px rgba(0,0,0,.55);
  transform: translateX(0);
  transition: transform .13s var(--spring), background .13s;
  position: relative;
}
.power-lever::after { /* grip lines */
  content: '';
  position: absolute; inset: 7px 14px;
  background: repeating-linear-gradient(90deg, rgba(90,75,45,.5) 0 1.5px, transparent 1.5px 5px);
}
.power[aria-pressed="true"] .power-lever {
  transform: translateX(38px);
  background: linear-gradient(180deg, var(--arancio-luce) 0%, var(--arancio) 55%, #b23f04 100%);
}
.power[aria-pressed="true"] .power-lever::after {
  background: repeating-linear-gradient(90deg, rgba(70,20,0,.55) 0 1.5px, transparent 1.5px 5px);
}
.power-labels {
  display: flex; justify-content: space-between;
  font-size: 8px; font-weight: 600; letter-spacing: .1em; color: var(--ink-soft);
  width: 84px;
}

.led-block, .hum-block { display: flex; flex-direction: column; align-items: center; gap: 5px; padding-bottom: 12px; }

/* --- LEDs --- */
.led {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6b3a2c, var(--led-off) 70%);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.6);
  transition: box-shadow .15s, background .15s;
}
.led.on.led-red {
  background: radial-gradient(circle at 35% 30%, #ffb59d, #ff3f14 60%, #c22400);
  box-shadow: 0 0 8px 2px rgba(255,70,20,.65), inset 0 0 2px rgba(255,255,255,.6);
}
.led-amber.on {
  background: radial-gradient(circle at 35% 30%, #ffd9a0, #ff9820 60%, #c96a00);
  box-shadow: 0 0 8px 2px rgba(255,152,30,.6), inset 0 0 2px rgba(255,255,255,.5);
}
.led-green.on {
  background: radial-gradient(circle at 35% 30%, #d4ffcf, #4ade50 60%, #159422);
  box-shadow: 0 0 8px 2px rgba(74,222,80,.55), inset 0 0 2px rgba(255,255,255,.5);
}

/* --- toggle lever (spring) --- */
.toggle {
  width: 26px; height: 40px; border-radius: 13px;
  background: linear-gradient(180deg, #9c9480 0%, #6a6455 12%, #47433a 50%, #33302a 88%, #57523f 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.65);
  position: relative; cursor: pointer;
}
.toggle:focus-visible { outline: 2px solid var(--arancio); outline-offset: 3px; }
.toggle-lever {
  position: absolute; left: 50%; bottom: 50%;
  width: 9px; height: 21px; margin-left: -4.5px;
  border-radius: 4.5px 4.5px 3px 3px;
  background: linear-gradient(90deg, #8e8e8e 0%, #f2f2f0 30%, #d9d9d4 55%, #7e7e7a 100%);
  box-shadow: 0 2px 3px rgba(0,0,0,.55), inset 0 1px 1px rgba(255,255,255,.9);
  transform-origin: 50% 100%;
  transform: rotate(24deg);
  transition: transform .16s var(--spring);
}
.toggle-lever::before { /* ball tip */
  content: '';
  position: absolute; left: 50%; top: -5px; width: 13px; height: 13px; margin-left: -6.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #ffffff, #d5d5d0 45%, #8b8b85 100%);
  box-shadow: 0 2px 3px rgba(0,0,0,.4);
}
.toggle[aria-checked="false"] .toggle-lever { transform: rotate(-24deg); }
.toggle-sm { transform: scale(.78); transform-origin: bottom center; }
.toggle-labels {
  display: flex; flex-direction: column; gap: 2px; margin-top: 4px;
  font-size: 7.5px; font-weight: 600; letter-spacing: .1em; color: var(--ink-soft);
  text-align: center;
}

/* --- CRT --- */
.crt-block { flex: 1 1 auto; display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.crt-bezel {
  position: relative; flex: 1;
  border-radius: 10px;
  padding: 9px;
  background: linear-gradient(180deg, #57534a 0%, #37342e 12%, #211f1b 55%, #16140f 100%);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,.22),
    inset 0 -2px 4px rgba(0,0,0,.7),
    0 1px 0 rgba(255,255,255,.55),
    0 3px 8px rgba(50,40,20,.35);
}
#crt {
  display: block; width: 100%; height: 100%;
  border-radius: 7px;
  background:
    radial-gradient(130% 110% at 50% 45%, #0d1a12 0%, #060d08 70%, #030604 100%);
  box-shadow: inset 0 0 26px rgba(0,0,0,.85);
}
.crt-scanlines {
  position: absolute; inset: 9px; border-radius: 7px;
  background: repeating-linear-gradient(180deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px);
  pointer-events: none;
  mix-blend-mode: multiply;
}
.crt-glass {
  position: absolute; inset: 9px; border-radius: 7px;
  background:
    radial-gradient(90% 60% at 28% 12%, rgba(190,255,220,.10), transparent 55%),
    radial-gradient(140% 120% at 50% 50%, transparent 62%, rgba(0,0,0,.5) 100%);
  pointer-events: none;
}
.crt-caption {
  display: flex; justify-content: space-between;
  font-size: 8px; font-weight: 600; letter-spacing: .16em; color: var(--ink-soft);
  padding: 0 3px;
}

/* --- VU + presets column --- */
.vu-block { width: 264px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px; }

.vu {
  position: relative;
  border-radius: 8px; padding: 6px;
  background: linear-gradient(180deg, #57534a 0%, #37342e 14%, #211f1b 60%, #16140f 100%);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,.22),
    inset 0 -2px 4px rgba(0,0,0,.7),
    0 1px 0 rgba(255,255,255,.55);
}
#vu { display: block; width: 100%; height: 88px; border-radius: 5px; }
.vu::after { /* vetro */
  content: '';
  position: absolute; inset: 6px; border-radius: 5px;
  background:
    linear-gradient(112deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,.06) 26%, transparent 42%),
    radial-gradient(120% 120% at 50% 120%, transparent 70%, rgba(60,40,10,.18) 100%);
  pointer-events: none;
}
.vu-caption { margin-bottom: 2px; }

.preset-strip { display: flex; gap: 5px; margin-top: 2px; }
.preset-btn {
  flex: 1; height: 30px;
  border: 0; border-radius: 4px; cursor: pointer;
  background: linear-gradient(180deg, #fbf7ea 0%, #e4dcc6 55%, #c8bfa3 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.9),
    inset 0 -2px 2px rgba(90,75,45,.4),
    0 2px 2px rgba(60,50,30,.4);
  position: relative;
  font-family: var(--ff-mono); font-size: 9px; font-weight: 700; color: var(--ink);
  transition: transform .06s, box-shadow .06s;
  padding-top: 8px;
}
.preset-btn::before { /* window LED */
  content: '';
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 3.5px; border-radius: 2px;
  background: var(--led-off);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.5);
  transition: background .12s, box-shadow .12s;
}
.preset-btn.on::before {
  background: linear-gradient(180deg, #ffd0b3, var(--arancio));
  box-shadow: 0 0 7px 1px rgba(232,89,12,.75);
}
.preset-btn:active, .preset-btn.pressed { transform: translateY(1.5px); box-shadow: inset 0 1px 1px rgba(255,255,255,.7), inset 0 -1px 1px rgba(90,75,45,.4), 0 1px 1px rgba(60,50,30,.4); }
.preset-btn.user { color: var(--arancio); }

.preset-actions { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; }
.chip {
  border: 0; border-radius: 4px; cursor: pointer;
  font-family: var(--ff-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .12em;
  color: #fff7ec;
  padding: 4px 12px;
  background: linear-gradient(180deg, var(--arancio-luce) 0%, var(--arancio) 55%, #b23f04 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.5), inset 0 -2px 2px rgba(100,30,0,.55), 0 2px 2px rgba(60,50,30,.45);
  transition: transform .06s, filter .12s;
}
.chip:active { transform: translateY(1.5px); }
.chip.flash { filter: brightness(1.35); }

/* ================= CONTROLS ROW ================= */

.row-controls {
  display: flex; gap: 9px; align-items: stretch;
}
.sect-osc   { flex: 0 0 220px; }
.sect-filter{ flex: 0 0 194px; }
.sect-env   { flex: 0 0 172px; }
.sect-lfo   { flex: 0 0 152px; }
.sect-fx    { flex: 1 1 auto; }
.sect-out   { flex: 0 0 128px; }

.knob-row { display: flex; gap: 10px; align-items: center; justify-content: center; height: 100%; padding-bottom: 6px; }
.knob-stack { display: flex; flex-direction: column; gap: 8px; }
.knob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 6px; justify-items: center; }
.knob-grid-v { grid-template-columns: 1fr; }
.knob-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.osc-cols { display: flex; gap: 10px; justify-content: space-between; height: 100%; }
.wave-col { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.wave-sel { display: flex; flex-direction: column; gap: 4px; }
.wave-btn {
  width: 46px; height: 22px;
  border: 0; border-radius: 3px; cursor: pointer;
  display: flex; align-items: center; gap: 5px; padding: 0 6px;
  background: linear-gradient(180deg, #fbf7ea 0%, #e4dcc6 55%, #ccc3a8 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 -1.5px 2px rgba(90,75,45,.4), 0 1.5px 2px rgba(60,50,30,.35);
  font-family: var(--ff-mono); font-size: 8px; font-weight: 700; color: var(--ink);
  transition: transform .06s;
}
.wave-btn:active { transform: translateY(1px); }
.wave-btn .wled {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--led-off);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.5);
  flex: 0 0 auto;
  transition: background .1s, box-shadow .1s;
}
.wave-btn.on .wled {
  background: radial-gradient(circle at 35% 30%, #ffd9a0, #ff9820 65%);
  box-shadow: 0 0 5px 1px rgba(255,152,30,.7);
}
.wave-btn svg { width: 14px; height: 9px; stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.knob-col { display: flex; flex-direction: column; gap: 8px; justify-content: center; }

.lfo-inner { display: flex; gap: 10px; align-items: center; justify-content: center; height: 100%; padding-bottom: 4px; }
.lfo-dest { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.fx-cols { display: flex; gap: 10px; justify-content: space-evenly; height: 100%; align-items: center; }
.fx-group { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.fx-group + .fx-group { border-left: 1px solid rgba(59,58,51,.3); padding-left: 12px; }
.fx-title { text-align: center; }

.out-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: center; padding-bottom: 4px; }
.out-leds { display: flex; align-items: center; gap: 6px; }

/* ---------------- KNOB ---------------- */

.knob-mount { display: flex; flex-direction: column; align-items: center; }

.knob {
  position: relative;
  width: 54px; height: 54px;
  cursor: grab;
  touch-action: none;
}
.knob:active { cursor: grabbing; }
.knob:focus-visible { outline: 2px solid var(--arancio); outline-offset: 4px; border-radius: 50%; }
.knob-lg .knob { width: 70px; height: 70px; }

.knob-ticks { position: absolute; inset: -7px; pointer-events: none; }
.knob-ticks svg { width: 100%; height: 100%; display: block; }

.knob-base { /* recessed seat */
  position: absolute; inset: 2px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(70,60,35,.4), rgba(70,60,35,.12) 62%, transparent 70%);
}

.knob-cap {
  position: absolute; inset: 4px;
  border-radius: 50%;
  /* brushed aluminum */
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.9), rgba(255,255,255,0) 40%),
    radial-gradient(circle at 68% 82%, rgba(0,0,0,.25), transparent 45%),
    repeating-conic-gradient(from 8deg, #d6d6d6 0deg 3deg, #b0b0b0 3deg 5deg, #cfcfcf 5deg 9deg, #a8a8a8 9deg 12deg),
    #bdbdbd;
  box-shadow:
    inset 0 1.5px 2px rgba(255,255,255,.95),
    inset 0 -3px 5px rgba(0,0,0,.4),
    0 4px 6px rgba(45,35,15,.45),
    0 1px 1px rgba(255,255,255,.6);
  will-change: transform;
}
.knob-cap::before { /* domed center */
  content: '';
  position: absolute; inset: 17%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #f4f4f2 0%, #cfcfcb 42%, #9d9d97 78%, #8a8a84 100%);
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.3), inset 0 1px 1px rgba(255,255,255,.9), 0 1px 2px rgba(0,0,0,.35);
}
.knob-cap::after { /* index line */
  content: '';
  position: absolute; left: 50%; top: 5%; width: 3px; height: 30%;
  margin-left: -1.5px; border-radius: 2px;
  background: linear-gradient(180deg, var(--arancio) 0%, #c14a08 100%);
  box-shadow: 0 0 2px rgba(0,0,0,.35);
}

.knob-label {
  margin-top: 6px;
  font-size: 8.5px; font-weight: 600; letter-spacing: .13em;
  color: var(--ink-soft); text-transform: uppercase;
  text-align: center; line-height: 1.3;
}

/* floating value bubble */
.knob-tip {
  position: fixed; z-index: 60;
  padding: 4px 9px;
  border-radius: 4px;
  background: #241f18;
  color: var(--fosforo);
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  box-shadow: 0 4px 10px rgba(0,0,0,.6), inset 0 0 0 1px rgba(92,255,168,.25);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -130%) scale(.9);
  transition: opacity .12s, transform .12s;
  white-space: nowrap;
}
.knob-tip.show { opacity: 1; transform: translate(-50%, -130%) scale(1); }

/* ================= SEQUENCER ================= */

.row-seq {
  display: flex; gap: 14px;
  border: 1px solid rgba(59,58,51,.5);
  border-radius: 6px;
  padding: 10px 12px;
}

.transport { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.transport-btns { display: flex; gap: 7px; }

.tbtn {
  width: 46px; height: 46px;
  border: 0; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fbf7ea 0%, #e4dcc6 55%, #c8bfa3 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.9),
    inset 0 -2.5px 3px rgba(90,75,45,.45),
    0 3px 3px rgba(60,50,30,.4);
  transition: transform .06s, box-shadow .06s;
}
.tbtn:active { transform: translateY(2px); box-shadow: inset 0 1px 1px rgba(255,255,255,.7), inset 0 -1px 1px rgba(90,75,45,.4), 0 1px 1px rgba(60,50,30,.35); }
.tbtn svg { width: 15px; height: 15px; fill: var(--ink); }
.tbtn-play.on { background: linear-gradient(180deg, #a7c2a0 0%, var(--salvia) 50%, #5f7a5c 100%); }
.tbtn-play.on svg { fill: #16250f; }
.tbtn:focus-visible { outline: 2px solid var(--arancio); outline-offset: 2px; }

.transport-knobs { display: flex; gap: 8px; }

.seq-title {
  font-size: 9px; font-weight: 700; letter-spacing: .2em; line-height: 1.75;
  color: var(--ink); text-align: center;
  border-left: 1px solid rgba(59,58,51,.4);
  padding-left: 13px;
  align-self: center;
}

.seq-grid-wrap { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.seq-leds {
  display: grid;
  grid-template-columns: 74px repeat(16, 1fr);
  gap: 4px;
  align-items: center;
}
.seq-led {
  height: 5px; border-radius: 3px;
  background: var(--led-off);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.45);
  justify-self: center; width: 22px;
  transition: background .05s, box-shadow .05s;
}
.seq-led.on {
  background: linear-gradient(180deg, #ffd0b3, var(--arancio));
  box-shadow: 0 0 8px 1px rgba(232,89,12,.8);
}
.seq-led.q { width: 26px; } /* quarter accents slightly wider */

.seq-grid {
  display: grid;
  grid-template-columns: 74px repeat(16, 1fr);
  gap: 4px;
}
.track-label {
  font-size: 8px; font-weight: 700; letter-spacing: .12em; color: var(--ink-soft);
  display: flex; align-items: center;
}
.step {
  height: 27px;
  border: 0; border-radius: 3.5px; cursor: pointer;
  position: relative;
  background: linear-gradient(180deg, #57534a 0%, #3b3831 30%, #2b2925 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.18),
    inset 0 -2px 3px rgba(0,0,0,.5),
    0 1.5px 2px rgba(60,50,30,.45);
  transition: transform .05s;
  touch-action: none;
}
.step:active { transform: translateY(1px); }
.step::before { /* pad light bar */
  content: '';
  position: absolute; left: 18%; right: 18%; top: 6px; height: 4px; border-radius: 2px;
  background: rgba(0,0,0,.5);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.6);
  transition: background .07s, box-shadow .07s;
}
.step.q4 { background: linear-gradient(180deg, #625d51 0%, #454138 30%, #322f29 100%); }
.step.on::before  { background: linear-gradient(180deg, #ffd7ba, var(--arancio)); box-shadow: 0 0 7px 1px rgba(232,89,12,.7); }
.step[data-track="1"].on::before { background: linear-gradient(180deg, #d9ecd0, var(--salvia)); box-shadow: 0 0 7px 1px rgba(142,164,139,.7); }
.step[data-track="2"].on::before { background: linear-gradient(180deg, #fffdf4, #e8ddb8); box-shadow: 0 0 7px 1px rgba(232,221,184,.6); }
.step[data-track="3"].on::before { background: linear-gradient(180deg, #ffe9b5, #dfa937); box-shadow: 0 0 7px 1px rgba(223,169,55,.65); }
.step.playhead { box-shadow: inset 0 1px 1px rgba(255,255,255,.18), inset 0 -2px 3px rgba(0,0,0,.5), 0 0 0 1.5px rgba(232,89,12,.85), 0 1.5px 2px rgba(60,50,30,.45); }
.step .note-tag {
  position: absolute; left: 0; right: 0; bottom: 3px;
  font-size: 7.5px; font-weight: 600; letter-spacing: .04em;
  color: #b9ae91; text-align: center;
  pointer-events: none;
}
.step:focus-visible { outline: 2px solid var(--arancio); outline-offset: 1px; }

/* ================= KEYBOARD ================= */

.row-keys { display: flex; gap: 0; align-items: stretch; height: 148px; }

.kbd-cheek {
  width: 40px;
  border-radius: 5px 0 0 5px;
  background: linear-gradient(180deg, #6b4a30 0%, #543823 55%, #3d2815 100%);
  box-shadow: inset 0 2px 3px rgba(255,224,178,.25), inset 0 -3px 5px rgba(0,0,0,.5), inset 2px 0 2px rgba(255,224,178,.15);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
}
.kbd-cheek-r { border-radius: 0 5px 5px 0; box-shadow: inset 0 2px 3px rgba(255,224,178,.25), inset 0 -3px 5px rgba(0,0,0,.5), inset -2px 0 2px rgba(0,0,0,.4); }
.kbd-cheek span { font-size: 7.5px; font-weight: 600; letter-spacing: .1em; color: rgba(255,230,200,.55); }

.kbd {
  flex: 1;
  position: relative;
  background: #201b14;
  border-radius: 0;
  padding: 9px 5px 0;
  box-shadow: inset 0 4px 8px rgba(0,0,0,.75);
  display: flex;
}
.kbd::before { /* feltro rosso sopra i tasti */
  content: '';
  position: absolute; left: 0; right: 0; top: 3px; height: 5px; z-index: 3;
  background: linear-gradient(180deg, #8e3324 0%, #6e2418 60%, #521a10 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.key-w {
  flex: 1;
  position: relative;
  margin: 0 1px;
  border: 0; cursor: pointer;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(180deg, #fbf8ef 0%, #f2ecdc 68%, #ddd4bd 92%, #c9bfa5 100%);
  box-shadow:
    inset 0 -5px 5px rgba(120,100,60,.28),
    inset 0 2px 2px rgba(255,255,255,.9),
    inset 1.5px 0 1px rgba(255,255,255,.4),
    inset -1.5px 0 2px rgba(120,100,60,.22),
    0 4px 4px rgba(0,0,0,.55);
  transition: transform .05s, box-shadow .05s, background .05s;
}
.key-w.held {
  transform: translateY(3px);
  background: linear-gradient(180deg, #f0e9d6 0%, #e5dcc4 70%, #cfc4a7 100%);
  box-shadow:
    inset 0 -3px 4px rgba(120,100,60,.35),
    inset 0 2px 3px rgba(120,100,60,.25),
    0 1px 1px rgba(0,0,0,.5);
}
.key-b {
  position: absolute; top: 9px;
  width: 34px; height: 58%;
  margin-left: -17px;
  border: 0; cursor: pointer;
  border-radius: 0 0 3.5px 3.5px;
  background: linear-gradient(180deg, #4d4237 0%, #332a22 40%, #211a13 88%, #443a2f 100%);
  box-shadow:
    inset 0 -3px 3px rgba(255,220,170,.14),
    inset 1.5px 0 1px rgba(255,255,255,.12),
    inset -1.5px 0 2px rgba(0,0,0,.5),
    0 5px 5px rgba(0,0,0,.6);
  z-index: 2;
  transition: transform .05s, box-shadow .05s;
}
.key-b.held {
  transform: translateY(2.5px);
  box-shadow: inset 0 -2px 2px rgba(255,220,170,.1), inset 0 2px 3px rgba(0,0,0,.6), 0 2px 2px rgba(0,0,0,.5);
}
.key-w:focus-visible, .key-b:focus-visible { outline: 2px solid var(--arancio); outline-offset: -3px; }

.key-qwerty {
  position: absolute; left: 0; right: 0; bottom: 8px;
  font-family: var(--ff-mono); font-size: 9px; font-weight: 600;
  color: #a89a78; text-align: center;
  pointer-events: none;
}
.key-b .key-qwerty { bottom: 6px; color: rgba(255,230,190,.6); font-size: 8.5px; }
.key-note {
  position: absolute; left: 0; right: 0; bottom: 22px;
  font-size: 7px; font-weight: 600; letter-spacing: .05em;
  color: #c4b995; text-align: center;
  pointer-events: none;
}

/* ================= FOOT ================= */

.panel-foot {
  display: flex; justify-content: space-between;
  font-size: 7.5px; font-weight: 500; letter-spacing: .14em;
  color: rgba(109,106,93,.8);
  padding: 2px 4px 0;
}

/* ================= POWER STATES ================= */

.panel[data-power="off"] .led-amber,
.panel[data-power="off"] .led-green { opacity: .8; }

/* dim non-power controls when off — subtly, like a machine at rest */
.panel[data-power="off"] .row-controls,
.panel[data-power="off"] .row-seq,
.panel[data-power="off"] .row-keys,
.panel[data-power="off"] .vu-block { filter: saturate(.9) brightness(.97); }

/* a macchina spenta i LED non emettono luce: resta solo la plastica colorata */
.panel[data-power="off"] .preset-btn.on::before,
.panel[data-power="off"] .wave-btn.on .wled {
  background: #8a5138;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.5);
}
.panel[data-power="off"] .step.on::before {
  box-shadow: inset 0 1px 1px rgba(0,0,0,.35);
  filter: saturate(.65) brightness(.7);
}
.panel[data-power="off"] .seq-led.on { background: var(--led-off); box-shadow: inset 0 1px 1px rgba(0,0,0,.45); }

/* invite pulse on power switch when off */
@keyframes invite {
  0%, 100% { box-shadow: inset 0 2px 5px rgba(0,0,0,.75), inset 0 -1px 1px rgba(255,255,255,.25), 0 1px 0 rgba(255,255,255,.7), 0 0 0 0 rgba(232,89,12,0); }
  50%      { box-shadow: inset 0 2px 5px rgba(0,0,0,.75), inset 0 -1px 1px rgba(255,255,255,.25), 0 1px 0 rgba(255,255,255,.7), 0 0 14px 2px rgba(232,89,12,.45); }
}
.panel[data-power="off"] .power-well { animation: invite 2.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .panel[data-power="off"] .power-well { animation: none; }
  .power-lever, .toggle-lever, .knob-tip { transition: none; }
  * { animation-duration: .001s !important; }
}
