/* Compound Code Video Studio. Colours come only from tokens.css (generated from brand/tokens.py). */
@font-face { font-family: "Manrope"; font-weight: 700; src: url("/fonts/Manrope-Bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Manrope"; font-weight: 800; src: url("/fonts/Manrope-ExtraBold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 400; src: url("/fonts/Inter-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 500; src: url("/fonts/Inter-Medium.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 600; src: url("/fonts/Inter-SemiBold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; src: url("/fonts/JetBrainsMono-Regular.ttf") format("truetype"); font-display: swap; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--brand-text); }
h1, h2, h3 { font-family: "Manrope", system-ui, sans-serif; font-weight: 800; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 30px; } h2 { font-size: 21px; } h3 { font-size: 17px; font-weight: 700; }
code, pre, textarea.code { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-ligatures: none; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
       padding: 14px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Manrope"; font-weight: 800; font-size: 17px; }
.brand img { width: 28px; height: 28px; }
.brand small { font-family: "Inter"; font-weight: 600; color: var(--ink-muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--ink-muted); font-weight: 500; }
nav a.on, nav a:hover { color: var(--ink); }
nav form { margin: 0; }

main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; }
.kicker { font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 6px; }
.kicker b { color: var(--brand-text); font-weight: 600; margin-right: 8px; }
.muted { color: var(--ink-muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; color: var(--ink-muted); }
input[type=text], input[type=password], select, textarea {
  width: 100%; background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
textarea.code { min-height: 340px; font-size: 13px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--highlight); outline-offset: 1px; }
input[type=file] { color: var(--ink-muted); font-size: 14px; }

.btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-raised);
       color: var(--ink); font: 600 14px "Inter"; padding: 10px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink-muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--negative); }
.btn[disabled] { opacity: .5; cursor: default; }

.badge { display: inline-block; font: 600 12px "Inter"; padding: 3px 10px; border-radius: 999px; background: var(--surface-raised); color: var(--ink-muted); }
.badge.done { color: var(--positive); } .badge.failed { color: var(--negative); }
.badge.running, .badge.queued { color: var(--highlight); } .badge.needs_confirm { color: var(--caution); }

.msg { border-radius: 10px; padding: 12px 14px; margin: 12px 0; background: var(--surface-raised); }
.msg.err { border-left: 3px solid var(--negative); }
.msg.ok { border-left: 3px solid var(--positive); }
.msg.warn { border-left: 3px solid var(--caution); }
.msg ul { margin: 6px 0 0; padding-left: 18px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
td audio { height: 32px; max-width: 220px; }
.thumb { width: 54px; height: 96px; object-fit: cover; border-radius: 6px; background: var(--surface-raised); display: block; }

.media { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 20px; align-items: start; }
video { width: 100%; border-radius: 14px; background: var(--code-bg); }
.sheet { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.files a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
pre.log { background: var(--code-bg); color: var(--code-ink); border-radius: 12px; padding: 14px; font-size: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap; }
.copy { position: relative; }
.copy pre { background: var(--surface-raised); border-radius: 10px; padding: 12px 72px 12px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: "Inter"; font-size: 14px; margin: 6px 0 12px; }
.copy button { position: absolute; top: 4px; right: 4px; }
details summary { cursor: pointer; color: var(--ink-muted); font-weight: 600; }
.login { max-width: 380px; margin: 12vh auto; }
.login img { width: 56px; height: 56px; margin-bottom: 14px; }
.score-low { color: var(--negative); } .score-ok { color: var(--positive); }

.table-wrap { overflow-x: auto; }
ol.steps { padding-left: 20px; } ol.steps li { margin-bottom: 10px; }
img, video, pre, table { max-width: 100%; }
pre { overflow-x: auto; }
details.card > summary { list-style-position: inside; }

@media (max-width: 720px) {
  .media { grid-template-columns: 1fr; }
  main { padding: 18px 16px 60px; }
  h1 { font-size: 25px; }
  .card { padding: 16px; border-radius: 14px; }
  .top { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .brand small { display: none; }
  nav { width: 100%; gap: 6px; flex-wrap: nowrap; overflow-x: auto; justify-content: space-between; }
  nav a { padding: 8px 2px; white-space: nowrap; font-size: 15px; }
  nav form { margin-left: auto; flex-shrink: 0; }
  nav .btn.small { padding: 5px 9px; }
  .hide-sm { display: none; }
  .btn { min-height: 42px; }
  .btn.small { min-height: 34px; }
  .row { gap: 8px; }
  /* tables become stacked cards on phones */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr:first-child { display: none; }
  table.stack tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: 3px 0; }
  table.stack td audio { width: 100%; max-width: none; margin-top: 6px; }
  table.stack form.row .btn.small { flex: 1 1 auto; }
  table.stack.jobs tr { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; }
  table.stack.jobs td { width: auto; }
  .files a { padding: 12px 0; }
  table.stack td.hide-sm, table.stack.jobs tr:first-child { display: none; }
}
