:root {
  --bg: #000000;
  --paper: #030303;
  --panel: #080808;
  --line: #707070;
  --line-dim: #333333;
  --white: #ffffff;
  --gray: #b9b9b9;
  --green: #00ff66;
  --acid: #ffff00;
  --red: #ff2020;
  --cyan: #00ccff;
  --blue: #0000ee;
  --visited: #aa55ff;
  --serif: "Times New Roman", Times, serif;
  --mono: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: #000;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.9) 0 1px, transparent 1px),
    radial-gradient(circle at 74% 12%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1px),
    radial-gradient(circle at 47% 81%, rgba(0, 255, 102, 0.35) 0 1px, transparent 1px),
    radial-gradient(circle at 92% 67%, rgba(255, 255, 0, 0.45) 0 1px, transparent 1px),
    #000;
  background-size: 220px 180px, 340px 240px, 260px 260px, 420px 300px, auto;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  content: "";
  opacity: 0.08;
  background: repeating-linear-gradient(180deg, transparent 0 2px, #fff 2px 3px);
}

a {
  color: var(--cyan);
  text-decoration: underline;
}

a:visited {
  color: var(--visited);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3 {
  margin: 0.35em 0;
  font-family: var(--serif);
  letter-spacing: 0;
}

h1 {
  color: var(--acid);
  font-size: 34px;
  text-align: center;
  text-shadow: 2px 2px 0 #660000;
}

h2 {
  color: var(--green);
  font-size: 22px;
}

h3 {
  color: var(--acid);
  font-size: 18px;
}

p {
  margin: 0.65em 0;
  color: var(--gray);
  line-height: 1.35;
}

.site-shell {
  width: min(820px, calc(100% - 18px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 8px 0;
}

.site-shell::before {
  display: block;
  padding: 4px;
  border: 1px solid var(--line);
  color: var(--red);
  background: #111;
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  content: "!! KALYCE mirror node // Area51/Quadrant style // do not index !!";
}

.topbar {
  margin: 10px 0;
  padding: 8px;
  border: 2px ridge var(--line);
  background: #000;
  text-align: center;
}

.brand {
  display: block;
  margin: 0 auto 8px;
  color: var(--acid);
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.brand::before,
.brand::after {
  color: var(--red);
  content: " ::: ";
}

.main-nav {
  display: block;
  line-height: 1.9;
}

.main-nav a {
  display: inline;
  margin: 0 6px;
  padding: 0;
  border: 0;
  color: var(--cyan);
  background: transparent;
  font-family: var(--serif);
  font-size: 16px;
  text-decoration: underline;
}

.main-nav a.active {
  color: var(--acid);
}

.audio-toggle {
  margin-top: 8px;
  padding: 2px 8px;
  border: 2px outset #999;
  color: #000;
  background: #c0c0c0;
  font-family: var(--mono);
  font-size: 12px;
}

.audio-toggle.enabled {
  color: #000;
  background: var(--acid);
}

.main-grid,
.page-layout,
.camera-console,
.countdown-stage,
.final-stage,
.terminal-page-wrap {
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

.main-grid {
  display: block;
}

.hero-console,
.status-panel,
.wide-section,
.page-heading,
.form-zone,
.access-denied-panel,
.main-monitor,
.file-browser,
.countdown-block,
.final-reveal,
.terminal-window,
.entity-card,
.incident-row {
  margin: 10px 0;
  padding: 10px;
  border: 2px ridge var(--line);
  background: rgba(0, 0, 0, 0.92);
}

.hero-console {
  min-height: 0;
  text-align: center;
}

.kalyce-dossier {
  position: relative;
  overflow: hidden;
}

.kalyce-dossier > *:not(.kalyce-mark) {
  position: relative;
  z-index: 1;
}

.kalyce-mark {
  position: absolute;
  right: -120px;
  bottom: -180px;
  z-index: 0;
  width: min(640px, 92vw);
  opacity: 0.18;
  mix-blend-mode: screen;
  filter: contrast(1.35);
  pointer-events: none;
}

.hero-console::before {
  display: block;
  margin: 4px auto 12px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
}


.system-label,
.panel-header,
.archive-path,
.feed-overlay,
.camera-label,
.incident-meta {
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: none;
}

.hero-subtitle {
  color: var(--white);
  font-size: 19px;
}

.cold-copy {
  color: var(--acid);
  font-family: var(--mono);
}

.conspiracy-note {
  width: min(690px, 100%);
  margin: 14px auto;
  padding: 8px;
  border: 1px dashed var(--red);
  background: #080000;
  text-align: left;
}

.conspiracy-note p {
  color: var(--white);
}

.theory-section {
  background:
    linear-gradient(90deg, rgba(255, 255, 0, 0.04), transparent 18%),
    rgba(0, 0, 0, 0.92);
}

.experiment-section {
  background:
    repeating-linear-gradient(45deg, rgba(0, 255, 102, 0.04) 0 6px, transparent 6px 12px),
    rgba(0, 0, 0, 0.92);
}

.buried-link {
  color: #000;
  font-size: 1px;
  text-decoration: none;
}

.buried-link:hover,
.buried-link:focus {
  color: var(--red);
  font-size: 14px;
  text-decoration: underline;
}

.recruitment-specs {
  width: min(620px, 100%);
  margin: 14px auto;
  border-collapse: collapse;
  display: table;
}

.recruitment-specs div {
  display: table-row;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.recruitment-specs span,
.recruitment-specs strong {
  display: table-cell;
  padding: 5px 8px;
  border: 1px solid var(--line-dim);
  text-align: left;
}

.recruitment-specs span {
  width: 38%;
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
}

.recruitment-specs strong {
  color: var(--white);
  font-size: 15px;
  font-weight: 400;
}

.cta-row {
  display: block;
  margin: 14px auto;
  text-align: center;
}

.button,
.filter,
.modal-close,
.footer-link {
  display: inline-block;
  min-height: 0;
  min-width: 0;
  margin: 4px;
  padding: 3px 10px;
  border: 2px outset #999;
  border-radius: 0;
  color: #000;
  background: #c0c0c0;
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
  text-decoration: none;
}

.button.primary {
  color: #000;
  background: var(--acid);
}

.button.danger {
  color: #fff;
  background: #660000;
}

.button:hover,
.filter:hover,
.filter.active,
.modal-close:hover,
.footer-link:hover {
  border-style: inset;
  color: #000;
  background: var(--green);
}

.status-stack {
  display: block;
}

.panel-header,
.feed-overlay {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.countdown-inline {
  color: var(--acid);
  font-family: var(--mono);
}

.thin-meter,
.integrity-meter {
  height: 12px;
  border: 2px inset #666;
  background: #222;
}

.thin-meter span,
.integrity-meter span {
  display: block;
  height: 100%;
  width: 46%;
  background: repeating-linear-gradient(90deg, var(--green) 0 8px, #004400 8px 12px);
}

.mini-feed,
.main-feed-visual,
.camera-visual,
.entity-visual {
  position: relative;
  overflow: hidden;
  border: 1px solid #555;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 65%, rgba(255, 255, 255, 0.08), transparent 18%),
    #050505;
}

.mini-feed {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.feed-time {
  position: absolute;
  top: 5px;
  right: 6px;
  z-index: 2;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
}

.shape,
.main-silhouette,
.tiny-presence {
  position: absolute;
  display: block;
  background: #000;
  border: 1px solid #111;
}

.shape.mannequin {
  left: 58%;
  bottom: 0;
  width: 28px;
  height: 88px;
  border-radius: 40% 40% 0 0;
}

.shape.observer {
  left: 15%;
  bottom: 15%;
  width: 17px;
  height: 54px;
  opacity: 0.6;
}

.rec-dot {
  color: var(--red);
  font-family: var(--mono);
}

.rec-dot::before {
  content: "[";
}

.rec-dot::after {
  content: "]";
}

.wide-section {
  text-align: left;
}

.protocol-grid {
  display: block;
}

.protocol-grid article {
  min-height: 0;
  margin: 6px 0;
  padding: 6px;
  border: 1px dashed var(--line);
  background: #050505;
}

.protocol-grid span {
  color: var(--red);
  font-family: var(--mono);
}

.page-heading {
  text-align: center;
}

.field-grid {
  display: table;
  width: 100%;
  border-collapse: collapse;
}

label {
  display: block;
  margin: 8px 0;
  color: var(--white);
}

.field-grid label {
  display: block;
}

input,
select {
  width: 100%;
  min-height: 0;
  margin-top: 3px;
  padding: 3px;
  border: 2px inset #999;
  border-radius: 0;
  color: #000;
  background: #fff;
}

input:focus,
select:focus {
  outline: 1px dotted var(--red);
}

.question-list {
  margin: 12px 0;
  padding: 8px;
  border: 1px dashed var(--line);
}

.question-list label {
  display: block;
  margin: 7px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gray);
}

.question-list input {
  width: auto;
}

.accepted-screen {
  border: 2px ridge var(--green);
  background: #001000;
}

.access-denied-panel {
  text-align: center;
  border-color: var(--red);
}

.monitor-layout {
  display: block;
}

.main-monitor {
  min-height: 0;
}

.main-feed-visual {
  min-height: 310px;
}

.main-silhouette {
  left: 63%;
  bottom: -5px;
  width: 62px;
  height: 210px;
  border-radius: 45% 45% 0 0;
  opacity: 0.72;
}

.signal-copy {
  position: absolute;
  left: 8px;
  bottom: 8px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
}

.camera-side {
  display: block;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.camera-tile {
  padding: 0;
  border: 2px outset #666;
  border-radius: 0;
  color: var(--white);
  background: #000;
  text-align: left;
}

.camera-tile.active {
  border-color: var(--acid);
}

.camera-tile.is-anomaly,
.main-feed-visual.is-anomaly {
  border-color: var(--red);
  animation: pageError 300ms steps(2) 3;
}

.camera-visual {
  aspect-ratio: 16 / 9;
}

.camera-visual .tiny-presence {
  left: var(--x, 52%);
  bottom: 8%;
  width: var(--w, 18px);
  height: var(--h, 58px);
}

.camera-label {
  display: block;
  padding: 4px;
}

.camera-label strong {
  display: block;
  color: var(--acid);
}

.file-browser {
  padding: 4px;
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
  width: 100%;
  min-height: 0;
  padding: 5px;
  border: 0;
  border-bottom: 1px solid #333;
  color: var(--cyan);
  background: transparent;
  font-family: var(--mono);
  text-align: left;
  text-decoration: underline;
}

.archive-row:hover {
  color: var(--acid);
  background: #111;
}

.archive-state {
  color: var(--green);
  text-decoration: none;
}

.archive-modal {
  width: min(720px, calc(100% - 20px));
  padding: 10px;
  border: 3px ridge var(--line);
  border-radius: 0;
  color: var(--white);
  background: #000;
}

.archive-modal::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.archive-body {
  clear: both;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 14px;
}

.redacted {
  color: #000;
  background: #000;
  border: 1px solid #333;
  user-select: none;
}

.entity-grid {
  display: block;
}

.failed-shell::before {
  color: var(--acid);
  background: #180000;
  content: "404 // cache residue // failed index recovered // this route is not linked";
}

body[data-page="entities"] {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 0, 0, 0.18), transparent 26%),
    repeating-linear-gradient(90deg, rgba(255, 0, 0, 0.05) 0 1px, transparent 1px 9px),
    #000;
}

.hidden-entity-page .page-heading {
  border-color: var(--red);
  background: #070000;
  animation: pageError 900ms steps(2) infinite;
}

.failed-warning {
  margin: 10px 0;
  padding: 9px;
  border: 2px dashed var(--red);
  background: #0c0000;
  font-family: var(--mono);
}

.failed-warning p {
  color: var(--acid);
  margin: 4px 0;
}

.entity-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
}

body[data-page="entities"] .entity-card {
  position: relative;
  border-color: var(--red);
  background:
    linear-gradient(180deg, rgba(80, 0, 0, 0.82), rgba(0, 0, 0, 0.95)),
    #000;
}

body[data-page="entities"] .entity-card::before {
  position: absolute;
  top: 4px;
  right: 8px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 12px;
  content: "FAILED";
}

.entity-visual {
  min-height: 220px;
}

body[data-page="entities"] .entity-visual {
  border-color: var(--red);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.11), transparent 16%),
    radial-gradient(circle at 30% 70%, rgba(255, 0, 0, 0.18), transparent 20%),
    #030000;
  animation: pageError 2.8s steps(2) infinite;
}

.entity-visual::after {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--entity-w, 46px);
  height: var(--entity-h, 150px);
  border-radius: var(--entity-radius, 45% 45% 0 0);
  background: #000;
  filter: blur(var(--entity-blur, 2px));
  transform: translateX(-50%) skew(var(--entity-skew, 0deg));
  content: "";
}

.entity-card[data-entity="andy"] .entity-visual {
  --entity-w: 88px;
  --entity-h: 135px;
  --entity-skew: -5deg;
}

.entity-card[data-entity="faceless"] .entity-visual {
  --entity-w: 42px;
  --entity-h: 190px;
  --entity-blur: 4px;
}

.entity-card[data-entity="chimera"] .entity-visual {
  --entity-w: 150px;
  --entity-h: 70px;
  --entity-radius: 50% 18% 0 0;
  --entity-skew: -12deg;
}

.entity-facts {
  margin: 0;
  padding-left: 18px;
}

.entity-facts li {
  margin: 4px 0;
  color: var(--gray);
  font-family: var(--mono);
  font-size: 13px;
}

body[data-page="entities"] .entity-facts li {
  color: #d8bdbd;
}

.entity-facts strong {
  color: var(--white);
}

.filters {
  margin: 10px 0;
  text-align: center;
}

.incident-timeline {
  display: block;
}

.incident-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 90px;
  gap: 8px;
  align-items: start;
}

.incident-row.locked {
  opacity: 0.65;
}

.incident-time {
  color: var(--green);
  font-family: var(--mono);
}

.incident-copy {
  margin: 0;
  color: var(--gray);
}

.incident-meta {
  color: var(--acid);
  text-align: right;
}

.countdown-block,
.final-reveal {
  text-align: center;
}

.countdown-units {
  display: table;
  width: min(540px, 100%);
  margin: 15px auto;
  border-collapse: collapse;
}

.countdown-units span {
  display: table-cell;
  padding: 9px;
  border: 1px solid var(--line);
  color: var(--gray);
  font-family: var(--mono);
}

.countdown-units strong {
  display: block;
  color: var(--acid);
  font-size: 30px;
}

.final-reveal h1 {
  color: var(--red);
  font-size: 48px;
}

.final-copy {
  width: min(520px, 100%);
  margin: 14px auto;
  padding: 10px;
  border: 1px dashed var(--line);
}

.final-copy p {
  color: var(--white);
}

.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.86);
}

.terminal-overlay.open {
  display: grid;
}

.terminal-window {
  position: relative;
  width: min(760px, calc(100vw - 20px));
  min-height: 420px;
  font-family: var(--mono);
}

.terminal-window.static-terminal {
  width: 100%;
  min-height: 520px;
}

.terminal-log {
  height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px inset #555;
  background: #000;
}

.static-terminal .terminal-log {
  height: 420px;
}

.terminal-line {
  margin: 0 0 5px;
  color: var(--green);
  white-space: pre-wrap;
}

.terminal-line.system {
  color: var(--gray);
}

.terminal-line.error {
  color: var(--red);
}

.terminal-input-row {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 8px;
}

.terminal-input-row span {
  color: var(--green);
}

.terminal-input {
  border: 0;
  outline: 0;
  color: var(--green);
  background: #000;
  font-family: var(--mono);
}

.terminal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border: 2px outset #999;
  color: #000;
  background: #c0c0c0;
  font-family: var(--mono);
}

