:root {
  color-scheme: dark;
  --bg: #050805;
  --panel: #071008;
  --green: #a8ffb0;
  --muted: #63a56a;
  --line: rgba(168, 255, 176, 0.25);
  --danger: #ffd37a;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(31, 80, 38, 0.2), transparent 45%),
    var(--bg);
  color: var(--green);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.14;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #000 3px 4px);
}

.terminal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(12px, 2vw, 24px);
  width: min(1200px, 100%);
  height: 100dvh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

.hero { grid-column: 1 / -1; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: clamp(0.65rem, 1.3vw, 0.85rem); letter-spacing: 0.13em; }
h1 { margin: 0; font-size: clamp(3.3rem, 10vw, 8.2rem); line-height: 0.9; letter-spacing: -0.07em; text-shadow: 0 0 28px rgba(101, 255, 115, 0.16); }
.subtitle { margin: 16px 0 0; font-size: clamp(1rem, 2.5vw, 1.7rem); letter-spacing: 0.16em; }
.pulse { display: inline-block; width: 0.65em; height: 0.65em; margin-right: 0.7em; background: var(--green); border-radius: 50%; box-shadow: 0 0 18px var(--green); animation: pulse 1.8s steps(2, jump-none) infinite; }

.screen {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(4, 13, 5, 0.74);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.65);
}

.screen-bar { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.7rem; letter-spacing: 0.08em; }
.log { position: absolute; inset: 38px 0 0; overflow: hidden; padding: clamp(14px, 2.4vw, 30px); }
.log-entry { margin: 0 0 clamp(8px, 1.2vh, 14px); font-size: clamp(1rem, 2.1vw, 1.55rem); line-height: 1.3; letter-spacing: 0.025em; animation: appear 300ms ease-out; }
.log-entry .timestamp { color: var(--muted); }
.log-entry.detected { color: #fff; text-shadow: 0 0 12px rgba(168, 255, 176, 0.75); }
.log-entry.warning { color: var(--danger); }
.scanline { position: absolute; left: 0; right: 0; height: 1px; background: rgba(190, 255, 195, 0.28); box-shadow: 0 0 8px var(--green); animation: scan 9s linear infinite; pointer-events: none; }

.status { display: flex; flex-direction: column; gap: 10px; min-width: 170px; padding: 12px 0; color: var(--muted); font-size: clamp(0.66rem, 1.1vw, 0.78rem); letter-spacing: 0.06em; }
.status span { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dotted rgba(168, 255, 176, 0.2); padding-bottom: 5px; }
.status b { color: var(--green); font-weight: 500; }

.camera-monitor { position: absolute; right: max(24px, env(safe-area-inset-right)); top: max(24px, env(safe-area-inset-top)); width: 112px; border: 1px solid var(--line); background: #000; opacity: 0.55; }
.camera-monitor video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: grayscale(1) contrast(1.35) brightness(0.62); }
.camera-monitor span { display: block; padding: 4px 6px; color: var(--muted); font-size: 0.55rem; }

.controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; opacity: 0.62; }
.controls button { appearance: none; border: 1px solid var(--line); border-radius: 0; padding: 8px 12px; background: transparent; color: var(--muted); font: inherit; font-size: 0.65rem; letter-spacing: 0.06em; touch-action: manipulation; }
.controls button:active { background: var(--green); color: var(--bg); }
noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }

@keyframes pulse { 50% { opacity: 0.2; } }
@keyframes appear { from { opacity: 0; transform: translateX(-10px); } }
@keyframes scan { from { top: 38px; } to { top: 100%; } }

@media (orientation: portrait), (max-width: 720px) {
  .terminal { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto auto; }
  .screen { grid-column: 1; }
  .status { grid-column: 1; display: grid; grid-template-columns: repeat(3, 1fr); min-width: 0; padding: 0; }
  .status span { display: block; }
  .status b { display: block; margin-top: 3px; }
  .camera-monitor { width: 86px; }
}

@media (max-height: 620px) {
  .terminal { padding-top: max(12px, env(safe-area-inset-top)); gap: 8px; }
  .eyebrow { display: none; }
  h1 { font-size: clamp(2.5rem, 12vh, 5rem); }
  .subtitle { margin-top: 7px; }
  .controls button { padding-block: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse, .scanline, .log-entry { animation: none; }
}

/* Set display: none to hide all test controls for the exhibition. */
.controls.is-hidden { display: none; }
