:root {
  color-scheme: dark;
  --phosphor: #73ff86;
  --phosphor-bright: #c0ffc8;
  --glass: #010803;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: #020302;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--glass);
}

.screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(40,160,58,.11), transparent 68%), var(--glass);
  box-shadow: inset 0 0 90px #000, inset 0 0 26px rgba(66,255,93,.12);
  text-shadow: 0 0 6px currentColor, 0 0 13px rgba(115,255,134,.45);
}

.screen::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  opacity: .075;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.screen::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0,0,0,.62) 100%);
}

.glare {
  position: absolute;
  z-index: 2;
  inset: -60% 38% 8% -42%;
  transform: rotate(-11deg);
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(190,255,198,.035), transparent);
}

.scanlines {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.17) 3px 4px);
}

.terminal {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: clamp(30px, 7vw, 68px);
  color: var(--phosphor);
  font: 400 clamp(13px, 1.9vw, 19px)/1.45 "Courier New", Courier, monospace;
}

.history p {
  margin: 0 0 .18em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.history .command { color: var(--phosphor-bright); }
.history .output { color: #45bb56; }
.history .dim { color: #277c34; }
.history .secret { margin: .7em 0; color: var(--phosphor-bright); }
.history .redacted { color: #1c6327; }
.history .alert { color: #d0ffd5; text-shadow: 0 0 8px currentColor; }

.prompt {
  display: block;
  margin: 0;
  min-height: 1.45em;
  color: var(--phosphor);
  letter-spacing: .015em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.prompt.is-busy { display: none; }

.path { color: var(--phosphor-bright); }
.separator { color: #348e41; }
.directory { color: var(--phosphor); }
.sign { margin-left: .38em; color: var(--phosphor-bright); }
.input { margin-left: .5em; color: var(--phosphor-bright); }

.cursor {
  display: inline-block;
  width: .62em;
  height: 1.05em;
  margin-left: .42em;
  vertical-align: -.15em;
  background: var(--phosphor-bright);
  box-shadow: 0 0 7px var(--phosphor), 0 0 16px rgba(115,255,134,.5);
  animation: blink 1.2s steps(1, end) infinite;
}

.screen.glitching { animation: crt-blink .18s steps(1, end) 1; }

@keyframes blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@keyframes crt-blink {
  0%, 24% { filter: none; }
  25%, 52% { filter: brightness(2.6) contrast(1.3); }
  53%, 82% { filter: brightness(.08); }
  83%, 100% { filter: none; }
}

@media (max-width: 560px) {
  .terminal { padding: 26px 22px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
