:root {
  --toxic: #39ff14;
  --toxic-dim: #1ea30a;
  --toxic-glow: #39ff1480;
  --bg: #000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--toxic);
  font-family: "Fira Code", "JetBrains Mono", "Consolas", "Menlo", monospace;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

#matrix {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  display: block;
  background: #000;
}

.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0) 0px,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0.18) 3px,
      rgba(0,0,0,0) 4px
    ),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
  mix-blend-mode: multiply;
}

.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vh, 36px);
  padding: clamp(12px, 3vw, 32px);
  container-type: inline-size;
}

.ascii-wrap {
  position: relative;
  line-height: 1.0;
  text-align: center;
  max-width: min(95vw, 1400px);
  filter: drop-shadow(0 0 6px var(--toxic-glow)) drop-shadow(0 0 18px rgba(57,255,20,0.35));
}

pre.ascii {
  margin: 0;
  color: var(--toxic);
  font-family: "Fira Code", "JetBrains Mono", "Consolas", monospace;
  font-weight: 700;
  font-size: clamp(5px, 1.35cqw, 28px);
  letter-spacing: 0;
  white-space: pre;
  text-shadow:
    0 0 2px var(--toxic),
    0 0 10px rgba(57,255,20,0.7),
    0 0 28px rgba(57,255,20,0.3);
  animation: flicker 3.6s infinite steps(1, end);
}

pre.ascii.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.85;
  text-shadow: none;
  filter: none;
  animation: none;
}
pre.ascii.layer.r { color: #ff2e6a; transform: translate(0, 0); }
pre.ascii.layer.b { color: #2ad9ff; transform: translate(0, 0); }

@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93%           { opacity: 0.55; }
  94%           { opacity: 1; }
  96%           { opacity: 0.7; }
  97%           { opacity: 1; }
}

.slice {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  pointer-events: none;
}
.slice pre {
  margin: 0;
  color: var(--toxic);
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(5px, 1.35cqw, 28px);
  line-height: 1.0;
  white-space: pre;
  text-shadow: 0 0 6px rgba(57,255,20,0.8);
}

.link-line {
  position: relative;
  z-index: 1;
  font-family: "Fira Code", "JetBrains Mono", "Consolas", monospace;
  font-size: clamp(10px, 2.6cqi, 22px);
  letter-spacing: 0.04em;
  color: var(--toxic);
  text-shadow: 0 0 6px rgba(57,255,20,0.55), 0 0 14px rgba(57,255,20,0.25);
  text-decoration: none;
  user-select: text;
  cursor: pointer;
  padding: 8px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: text-shadow 120ms ease, color 120ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .link-line:hover {
    color: #b6ff9e;
    text-shadow: 0 0 8px rgba(57,255,20,0.9), 0 0 22px rgba(57,255,20,0.5);
  }
}
.link-line:active {
  color: #b6ff9e;
  text-shadow: 0 0 8px rgba(57,255,20,0.9), 0 0 22px rgba(57,255,20,0.5);
}

.caret {
  display: inline-block;
  width: 0.6ch;
  margin-left: 2px;
  background: var(--toxic);
  color: transparent;
  animation: caret 1s steps(1, end) infinite;
  box-shadow: 0 0 8px rgba(57,255,20,0.8);
}
@keyframes caret {
  50% { background: transparent; box-shadow: none; }
}

@media (max-height: 480px) {
  .stage { gap: 10px; padding: 8px; }
  .link-line { font-size: clamp(11px, 2.2cqi, 18px); padding: 6px 10px; min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  pre.ascii { animation: none; }
  .caret { animation: none; background: var(--toxic); }
}
