/* CONTROL ROOM: the home page's look, for the apps that sit beside it (ILM, TMD).
 *
 * Linked AFTER shared/pren.css and BEFORE the app's own stylesheet. It adds, and
 * changes nothing the other apps rely on, so Beam, Frame and the dashboard are
 * unaffected: only pages that link this file get it.
 *
 * THE IDEA. Graphite first (the page opens dark unless the reader chose light),
 * Steel Blue still leads, yellow still highlights, red is still force. Matrix
 * Green is one new signal, and it means exactly one thing: "live / computing".
 * It is used for HUD readouts, status lights and a faint glyph rain, never for
 * headlines, never for the answer, never beside red. On paper it becomes a
 * text-safe green. The PM mark is not used here: the name is set in type.
 */
:root {
  --mx: #00FF41; --mx-text: #2CFF6B;
  --mx-dim: rgba(0, 255, 65, .16); --mx-line: rgba(0, 255, 65, .38);
}
:root[data-theme="light"] {
  --mx: #0F9F4B; --mx-text: #0B7A34;
  --mx-dim: rgba(11, 122, 52, .12); --mx-line: rgba(11, 122, 52, .4);
}

/* the bar: no mark, the name in type, and the status light */
.sitebar .brand svg { display: none; }
.sitebar .brand b { font-size: 12.5px; }
.live {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mx-text);
}
.live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mx);
  box-shadow: 0 0 10px var(--mx); animation: ctl-blink 1.6s steps(2, jump-none) infinite;
}
@keyframes ctl-blink { 50% { opacity: .25; } }
.sitebar .live { margin-left: 2px; }
@media (max-width: 700px) { .sitebar .live { display: none; } }

/* a readout in the HUD voice: Martian Mono capitals, green label, bright value */
.hudline {
  display: flex; justify-content: space-between; gap: 14px;
  font: 500 10.5px/1.8 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mx-text);
}
.hudline b { color: var(--head); font-weight: 600; }
.hudbox {
  padding: 10px 12px; background: color-mix(in srgb, var(--card, var(--panel)) 84%, transparent);
  border: 1px solid var(--mx-line); border-radius: var(--r);
}
.chip-live {
  display: inline-flex; align-items: center; gap: 7px; font: 600 10px/1 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--mx-text); border: 1px solid var(--mx-line); border-radius: var(--r); padding: 6px 9px;
}

/* the kinetic headline: words pop (120 ms), the highlighter swipes (250 ms) */
.hl { background-repeat: no-repeat; background-size: 100% 100%; }
.js-ctl .kin:not(.go) .w { opacity: 0; }
.kin.go .w { animation: ctl-pop .12s steps(2, end) both; animation-delay: calc(var(--i, 0) * .14s); }
.kin.go .hl { animation: ctl-swipe .25s .45s both; }
@keyframes ctl-pop { from { opacity: 0; transform: translateY(.12em) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes ctl-swipe { from { background-size: 0 100%; } to { background-size: 100% 100%; } }

/* a faint band of glyph rain behind a page header; the canvas is placed by the page */
canvas.rain {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .3;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 55%, #000 85%);
  mask-image: linear-gradient(90deg, transparent 0, transparent 55%, #000 85%);
}

/* the sign-off under the page: where it is from, and that the door is open */
.openline {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px;
  font: 500 10.5px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.openline a { color: var(--head); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.openline a:hover { background: var(--hi); color: var(--on-hi); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .live::before { animation: none; }
  .kin.go .w, .kin.go .hl { animation: none !important; }
  .js-ctl .kin:not(.go) .w { opacity: 1; }
}
@media print { canvas.rain, .live, .openline { display: none !important; } }
