/* ==========================================================================
   SIGILLITE REELS — production console
   Aesthetic: Departmento Munitorum terminal. Iron & bone, one red accent,
   aged-gold seals. Cinzel (imperial display) / Barlow (industrial UI) /
   JetBrains Mono (data). Matches the house art style: muted, desaturated,
   single red accent.
   ========================================================================== */

:root {
  --bg: #0b0a08;
  --bg2: #12100d;
  --panel: #161310;
  --panel2: #1d1915;
  --inset: #0a0908;
  --line: #2b2620;
  --line2: #3d362c;
  --ink: #e9e3d6;
  --ink-dim: #b9b0a0;
  --muted: #8b8272;
  --red: #c8402f;
  --red-hi: #e05a45;
  --red-dim: #59241c;
  --gold: #c9a22e;
  --gold-hi: #e6c352;
  --gold-dim: #4d4015;
  --ok: #9cb06a;
  --warn: #d99a2b;
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-ui: 'Barlow', 'Segoe UI', sans-serif;
  --font-label: 'Barlow Semi Condensed', 'Barlow', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --r: 3px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
::selection { background: var(--red); color: var(--ink); }

html { scrollbar-color: var(--line2) var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 0; border: 2px solid var(--bg); }

body {
  margin: 0;
  color: var(--ink);
  font: 400 15px/1.55 var(--font-ui);
  background:
    radial-gradient(1200px 700px at 75% -10%, rgba(200, 64, 47, .05), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(201, 162, 46, .04), transparent 55%),
    linear-gradient(var(--bg2), var(--bg) 340px);
  background-attachment: fixed;
  min-height: 100vh;
}

/* film grain over everything */
.grain {
  position: fixed; inset: 0; z-index: 2000; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

/* --------------------------------------------------------------------------
   masthead
   -------------------------------------------------------------------------- */
.masthead {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 26px; height: 58px;
  background: rgba(10, 9, 8, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .6);
}
.brand {
  display: flex; align-items: baseline; gap: 10px; text-decoration: none;
}
.brand .seal {
  color: var(--red-hi); font-size: 17px; align-self: center;
  text-shadow: 0 0 14px rgba(224, 90, 69, .5);
}
.brand-word {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  letter-spacing: .3em; color: var(--ink);
}
.brand-sub {
  font-family: var(--font-label); font-weight: 600; font-size: 10.5px;
  letter-spacing: .34em; color: var(--gold); padding-bottom: 1px;
}
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  font-family: var(--font-label); font-weight: 600; font-size: 12.5px;
  letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  color: var(--muted); padding: 8px 14px; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); border-bottom-color: var(--red); }
.nav a.nav-out { color: var(--muted); opacity: .7; }
.nav a.nav-out:hover { color: var(--red-hi); opacity: 1; }

main { max-width: 1240px; margin: 0 auto; padding: 30px 26px 90px; }

/* --------------------------------------------------------------------------
   type
   -------------------------------------------------------------------------- */
h1.display {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(26px, 4vw, 40px); letter-spacing: .08em;
  text-transform: uppercase; margin: 0; line-height: 1.1;
}
h1.display::after {
  content: ""; display: block; width: 64px; height: 3px; margin-top: 10px;
  background: var(--red);
  box-shadow: 84px 1px 0 -1px var(--gold-dim);
}
.crumb { font-family: var(--font-label); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line2); }
.crumb a:hover { color: var(--gold); border-color: var(--gold-dim); }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
a { color: var(--gold); }
.muted { color: var(--muted); text-decoration: none; }
.small { font-size: 12.5px; }
.right { text-align: right; }
.mono { font-family: var(--font-mono); }
code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--inset); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: var(--r); color: var(--ink-dim);
}

/* --------------------------------------------------------------------------
   plates (cards)
   -------------------------------------------------------------------------- */
.plate {
  position: relative;
  background: linear-gradient(178deg, var(--panel2), var(--panel) 60px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 8px 26px rgba(0, 0, 0, .35);
}
.plate-title {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-label); font-weight: 600; font-size: 12px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  margin: 0 0 16px;
}
.plate-title::after {
  content: ""; flex: 1; height: 1px; align-self: center;
  background: linear-gradient(90deg, var(--line2), transparent);
}
.plate-title .hint {
  font-size: 11px; letter-spacing: .08em; color: var(--muted);
  text-transform: none; font-weight: 500;
}

