/* tuxcast dashboard: a broadcast control desk.
   Graphite surfaces like studio hardware, soft contrast for long evenings, and colour only where
   a real desk has light: the tally, the LEDs, the mute buttons. */

@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --room: #15171b;        /* behind the desk */
  --dock: #1e2126;        /* a module */
  --dock-head: #23272d;
  --raise: #2b3037;       /* buttons, keys */
  --raise-hover: #343a42;
  --well: #101215;        /* recessed: fader tracks, deck body */
  --line: #2f343b;
  --line-soft: #262a30;
  --text: #e2e4e8;
  --text-2: #a0a6b0;
  --text-3: #6e7480;
  --green: #4cc38a;
  --amber: #efb04b;
  --red: #e5484d;
  --blue: #5b9dff;        /* selection and focus only */
  --mono: "JetBrains Mono", "DejaVu Sans Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--room);
  color: var(--text);
  font: 15px/1.45 "Barlow", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); }
code { font-family: var(--mono); font-size: 0.86em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------------ top bar */

.bar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  height: 68px; padding: 0 22px;
  background: #191c20; border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: "Barlow Condensed"; font-weight: 700;
  font-size: 22px; letter-spacing: 0.01em; }
.brand img { width: 30px; height: 30px; }
.brand small { font-family: "Barlow"; font-weight: 500; font-size: 13px; color: var(--text-3); margin-left: 4px; }
.bar__end { display: flex; justify-content: flex-end; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }

