:root {
  --bg: #070b07;
  --fg: #33ff66;
  --hi: #b8ffca;
  --dim: #1f8f40;
  --path: #3fd0c0;
  --err: #ff6b6b;
  --glow: 0 0 6px rgba(51, 255, 102, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, #0d180d 0%, var(--bg) 70%) fixed;
  color: var(--fg);
  font: 15px/1.5 ui-monospace, "JetBrains Mono", "Fira Code", "Cascadia Code",
        "DejaVu Sans Mono", Menlo, Consolas, monospace;
  text-shadow: var(--glow);
  -webkit-font-smoothing: antialiased;
}

/* CRT scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
    rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
  z-index: 10;
}

::selection { background: var(--fg); color: var(--bg); text-shadow: none; }

.term {
  max-width: 82ch;
  margin: 0 auto;
  padding: clamp(20px, 6vh, 64px) clamp(14px, 4vw, 32px) 30vh;
  cursor: text;
}

/* ---- ASCII name ---- */
.banner {
  margin: 0 0 1.75em;
  font: inherit;
  line-height: 1.15;
  white-space: pre;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: crosshair;
}
.banner span { display: inline-block; }

.banner--wide { font-size: min(1em, calc((100vw - 48px) / 42)); }
.banner--narrow { display: none; font-size: min(1em, calc((100vw - 32px) / 26)); }

@media (max-width: 640px) {
  .banner--wide { display: none; }
  .banner--narrow { display: block; }
}

/* ---- terminal lines ---- */
.line {
  min-height: 1.5em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pu { color: var(--hi); font-weight: 700; }
.pp { color: var(--path); }
.dim { color: var(--dim); }
.err { color: var(--err); text-shadow: 0 0 6px rgba(255, 107, 107, 0.35); }

.cursor {
  background: var(--fg);
  color: var(--bg);
  text-shadow: none;
  animation: blink 1.06s steps(1) infinite;
}
.term:not(.focused) .live .cursor {
  background: transparent;
  color: inherit;
  outline: 1px solid var(--fg);
  outline-offset: -1px;
  animation: none;
}
@keyframes blink {
  50% { background: transparent; color: inherit; }
}

/* The real input is invisible; #buf mirrors it. Fixed + 16px avoids mobile scroll/zoom jumps. */
.cmd-input {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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