/* SFXiz — every value here comes from PROJECT/BRIEFS/design_system.md. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "sfx-mono";
  src: url("../fonts/plexmono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "sfx-mono";
  src: url("../fonts/plexmono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --canvas: #e8e9eb;
  --surface: #f7f7f8;
  --sunken: #dcdee2;
  --ink: #141518;
  --ink-2: #5b5f67;
  --hairline: #c6c9ce;
  --pad: #f4f5f6;
  --pad-hi: #ffffff;
  --pad-lo: rgba(20, 21, 24, 0.16);
  --rec: #cf3426;
  --rec-ink: #ffffff;
  --danger: #b3261e;

  --t-body: 15px;
  --t-small: 13px;
  --t-mono: 12.5px;
  --t-mono-cap: 11px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --ctl: 44px;
  --r-press: 6px;
  --r-hold: 10px;
  --col: 760px;
  --gutter: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #1b1d21;
    --surface: #24272c;
    --sunken: #141619;
    --ink: #eceef1;
    --ink-2: #a0a5ad;
    --hairline: #363a41;
    --pad: #2b2e34;
    --pad-hi: #3b3f47;
    --pad-lo: rgba(0, 0, 0, 0.5);
    --rec: #ff6150;
    --rec-ink: #1b0a07;
    --danger: #ff8a7e;
  }
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font: 400 var(--t-body)/1.45 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--rec); outline-offset: 2px; }

.wrap { max-width: calc(var(--col) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------------------------------------------ header */
.top {
  display: flex; align-items: center; gap: var(--s2);
  height: 64px;
}
.mark {
  font-size: 26px; line-height: 1; font-weight: 700; font-stretch: 125%;
  letter-spacing: -0.02em; margin: 0; flex: 1;
}
.mark b { font-weight: 700; color: var(--ink-2); }
.quiet {
  height: var(--ctl); min-width: var(--ctl); padding: 0 var(--s3);
  background: none; border: 0; border-radius: var(--r-press);
  font-size: var(--t-small); font-weight: 500; letter-spacing: 0.01em; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.quiet:hover { color: var(--ink); }

/* ------------------------------------------------------------------ describe field */
.ask {
  display: flex; align-items: center; gap: var(--s1);
  background: var(--sunken); border: 1px solid var(--hairline); border-radius: var(--r-hold);
  padding: 0 var(--s1) 0 var(--s4);
  height: 52px;
}
.ask input {
  flex: 1; min-width: 0; height: var(--ctl); border: 0; background: none; outline: none;
  font-size: 16px;
}
.ask input::placeholder { color: var(--ink-2); opacity: 1; }
.ask:focus-within { border-color: var(--ink-2); }
/* while a described sound is being made: the field and the arrow are greyed and take no press */
.ask.busy input, .ask.busy #send { opacity: 0.45; cursor: default; }
.ask.busy #send:hover { color: var(--ink-2); }
.icon {
  width: var(--ctl); height: var(--ctl); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: var(--r-press); color: var(--ink-2);
}
.icon:hover { color: var(--ink); }
.icon svg { width: 20px; height: 20px; }
.icon[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink); }
.icon.rec { background: var(--rec); color: var(--rec-ink); }

.say {
  margin: var(--s2) 0 0; max-width: 60ch; min-height: 0;
  font-size: var(--t-small); color: var(--ink-2);
}
.say.error { color: var(--danger); }
.say span { display: block; }

/* ------------------------------------------------------------------ pads */
.pads {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  margin: 0; padding: 0; list-style: none;
}
.sheet-wrap { margin-top: var(--s4); }
.pad {
  height: var(--ctl); padding: 0 var(--s4);
  background: var(--pad); border: 1px solid transparent; border-radius: var(--r-press);
  box-shadow: inset 0 1px 0 var(--pad-hi), inset 0 -2px 0 var(--pad-lo);
  font-size: 15px; line-height: 1; font-weight: 500; font-stretch: 112%; letter-spacing: 0.01em;
  white-space: nowrap;
}
.pad:hover { border-color: var(--ink-2); }
.pad:active, .pad.on {
  background: var(--sunken);
  box-shadow: inset 0 2px 0 var(--pad-lo);
  transform: translateY(1px);
}
.pad.on { border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .pad:active, .pad.on { transform: none; } }

