/* APOCALYPSE EXPRESS // REBUILD // STYLE_SHEET */
:root {
  --bg: #050510;
  --blue: #00f0ff;
  --purple: #bc13fe;
  --white: #e0f0ff;
  --dim: #2a2a40;
  --crt-scale: 2;
}

@font-face {
  font-family: 'Terminess';
  src: local('Courier New'), monospace;
}

/* --- PHOSPHENE BACKGROUND --- */
.phosphene-void {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #020202;
  overflow: hidden;
  transform-origin: center;
  will-change: transform;
}

.neural-cloud {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.8;
  /* Stronger base visibility */
  animation: drift 20s infinite alternate ease-in-out;
}

.c1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  /* PURPLE ACCENT: #bc13fe */
  background: radial-gradient(circle, rgba(188, 19, 254, 0.2) 0%, transparent 60%);
  animation-duration: 25s;
}

.c2 {
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  /* BLUE ACCENT: #00f0ff */
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 60%);
  animation-duration: 30s;
  animation-direction: alternate-reverse;
}

.c3 {
  top: 40%;
  left: 40%;
  width: 30vw;
  height: 30vw;
  /* WHITE/CYAN PULSE */
  background: radial-gradient(circle, rgba(224, 240, 255, 0.1) 0%, transparent 60%);
  opacity: 0.6;
  animation: pulse 15s infinite ease-in-out;
}

/* INTERACTIVE SPARKS */
.neural-spark {
  position: absolute;
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
  opacity: 0;
  animation: spark-fade 2s forwards ease-out;
}

/* SYNAPTIC DUST ("NEURON" PARTICLES) */
.synapse-dust {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  opacity: var(--op, 0.8);
  mix-blend-mode: screen;
  filter:
    blur(0.2px)
    drop-shadow(0 0 6px rgba(0, 240, 255, 0.25));
  animation: dust-drift 15s linear forwards;
}

@keyframes dust-drift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: var(--op, 0.8);
  }

  100% {
    transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0.85);
    opacity: 0;
  }
}

@keyframes spark-fade {
  0% {
    transform: scale(0);
    opacity: 0.8;
  }

  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  filter: url(#noiseFilter);
  background: #fff;
  /* Noise base */
  mix-blend-mode: overlay;
  pointer-events: none;
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(5%, 10%) scale(1.1);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.2;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.3;
  }
}

body {
  margin: 0;
  background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
  color: var(--white);
  font-family: 'Terminess', monospace;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
}

/* 
  CONTAINER: 640x360 
  Scaled 2x for view
*/
#crt-frame {
  width: 640px;
  height: 360px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  transform: scale(var(--crt-scale));

  /* SOFT FADE (Mind's Eye Style) */
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 100px 60px #000;
  border-radius: 4px;
  z-index: 10;

  image-rendering: pixelated;
}

#screen {
  width: 100%;
  height: 100%;
  position: relative;
}

/* EFFECTS */
.scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
  z-index: 10;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.8));
  z-index: 9;
  pointer-events: none;
}

/* STATES */
.state {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
}

.state.active {
  display: block;
}

/* --- BOOT STATE (STRICT ALIGNMENT) --- */
#state-boot {
  background: radial-gradient(circle at 30% 50%, rgba(0, 240, 255, 0.05), transparent 40%);
}

.boot-layout {
  position: absolute;
  top: 50%;
  left: 10%;
  /* More to the left */
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1px;
  /* Tighter */
  width: auto;
  align-items: flex-start;
}

.boot-line {
  font-size: 10px;
  /* Way smaller */
  text-shadow: 0 0 5px var(--blue);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Spinner & Dots */
.spinner-zone {
  display: inline-block;
  min-width: 15px;
  color: var(--white);
  font-weight: bold;
}

.dot-stream {
  color: var(--blue);
  opacity: 0.8;
}

/* --- MENU STATE --- */
#state-menu {
  display: none;
  /* Override flex */
  flex-direction: column;
  justify-content: space-between;
}

#state-menu.active {
  display: flex;
}

.top-hud,
.bottom-hud {
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  font-size: 10px;
  border-bottom: 1px solid var(--dim);
  display: flex;
  justify-content: space-between;
  /* LAYER FIX */
  position: relative;
  z-index: 20;
}

.bottom-hud {
  border-bottom: none;
  border-top: 1px solid var(--dim);
  justify-content: center;
}

.menu-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 30px 60px;
  align-content: center;
  /* LAYER FIX */
  position: relative;
  z-index: 20;
}

.menu-item {
  border: 1px solid var(--dim);
  padding: 14px 16px;
  cursor: pointer;
  transition: 0.2s;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--white);
  letter-spacing: 0.6px;
}

.menu-icon {
  opacity: 0.88;
  flex-shrink: 0;
}

.menu-hotkey {
  display: inline-flex;
  align-items: center;
  gap: 0px;
}

.bracket {
  opacity: 0.55;
  margin: 0 1px;
}

.keycap {
  background: var(--white);
  color: #000;
  font-weight: 900;
  padding: 0 4px;
  border-radius: 2px;
  display: inline-block;
  line-height: 1.25;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.12);
}

