:root {
  --bg: #04070a;
  --green: #21f37b;
  --green-glow: rgba(33, 243, 123, 0.5);
  --red: #ff2b4e;
  --red-glow: rgba(255, 43, 78, 0.55);
  --muted: #5c7a6d;
  --mono: 'JetBrains Mono', monospace;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: #cfe9d9;
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

/* Digital rain */
#matrix {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.4;
  pointer-events: none;
}

/* Hero image, barely there — lives in a parallax scene */
.scene {
  position: fixed;
  inset: -6%;
  z-index: 1;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1);
}
.veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(33, 243, 123, 0.16), transparent 18%),
    radial-gradient(circle at 70% 35%, rgba(255, 43, 78, 0.14), transparent 16%),
    linear-gradient(180deg, rgba(4, 7, 10, 0.86), rgba(12, 18, 30, 0.98));
  filter: brightness(0.55) contrast(1.15) saturate(1.1);
  transform: scale(1.06);
  animation: drift 40s ease-in-out infinite alternate;
}
/* RGB-split ghosts for glitch flicker */
.veil.ghost {
  mix-blend-mode: screen;
  opacity: 0;
  animation: none;
}
.veil.ghost.r { filter: brightness(0.45) contrast(1.15) sepia(1) hue-rotate(-50deg) saturate(6); }
.veil.ghost.b { filter: brightness(0.45) contrast(1.15) sepia(1) hue-rotate(160deg) saturate(6); }
.scene.glitch .veil.ghost.r { opacity: 0.6; transform: scale(1.06) translate(6px, -2px); }
.scene.glitch .veil.ghost.b { opacity: 0.6; transform: scale(1.06) translate(-6px, 2px); }
.scene.glitch .veil.base   { transform: scale(1.06) translate(-2px, 1px); filter: brightness(0.6) contrast(1.4) saturate(1.4); }
@keyframes drift {
  from { transform: scale(1.06) translate(0, 0); }
  to   { transform: scale(1.12) translate(-1.5%, -1%); }
}
.veil.base::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 20%, rgba(4,7,10,0.75) 75%, var(--bg) 100%);
}

/* Scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.22) 3px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: overlay;
}

/* Center stage */
.stage {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.knock {
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--green);
  text-shadow: 0 0 18px var(--green-glow);
  opacity: 0;
  animation: fadein 2s ease 0.4s forwards;
}

.type {
  margin-top: 1.6rem;
  min-height: 1.4em;
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  letter-spacing: 0.02em;
  color: #eafff2;
  text-shadow: 0 0 24px var(--green-glow);
}
.type .cursor {
  display: inline-block;
  width: 0.55ch;
  background: var(--green);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
  box-shadow: 0 0 12px var(--green-glow);
}
@keyframes blink { 50% { opacity: 0; } }

.choice {
  margin-top: 3.5rem;
  display: flex;
  gap: 2.5rem;
  opacity: 0;
  animation: fadein 2s ease 3.5s forwards;
}

.dose {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s;
}
.dose::after {
  content: attr(data-label);
  position: absolute;
  top: 150%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  color: var(--muted);
}
.dose:hover { transform: scale(1.35); }
.dose:hover::after { opacity: 1; }
.dose.red  { background: var(--red);   box-shadow: 0 0 22px var(--red-glow); }
.dose.blue { background: #2b6bff;       box-shadow: 0 0 22px rgba(43,107,255,0.55); }

@keyframes fadein { to { opacity: 1; } }

/* Glitch flash on red */
.flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #eafff2;
  opacity: 0;
  pointer-events: none;
}
.flash.go { animation: flash 0.5s ease forwards; }
@keyframes flash {
  0% { opacity: 0; }
  15% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* faint footer glyph */
.mark {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 0.68rem;
  letter-spacing: 0.4em;
  color: var(--muted);
  opacity: 0.5;
}

/* Terminal overlay */
.terminal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}
.terminal.active {
  opacity: 1;
  pointer-events: auto;
}
.terminal-body {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: min(84vw, 520px);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.88rem;
}
@media (max-width: 520px) {
  .terminal-body {
    width: calc(100vw - 2rem);
    top: 1rem;
    left: 1rem;
  }
}
.terminal-output {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  opacity: 0.95;
}
.terminal-output div {
  margin-bottom: 0.25rem;
}
.terminal-prompt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.2rem;
  color: #fff;
  font-size: 0.95rem;
}
.terminal-wake {
  color: #21f37b;
}
.prompt-symbol {
  color: #fff;
  font-weight: 600;
}
.terminal-prompt input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.1rem 0.2rem;
  outline: none;
  caret-color: #fff;
}
.terminal-prompt input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
