:root {
  --black: #000;
  --white: #deded8;
  --terminal: #9ab8a4;
  --yellow: #e7d84d;
  --red: #d54b43;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--black);
  color: var(--white);
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}

.surveillance {
  position: fixed;
  inset: 0;
  opacity: 0;
  background: #050605;
  transition: opacity .32s steps(3);
}

body.scanning .surveillance,
body.unknown .surveillance { opacity: .9; }
body.admin .surveillance { opacity: 0; transition-duration: 1.15s; }

#camera {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scaleX(-1);
  filter: grayscale(1) contrast(1.38) brightness(.67);
}

body.unknown #camera { filter: grayscale(1) contrast(1.7) brightness(.48); }

.video-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .23;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255,255,255,.08) 3px, rgba(255,255,255,.08) 4px);
}

.video-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 46%, rgba(0,0,0,.72) 100%);
}

.camera-data,
.system-data,
.frame-number {
  position: fixed;
  z-index: 8;
  display: flex;
  gap: 14px;
  color: rgba(222,222,216,.64);
  font-size: 9px;
  letter-spacing: .08em;
  text-shadow: 1px 1px #000;
}

.camera-data { top: 17px; left: 19px; }
.system-data { top: 17px; right: 19px; }
.frame-number { right: 19px; bottom: 16px; opacity: .56; }

body:not(.scanning):not(.unknown) .camera-data,
body:not(.scanning):not(.unknown) .frame-number { opacity: .25; }

.face-box {
  position: fixed;
  z-index: 10;
  display: none;
  border: 1px dashed var(--yellow);
  outline: 1px solid rgba(0,0,0,.28);
  transition: left .13s linear, top .13s linear, width .13s linear, height .13s linear;
}

.face-box::before,
.face-box::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border-color: var(--yellow);
}

.face-box::before {
  left: -3px;
  top: -3px;
  border-left: 2px solid;
  border-top: 2px solid;
}

.face-box::after {
  right: -3px;
  bottom: -3px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.face-box.unknown { border-color: var(--red); }
.face-box.unknown::before, .face-box.unknown::after { border-color: var(--red); }

.face-identity {
  position: absolute;
  left: -1px;
  top: -19px;
  padding: 3px 6px 2px;
  color: #000;
  background: var(--yellow);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.unknown .face-identity { background: var(--red); }

.face-metric {
  position: absolute;
  right: -1px;
  bottom: -17px;
  color: var(--yellow);
  background: #000;
  padding: 2px 4px;
  font-size: 8px;
}

.unknown .face-metric { color: var(--red); }

.message-stage {
  position: fixed;
  z-index: 6;
  inset: 18% 12% 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.classification {
  min-height: 15px;
  margin-bottom: 18px;
  color: var(--yellow);
  font-size: 9px;
  letter-spacing: .14em;
}

.message {
  min-height: 1.25em;
  max-width: 820px;
  color: var(--white);
  font-size: clamp(18px, 2.45vw, 34px);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: pre-line;
}

.message.denied { color: var(--red); }

.message.typing::after {
  content: "";
  display: inline-block;
  width: .5em;
  height: 1em;
  margin-left: .16em;
  background: currentColor;
  vertical-align: -.12em;
  animation: cursor .72s steps(1) infinite;
}

@keyframes cursor { 50% { opacity: 0; } }

.submessage {
  min-height: 14px;
  max-width: 720px;
  margin-top: 18px;
  color: rgba(222,222,216,.48);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.listening-wave {
  display: none;
  align-items: center;
  gap: 4px;
  height: 22px;
  margin-top: 18px;
}

.listening-wave.active { display: flex; }
.listening-wave i { width: 1px; height: 4px; background: var(--white); animation: wave .54s ease-in-out infinite alternate; }
.listening-wave i:nth-child(2) { animation-delay: .11s; }
.listening-wave i:nth-child(3) { animation-delay: .22s; }
.listening-wave i:nth-child(4) { animation-delay: .33s; }
.listening-wave i:nth-child(5) { animation-delay: .44s; }
@keyframes wave { to { height: 17px; } }

.terminal {
  position: fixed;
  z-index: 7;
  left: 19px;
  bottom: 16px;
  width: min(650px, calc(100vw - 38px));
  color: rgba(154,184,164,.63);
  font-size: 9px;
  line-height: 1.45;
  letter-spacing: .025em;
  text-shadow: 1px 1px #000;
  pointer-events: none;
}

.terminal-log { display: flex; flex-direction: column; justify-content: flex-end; }

.terminal-entry {
  display: grid;
  grid-template-columns: 67px 78px 1fr;
  gap: 8px;
  padding: 1px 0;
  animation: terminalIn .12s steps(2);
}

@keyframes terminalIn { from { opacity: 0; transform: translateX(-3px); } }

.terminal-entry .time { color: rgba(154,184,164,.3); }
.terminal-entry .source { color: rgba(168,202,180,.82); }
.terminal-entry.warning .payload { color: var(--yellow); }
.terminal-entry.denied .payload { color: var(--red); }
.terminal-entry.confirmed .payload { color: rgba(201,225,208,.85); }

.terminal-prompt {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: rgba(154,184,164,.66);
}

.terminal-prompt::before { content: ">"; }
.terminal-prompt i { width: 5px; height: 9px; background: currentColor; animation: cursor .72s steps(1) infinite; }

.permission-notice {
  position: fixed;
  z-index: 20;
  left: 50%;
  top: 50%;
  display: none;
  width: min(440px, calc(100vw - 44px));
  transform: translate(-50%, -50%);
  color: var(--white);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: .08em;
  text-align: left;
}

.permission-notice span { display: block; margin-bottom: 9px; color: var(--yellow); }
.permission-notice.visible { display: block; }

body.signal-break .message-stage { transform: translateX(2px); filter: blur(.25px); }

@media (max-width: 680px) {
  .system-data { display: none; }
  .message-stage { inset: 15% 9% 29%; }
  .terminal { font-size: 8px; }
  .terminal-entry { grid-template-columns: 55px 62px 1fr; gap: 5px; }
  .frame-number { display: none; }
}
