/*
  style.css — EDEN studio mock-up. Author: Thomas DeVine.

  Look: black ground, white type; colour only comes from the sound (the face and glass canvases)
  and from activity glows. One custom property drives every glow:
      --act   0 … 1   how hard a control / pedal / node is working right now (set from JS each frame)
  Layout:  top bar · river · view tabs · main view (studio | stage | glossary)
  Breakpoints: 1100 (tablet), 720 (phone, 375 px minimum)
*/
:root {
  --bg: #000; --fg: #fff; --dim: rgba(255,255,255,.6); --faint: rgba(255,255,255,.14); --line: rgba(255,255,255,.22);
  --card: rgba(10,10,12,.62); --r: 18px; --r-s: 10px;
  --f-display: 'Clash Display', 'Satoshi', system-ui, sans-serif;
  --f-body: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #2a2a2e; color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { background: #2a2a2e; padding: 20px 0; }   /* no viewport units: the page height is just the window, so embedded previews size correctly */

/* ---------- the plug-in window (a normal window inside the DAW, never maximised) ---------- */
.win { position: relative; margin: 0 auto; left: 0; top: 0; width: 1280px; height: 800px;
  background: #000; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 30px 80px rgba(0,0,0,.7);
  display: flex; flex-direction: column; overflow: hidden; z-index: 1; }
.win-bar { height: 30px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: #141416;
  border-bottom: 1px solid rgba(255,255,255,.1); cursor: grab; user-select: none; touch-action: none; }
.win-bar:active { cursor: grabbing; }
.win-dots { display: flex; gap: 7px; } .win-dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a3e; }
.win-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--dim); }
.win-size { margin-left: auto; font-family: var(--f-mono); font-size: 10.5px; color: var(--dim); }
.win-body { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.win-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; }
.win-grip { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; z-index: 50; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.35) 50%, rgba(255,255,255,.35) 56%, transparent 56%, transparent 68%, rgba(255,255,255,.35) 68%, rgba(255,255,255,.35) 74%, transparent 74%); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }
h2, h3, h4 { font-family: var(--f-display); font-weight: 600; letter-spacing: .02em; margin: 0; }

