@font-face { font-family: "Barlow"; src: url("fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --bg: #12100c;
  --raise: #1c1914;
  --inset: #0c0b09;
  --line: #3c352c;
  --text: #f3eee4;
  --muted: #c9bfb0;
  --faint: #9a8f7e;
  --amber: #e6a117;
  --amber-ink: #1c1406;
  --red: #d94a3d;
  --green: #7da86a;
  --steel: #8eacbb;
  --display: "Barlow Condensed", "Noto Sans Display", sans-serif;
  --body: "Barlow", "Noto Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(230, 161, 23, 0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only, .skip {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; margin: 0; clip: auto; background: var(--amber); color: var(--amber-ink); padding: 8px 12px; z-index: 10; }
.hint { color: var(--muted); font-size: 13px; }
.err { color: #ffb4a8; min-height: 1.2em; }
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.boot { padding: 24px; color: var(--muted); }

.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.gate-mark {
  padding: 64px 56px;
  background:
    linear-gradient(180deg, rgba(230,161,23,0.05), transparent 30%),
    #18150f;
  border-right: 1px solid var(--line);
}
.gate-mark svg { width: 42px; height: 84px; color: var(--red); }
.eyebrow { letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; color: var(--amber); margin: 18px 0 8px; }
.gate-mark h1, .top strong {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}
.gate-mark h1 { font-size: 72px; line-height: 0.9; }
.lede { max-width: 38ch; font-size: 18px; color: var(--muted); }
.gate-mark ul { padding-left: 18px; color: var(--text); max-width: 46ch; }
.gate-mark li { margin: 8px 0; }
.gate-form {
  align-self: center;
  padding: 48px 40px;
  max-width: 420px;
}
.gate-form h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; font-size: 28px; margin: 0 0 16px; }
.gate-form button { width: 100%; }
label { display: block; margin-top: 12px; font-size: 13px; color: var(--muted); }
input, select {
  width: 100%;
  margin-top: 4px;
  padding: 11px 12px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 2px;
}
button, .top-actions button {
  margin-top: 16px;
  background: var(--amber);
  color: var(--amber-ink);
  border: 0;
  padding: 11px 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ghost, .top-actions .ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.top-actions button { margin-top: 0; padding: 8px 12px; min-height: 40px; }

.console { min-height: 100vh; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 18px; }
.top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand svg { width: 18px; height: 30px; color: var(--red); }
.brand strong { font-size: 28px; display: block; line-height: 1; }
.site { color: var(--muted); font-size: 13px; }
.beat { margin: 0; font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.pill { border: 1px solid var(--line); padding: 4px 8px; border-radius: 999px; font-family: var(--mono); font-size: 12px; }
.pill.off, .pill.deny { color: #ffb4a8; border-color: #6a3030; background: #2a1614; }
.pill.on { color: #d7ecc8; border-color: #345232; background: #172117; }
.banner { margin: 0; padding: 8px 12px; background: #3a2a10; color: #f3ddb0; border-left: 3px solid var(--amber); }

.beats { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; overflow-x: auto; }
.beats li { border: 1px solid var(--line); padding: 4px 8px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.beats li.now { color: var(--amber-ink); background: var(--amber); border-color: var(--amber); }

.board {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.7fr) minmax(280px, 0.85fr);
  gap: 12px;
  min-height: 0;
}
.cameras { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cam, .mic {
  position: relative;
  background: var(--inset);
  border: 1px solid var(--line);
  min-height: 140px;
  overflow: hidden;
}
.cam video, .cam .still { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 16/9; background: #070706; }
.cam header, .mic header {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between;
  padding: 6px 8px;
  background: linear-gradient(#0c0b09, transparent);
  font-family: var(--mono); font-size: 12px;
}
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.box-label { font-family: var(--mono); font-size: 11px; fill: #f3eee4; }
.mic { padding: 36px 12px 12px; display: flex; flex-direction: column; justify-content: flex-end; }
.meter { height: 10px; background: #2a261f; }
.meter span { display: block; height: 100%; background: var(--amber); width: 0; }
.plan, .feed, .meters {
  background: var(--raise);
  border: 1px solid var(--line);
  padding: 10px 12px;
}
.plan header, .feed header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
h2, h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin: 0 0 8px; }
#floor { width: 100%; height: auto; background: #14120e; }
#floor .room { fill: none; stroke: #8d7d64; stroke-width: 0.6; }
#floor text { fill: #e6a117; font-size: 7px; text-anchor: middle; font-family: var(--display); }
#floor .room-name { fill: #c9bfb0; font-size: 3.2px; font-family: var(--body); }
.dot-label { fill: #f3eee4; font-size: 3px; font-family: var(--mono); }

.feed { display: flex; flex-direction: column; min-height: 280px; max-height: calc(100vh - 180px); }
#alerts { list-style: none; padding: 0; margin: 0; overflow: auto; }
#alerts li { padding: 10px 8px 10px 10px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--line); }
.sev-critical { border-left-color: var(--red) !important; }
.sev-high { border-left-color: #e07a3d !important; }
.sev-medium { border-left-color: var(--amber) !important; }
.sev-low { border-left-color: var(--steel) !important; }
.kind { font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; font-size: 18px; }
.meta { color: var(--muted); font-family: var(--mono); font-size: 12px; }
#alerts button { margin: 8px 6px 0 0; padding: 6px 10px; background: var(--raise); color: var(--text); border: 1px solid var(--line); }
#alerts button.danger { border-color: #6a3030; color: #ffb4a8; }
.empty { color: var(--muted); }
.thumb { width: 96px; height: 54px; object-fit: cover; border: 1px solid var(--line); margin-top: 6px; }

.meters { display: flex; flex-wrap: wrap; gap: 16px 22px; font-family: var(--mono); font-size: 13px; }
.legal { margin: 0; color: var(--faint); font-size: 12px; max-width: 80ch; }

dialog {
  width: min(560px, calc(100vw - 24px));
  background: var(--raise);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 16px;
}
dialog::backdrop { background: rgba(0,0,0,0.6); }
dialog header, .dialog-head { display: flex; justify-content: space-between; align-items: center; }
dialog section { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
#clip-video { width: 100%; background: black; }
#user-list, #cam-admin { list-style: none; padding: 0; }
#user-list li, #cam-admin li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }

@media (max-width: 960px) {
  .gate { grid-template-columns: 1fr; }
  .gate-mark { padding: 32px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .gate-mark h1 { font-size: 56px; }
  .gate-form { padding: 24px 20px 48px; }
  .board { grid-template-columns: 1fr; }
  .feed { max-height: none; }
  .top-actions { margin-left: 0; }
}
.demo-banner {
  margin: 0;
  padding: 8px 12px;
  background: #3a2a10;
  color: #f3ddb0;
  border-left: 3px solid var(--amber);
}
.clock { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cred { font-family: var(--mono); color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
