/* kb0t.com - WOPR-flavored terminal landing */

:root {
  --bg: #000000;
  --phosphor: #33ff66;
  --phosphor-dim: #1a8033;
  --phosphor-glow: rgba(51, 255, 102, 0.35);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--phosphor);
  font-family: 'VT323', 'Courier New', monospace;
  overflow: hidden;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

/* ---- CRT frame ---- */

.crt {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 4vmin;
  background:
    radial-gradient(ellipse at center, #051005 0%, #000000 80%);
  animation: flicker 4s infinite steps(1);
}

/* subtle randomized brightness flicker */
@keyframes flicker {
  0%   { opacity: 1.00; }
  3%   { opacity: 0.96; }
  6%   { opacity: 1.00; }
  10%  { opacity: 0.98; }
  20%  { opacity: 1.00; }
  50%  { opacity: 0.99; }
  80%  { opacity: 1.00; }
  92%  { opacity: 0.97; }
  100% { opacity: 1.00; }
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  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.18) 3px
    );
  mix-blend-mode: multiply;
  z-index: 5;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
  z-index: 4;
}

/* ---- Terminal text ---- */

.terminal {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 90ch;
  margin: 0 auto;
  padding: 2vmin 2vmin 8vmin;
  font-size: clamp(20px, 2.6vmin, 30px);
  line-height: 1.25;
  letter-spacing: 0.5px;
  text-shadow:
    0 0 2px var(--phosphor-glow),
    0 0 6px var(--phosphor-glow),
    0 0 14px rgba(51, 255, 102, 0.18);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  scrollbar-width: none;
}

.terminal::-webkit-scrollbar { display: none; }

.line {
  display: block;
  min-height: 1em;
}

.user {
  color: var(--phosphor);
}

.sys {
  color: var(--phosphor-dim);
}

.cursor {
  display: inline-block;
  width: 0.6ch;
  background: var(--phosphor);
  color: var(--phosphor);
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
  text-shadow: 0 0 6px var(--phosphor-glow);
}

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

/* Reduced motion: stop the flicker + cursor blink */
@media (prefers-reduced-motion: reduce) {
  .crt { animation: none; }
  .cursor { animation: none; opacity: 1; }
}