.site-footer {
  margin: 12px 0 0;
  padding: 8px;
  border: 2px ridge var(--line);
  color: var(--gray);
  background: #000;
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

.site-footer::after {
  display: block;
  margin-top: 6px;
  color: var(--acid);
  content: "Best viewed with Netscape Navigator 4.7 - 800x600 - cookies must remain enabled";
}

.footer-link {
  margin-left: 8px;
}

.glitch-text {
  animation: uglyBlink 5s steps(2) infinite;
}

.glitch-text::before,
.glitch-text::after {
  display: none;
}

.blink {
  animation: uglyBlink 700ms steps(2) infinite;
}

.is-hidden {
  display: none !important;
}

@keyframes uglyBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.35; }
}

@keyframes pageError {
  0% { transform: translate(0); filter: invert(0); }
  50% { transform: translate(4px, -2px); filter: invert(1); }
  100% { transform: translate(0); filter: invert(0); }
}

@media (max-width: 700px) {
  body {
    font-size: 15px;
  }

  h1 {
    font-size: 27px;
  }

  .site-shell {
    width: calc(100% - 10px);
  }

  .main-nav a {
    display: block;
    margin: 3px 0;
  }

  .recruitment-specs,
  .recruitment-specs div,
  .recruitment-specs span,
  .recruitment-specs strong,
  .countdown-units,
  .countdown-units span {
    display: block;
    width: 100%;
  }

  .camera-grid,
  .entity-card,
  .incident-row,
  .archive-row {
    display: block;
  }

  .entity-visual {
    margin-bottom: 8px;
  }

  .kalyce-mark {
    right: -170px;
    bottom: -120px;
    width: 520px;
    opacity: 0.11;
  }

  .incident-meta {
    text-align: left;
  }
}