.drop {
  display: flex; align-items: center; gap: var(--s2);
  height: var(--ctl); margin: var(--s4) 0 0; padding: 0 var(--s3) 0 0;
  background: none; border: 0; color: var(--ink-2); font-size: var(--t-small); font-weight: 500;
}
.drop svg { width: 20px; height: 20px; }
.drop:hover { color: var(--ink); }

/* ------------------------------------------------------------------ takes: the signature */
.takes-wrap { margin: var(--s5) 0 0; }
.takes-wrap:has(.takes:empty) { display: none; }
main.wrap { padding-bottom: var(--s7); }
.takes {
  background: var(--surface); border-radius: var(--r-hold); overflow: hidden;
}
.takes:empty { display: none; }
.take {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) var(--ctl); align-items: center;
  height: 56px; padding: 0 var(--s1) 0 var(--s3);
}
.take + .take { border-top: 1px solid var(--hairline); }
.take.sel { background: var(--sunken); }
.take .dur {
  font: 400 var(--t-mono)/1.2 "sfx-mono", ui-monospace, monospace; letter-spacing: 0.02em;
  color: var(--ink-2);
}
.wave {
  display: block; height: 40px; width: 100%;
  background: none; border: 0; padding: 0; border-radius: 0;
}
.wave canvas { display: block; width: 100%; height: 100%; }
.more-row { display: flex; justify-content: flex-end; margin-top: var(--s1); }
.more-row .quiet { gap: var(--s2); }
.more-row svg { width: 20px; height: 20px; }
.waiting {
  display: flex; align-items: center; height: 56px; padding: 0 var(--s3);
  font: 400 var(--t-mono)/1.2 "sfx-mono", ui-monospace, monospace; color: var(--ink-2);
}

/* ------------------------------------------------------------------ settings sheet */
.sheet-wrap { position: relative; }
.sheet {
  position: absolute; left: 0; right: 0; top: calc(100% + var(--s2)); z-index: 5;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-hold);
  padding: var(--s4);
}
@media (min-width: 720px) { .sheet { left: auto; width: 340px; } }
.sheet h2 {
  margin: 0 0 var(--s2); font: 500 var(--t-mono-cap)/1.2 "sfx-mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.sheet h2 + * { margin-top: 0; }
.sheet .group + .group { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--hairline); }
.row {
  display: grid; grid-template-columns: 84px 1fr 56px; align-items: center; gap: var(--s2);
  height: var(--ctl);
  font-size: var(--t-small); font-weight: 500; letter-spacing: 0.01em;
}
.row output {
  text-align: right; font: 400 var(--t-mono)/1.2 "sfx-mono", ui-monospace, monospace; color: var(--ink-2);
}
.row input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: var(--ctl); margin: 0;
  background: none; --fill: 50%;
}
.row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 0;
  background: linear-gradient(to right, var(--ink) var(--fill), var(--hairline) var(--fill)); /* slop-ok: a hard-stop two-colour split, the slider's filled part; no visible gradient */
}
.row input[type="range"]::-moz-range-track { height: 4px; border-radius: 0; background: var(--hairline); }
.row input[type="range"]::-moz-range-progress { height: 4px; border-radius: 0; background: var(--ink); }
.row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 0 2px var(--surface);
}
.row input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border: 0; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 0 2px var(--surface);
}
.seg {
  display: inline-flex; height: var(--ctl); padding: var(--s1); gap: var(--s1);
  background: var(--sunken); border-radius: var(--r-press);
}
.seg button {
  border: 0; background: none; border-radius: var(--r-press); padding: 0 var(--s3);
  font: 400 var(--t-mono)/1 "sfx-mono", ui-monospace, monospace; letter-spacing: 0.02em; color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sheet .reset { margin-top: var(--s1); padding: 0; height: var(--ctl); }

/* ------------------------------------------------------------------ help */
.help {
  margin: 0 0 var(--s4); padding: var(--s4); width: fit-content; max-width: 100%;
  background: var(--surface); border-radius: var(--r-hold);
  font-size: var(--t-small); font-weight: 500; line-height: 1.4; letter-spacing: 0.01em;
}
.help p { margin: 0; max-width: 60ch; text-wrap: pretty; }
.help p + p { margin-top: var(--s2); }

/* ------------------------------------------------------------------ sign-in */
.signin { max-width: 380px; margin: 12vh auto 0; padding: 0 var(--gutter); }
.signin .mark { margin-bottom: var(--s5); }
.signin form { display: grid; gap: var(--s3); }
.signin label { display: grid; gap: var(--s1); font-size: var(--t-small); font-weight: 500; }
.field {
  height: var(--ctl); padding: 0 var(--s3); font-size: 16px;
  background: var(--sunken); border: 1px solid var(--hairline); border-radius: var(--r-press);
}
.field:focus { border-color: var(--ink-2); outline: none; }
.btn {
  height: var(--ctl); padding: 0 var(--s4);
  background: var(--ink); color: var(--canvas); border: 0; border-radius: var(--r-press);
  font-weight: 600; font-stretch: 112%; letter-spacing: 0.01em; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  text-decoration: none;
}
@media (max-width: 719px) { .vbar .btn { padding: 0 var(--s3); } }
.btn.ghost { background: var(--sunken); color: var(--ink); border: 1px solid var(--hairline); }
.or { display: flex; align-items: center; gap: var(--s3); color: var(--ink-2); font-size: var(--t-small); margin: var(--s2) 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--hairline); }
.ask.bare { background: none; border: 0; justify-content: flex-end; padding: 0; }

