/* FRAMECHOP, a sound thrift plugin. Brand rules live in brand.css; this file only lays the instrument out. */
:root { --sky-img: url(assets/sky.jpg); }
html, body { min-height: 100%; }
body { padding: 0 0 48px; font-size: 13px; font-variant-numeric: tabular-nums; -webkit-user-select: none; user-select: none; }

.shell { max-width: 1360px; margin: 0 auto; }
.shell > *:not(.fc-head) { margin-left: clamp(16px, 2.5vw, 32px); margin-right: clamp(16px, 2.5vw, 32px); }

/* header: the name splits at the horizon */
.fc-head { position: relative; height: 136px; overflow: hidden; margin-bottom: 24px; }
.fc-head .fc-sky { position: absolute; left: 50%; right: 0; top: 0; bottom: 0; --sky-size: 230% auto; --sky-pos: right 46%; }
.fc-head .word { position: absolute; top: 50%; transform: translateY(-50%); margin: 0; font-size: clamp(36px, 6vw, 76px); }
.fc-head .w1 { right: 50%; font-weight: 200; }
.fc-head .w2 { left: 50%; font-weight: 800; color: #fff; }
.fc-head .door { --w: 44px; } .fc-head .door.a { left: clamp(16px, 2.5vw, 32px); --h: 104px; } .fc-head .door.b { left: calc(clamp(16px, 2.5vw, 32px) + 56px); --h: 78px; }
.fc-head .fc-tag { position: absolute; left: clamp(16px, 2.5vw, 32px); bottom: 14px; }
.topbar { position: absolute; right: clamp(16px, 2.5vw, 32px); top: 0; bottom: 0; display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; align-content: center; max-width: 30%; }
.topbar .file { flex-basis: 100%; text-align: right; font-family: var(--data); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .btn { background: var(--cloud); border-color: var(--cloud); color: var(--ink); }
.topbar .btn:hover { background: #fff; }

body.nohelper .needs-helper { display: none; }

/* layout */
.row3 { display: grid; grid-template-columns: 256px minmax(0, 1fr) 352px; gap: 32px; align-items: start; }
.rowB { display: grid; grid-template-columns: 256px minmax(0, 1fr) 352px; gap: 32px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.gap { height: 32px; }
.panel { border-top: 1px solid var(--ink); padding-top: 12px; min-width: 0; }
.panel > h2 { margin: 0 0 12px; font: 400 11px/1.2 var(--data); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.panel > h2 b { font-weight: 400; color: var(--orange-text); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.line > .btn { flex: 1; }
.grow { flex: 1; }

/* controls: outlined pills, ink when on */
.btn { min-height: 36px; padding: 0 14px; font-size: 13px; text-transform: lowercase; background: transparent; color: var(--ink); gap: 8px; }
.btn:hover { background: rgba(18, 18, 18, 0.06); }
.btn.on, .btn.on:hover { background: var(--ink); color: var(--cloud); }
.btn.sm { min-height: 30px; padding: 0 12px; font-size: 12px; }
#bRec.on, #bRec.on:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn kbd { font: 400 9px/1 var(--data); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.btn.on kbd { color: #b9b6ac; } #bRec.on kbd { color: var(--ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; flex: none; }
.btn.on .dot { background: currentColor; }

label.f { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font: 400 11px/1 var(--data); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
input[type=number], select, input[type=url] {
  font: 800 13px/1 var(--font); color: var(--ink); height: 36px; padding: 0 12px; min-width: 0; width: 100%;
  border: 1px solid var(--ink); border-radius: 18px; background: var(--cloud); font-variant-numeric: tabular-nums;
}
input[type=url] { font-weight: 400; -webkit-user-select: text; user-select: text; }
input[type=url]::placeholder { color: var(--muted); }
input[type=range] { accent-color: var(--ink); min-width: 0; width: 100%; height: 16px; margin: 0; }
.knobs { display: grid; grid-template-columns: 68px minmax(0, 1fr) 60px; gap: 10px 10px; align-items: center; }
.knobs > span:not(.v) { font: 400 11px/1 var(--data); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.knobs .v { text-align: right; font-weight: 800; }
.knobs select { height: 30px; padding: 0 8px; }
.ends { display: flex; justify-content: space-between; font: 400 9px/1 var(--data); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

/* display */
.deck { min-height: 176px; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; --sky-size: 420% auto; --sky-pos: right 52%; }
.deck .time { font: 800 44px/1 var(--font); letter-spacing: -0.04em; color: #fff; }
.deck .meta { display: grid; gap: 4px; font: 400 11px/1.3 var(--data); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }
.deck .meta b { font-weight: 400; }

/* monitor */
.screen { position: relative; aspect-ratio: 16 / 9; background: var(--ink); overflow: hidden; cursor: pointer; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--ink); }
.screen video.pv { visibility: hidden; }
.screen video.pv.live { visibility: visible; z-index: 2; }
.screen .empty { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 8px; padding: 32px; background: var(--sky); color: #fff; }
.screen .empty b { font: 200 clamp(30px, 4.4vw, 56px)/1 var(--font); letter-spacing: -0.04em; text-transform: lowercase; }
.screen .empty span { font-size: 14px; max-width: 44ch; }
.screen .empty::before { content: ""; position: absolute; right: 40px; top: -40px; width: 72px; height: 55%; border-radius: 72px; background: var(--sky-img) 30% 40% / auto 170% no-repeat; }
.screen.drag { outline: 2px dashed var(--orange); outline-offset: -10px; }
.screen .tag { position: absolute; left: 12px; top: 12px; z-index: 4; padding: 6px 12px; border-radius: 999px; background: var(--cloud); color: var(--ink); font: 400 11px/1 var(--data); letter-spacing: 0.08em; pointer-events: none; }

/* pads */
.pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad { position: relative; aspect-ratio: 1; border: 1px solid var(--ink); border-radius: 14px; background: var(--cloud); cursor: pointer; touch-action: none; }
.pad .num { position: absolute; left: 10px; bottom: 8px; font: 800 20px/1 var(--font); letter-spacing: -0.03em; color: #8a877d; }
.pad.has .num { color: var(--ink); }
.pad .key { position: absolute; right: 10px; top: 10px; font: 400 10px/1 var(--data); color: var(--muted); }
.pad .len { position: absolute; right: 10px; bottom: 10px; font: 400 9px/1 var(--data); color: var(--muted); }
.pad .hub { display: none; }
.pad.offline { border-style: dashed; }
.pad.sel::after { content: ""; position: absolute; left: 12px; top: -1px; width: 12px; height: 30px; border-radius: 0 0 6px 6px; background: var(--orange); }
.pad.on { background: var(--ink); transform: translateY(1px); }
.pad.on .num { color: var(--cloud); } .pad.on .key, .pad.on .len { color: #b9b6ac; }

/* sample strip */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.tab { height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 800 12px/1 var(--font); cursor: pointer; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.on { background: var(--ink); color: var(--cloud); }
.tab.missing { border-style: dashed; color: var(--muted); }
.wave { position: relative; height: 156px; background: var(--sky); overflow: hidden; }
.wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wave #ov { cursor: crosshair; touch-action: none; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }

/* looper + pattern */
.loopbar { height: 4px; background: var(--line); overflow: hidden; }
.loopbar i { display: block; height: 100%; width: 0; background: var(--ink); }
.loopbar.rec i { background: var(--orange); }
.gridwrap { position: relative; border: 1px solid var(--line); background: var(--cloud); overflow: hidden; }
.gridwrap canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: cell; }
.hint { color: var(--muted); font-size: 12px; }

.statusbar { display: flex; gap: 16px; margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.statusbar #status { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.statusbar .keys { font: 400 11px/1.4 var(--data); letter-spacing: 0.06em; text-transform: uppercase; }

@media (max-width: 1040px) {
  .row3, .rowB { grid-template-columns: 1fr; }
  .row3 .center { order: -1; }
  .pads { max-width: 440px; margin: 0 auto; width: 100%; }
  .fc-head { height: auto; padding-bottom: 12px; }
  .fc-head .word { top: 68px; }
  .topbar { position: relative; max-width: none; margin-top: 136px; justify-content: flex-start; right: auto; padding: 0 16px; }
  .topbar .file { text-align: left; color: var(--muted); }
  .topbar .btn { border-color: var(--ink); }
  .fc-head .fc-sky { bottom: auto; height: 136px; }
}
