/* ═══════════════════════════════════════════════════════════════
   NODE.973 — shared shell
   "the aesthetic of a place that should have been shut down."
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #05060a;
  --ink: #b9c2c9;
  --dim: #4a545c;
  --blood: #c1121f;
  --sick: #6ee7a8;
  --warn: #e0a800;
  --mono: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(ellipse at 50% 30%, #0a0d15 0%, #05060a 60%, #010102 100%);
  color: var(--ink);
  font-family: var(--mono);
  letter-spacing: 0.03em;
  overflow-x: hidden;
}

body { position: relative; }

/* ── CRT / atmosphere overlays ───────────────────────────────── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.28) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: multiply;
  animation: scan 8s linear infinite;
}
@keyframes scan { from { background-position-y: 0; } to { background-position-y: 100px; } }

.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  box-shadow: inset 0 0 220px 40px rgba(0, 0, 0, 0.95);
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: -50%;
  z-index: 9996;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: shift 0.6s steps(4) infinite;
}
@keyframes shift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-8%, 6%); }
}

body.flicker { animation: flick 0.18s steps(2) 3; }
@keyframes flick { 50% { opacity: 0.6; filter: contrast(1.6) brightness(0.7); } }

/* ── stage ───────────────────────────────────────────────────── */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 3rem 1.5rem;
  text-align: center;
}

/* ── the signal orb ──────────────────────────────────────────── */
.signal {
  position: relative;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  cursor: crosshair;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--blood);
  opacity: 0.5;
  animation: pulse 3.2s ease-out infinite;
}
.ring-1 { width: 60px; height: 60px; }
.ring-2 { width: 120px; height: 120px; animation-delay: 0.6s; }
.ring-3 { width: 190px; height: 190px; animation-delay: 1.2s; }
.core {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blood);
  box-shadow: 0 0 24px 6px var(--blood), 0 0 60px 20px rgba(193, 18, 31, 0.4);
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 0; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); box-shadow: 0 0 40px 12px var(--blood); }
}

/* ── glitch title ────────────────────────────────────────────── */
.glitch {
  position: relative;
  font-size: clamp(2rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.25em;
  margin: 0;
  color: #eef2f5;
  text-shadow: 0 0 8px rgba(238, 242, 245, 0.25);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.glitch::before { color: var(--blood); left: 2px; animation: g1 2.6s infinite steps(12); clip-path: inset(0 0 55% 0); }
.glitch::after { color: var(--sick); left: -2px; animation: g2 3.4s infinite steps(9); clip-path: inset(55% 0 0 0); }
@keyframes g1 { 0%,92%,100% { transform: none; } 94% { transform: translateX(4px); } 96% { transform: translateX(-6px); } }
@keyframes g2 { 0%,90%,100% { transform: none; } 92% { transform: translateX(-5px); } 97% { transform: translateX(5px); } }

.subtitle { color: var(--dim); font-size: 0.95rem; letter-spacing: 0.4em; margin: 0; text-transform: lowercase; }

/* ── readout / typewriter ────────────────────────────────────── */
.readout {
  min-height: 4.5rem;
  max-width: 640px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
}
.readout .cursor { color: var(--blood); animation: blink 1s steps(1) infinite; }

.whisper {
  color: rgba(110, 231, 168, 0.35);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  min-height: 1.2em;
  margin: 0;
  user-select: none;
}

.blink { animation: blink 1.1s steps(1) infinite; color: var(--sick); }
@keyframes blink { 50% { opacity: 0; } }

/* ── footer ──────────────────────────────────────────────────── */
.foot {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.6rem;
  font-size: 0.72rem;
  color: var(--dim);
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
}
.foot .sep { opacity: 0.4; }

/* ═══════════════════════════════════════════════════════════════
   Document / archive pages (the deeper you go)
   ═══════════════════════════════════════════════════════════════ */
.doc {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 1.5rem 8rem;
  line-height: 1.85;
}
.doc h1, .doc h2 { color: #eef2f5; letter-spacing: 0.15em; }
.doc h1 { font-size: 1.6rem; border-bottom: 1px solid var(--dim); padding-bottom: 0.6rem; }
.doc h2 { font-size: 1.05rem; color: var(--blood); margin-top: 2.5rem; }
.doc p { color: var(--ink); }
.doc a { color: var(--sick); text-decoration: none; border-bottom: 1px dotted rgba(110,231,168,0.4); }
.doc a:hover { color: #fff; background: rgba(110,231,168,0.08); }
.doc .meta { color: var(--dim); font-size: 0.8rem; letter-spacing: 0.2em; }
.doc .redact { background: #111; color: #111; padding: 0 0.3em; border-radius: 2px; user-select: all; transition: color 0.3s; }
.doc .redact:hover { color: var(--blood); }
.doc blockquote {
  border-left: 2px solid var(--blood);
  margin: 1.5rem 0;
  padding: 0.4rem 1.2rem;
  color: var(--dim);
  font-style: italic;
}
.doc code, .cipher {
  display: inline-block;
  background: #0c1018;
  border: 1px solid #1a2230;
  color: var(--warn);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.85rem;
  word-break: break-all;
}
.cipher-block {
  background: #080b11;
  border: 1px solid #1a2230;
  border-left: 3px solid var(--warn);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  color: var(--warn);
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.back { display: inline-block; margin-top: 3rem; color: var(--dim); }

/* ── the ennead grid (hidden hub) ────────────────────────────── */
.ennead {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2.5rem 0;
}
.node {
  aspect-ratio: 1;
  border: 1px solid #1a2230;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--dim);
  background: #080b11;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.node .num { font-size: 1.8rem; font-weight: 700; }
.node .name { font-size: 0.7rem; letter-spacing: 0.2em; }
.node.open { color: var(--ink); border-color: var(--blood); }
.node.open:hover { background: rgba(193,18,31,0.08); box-shadow: 0 0 20px rgba(193,18,31,0.25); color: #fff; }
.node.locked { cursor: not-allowed; opacity: 0.5; }
.node.locked::after {
  content: "◼ SEALED";
  position: absolute;
  bottom: 0.5rem;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--dim);
}
.node.you { border-color: var(--sick); color: var(--sick); }

/* ── terminal ────────────────────────────────────────────────── */
.terminal {
  max-width: 760px;
  margin: 3rem auto;
  padding: 1.5rem;
  background: #04050a;
  border: 1px solid #1a2230;
  border-radius: 4px;
  min-height: 60vh;
  position: relative;
  z-index: 1;
}
.terminal .log { white-space: pre-wrap; line-height: 1.6; font-size: 0.9rem; color: var(--sick); }
.terminal .line { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.terminal .prompt { color: var(--blood); }
.terminal input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.9rem;
  outline: none;
  letter-spacing: 0.05em;
}
.terminal .sys { color: var(--dim); }
.terminal .err { color: var(--blood); }
.terminal .ok { color: var(--warn); }

/* utility: nearly invisible text (a secret for the persistent) */
.faint { color: #06070c; user-select: text; }
.faint:hover { color: var(--dim); }

::selection { background: var(--blood); color: #05060a; }

@media (max-width: 520px) {
  .ennead { grid-template-columns: repeat(2, 1fr); }
}
