/* ==========================================================
   Layer 3 — "The Core" (roommom.net)
   What was always underneath. The mask is gone.
   ========================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { background: #080810; }

body {
  color: #00FF41;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  line-height: 1.7;
  padding: 10vh 6vw 24vh;
  overflow-x: hidden;
  min-height: 100vh;
}

/* faint scanlines over the whole page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 3px
  );
}

.l3-wrap {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* ---- beats: hidden until revealed ---- */
.beat {
  opacity: 0;
  transition: opacity 0.9s ease;
  margin-bottom: 16vh;
}
.beat.show { opacity: 1; }

.line { min-height: 1.7em; white-space: pre-wrap; word-break: break-word; }
.voice { color: #00FF41; text-shadow: 0 0 6px rgba(0, 255, 65, 0.3); }
.dim   { color: #00AA28; }
.frag  { color: #FFFFFF; text-shadow: 0 0 8px rgba(255, 255, 255, 0.35); }

/* ---- recovered fragment block ---- */
.recovered {
  text-align: center;
  color: #00AA28;
  font-size: 14px;
  letter-spacing: 1px;
  line-height: 2;
  margin: 5vh 0 4vh;
}
.recovered .subject { color: #FFFFFF; }

/* ---- the corrupted class photo ---- */
.l3-photo {
  width: 100%;
  margin: 4vh auto 5vh;
  position: relative;
  overflow: hidden;
  border: 1px solid #1a1a26;
}
.l3-photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  /* heavy corruption: pushed contrast, hue shift, drained, dark */
  filter:
    contrast(1.7) hue-rotate(45deg) saturate(0.5) brightness(0.72)
    drop-shadow(2px 0 0 rgba(255, 0, 0, 0.45))
    drop-shadow(-2px 0 0 rgba(0, 255, 255, 0.4));
  cursor: pointer;
}
.l3-photo-grid img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
}
/* scanlines + vignette over the photo at full strength */
.l3-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom,
      rgba(0,0,0,0) 0px, rgba(0,0,0,0) 1px,
      rgba(0,0,0,0.5) 1px, rgba(0,0,0,0.5) 2px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(8,8,16,0.85) 100%);
}
.l3-photo-caption {
  text-align: center;
  color: #445;
  font-size: 11px;
  margin-top: 8px;
  letter-spacing: 1px;
}

/* ---- handwritten OCR'd fragment ---- */
.handwritten {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 22px;
  color: #d8d8d8;
  text-align: center;
  margin: 4vh 0 1vh;
  text-shadow: 0 0 2px rgba(255,255,255,0.2);
}
.handwritten-meta {
  text-align: center;
  color: #00AA28;
  font-size: 12px;
  letter-spacing: 1px;
}
.handwritten-wrap { cursor: help; }

/* ---- terminal-style recovered text block ---- */
.term-block {
  color: #00AA28;
  border-left: 2px solid #00AA28;
  padding: 4px 0 4px 14px;
  margin: 5vh 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
}
.term-block .cmd { color: #00FF41; }
.term-block .warn { color: #FFAA00; }

/* ---- the subject_26 archive row ---- */
.archive-row {
  color: #FFFFFF;
  background: #0d0d18;
  border: 1px solid #223355;
  padding: 10px 14px;
  margin-top: 3vh;
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
}

/* ---- final line ---- */
.final .line { color: #FFFFFF; text-shadow: 0 0 8px rgba(255,255,255,0.4); }

/* ---- return link — the only interactive element ---- */
.return-wrap { text-align: center; margin-top: 10vh; opacity: 0; transition: opacity 1.2s ease; }
.return-wrap.show { opacity: 1; }
.return-link {
  display: inline-block;
  color: #00AA28;
  font-size: 14px;
  letter-spacing: 2px;
  text-decoration: none;
  border: 1px solid #1a3a1a;
  padding: 10px 20px;
  transition: all 0.3s ease;
}
.return-link:hover {
  color: #00FF41;
  border-color: #00AA28;
  box-shadow: 0 0 14px rgba(0,255,65,0.25);
}

/* ---- waiting cursor (after beat 1, before surveillance) ---- */
.waiting {
  text-align: center;
  color: #00AA28;
  font-size: 18px;
  margin: 6vh 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.waiting.show { opacity: 1; }
.waiting .blink { animation: l3-blink 1.2s steps(2) infinite; }
@keyframes l3-blink { 0%,49%{opacity:1;} 50%,100%{opacity:0;} }

/* ---- type-anywhere hidden input ---- */
#l3-type {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 86vw);
  background: #050508;
  border: 1px solid #00AA28;
  color: #00FF41;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  padding: 10px 14px;
  z-index: 3000;
  display: none;
  box-shadow: 0 0 20px rgba(0,255,65,0.2);
}
#l3-type.show { display: block; }
#l3-type-response {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  color: #FFFFFF;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.5s ease;
  text-shadow: 0 0 8px rgba(255,255,255,0.4);
}
#l3-type-response.show { opacity: 1; }