/* --------------------------------------------------------------------------
   controls
   -------------------------------------------------------------------------- */
input, textarea, select {
  font: 500 14px/1.4 var(--font-ui);
  color: var(--ink); background: var(--inset);
  border: 1px solid var(--line2); border-radius: var(--r);
  padding: 9px 12px; transition: border-color .15s, box-shadow .15s;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 64, 47, .18);
}
::placeholder { color: #6a6254; }
textarea { width: 100%; resize: vertical; }
textarea.mono, textarea.editor {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre; min-height: 380px;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='6'><path d='M0 0l4.5 6L9 0z' fill='%238b8272'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 30px;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-label); font-weight: 600; font-size: 12.5px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); background: var(--panel2);
  border: 1px solid var(--line2); border-radius: var(--r);
  padding: 10px 18px; cursor: pointer; text-decoration: none;
  transition: transform .1s, border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--muted); background: #241f19; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.btn.primary {
  color: #f6ece6;
  background: linear-gradient(180deg, var(--red-hi), var(--red) 55%);
  border-color: #8f2d20;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 3px 12px rgba(200, 64, 47, .25);
}
.btn.primary:hover { filter: brightness(1.09); border-color: var(--red-hi); }
.btn.gold {
  color: #171204;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%);
  border-color: #8a6d17;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn.gold:hover { filter: brightness(1.07); }
.btn.busy { pointer-events: none; opacity: .65; }
.btn.busy::after {
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; align-items: flex-end; }
.row.inline { flex-wrap: wrap; }
.field-label {
  display: block; font-family: var(--font-label); font-weight: 600;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px;
}

/* --------------------------------------------------------------------------
   pipeline
   -------------------------------------------------------------------------- */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 26px; flex-wrap: wrap; margin-bottom: 26px;
}
.pipeline { display: flex; list-style: none; margin: 0; padding: 0; }
.pipeline li {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 0 22px; min-width: 96px;
}
.pipeline li + li::before {
  content: ""; position: absolute; left: -26px; top: 15px; width: 52px; height: 1px;
  background: var(--line2);
}
.pipeline li.done + li.done::before { background: var(--gold-dim); }
.node-mark {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--line2); z-index: 1;
  transition: all .2s;
}
.pipeline li.done .node-mark {
  color: #171204; background: var(--gold); border-color: var(--gold-hi);
  box-shadow: 0 0 16px rgba(201, 162, 46, .3);
}
.node-label {
  margin-top: 8px; font-family: var(--font-label); font-weight: 600;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-dim);
}
.pipeline li.done .node-label { color: var(--gold); }
.node-detail { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   workbench layout
   -------------------------------------------------------------------------- */
.workbench { display: grid; grid-template-columns: 7fr 5fr; gap: 20px; align-items: start; }
@media (max-width: 1020px) { .workbench { grid-template-columns: 1fr; } }

/* beat board */
.cut-head {
  display: flex; align-items: baseline; gap: 12px; margin: 22px 0 10px;
  font-family: var(--font-label); font-weight: 600; font-size: 12px;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim);
}
.cut-head:first-of-type { margin-top: 0; }
.cut-head .cap { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; }
.beat {
  display: flex; gap: 14px; padding: 12px 0;
  border-top: 1px solid var(--line);
}
.beat-n {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--red-hi); min-width: 30px; padding-top: 1px; text-align: right;
  opacity: .85;
}
.beat-body { flex: 1; min-width: 0; }
.beat-text {
  margin: 0 0 7px; font-size: 13.5px; line-height: 1.5; color: var(--ink-dim);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.beat-text.empty { color: var(--red-hi); font-style: italic; }
.beat-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 2px;
  border: 1px solid var(--line2); color: var(--muted);
}
.chip.ok { color: var(--gold); border-color: var(--gold-dim); background: rgba(201, 162, 46, .06); }
.chip.no { color: #7a7264; border-style: dashed; }
.chip.ref { color: var(--ink-dim); }
.wc { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-left: auto; }
.wc.over { color: var(--warn); }

details.advanced { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
details.advanced summary {
  cursor: pointer; font-family: var(--font-label); font-weight: 600;
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); list-style: none; user-select: none;
}
details.advanced summary::before { content: "▸ "; color: var(--red); }
details.advanced[open] summary::before { content: "▾ "; }
details.advanced summary:hover { color: var(--ink-dim); }
details.advanced form { margin-top: 12px; }

/* ops groups */
.ops-group { padding: 16px 0; border-top: 1px solid var(--line); }
.ops-group:first-of-type { border-top: none; padding-top: 0; }
.ops-group:last-of-type { padding-bottom: 0; }
.ops-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-family: var(--font-label); font-weight: 600; font-size: 11.5px;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim);
  margin-bottom: 10px;
}
.ops-head .tag { font-size: 10px; color: var(--muted); letter-spacing: .1em; }
.ops-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.ops-note a { color: var(--gold); }

