:root {
  --ink: #06090D;
  --paper: #ECE6DA;
  --paper-dim: rgba(236, 230, 218, .62);
  --crest: #FFC46B;
  --trough: #44D7E8;
  --rec: #FF5A4E;
  --glass: rgba(10, 15, 21, .62);
  --line: rgba(236, 230, 218, .16);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font: 15px/1.45 var(--font); overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--crest); outline-offset: 3px; }

#field { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

/* ---------- top ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 0;
}
.status { margin: 0; font-size: 13px; letter-spacing: .01em; color: var(--paper-dim); font-variant-numeric: tabular-nums; }
.meters { margin-left: auto; display: grid; gap: 5px; }
.meter { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--paper-dim); }
.meter i { font-style: normal; width: 20px; text-align: right; }
.meter b { width: 64px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--crest); transition: width .08s linear; }
.meter-out span { background: var(--trough); }

/* ---------- dock ---------- */
.dock {
  position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 10px);
  max-width: 460px; margin: 0 auto;
  display: grid; gap: 12px; padding: 14px 14px 16px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 26px;
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
}
.dock-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.modes { display: flex; flex: 1; min-width: 0; background: rgba(236, 230, 218, .07); border-radius: 999px; padding: 3px; }
.modes button {
  flex: 1; min-width: 0; border: 0; background: none; padding: 8px 2px; border-radius: 999px; font-size: 14px; color: var(--paper-dim);
}
.modes button[aria-checked="true"] { background: var(--paper); color: var(--ink); font-weight: 600; }
.ghost { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 8px 12px; font-size: 14px; white-space: nowrap; flex: none; }
.ghost:disabled { opacity: .35; }
.ghost[aria-pressed="true"] { border-color: var(--rec); color: var(--rec); }

.transport { justify-content: center; gap: 34px; padding: 2px 0; }
.round {
  width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line); background: rgba(236, 230, 218, .06);
  display: grid; place-items: center;
}
.round svg { width: 22px; height: 22px; fill: var(--paper); }
#live svg { fill: none; stroke: var(--paper); stroke-width: 1.8; stroke-linecap: round; }
#live svg rect { fill: var(--paper); stroke: none; }
#live[aria-pressed="true"] { background: var(--trough); border-color: var(--trough); }
#live[aria-pressed="true"] svg { stroke: var(--ink); }
#live[aria-pressed="true"] svg rect { fill: var(--ink); }
.round:disabled { opacity: .3; }
.i-pause { display: none; }
#play.is-playing .i-play { display: none; }
#play.is-playing .i-pause { display: block; }
#play.nudge { border-color: var(--crest); box-shadow: 0 0 0 4px rgba(255, 196, 107, .25); }
#play.is-playing { background: var(--crest); border-color: var(--crest); }
#play.is-playing svg { fill: var(--ink); }

.rec {
  width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--paper); background: none; padding: 0;
  display: grid; place-items: center;
}
.rec span { width: 54px; height: 54px; border-radius: 50%; background: var(--rec); transition: all .2s cubic-bezier(.3, .7, .3, 1); }
.rec.is-recording span { width: 26px; height: 26px; border-radius: 7px; }
.rec.is-recording { border-color: var(--rec); }

.mix { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--paper-dim); }
.mix input { flex: 1; accent-color: var(--crest); min-width: 0; }

/* ---------- intro ---------- */
.intro {
  position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px;
  padding: 24px 26px calc(env(safe-area-inset-bottom) + 34px);
  background: linear-gradient(to top, rgba(6, 9, 13, .94) 38%, rgba(6, 9, 13, .2));
}
.intro h1 { margin: 0; font-size: clamp(44px, 13vw, 72px); line-height: .95; font-weight: 700; letter-spacing: -.03em; }
.intro p { margin: 0; max-width: 34ch; color: var(--paper-dim); font-size: 16px; }
.intro .primary {
  margin-top: 10px; border: 0; border-radius: 999px; padding: 16px 22px; font-size: 17px; font-weight: 600;
  background: var(--crest); color: var(--ink); max-width: 340px;
}
.intro .ghost { max-width: 340px; padding: 13px 22px; font-size: 15px; }
.intro .fine { font-size: 13px; }
.error { color: var(--rec) !important; min-height: 1.4em; }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 44px); transform: translateX(-50%);
  background: var(--paper); color: var(--ink); padding: 9px 15px; border-radius: 999px; font-size: 14px;
  max-width: calc(100% - 32px); text-align: center; pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .rec span, .meter span { transition: none; } }