/* the tally: the one big light of the desk */
.tally {
  display: flex; align-items: center; gap: 12px; min-width: 300px; justify-content: center;
  padding: 9px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--well); font-family: "Barlow Condensed"; font-weight: 700; font-size: 20px; letter-spacing: 0.02em;
}
.tally__lamp { width: 14px; height: 14px; border-radius: 50%; background: var(--text-3); }
.tally[data-state="ok"] { border-color: rgb(76 195 138 / 45%); color: #bff0d6; }
.tally[data-state="ok"] .tally__lamp { background: var(--green); box-shadow: 0 0 14px 2px rgb(76 195 138 / 70%); }
.tally[data-state="warn"] { border-color: rgb(239 176 75 / 45%); color: #f7dcae; }
.tally[data-state="warn"] .tally__lamp { background: var(--amber); box-shadow: 0 0 14px 2px rgb(239 176 75 / 65%); }
.tally[data-state="fail"] { border-color: rgb(229 72 77 / 55%); color: #f6c0c2; }
.tally[data-state="fail"] .tally__lamp { background: var(--red); box-shadow: 0 0 14px 2px rgb(229 72 77 / 70%); }

/* ------------------------------------------------------------------ the desk */

.desk {
  display: grid; gap: 14px; padding: 16px 22px 40px; max-width: 1560px; margin: 0 auto;
  grid-template-columns: minmax(360px, 5fr) minmax(0, 7fr);
  grid-template-areas: "deck checks" "mixer mixer" "discord patches";
}
.dock { display: flex; flex-direction: column; min-width: 0; background: var(--dock); border: 1px solid var(--line-soft);
  border-radius: 12px; overflow: hidden; }
.dock--deck { grid-area: deck; }
.dock--checks { grid-area: checks; }
.dock--mixer { grid-area: mixer; }
.dock--discord { grid-area: discord; }
.dock--patches { grid-area: patches; }
.dock__head { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 10px 8px 16px;
  background: var(--dock-head); border-bottom: 1px solid var(--line-soft); }
.dock__head h2 { margin: 0; font-family: "Barlow Condensed"; font-weight: 600; font-size: 18px; letter-spacing: 0.01em; }
.dock__meta { color: var(--text-3); font-size: 13px; }
.dock__tools { margin-left: auto; display: flex; gap: 6px; }
.dock__body { padding: 16px; flex: 1; }
.empty { color: var(--text-2); }
.empty strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* ------------------------------------------------------------------ controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--raise); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--raise-hover); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn svg { width: 16px; height: 16px; }
.btn--go { background: #2f6f53; border-color: #3c8865; color: #eafff4; }
.btn--go:hover { background: #377d5e; }
.btn--ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--raise); color: var(--text); }
.btn--icon { width: 32px; padding: 0; }
input[type="text"], select { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--well); color: var(--text); font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.led { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #3a3f47; }
.led[data-state="ok"] { background: var(--green); box-shadow: 0 0 8px rgb(76 195 138 / 70%); }
.led[data-state="warn"] { background: var(--amber); box-shadow: 0 0 8px rgb(239 176 75 / 70%); }
.led[data-state="fail"] { background: var(--red); box-shadow: 0 0 8px rgb(229 72 77 / 70%); }
.led[data-state="info"] { background: var(--blue); }

/* ------------------------------------------------------------------ Stream Deck */

.device { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.device__body { width: 100%; max-width: 520px; padding: 18px; border-radius: 18px;
  background: linear-gradient(180deg, #121417, #0b0c0e); border: 1px solid #2a2e34;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%), 0 18px 30px -18px rgb(0 0 0 / 80%); position: relative; }
.device__keys { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 10px; }
.key { position: relative; aspect-ratio: 1; border-radius: 10px; border: 0; padding: 0; overflow: hidden;
  background: #1a1c20; box-shadow: inset 0 0 0 1px #24272c, inset 0 -3px 0 rgb(0 0 0 / 45%); cursor: default; color: #fff; }
button.key { cursor: pointer; }
button.key:hover { filter: brightness(1.12); }
.key img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.key span { position: absolute; left: 4px; right: 4px; bottom: 5px; font-size: 11px; font-weight: 600; line-height: 1.1;
  text-align: center; white-space: pre-line; text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.key:not(:has(img)) span { top: 50%; bottom: auto; transform: translateY(-50%); color: var(--text-2); text-shadow: none; }
.key::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.key[data-status="partial"]::after { box-shadow: inset 0 0 0 3px var(--amber); }
.key[data-status="manual"]::after { box-shadow: inset 0 0 0 3px var(--red); }
.key[aria-pressed="true"] { outline: 2px solid var(--blue); outline-offset: 2px; }
.device__label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: none;
  color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { color: var(--text); border-color: #464c55; }
.chip[aria-pressed="true"] { background: var(--text); color: #15171b; border-color: var(--text); }

.dropzone { position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center; text-align: center;
  padding: 20px; background: rgb(11 12 14 / 92%); border: 2px dashed #4a515b; color: var(--text-2); cursor: pointer; }
.dropzone strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.dropzone[data-over] { border-color: var(--blue); background: rgb(20 32 52 / 92%); }
.preview-bar { width: 100%; display: grid; gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--well); }
.preview-bar__line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 14px; }
.preview-bar__score { font-family: "Barlow Condensed"; font-weight: 700; font-size: 22px; }
.note { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; background: var(--raise); color: var(--text-2); }

/* ------------------------------------------------------------------ checks */

.checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.check-tile { display: flex; flex-direction: column; gap: 6px; min-height: 104px; padding: 12px 13px; text-align: left;
  border-radius: var(--radius); border: 1px solid var(--line-soft); background: #22262b; cursor: pointer; }
.check-tile:hover { background: #272b31; border-color: var(--line); }
.check-tile__top { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check-tile__text { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.check-tile[data-state="warn"] { border-color: rgb(239 176 75 / 35%); background: #27251f; }
.check-tile[data-state="fail"] { border-color: rgb(229 72 77 / 40%); background: #2a2023; }
.check-tile[data-state="warn"] .check-tile__text { color: #e8cf9f; }
.check-tile[data-state="fail"] .check-tile__text { color: #f0b8bb; }

.todo { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.todo__title { margin: 0 0 6px; font-family: "Barlow Condensed"; font-weight: 600; font-size: 16px; color: var(--text-2); }
.todo__row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--line-soft); }
.todo__row:last-child { border-bottom: 0; }
.todo__row .led { align-self: start; margin-top: 7px; }
.todo__summary { font-weight: 600; }
.todo__fix { font-family: var(--mono); font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.todo--done { color: var(--green); font-weight: 600; }

/* ------------------------------------------------------------------ mixer */

.mixer { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.strip { flex: 0 0 132px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 10px;
  border-radius: var(--radius); background: #22262b; border: 1px solid var(--line-soft); }
.strip[data-drop] { border-color: var(--blue); background: #1f2836; }
.strip--master { margin-left: auto; background: #1b1e22; border-style: dashed; }
.strip__name { width: 100%; text-align: center; font-family: "Barlow Condensed"; font-weight: 600; font-size: 17px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip__value { font-family: "Barlow Condensed"; font-weight: 600; font-size: 15px; color: var(--text-2); }
.fader { position: relative; display: flex; justify-content: center; height: 190px; width: 100%; }
.fader__scale { position: absolute; left: 12px; top: 8px; bottom: 8px; display: flex; flex-direction: column;
  justify-content: space-between; font-size: 10px; color: var(--text-3); font-family: "Barlow Condensed"; }
.fader input { writing-mode: vertical-lr; direction: rtl; width: 34px; height: 190px; margin: 0; background: none;
  -webkit-appearance: none; appearance: none; cursor: ns-resize; }
.fader input::-webkit-slider-runnable-track { width: 6px; border-radius: 3px; background: var(--well); box-shadow: inset 0 0 0 1px #2a2e34; }
.fader input::-moz-range-track { width: 6px; border-radius: 3px; background: var(--well); }
.fader input::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 18px; margin-left: -14px; border-radius: 4px;
  background: linear-gradient(180deg, #d9dce1, #a2a8b1); box-shadow: 0 2px 4px rgb(0 0 0 / 60%), inset 0 -2px 0 rgb(0 0 0 / 25%);
  border: 0; }
.fader input::-moz-range-thumb { width: 34px; height: 18px; border-radius: 4px; border: 0;
  background: linear-gradient(180deg, #d9dce1, #a2a8b1); box-shadow: 0 2px 4px rgb(0 0 0 / 60%); }
.mute { width: 100%; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--raise);
  color: var(--text-2); font-family: "Barlow Condensed"; font-weight: 700; font-size: 15px; cursor: pointer; }
.mute[aria-pressed="true"] { background: #6b2326; border-color: #8a2d31; color: #ffd9da; box-shadow: 0 0 12px rgb(229 72 77 / 35%); }
.apps { width: 100%; display: grid; gap: 5px; min-height: 28px; }
.app { padding: 4px 8px; border-radius: 6px; background: var(--raise); font-size: 12px; font-weight: 600; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; }
.app:active { cursor: grabbing; }
.app--elsewhere { background: none; border: 1px dashed var(--line); color: var(--text-2); }
.mixer-hint { margin: 10px 0 0; font-size: 13px; color: var(--text-3); }
.setup { display: grid; gap: 12px; }
.sink-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.sink-pick label { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--raise); font-weight: 600; font-size: 14px; cursor: pointer; }

/* ------------------------------------------------------------------ Discord and patches */

.status-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.status-line:last-of-type { border-bottom: 0; }
.status-line span:last-child { margin-left: auto; color: var(--text-3); font-size: 13px; text-align: right; }
.dock__foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }

/* ------------------------------------------------------------------ drawer and toasts */

.drawer { position: fixed; inset: 0 0 0 auto; z-index: 40; width: min(480px, 100vw); display: flex; flex-direction: column;
  background: #1c1f24; border-left: 1px solid var(--line); box-shadow: -24px 0 50px rgb(0 0 0 / 45%); }
.drawer[hidden] { display: none; }
.drawer__head { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line-soft); }
.drawer__head h2 { margin: 0; font-family: "Barlow Condensed"; font-size: 21px; font-weight: 700; }
.drawer__head .btn { margin-left: auto; }
.drawer__body { padding: 18px 20px 30px; overflow-y: auto; }
.finding { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.finding .led { margin-top: 6px; }
.finding__summary { font-weight: 600; }
.finding__detail, .finding__fix { grid-column: 2; margin: 0; font-size: 14px; color: var(--text-2); }
.finding__fix code { color: var(--text); background: var(--well); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.finding .btn { grid-column: 2; justify-self: start; margin-top: 6px; }
pre.block { margin: 10px 0; padding: 12px 14px; border-radius: 8px; background: var(--well); font-family: var(--mono);
  font-size: 12.5px; white-space: pre; overflow-x: auto; }
.scrim { position: fixed; inset: 0; z-index: 39; background: rgb(0 0 0 / 45%); }
.scrim[hidden] { display: none; }

#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; max-width: 380px; }
.toast { padding: 12px 16px; border-radius: 9px; background: #2a2f36; border-left: 4px solid var(--green);
  box-shadow: 0 16px 34px -16px rgb(0 0 0 / 80%); font-size: 14px; }
.toast[data-kind="error"] { border-left-color: var(--red); }

.loading { color: var(--text-3); font-size: 14px; }

/* ------------------------------------------------------------------ narrower screens */

@media (max-width: 1100px) {
  .desk { grid-template-columns: minmax(0, 1fr); grid-template-areas: "deck" "checks" "mixer" "discord" "patches"; }
  .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .bar { grid-template-columns: 1fr auto; height: auto; padding: 10px 14px; row-gap: 8px; }
  .tally { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .bar__end span { display: none; }
  .desk { padding: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .led, .tally__lamp, .check-tile, .key { transition: background-color 0.25s, box-shadow 0.25s, border-color 0.25s; }
}

/* only on the website's demo */
.demo-banner { padding: 8px 16px; text-align: center; font-size: 14px; color: #f7dcae; background: #2b2619;
  border-bottom: 1px solid rgb(239 176 75 / 30%); }
.demo-banner a { color: #ffd38a; font-weight: 600; }