.status-line {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 10px;
}
.status-line .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-line.good { color: var(--ok); }
.status-line.good .dot { background: var(--ok); box-shadow: 0 0 8px rgba(156, 176, 106, .5); }
.status-line.bad { color: var(--warn); }
.status-line.bad .dot { background: var(--warn); }

/* --------------------------------------------------------------------------
   console
   -------------------------------------------------------------------------- */
.console { padding: 0; overflow: hidden; }
.console-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; border-bottom: 1px solid var(--line);
  background: var(--panel2);
}
.console-bar .title {
  font-family: var(--font-label); font-weight: 600; font-size: 11.5px;
  letter-spacing: .24em; text-transform: uppercase; color: var(--gold);
}
.lamp {
  width: 9px; height: 9px; border-radius: 50%; background: #4a443a;
  transition: background .2s, box-shadow .2s;
}
.lamp.running { background: var(--red-hi); box-shadow: 0 0 10px rgba(224, 90, 69, .7); animation: pulse 1.1s ease-in-out infinite; }
.lamp.done { background: var(--gold); box-shadow: 0 0 8px rgba(201, 162, 46, .5); }
.lamp.failed { background: var(--red-hi); box-shadow: 0 0 8px rgba(224, 90, 69, .7); }
@keyframes pulse { 50% { opacity: .45; } }
#jstatus { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-left: auto; }
.log {
  margin: 0; padding: 14px 18px; height: 280px; overflow: auto;
  background: var(--inset);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.log:empty::before {
  content: "— console idle · start a job to stream its output here —";
  color: #5b5446;
}
.log .l { display: block; animation: rise .18s ease-out; }
.log .l-sec { color: var(--gold); }
.log .l-err { color: var(--red-hi); }
.log .l-ok { color: var(--ok); }
.log .l-end { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(2px); } }

/* --------------------------------------------------------------------------
   deliverables / publish
   -------------------------------------------------------------------------- */