/* ------------------------------------------------------------------ the video panel */
.drop.hot { color: var(--ink); outline: 2px dashed var(--ink-2); outline-offset: 2px; border-radius: var(--r-press); }
.video {
  margin: var(--s2) 0 0; padding: var(--s3);
  background: var(--surface); border-radius: var(--r-hold);
}
.video video {
  display: block; width: 100%; max-height: 56vh; background: #000; border-radius: 0;
  cursor: pointer;
}
.strip {
  position: relative; height: 72px; margin-top: var(--s3);
  background: var(--sunken); border-radius: 0; touch-action: none; cursor: pointer;
}
.strip canvas { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40px; }
.strip .head {
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: var(--rec); pointer-events: none;
}
.tick {
  position: absolute; top: 0; bottom: 0; width: 24px; margin-left: -12px;
  padding: 0; border: 0; background: none; cursor: grab; touch-action: none;
}
.tick::before {
  content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--ink-2);
}
.tick span {
  position: absolute; left: 16px; top: 4px; white-space: nowrap;
  font: 400 var(--t-mono)/1.2 "sfx-mono", ui-monospace, monospace; letter-spacing: 0.02em; color: var(--ink-2);
  pointer-events: none;
}
.tick.sel::before { background: var(--ink); width: 3px; left: 10.5px; }
.tick.sel span { color: var(--ink); }
.tick span i { font-style: normal; color: var(--ink-2); margin-left: var(--s1); }
.tick.flip span { left: auto; right: 16px; }     /* near the right edge the label opens leftward */
.vbar {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--s2);
  margin-top: var(--s3);
}
.vbar .tc { grid-column: 1; }
.vbar .act { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
@media (min-width: 720px) {
  .vbar { grid-template-columns: 1fr auto auto auto; }
  .vbar .act { grid-column: auto; grid-row: 1; grid-template-columns: auto auto; }
  .vbar .tc { grid-row: 1; }
}
.vbar .tc {
  font: 400 var(--t-mono)/1.2 "sfx-mono", ui-monospace, monospace; letter-spacing: 0.02em; color: var(--ink-2);
}
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.45; cursor: default; }
.video .waiting { height: var(--ctl); padding: 0; }
.vbar .tc { grid-row: 1; grid-column: 1; }
.vbar .rm { grid-row: 1; grid-column: 2; }
.vbar .shut { grid-row: 1; grid-column: 3; }
.vbar .act { grid-row: 2; }
@media (min-width: 720px) {
  .vbar .act { grid-row: 1; grid-column: 3; }
  .vbar .shut { grid-column: 4; }
}

/* ------------------------------------------------------------------ v2: Cuts | Beats, bar marks */
.on-row { display: flex; justify-content: flex-end; margin-top: var(--s3); }
.strip .marks { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; pointer-events: none; }
.strip .marks i { position: absolute; bottom: 0; width: 1px; height: 8px; background: var(--ink-2); }

