:root {
  --ink: #151712;
  --paper: #e9e8df;
  --paper-deep: #dad8cc;
  --acid: #d7ff38;
  --signal: #ff4d2e;
  --line: rgba(21, 23, 18, 0.2);
  --display: Cambria, "Times New Roman", serif;
  --technical: "Bahnschrift", "Trebuchet MS", sans-serif;
  --mono: Consolas, "Lucida Console", monospace;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(21, 23, 18, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 23, 18, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  font-family: var(--technical);
}

button, input { font: inherit; }

button { color: inherit; }

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.wordmark-mark {
  width: 17px;
  height: 17px;
  border: 5px solid var(--ink);
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-35deg);
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: hidden;
}

.login-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 46vw;
  height: 46vw;
  right: -15vw;
  bottom: -22vw;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 0 0 6vw var(--acid), 0 0 0 calc(6vw + 1px) var(--ink);
}

.login-shell {
  width: min(1120px, 100%);
  min-height: 630px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  border: 1px solid var(--ink);
  background: rgba(233, 232, 223, 0.9);
  box-shadow: 14px 14px 0 var(--ink);
  animation: arrive 600ms cubic-bezier(.2,.8,.2,1) both;
}

.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 46px 56px;
  border-right: 1px solid var(--ink);
}

.login-intro .eyebrow { margin-top: auto; }

.login-intro h1 {
  max-width: 650px;
  margin: 16px 0 24px;
  font-family: var(--display);
  font-size: clamp(58px, 6.2vw, 96px);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.065em;
}

.login-copy {
  max-width: 470px;
  margin: 0 0 46px;
  font-size: 15px;
  line-height: 1.6;
}

.signal-line {
  height: 33px;
  display: flex;
  align-items: end;
  gap: 5px;
}

.signal-line span {
  width: 7px;
  height: 30%;
  background: var(--ink);
  animation: signal 1.4s ease-in-out infinite alternate;
}

.signal-line span:nth-child(2) { height: 65%; animation-delay: -1.1s; }
.signal-line span:nth-child(3) { height: 100%; animation-delay: -.6s; }
.signal-line span:nth-child(4) { height: 45%; animation-delay: -.2s; }
.signal-line span:nth-child(5) { height: 75%; animation-delay: -.9s; }
.signal-line span:nth-child(6) { height: 20%; animation-delay: -.4s; }

.login-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  background: var(--paper-deep);
}

.panel-index {
  position: absolute;
  top: 30px;
  right: 30px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .15em;
}

.login-form label {
  display: block;
  margin-bottom: 13px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.password-row {
  display: flex;
  border-bottom: 2px solid var(--ink);
}

.password-row input {
  width: 100%;
  min-width: 0;
  height: 62px;
  padding: 0 12px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 26px;
}

.password-row button {
  align-self: center;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  background: var(--acid);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  cursor: pointer;
  transition: color 150ms, background 150ms, transform 150ms;
}

.password-row button:hover { color: var(--paper); background: var(--ink); transform: translateY(-2px); }

.form-error {
  margin: 18px 0 0;
  color: #a5220d;
  font-size: 13px;
  line-height: 1.5;
}

.secure-note {
  position: absolute;
  right: 56px;
  bottom: 45px;
  left: 56px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
}

.secure-dot { width: 7px; height: 7px; background: var(--ink); border-radius: 50%; }

.monitor-page { padding: 0 42px; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}

.topbar-meta { display: flex; align-items: center; gap: 28px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; }
.topbar-meta form { margin: 0; }
.text-button { padding: 0 0 3px; border: 0; border-bottom: 1px solid; background: none; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; cursor: pointer; }

.monitor-shell { width: min(1500px, 100%); margin: 0 auto; }

.broadcast-heading {
  min-height: 155px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 34px 0 26px;
}

.broadcast-heading h1 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.055em;
}

.live-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}

.live-dot { width: 8px; height: 8px; background: #77786f; border-radius: 50%; }
.live-state[data-online="true"] { background: var(--acid); }
.live-state[data-online="true"] .live-dot { background: var(--signal); box-shadow: 0 0 0 4px rgba(255,77,46,.18); animation: pulse 1.2s infinite; }

.screen-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--ink);
  background: #0e100d;
  box-shadow: 8px 8px 0 var(--acid), 9px 9px 0 var(--ink);
  overflow: hidden;
}