.menu-label {
  font-size: 12px;
  letter-spacing: 1.6px;
}

.menu-item:hover,
.menu-item.active {
  border-color: var(--blue);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.18);
}

.menu-item:hover .menu-icon,
.menu-item.active .menu-icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.25));
}

.menu-item:hover .keycap,
.menu-item.active .keycap {
  background: var(--blue);
}

/* "Inverted letters" used across HUD */
.hotkey {
  background: var(--white);
  color: #000;
  font-weight: 900;
  padding: 0 3px;
  border-radius: 2px;
  display: inline-block;
  line-height: 1.25;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.10);
}


/* --- READER STATE --- */
#state-reader {
  display: none;
  flex-direction: column;
}

#state-reader.active {
  display: flex;
}

.top-hud.inverted {
  background: transparent;
  color: var(--white);
  border-bottom: 1px solid var(--white);
}

.content-scroll {
  flex: 1;
  padding: 20px 40px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.75;
  color: rgba(243, 249, 255, 0.92);
}

.content-scroll h1 {
  color: var(--blue);
  border-bottom: 1px solid var(--dim);
}

.content-scroll a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 240, 255, 0.4);
}

.content-scroll a:hover {
  color: var(--white);
  border-bottom-color: rgba(224, 240, 255, 0.85);
}

.content-scroll img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px 0;
  border: 1px solid rgba(42, 42, 64, 0.8);
  background: rgba(0, 0, 0, 0.25);
}

.legal-text {
  font-size: 10px;
  text-align: justify;
  opacity: 0.8;
}

.legal-text h3 {
  color: var(--white);
  border-bottom: 1px dashed var(--dim);
  margin-top: 20px;
}

#btn-return {
  background: var(--white);
  color: #000;
  padding: 2px 6px;
  font-weight: bold;
  border: 1px solid var(--white);
}

#btn-return:hover {
  background: var(--blue);
  color: #000;
  border-color: var(--blue);
}

/* --- BADGE ROW --- */
.badge-row {
  margin: 10px 0 8px 0;
}

.badge-row img {
  height: 22px;
  margin-right: 6px;
  vertical-align: middle;
}

/* --- DATA CARDS (REUSABLE) --- */
.data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 20px;
}

.data-card {
  border: 1px solid var(--dim);
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  transition: 0.2s;
}

.data-card:hover {
  border-color: var(--blue);
  background: rgba(0, 240, 255, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--dim);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.card-title {
  color: var(--white);
  font-size: 13px;
  letter-spacing: 1px;
  margin: 0;
}

.data-card.highlight {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.data-card.highlight .card-header {
  border-bottom-color: var(--white);
}

.data-card.highlight .card-title {
  color: var(--white);
}

/* --- PARTNERSHIP ROLE CARDS --- */
.team-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  margin-top: 20px;
}

.role-card {
  border: 1px solid var(--dim);
  padding: 15px;
  background: rgba(0, 0, 0, 0.30);
}

.role-card.core {
  border-color: rgba(0, 240, 255, 0.35);
}

.role-card.highlight {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.role-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--dim);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.role-card.highlight .role-head {
  border-bottom-color: rgba(224, 240, 255, 0.55);
}

.role-card h3 {
  margin: 0;
  color: var(--white);
  font-size: 14px;
  letter-spacing: 1px;
}

.role-tag {
  color: var(--blue);
  font-size: 10px;
  margin: 0 0 8px 0;
  font-weight: bold;
}

.role-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--white);
}

.role-note {
  margin-top: 10px;
  color: var(--white);
  font-size: 11px;
  opacity: 0.92;
}

.role-quote {
  font-size: 11px;
  margin-bottom: 12px;
  font-style: italic;
  opacity: 0.8;
  color: var(--white);
}
/* ---------- readability & utility ---------- */
.hud-btn {
  cursor: pointer;
  color: var(--blue);
  transition: color 120ms ease;
  white-space: nowrap;
}
.hud-btn:hover {
  color: var(--cyan);
}

.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.45);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.micro {
  font-size: 12px;
  opacity: 0.82;
}

.content-scroll p {
  margin: 0 0 10px;
}
.content-scroll ul {
  margin: 8px 0 0 18px;
  padding: 0;
}
.content-scroll li {
  margin: 6px 0;
}

.fold {
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.35);
}
.fold summary {
  cursor: pointer;
  color: rgba(243,249,255,0.92);
  letter-spacing: 1px;
  font-size: 12px;
}
.fold summary:hover {
  color: var(--cyan);
}
.fold[open] {
  background: rgba(0,0,0,0.45);
}

body.mode-reader .scanlines {
  opacity: 0.55;
}
body.mode-reader .vignette {
  opacity: 0.18;
}
body.mode-reader .data-card {
  background: rgba(0,0,0,0.58);
}
body.mode-reader .content-scroll {
  text-shadow: 0 0 14px rgba(94,225,255,0.05);
}

@media (max-width: 560px) {
  .content-scroll {
    padding: 18px 18px;
  }
}