.finals { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.final {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel2); padding: 14px 16px;
}
.final .fk {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink);
}
.final .fo { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin: 4px 0 10px; word-break: break-all; }
video { width: 100%; max-width: 230px; border-radius: var(--r); background: #000; border: 1px solid var(--line2); display: block; }
.pill {
  display: inline-block; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 2px; border: 1px solid var(--line2); color: var(--muted);
}
.pill.ok { color: var(--gold); border-color: var(--gold-dim); background: rgba(201, 162, 46, .07); }
.pill.live { color: var(--ok); border-color: #3c4a26; background: rgba(156, 176, 106, .07); }
.publish { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }

/* --------------------------------------------------------------------------
   assets
   -------------------------------------------------------------------------- */
.warnbox {
  border: 1px solid rgba(217, 154, 43, .5); border-left: 3px solid var(--warn);
  background: rgba(217, 154, 43, .06); border-radius: var(--r);
  padding: 10px 14px; margin-bottom: 14px; font-size: 12.5px; color: var(--ink-dim);
  line-height: 1.9;
}
table.assets { width: 100%; border-collapse: collapse; margin-top: 14px; }
table.assets td {
  padding: 6px 8px; border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
table.assets td.t {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); width: 52px;
}
table.assets tr:hover td { background: rgba(255, 255, 255, .015); }
table.assets a { color: var(--ink-dim); text-decoration: none; font-family: var(--font-mono); font-size: 12px; }
table.assets a:hover { color: var(--gold); }

input[type=file] {
  font-size: 12.5px; color: var(--muted); padding: 7px;
  border-style: dashed; max-width: 100%;
}
input[type=file]::file-selector-button {
  font: 600 11px var(--font-label); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 2px; padding: 6px 12px; margin-right: 12px; cursor: pointer;
}

/* --------------------------------------------------------------------------
   index — production slate
   -------------------------------------------------------------------------- */
.slate-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-top: 22px;
}
.slate-card {
  display: block; text-decoration: none; position: relative;
  background: linear-gradient(178deg, var(--panel2), var(--panel) 70px);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 18px 16px;
  transition: transform .16s ease, border-color .16s, box-shadow .16s;
  animation: card-in .4s ease-out backwards;
}
.slate-card:nth-child(2) { animation-delay: .05s; }
.slate-card:nth-child(3) { animation-delay: .1s; }
.slate-card:nth-child(4) { animation-delay: .15s; }
.slate-card:nth-child(5) { animation-delay: .2s; }
.slate-card:nth-child(n+6) { animation-delay: .25s; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }
.slate-card:hover {
  transform: translateY(-3px); border-color: var(--red);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45), 0 0 0 1px var(--red-dim);
}
.slate-card h3 {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: 17px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink);
}
.slate-card .meta {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted);
  margin: 6px 0 12px;
}
.slate-card .cuts { display: flex; gap: 6px; flex-wrap: wrap; }
.empty {
  border: 1px dashed var(--line2); border-radius: var(--r);
  padding: 48px 20px; text-align: center; color: var(--muted); margin-top: 22px;
  font-size: 14px;
}
.empty .glyph { display: block; font-size: 26px; color: var(--gold-dim); margin-bottom: 10px; }

/* --------------------------------------------------------------------------
   login — the seal
   -------------------------------------------------------------------------- */
.gate { max-width: 380px; margin: 9vh auto 0; text-align: center; animation: card-in .5s ease-out backwards; }
.gate .sigil {
  display: inline-flex; align-items: center; justify-content: center;
  width: 88px; height: 88px; border-radius: 50%;
  border: 1px solid var(--gold-dim);
  box-shadow: inset 0 0 0 6px var(--bg), inset 0 0 0 7px var(--line2), 0 0 44px rgba(201, 162, 46, .12);
  font-size: 30px; color: var(--gold); margin-bottom: 26px;
  animation: seal-glow 4s ease-in-out infinite;
}
@keyframes seal-glow {
  50% { box-shadow: inset 0 0 0 6px var(--bg), inset 0 0 0 7px var(--line2), 0 0 60px rgba(201, 162, 46, .22); }
}
.gate h1 {
  font-family: var(--font-display); font-weight: 900; font-size: 30px;
  letter-spacing: .3em; margin: 0 0 6px; text-transform: uppercase;
}
.gate .motto {
  font-family: var(--font-label); font-weight: 600; font-size: 10.5px;
  letter-spacing: .4em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 34px;
}
.gate form { display: flex; flex-direction: column; gap: 12px; }
.gate input { text-align: center; font-size: 15px; padding: 12px; }
.gate .btn { justify-content: center; padding: 12px; }

/* --------------------------------------------------------------------------
   toasts / flash
   -------------------------------------------------------------------------- */
.toasts { position: fixed; top: 70px; right: 22px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel2); border: 1px solid var(--line2);
  border-left: 3px solid var(--gold);
  border-radius: var(--r); padding: 11px 16px; font-size: 13px; color: var(--ink-dim);
  box-shadow: var(--shadow); max-width: 340px;
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } }
.toast.leaving { opacity: 0; transform: translateX(14px); transition: all .3s; }

/* --------------------------------------------------------------------------
   misc
   -------------------------------------------------------------------------- */
hr.rule { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
@media (max-width: 700px) {
  main { padding: 20px 14px 70px; }
  .masthead { padding: 0 14px; }
  .pipeline li { padding: 0 10px; min-width: 72px; }
  .pipeline li + li::before { left: -14px; width: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