.screen-frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.018) 50%, rgba(0,0,0,.025) 50%);
  background-size: 100% 4px;
}

#screen-video { width: 100%; height: 100%; object-fit: contain; background: #090a08; }

.screen-empty {
  position: absolute;
  inset: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e9e8df;
  background: radial-gradient(circle at center, #1d211a, #090a08 70%);
}

.screen-empty[hidden] { display: none; }
.screen-empty strong { margin-top: 22px; font-family: var(--mono); font-size: 12px; letter-spacing: .28em; }
.screen-empty p { margin: 12px 0 0; color: #888b80; font-size: 13px; }

.empty-reticle { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid #55594f; border-radius: 50%; animation: rotate 8s linear infinite; }
.empty-reticle::before, .empty-reticle::after { content: ""; position: absolute; width: 84px; height: 1px; background: #34382f; }
.empty-reticle::after { transform: rotate(90deg); }
.empty-reticle span { width: 8px; height: 8px; background: var(--acid); border-radius: 50%; box-shadow: 0 0 20px var(--acid); }

.screen-message {
  position: absolute;
  z-index: 3;
  bottom: 30px;
  max-width: calc(100% - 60px);
  padding: 12px 16px;
  color: #fff;
  background: #9d2c18;
  font-family: var(--mono);
  font-size: 11px;
}

.frame-corner { position: absolute; z-index: 4; width: 20px; height: 20px; pointer-events: none; }
.frame-corner-tl { top: 5px; left: 5px; border-top: 2px solid var(--acid); border-left: 2px solid var(--acid); }
.frame-corner-tr { top: 5px; right: 5px; border-top: 2px solid var(--acid); border-right: 2px solid var(--acid); }
.frame-corner-bl { bottom: 5px; left: 5px; border-bottom: 2px solid var(--acid); border-left: 2px solid var(--acid); }
.frame-corner-br { right: 5px; bottom: 5px; border-right: 2px solid var(--acid); border-bottom: 2px solid var(--acid); }

.telemetry {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr 2.6fr;
  margin: 22px 0 46px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.telemetry-item { min-height: 78px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 13px 20px; border-right: 1px solid var(--line); }
.telemetry-item:first-child { padding-left: 0; }
.telemetry-item:last-child { border-right: 0; }
.telemetry-label { font-family: var(--mono); font-size: 9px; letter-spacing: .16em; }
.telemetry-item strong { font-family: var(--mono); font-size: 12px; letter-spacing: .07em; }

.buffer-track { height: 6px; width: 100%; background: var(--paper-deep); border: 1px solid var(--ink); }
.buffer-track span { display: block; width: 0; height: 100%; background: var(--acid); transition: width 300ms; }

.footer-line { min-height: 58px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; }

@keyframes arrive { from { opacity: 0; transform: translateY(20px); } }
@keyframes signal { to { height: 15%; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes rotate { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .login-page { padding: 18px; overflow: auto; }
  .login-shell { min-height: 680px; grid-template-columns: 1fr; box-shadow: 8px 8px 0 var(--ink); }
  .login-intro { min-height: 390px; padding: 32px 28px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .login-intro h1 { font-size: clamp(52px, 16vw, 76px); }
  .login-copy { margin-bottom: 22px; }
  .login-panel { min-height: 290px; padding: 44px 28px 70px; }
  .secure-note { right: 28px; bottom: 26px; left: 28px; }
  .monitor-page { padding: 0 17px; }
  .topbar { height: 64px; }
  .topbar-meta > span { display: none; }
  .broadcast-heading { min-height: 130px; align-items: start; padding: 28px 0 20px; }
  .broadcast-heading h1 { font-size: 48px; }
  .live-state { margin-top: 10px; padding: 8px; }
  .live-state span:last-child { max-width: 72px; line-height: 1.3; }
  .screen-frame { padding: 6px; box-shadow: 5px 5px 0 var(--acid), 6px 6px 0 var(--ink); }
  .screen-frame::after, .screen-empty { inset: 6px; }
  .screen-empty p { display: none; }
  .empty-reticle { width: 44px; height: 44px; }
  .telemetry { grid-template-columns: repeat(3, 1fr); margin-top: 17px; }
  .telemetry-item { min-height: 65px; padding: 10px; }
  .telemetry-wide { grid-column: 1 / -1; border-top: 1px solid var(--line); border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
