/* Green-phosphor CRT. Swap --phosphor to #ffb000 for an amber monitor. */
:root {
  --phosphor: #33ff66;
  --dim: #1e9a42;
  --glass: #061108;
  --bezel: #1b1b18;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #000;
  font: 15px/1.55 var(--mono);
}

/* ---------- Monitor ---------- */
.crt {
  position: relative;
  width: 100%;
  max-width: 820px;
  overflow: hidden;
  border: 14px solid var(--bezel);
  border-radius: 22px;
  background: radial-gradient(ellipse at center, #0c2412 0%, var(--glass) 70%, #020402 100%);
  box-shadow:
    0 0 0 2px #2c2c27,
    0 30px 80px rgba(0, 0, 0, .9),
    inset 0 0 90px rgba(0, 0, 0, .85);
}
@media (max-width: 600px) {
  .crt { border-width: 6px; border-radius: 14px; }
}

/* Scanlines */
.crt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px);
}

/* Faint flicker */
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: rgba(51, 255, 102, .025);
  animation: flicker .12s infinite;
}
@keyframes flicker { 50% { opacity: .4; } }

.screen {
  position: relative;
  padding: 28px 28px 32px;
  color: var(--phosphor);
  text-shadow: 0 0 2px var(--phosphor), 0 0 10px rgba(51, 255, 102, .45);
}
@media (max-width: 600px) {
  .screen { padding: 18px 14px 22px; font-size: 13px; }
}

.screen p, .screen ul { margin: 0; }
.dim { color: var(--dim); }
.cmd { margin-top: 18px !important; }

/* ---------- Banner ---------- */
.banner {
  margin: 22px 0 18px;
  /* 50 characters wide: scale so it always fits the screen */
  font: 400 min(15px, calc((100vw - 90px) / 31)) / 1 var(--mono);
  white-space: pre;
  overflow: hidden;
}

h1 {
  margin: 0;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: .04em;
}

/* ---------- DIR listing ---------- */
.dir { list-style: none; padding: 0; margin-top: 6px !important; }
.dir a {
  display: grid;
  grid-template-columns: 10ch 5ch 1fr;
  color: inherit;
  text-decoration: none;
  padding: 0 4px;
  margin: 0 -4px;
}
.dir a span:last-child { overflow-wrap: anywhere; }

/* Inverse video on hover, like a selected menu item */
a { color: var(--phosphor); }
a:hover, a:focus-visible {
  background: var(--phosphor);
  color: #000 !important;
  text-shadow: none;
  outline: none;
}
a:hover .dim, a:focus-visible .dim { color: #000; }

.cursor {
  display: inline-block;
  width: .6em;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Boot sequence (CSS only) ---------- */
.boot p, .main { opacity: 0; animation: on .01s forwards; }
.boot p:nth-child(1) { animation-delay: .15s; }
.boot p:nth-child(2) { animation-delay: .45s; }
.boot p:nth-child(3) { animation-delay: .8s; }
.boot p:nth-child(4) { animation-delay: 1.1s; }
.boot p:nth-child(5) { animation-delay: 1.4s; }
.main { animation-delay: 1.8s; }
@keyframes on { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .boot p, .main { opacity: 1; animation: none; }
  .crt::after, .cursor { animation: none; }
}