/* background canvases */
#face { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
#glass { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; transition: opacity .4s; }
header, nav, main { position: relative; z-index: 2; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 20px; padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(#000 40%, rgba(0,0,0,0)); position: sticky; top: 0; z-index: 30; }
.brand { font-family: var(--f-display); font-weight: 700; font-size: 26px; letter-spacing: .18em; display: flex; align-items: baseline; gap: 10px; }
.draft-tag, .draft, .tip-h i { font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; font-weight: 400; font-style: normal;
  border: 1px dashed var(--line); border-radius: 4px; padding: 1px 5px; color: var(--dim); white-space: nowrap; }
.preset { display: flex; align-items: center; gap: 6px; }
.p-label { min-width: 140px; text-align: center; font-weight: 700; }
.tools, .source { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.source { margin-left: auto; }
.glass-ctl { display: inline-flex; align-items: center; gap: 6px; }
.glass-ctl input { width: 70px; accent-color: #fff; }
.src-name { font-family: var(--f-mono); font-size: 11px; color: var(--dim); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--line); background: rgba(255,255,255,.06); border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 13px;
  letter-spacing: .06em; min-height: 40px; transition: background .2s, border-color .2s, box-shadow .2s; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn.lit, .btn[aria-pressed="true"].toggle, .btn.play[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; box-shadow: 0 0 18px rgba(255,255,255,.35); }
.btn.play { min-width: 104px; justify-content: center; }
.file { cursor: pointer; }


/* ---------- diagnostics: one-line row (default) or full-window glass ---------- */
.diag-row { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; z-index: 35; background: #050506; border-top: 1px solid rgba(255,255,255,.14); }
body:not(.glass-full) .win-scroll { bottom: 44px; }            /* the page ends above the row, nothing hides under it */
body.glass-full .diag-row { display: none; }
.diag-expand { position: absolute; right: 30px; bottom: 7px; z-index: 45; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4); background: #000; font-weight: 700; font-size: 11px; letter-spacing: .08em; }
.diag-expand:hover, .diag-expand[aria-pressed="true"] { background: #fff; color: #000; }
body.glass-full .diag-expand { bottom: 14px; }
.layers { position: absolute; left: 24px; bottom: 14px; z-index: 45; display: none; gap: 4px; align-items: center; flex-wrap: wrap; right: 170px; }
body.glass-full .layers { display: flex; }
.ly-h { font-family: var(--f-mono); font-size: 10px; color: var(--dim); margin-right: 6px; }
.layers button { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.6); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--dim); }
.layers button[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }

/* ---------- river ---------- */
.river { height: 96px; margin: 0 20px; border-radius: var(--r); overflow: hidden; background: rgba(0,0,0,.35); border: 1px solid var(--faint); }
.river canvas { position: absolute; inset: 0; }
.river-nodes { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 3%; }
.rnode { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; --act: 0; min-width: 64px; }
.rn-dot { width: 22px; height: 22px; border-radius: 50%; background: #000; border: 2px solid #fff;
  box-shadow: 0 0 calc(4px + var(--act) * 26px) rgba(255,255,255, calc(.25 + var(--act) * .7)); transition: transform .3s var(--ease); }
.rn-name { font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .1em; }
.rn-key { font-family: var(--f-mono); font-size: 10px; color: var(--dim); }
.rnode.on .rn-dot { background: #fff; transform: scale(1.25); }
.rnode.on .rn-name { text-decoration: underline; text-underline-offset: 5px; }

/* ---------- view tabs ---------- */
.views { display: flex; gap: 4px; margin: 14px 20px 0; }
.views button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font-weight: 700; letter-spacing: .1em; font-size: 12px; color: var(--dim); }
.views button[aria-pressed="true"] { color: #fff; border-color: #fff; }
.view { display: none; padding: 18px 20px 80px; max-width: 1400px; margin: 0 auto; }
body[data-view="studio"] .v-studio, body[data-view="stage"] .v-stage, body[data-view="glossary"] .v-glossary { display: block; animation: rise .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- sections ---------- */
.section { animation: rise .45s var(--ease); }
.sec-head { margin-bottom: 18px; }
.sec-head h2 { font-size: clamp(30px, 5vw, 54px); font-weight: 700; letter-spacing: .06em; line-height: 1; }
.sec-head p { margin: 8px 0 0; color: var(--dim); max-width: 70ch; }
.cards, .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--faint); border-radius: var(--r); padding: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card.wide { grid-column: 1 / -1; }
.card h3 { font-size: 14px; letter-spacing: .16em; margin-bottom: 12px; }
.knobs { display: flex; flex-wrap: wrap; gap: 14px 10px; }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.mode-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.hint { color: var(--dim); font-size: 13px; }
.blurb { color: var(--dim); margin: 0 0 14px; max-width: 70ch; }
.concept { border: 1px dashed var(--line); border-radius: var(--r-s); padding: 14px; color: var(--dim); }
.slot { border: 1px dashed var(--line); border-radius: var(--r-s); padding: 16px; display: grid; gap: 8px; justify-items: start; }
.slot-name { font-weight: 700; } .slot-sub { color: var(--dim); font-size: 13px; }

/* ---------- knob ---------- */
.knob { display: flex; flex-direction: column; align-items: center; gap: 2px; width: max-content; min-width: 84px; touch-action: none; user-select: none; --act: 0; position: relative; }
.knob canvas { cursor: ns-resize; border-radius: 50%; filter: drop-shadow(0 0 calc(var(--act) * 14px) rgba(255,255,255, calc(var(--act) * .45))); }
.k-label { font-weight: 700; font-size: 11px; letter-spacing: .1em; text-align: center; max-width: 110px; }
.k-val { font-family: var(--f-mono); font-size: 12px; color: var(--dim); cursor: text; min-height: 18px; }
.k-input { font-family: var(--f-mono); font-size: 12px; width: 84px; text-align: center; background: #000; border: 1px solid #fff; border-radius: 6px; padding: 2px; }
.knob.big .k-label { font-size: 13px; }
body.learning .knob canvas, body.learning .sw { outline: 1px dashed #fff; outline-offset: 4px; }

/* ---------- switch & choice ---------- */
.sw { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 999px;
  padding: 7px 14px; font-weight: 700; font-size: 12px; letter-spacing: .08em; min-height: 36px; --act: 0; }
.sw-led { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; background: rgba(255,255,255, var(--act));
  box-shadow: 0 0 calc(var(--act) * 14px) rgba(255,255,255, var(--act)); }
.choice { display: grid; gap: 6px; min-width: 0; max-width: 100%; }
.cols > *, .cards > * { min-width: 0; }
.c-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--dim); }
.c-row { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 20px; padding: 3px; gap: 2px; width: fit-content; max-width: 100%; }
.c-opt { background: none; border: 0; border-radius: 999px; padding: 7px 13px; font-weight: 700; font-size: 12px; letter-spacing: .06em; min-height: 34px; transition: background .25s var(--ease), color .25s; }
.c-opt.on { background: #fff; color: #000; }

/* ---------- visual editors ---------- */
.eq, .viz { position: relative; height: 200px; border-radius: var(--r-s); border: 1px solid var(--faint); background: rgba(0,0,0,.45); overflow: hidden; touch-action: none; }
.eq canvas, .viz canvas { position: absolute; inset: 0; cursor: crosshair; }
.eq-label, .viz-cap { position: absolute; left: 10px; bottom: 8px; font-family: var(--f-mono); font-size: 10.5px; color: var(--dim); pointer-events: auto; }
.wavebox { display: grid; gap: 10px; margin: 12px 0; }
.viz.wave { height: 150px; }

/* ---------- pedalboard ---------- */
.board { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.pedal { position: relative; width: 132px; height: 150px; border-radius: 16px; border: 1px solid var(--line); background: rgba(12,12,14,.8);
  padding: 14px 12px; display: flex; flex-direction: column; justify-content: space-between; cursor: grab; touch-action: none; user-select: none;
  transition: transform .3s var(--ease), border-color .2s, opacity .2s; --act: 0; overflow: hidden; }
.pedal:hover { border-color: rgba(255,255,255,.55); }
.p-glow { position: absolute; inset: -40%; background: radial-gradient(circle at 50% 75%, rgba(255,255,255, calc(var(--act) * .35)), transparent 55%); pointer-events: none; }
.p-name { font-family: var(--f-display); font-weight: 600; font-size: 16px; position: relative; }
.p-meta { font-family: var(--f-mono); font-size: 9.5px; color: var(--dim); position: relative; }
.p-sw { position: relative; align-self: center; width: 38px; height: 38px; border-radius: 50%; border: 2px solid #fff; background: #000; }
.pedal.on .p-sw { background: #fff; box-shadow: 0 0 calc(6px + var(--act) * 18px) rgba(255,255,255,.7); }
.pedal:not(.on) { opacity: .55; }
.pedal.open { border-color: #fff; border-width: 2px; }
.pedal.par::after { content: '∥'; position: absolute; top: 10px; right: 12px; font-weight: 700; }
.pedal.dragging { cursor: grabbing; z-index: 20; transition: none; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.pedal.removing { opacity: .3; border-style: dashed; }
.pedal.add { align-items: center; justify-content: center; border-style: dashed; background: transparent; cursor: pointer; gap: 6px; opacity: 1; }
.pedal.add span { font-size: 34px; font-weight: 300; line-height: 1; }
.unit { margin-top: 4px; }
.unit-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.unit-top h3 { font-size: 24px; letter-spacing: .04em; margin: 0; }
.unit-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ir, .ir-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.ir select, .ir-row select { background: #000; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-width: 100%; }

/* ---------- tooltip ---------- */
#tip { position: fixed; z-index: 60; max-width: 340px; background: rgba(0,0,0,.92); border: 1px solid rgba(255,255,255,.4); border-radius: 12px;
  padding: 12px 14px; font-size: 13px; pointer-events: none; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
#tip p { margin: 6px 0; }
.tip-h { font-family: var(--f-display); font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.tip-row { display: grid; grid-template-columns: 62px 1fr; gap: 8px; margin-top: 5px; color: var(--dim); }
.tip-row span { font-weight: 700; color: #fff; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- modal / toast / command bar ---------- */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: min(680px, 100%); max-height: 86vh; overflow: auto; background: #050506; border: 1px solid var(--line); border-radius: var(--r); padding: 24px; animation: rise .3s var(--ease); }
.modal-box h3 { font-size: 22px; margin-bottom: 8px; } .modal-box h4 { font-size: 12px; letter-spacing: .14em; color: var(--dim); margin: 16px 0 8px; }
.x { position: absolute; top: 12px; right: 12px; background: none; border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; }
.lib { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-item { border: 1px solid var(--faint); background: none; border-radius: 999px; padding: 7px 12px; font-size: 13px; color: var(--dim); }
.lib-item.detail { color: #fff; border-color: var(--line); font-weight: 700; }
.lib-item i { font-style: normal; font-family: var(--f-mono); font-size: 9px; margin-left: 6px; opacity: .6; }
.lib-item:hover { background: #fff; color: #000; }
.cmd-in { width: 100%; background: #000; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 16px; margin-bottom: 10px; }
.cmd-list { display: grid; gap: 2px; }
.cmd { text-align: left; background: none; border: 0; border-radius: 8px; padding: 10px 12px; }
.cmd.sel, .cmd:hover { background: #fff; color: #000; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: #fff; color: #000; font-weight: 700;
  padding: 10px 18px; border-radius: 999px; max-width: calc(100vw - 32px); text-align: center; font-size: 13px; }
.toast[hidden] { display: none; }
.steps { padding-left: 20px; } .steps li { margin: 8px 0; }
.cap-meters { display: grid; gap: 8px; margin: 14px 0; }
.cap-meters div { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.cap-meters i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #fff calc(var(--l) * 100%), var(--faint) 0); }
.qr { display: grid; grid-template-columns: repeat(11, 1fr); width: 176px; aspect-ratio: 1; gap: 2px; margin: 16px 0; padding: 10px; background: #fff; border-radius: 8px; }
.qr i { background: #000; }
.code { font-family: var(--f-mono); font-size: 20px; letter-spacing: .1em; }

/* ---------- STAGE ---------- */
.setup { width: 100%; max-width: 900px; display: block; margin: 0 0 24px; }
.stage-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.dev-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--dim); margin-bottom: 8px; }
.ipad-screen { border: 10px solid #1b1b1e; border-radius: 28px; aspect-ratio: 4 / 3; background: rgba(0,0,0,.55); padding: 20px; display: grid; place-items: center; }
.ipad-knobs { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.phone-screen { border: 8px solid #1b1b1e; border-radius: 34px; aspect-ratio: 9 / 18; max-width: 260px; background: #000; padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.ph-note { font-family: var(--f-display); font-weight: 700; font-size: 96px; line-height: 1; transition: color .2s; }
#phNeedle { width: 100%; max-width: 230px; height: auto; }
.ph-hz { font-family: var(--f-mono); font-size: 12px; color: var(--dim); min-height: 18px; }
.ph-mute { margin-top: 18px; width: 100%; min-height: 64px; border-radius: 16px; border: 2px solid #fff; background: none; font-weight: 700; font-size: 18px; letter-spacing: .14em; }
.ph-mute.on { background: #fff; color: #000; }
.stage-h { font-size: 14px; letter-spacing: .16em; margin: 30px 0 12px; }
.fsw { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 900px; }
.sw-foot { border: 1px solid var(--line); background: rgba(10,10,12,.8); border-radius: 16px; padding: 14px; min-height: 104px; display: grid; gap: 4px; justify-items: center; text-align: center; --act: 0;
  box-shadow: 0 0 calc(var(--act) * 26px) rgba(255,255,255, calc(var(--act) * .5)); transition: border-color .2s; }
.sw-foot.on { border-color: #fff; }
.fs-l { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center; font-weight: 700; }
.sw-foot.on .fs-l { background: #fff; color: #000; }
.fs-t { font-weight: 700; font-size: 13px; } .fs-cc { font-family: var(--f-mono); font-size: 10px; color: var(--dim); }
.expr { display: flex; flex-wrap: wrap; gap: 12px; }
.exp-pedal { border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; display: grid; gap: 4px; min-width: 240px; }
.exp-pedal span { font-family: var(--f-mono); font-size: 11px; color: var(--dim); }

/* ---------- GLOSSARY ---------- */
.gl { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.gl-item { background: var(--card); border: 1px solid var(--faint); border-radius: 14px; padding: 14px 16px; }
.gl-item h4 { font-size: 15px; margin-bottom: 4px; } .gl-item p { margin: 4px 0; font-size: 13px; color: var(--dim); } .gl-item b { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stage-grid { grid-template-columns: 1fr; }
  .phone-screen { margin: 0 auto; }
}
@media (max-width: 720px) {
  .top { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 20px; } .draft-tag { display: none; }
  .p-label { min-width: 0; font-size: 13px; }
  .source { margin-left: 0; width: 100%; } .src-name { display: none; }
  .glass-ctl input { display: none; }
  .river { margin: 0 12px; height: 84px; }
  .rnode { min-width: 0; padding: 4px; } .rn-name { font-size: 10px; letter-spacing: .04em; } .rn-key { display: none; }
  .views { margin: 10px 12px 0; }
  .view { padding: 14px 12px 80px; }
  .cards, .cols { grid-template-columns: 1fr; }
  .pedal { width: calc(50% - 6px); height: 128px; }
  .knob { min-width: 76px; }
  .fsw { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

p.draft { border: 0; padding: 0; font-size: 11px; white-space: normal; }
