:root {
  --bg: #0d0d10;
  --bg-raise: #16161b;
  --bg-raise-2: #1d1d24;
  --line: #2a2a33;
  --ink: #f2efe9;
  --ink-dim: #9a978f;
  --ink-faint: #63615b;
  --amber: #ffb454;
  --amber-deep: #ff8a3d;

  /* colori canale */
  --c-vocals: #ff6f7d;
  --c-drums:  #ffc24b;
  --c-bass:   #4fd6c4;
  --c-other:  #b6e36b;

  --radius: 14px;
  --mono: "Space Mono", ui-monospace, monospace;
  --disp: "Bricolage Grotesque", system-ui, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--disp);
  background:
    radial-gradient(1200px 600px at 50% -10%, #1a1a22 0%, rgba(26,26,34,0) 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
  background-image: 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='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar, .stage, .footer { position: relative; z-index: 1; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.brand-mark i {
  width: 3px; background: var(--amber); border-radius: 2px; display: block;
  animation: eq 1.1s ease-in-out infinite;
}
.brand-mark i:nth-child(1){ height: 8px;  animation-delay: 0s; }
.brand-mark i:nth-child(2){ height: 18px; animation-delay: .15s; }
.brand-mark i:nth-child(3){ height: 12px; animation-delay: .3s; }
.brand-mark i:nth-child(4){ height: 20px; animation-delay: .45s; }
.brand-mark i:nth-child(5){ height: 7px;  animation-delay: .6s; }
@keyframes eq { 0%,100%{ transform: scaleY(.5);} 50%{ transform: scaleY(1);} }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; letter-spacing: 2px; font-size: 15px; }
.brand-name b { color: var(--amber); font-weight: 800; }
.brand-by {
  font-family: var(--mono); font-size: 10px; letter-spacing: .5px;
  color: var(--ink-dim); text-decoration: none; margin-top: 2px;
  transition: color .15s ease;
}
.brand-by:hover { color: var(--amber); }

.ghost-btn {
  font-family: var(--mono); font-size: 12px; color: var(--ink-dim);
  background: var(--bg-raise); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.ghost-btn:hover { color: var(--ink); border-color: var(--amber); }

/* ---- stage ---- */
.stage {
  flex: 1; width: 100%; max-width: 720px; margin: 0 auto;
  padding: 8px 18px 28px; display: flex; flex-direction: column; gap: 18px;
}

.banner {
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: var(--ink-dim);
  background: linear-gradient(180deg, rgba(255,180,84,.08), rgba(255,180,84,.02));
  border: 1px solid rgba(255,180,84,.25);
  border-radius: 12px; padding: 12px 14px;
}
.banner strong { color: var(--amber); }

.panel {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---- dropzone ---- */
.drop { padding: 6px; }
.dropzone {
  border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 54px 24px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--amber); background: rgba(255,180,84,.03); outline: none; }
.dropzone.drag { border-color: var(--amber); background: rgba(255,180,84,.06); transform: scale(.995); }
.dz-icon { display: flex; align-items: center; justify-content: center; gap: 4px; height: 46px; margin-bottom: 22px; }
.dz-icon i {
  width: 4px; border-radius: 3px; background: var(--ink-faint);
  animation: eq 1.4s ease-in-out infinite;
}
.dz-icon i:nth-child(1){height:14px;animation-delay:0s}
.dz-icon i:nth-child(2){height:30px;animation-delay:.1s;background:var(--amber)}
.dz-icon i:nth-child(3){height:42px;animation-delay:.2s;background:var(--amber)}
.dz-icon i:nth-child(4){height:22px;animation-delay:.3s}
.dz-icon i:nth-child(5){height:38px;animation-delay:.4s;background:var(--amber)}
.dz-icon i:nth-child(6){height:18px;animation-delay:.5s}
.dz-icon i:nth-child(7){height:12px;animation-delay:.6s}
.dropzone h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.5px; }
.dropzone p { color: var(--ink-dim); font-size: 14px; margin-top: 2px; }
.dropzone .link { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.fine-print { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin-top: 14px !important; }

/* ---- processing ---- */
.processing { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.proc-track-name { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); margin-bottom: 18px; word-break: break-all; }
.proc-ring { position: relative; width: 150px; height: 150px; }
.proc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 6; }
.ring-fg {
  fill: none; stroke: var(--amber); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset .35s ease;
  filter: drop-shadow(0 0 6px rgba(255,180,84,.5));
}
.proc-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 34px;
}
.proc-pct small { font-size: 16px; color: var(--ink-dim); margin-left: 2px; align-self: flex-start; margin-top: 8px; }
.proc-stage { font-family: var(--mono); font-size: 13px; color: var(--amber); margin-top: 22px; }

/* ---- mixer ---- */
.mixer { padding: 16px; }
.mixer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mh-name { font-family: var(--mono); font-size: 13px; color: var(--ink); word-break: break-all; }

.transport {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px;
}
.play-btn {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--amber); border: none; cursor: pointer;
  display: grid; place-items: center; transition: transform .12s, background .2s;
}
.play-btn:hover { transform: scale(1.05); background: var(--amber-deep); }
.play-btn svg { width: 22px; height: 22px; fill: #1a1206; }
.scrub { position: relative; flex: 1; height: 6px; }
.scrub-fill { position: absolute; left: 0; top: 0; height: 6px; width: 0%; background: var(--amber); border-radius: 999px; pointer-events: none; }
.scrub::before { content:""; position:absolute; inset:0; background: var(--line); border-radius: 999px; }
.scrub input { position: absolute; inset: -8px 0; width: 100%; opacity: 0; cursor: pointer; }
.time { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); flex: none; min-width: 78px; text-align: right; }

/* channel strips */
.strips { display: flex; flex-direction: column; gap: 10px; }
.strip {
  --c: var(--amber);
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  padding: 12px; background: var(--bg-raise-2); border: 1px solid var(--line);
  border-left: 3px solid var(--c); border-radius: 11px;
  transition: opacity .2s;
}
.strip.muted { opacity: .4; }
.strip-led {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 9px; color: var(--c); font-weight: 700; text-align: center; line-height: 1.1;
}
.strip-main { min-width: 0; }
.strip-name { font-weight: 600; font-size: 14px; margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.strip-name .swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.wave { width: 100%; height: 30px; display: block; }
.strip-ctrls { display: flex; align-items: center; gap: 6px; }
.mini {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-dim);
  transition: all .15s;
}
.mini:hover { color: var(--ink); border-color: var(--ink-dim); }
.mini.on[data-act="solo"] { background: var(--amber); border-color: var(--amber); color: #1a1206; }
.mini.on[data-act="mute"] { background: var(--c-vocals); border-color: var(--c-vocals); color: #1a0606; }
.mini svg { width: 14px; height: 14px; fill: currentColor; vertical-align: middle; }

.gain-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.gain-row input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 999px;
  background: var(--line); cursor: pointer;
}
.gain-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--c); border: 2px solid var(--bg);
}
.gain-row input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid var(--bg);
}
.gain-val { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); width: 30px; text-align: right; }

/* ---- footer ---- */
.footer {
  text-align: center; padding: 18px; font-family: var(--mono);
  font-size: 11px; color: var(--ink-faint); display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.footer .dot { color: var(--line); }

@media (max-width: 480px) {
  .dropzone { padding: 40px 16px; }
  .dropzone h1 { font-size: 22px; }
  .strip { grid-template-columns: 38px 1fr auto; gap: 9px; padding: 10px; }
}