/* ------------------------------------------------------------------ v2: a take's character */
.take .lead { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.take .tname {
  font: 400 var(--t-mono)/1.2 "sfx-mono", ui-monospace, monospace; letter-spacing: 0.02em;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.take .tname:empty { display: none; }
/* A take made from words has no character name and keeps the same 96px column, so its wave starts
   where a pad take's does: one list, whichever door filled it (2026-11-15). */

/* ------------------------------------------------------------------ v2: the pads fold on a phone */
.pads .more-li { display: none; }
@media (max-width: 719px) {
  .pads .more-li { display: list-item; }
  .pads:not(.open) .extra { display: none; }
}
.pad.more { color: var(--ink-2); }

/* ------------------------------------------------------------------ described sounds: quality */
.row.flip { grid-template-columns: 1fr auto; }
.sheet .needs { margin: var(--s1) 0 0; font-size: var(--t-small); color: var(--ink-2); }
.switch {
  position: relative; width: 44px; height: 26px; padding: 0; border: 0; border-radius: 13px;
  background: var(--sunken); box-shadow: inset 0 0 0 1px var(--ink-2); cursor: pointer;
}
.switch::before { content: ""; position: absolute; inset: -9px -4px; }   /* the press area: 44px tall */
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink-2); transition: transform 0.15s ease;
}
.switch[aria-checked="true"] { background: var(--ink); box-shadow: none; }
.switch[aria-checked="true"]::after { background: var(--surface); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch[aria-disabled="true"] { opacity: 0.4; cursor: default; }
@media (prefers-reduced-motion: reduce) { .switch::after { transition: none; } }

/* ------------------------------------------------------------------ sign-in: links, hints, a heading */
a.quiet { text-decoration: none; }
.signin-head { margin: 0 0 var(--s3); font-size: var(--t-body); font-weight: 600; }
.signin > .say { margin: 0 0 var(--s3); }
.signin > form + form, .signin > form + .say { margin-top: var(--s3); }
.hint { font-size: var(--t-small); font-weight: 400; color: var(--ink-2); }
.hint span { display: block; }
button.link {
  padding: 0; border: 0; background: none; color: var(--ink); font-size: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}

/* ------------------------------------------------------------------ admin settings */
/* One holder (--surface, 10px) of folded rows, like the take list: every row 56px, rules between. */
.adm { padding-top: var(--s2); }
.adm-title {
  margin: 0 0 var(--s3); font: 500 var(--t-mono-cap)/1.2 "sfx-mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.adm-list { background: var(--surface); border-radius: var(--r-hold); overflow: hidden; }
.fold + .fold { border-top: 1px solid var(--hairline); }
.fold-head { margin: 0; font: inherit; }
.fold-toggle {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 20px; align-items: center; gap: var(--s3);
  width: 100%; height: 56px; padding: 0 var(--s3) 0 var(--s4);
  background: none; border: 0; text-align: left;
}
.fold-name { font-size: var(--t-body); font-weight: 500; }
.fold-sum {
  justify-self: end; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 var(--t-mono)/1.2 "sfx-mono", ui-monospace, monospace; letter-spacing: 0.02em; color: var(--ink-2);
}
/* below 720px the name and what is set share no line: the summary sits under the name, whole */
@media (max-width: 719px) {
  .fold-toggle {
    grid-template-columns: minmax(0, 1fr) 20px; grid-template-rows: auto auto; row-gap: 2px;
    height: auto; min-height: 56px; padding-top: var(--s2); padding-bottom: var(--s3);
  }
  .fold-name { grid-column: 1; grid-row: 1; }
  .fold-sum { grid-column: 1; grid-row: 2; justify-self: start; }
  .fold-toggle svg { grid-column: 2; grid-row: 1 / 3; }
}
.fold-toggle:focus-visible { outline-offset: -2px; }   /* inside the holder, which clips its edges */
.fold-toggle svg { width: 20px; height: 20px; color: var(--ink-2); }
.fold-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.fold-toggle:hover .fold-name, .fold-toggle:hover svg { color: var(--ink); }
.fold-body { display: grid; gap: var(--s4); padding: 0 var(--s4) var(--s4); }
.fold-body .row.flip { height: var(--ctl); font-size: var(--t-small); }
.adm-field { display: grid; gap: var(--s1); }
.adm-label { font-size: var(--t-small); font-weight: 500; letter-spacing: 0.01em; }
.adm-field .field { width: 100%; min-width: 0; }
.adm-field .field::placeholder { color: var(--ink-2); opacity: 1; }
.adm .say { margin: var(--s3) 0 0; }
.adm .say:empty { display: none; }
.adm-act { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s4); }
@media (min-width: 720px) { .adm-act { display: flex; justify-content: flex-end; } }
