/* HoloNet green-phosphor terminal theme, shared by / and /webapps/ */

@font-face {
  font-family: "MatrixCode";
  src: url("matrix-code.ttf") format("truetype");
  font-display: block;
}

:root {
  --bg: #020a03;
  --fg: #5cff85;
  --dim: #3ad866;
  --faint: #1f8a3f;
  --glow: 0 0 2px #5cff85, 0 0 8px rgba(51, 255, 102, 0.6), 0 0 18px rgba(51, 255, 102, 0.3);
  /* over the rain, a tight dark edge keeps letters readable, then the green bloom */
  --rain-glow: 0 0 1px #000, 0 0 3px #000, 0 0 6px rgba(51, 255, 102, 0.7), 0 0 14px rgba(51, 255, 102, 0.35);
}

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

html, body {
  min-height: 100%;
  background: #000;
}

body {
  color: var(--fg);
  font-family: "VT323", "Cascadia Mono", "Consolas", "Courier New", monospace;
  font-size: 22px;
  line-height: 1.25;
  overflow-x: hidden;
}

/* The tube: dark glass with a glowing centre and burnt-in edges */
.screen {
  position: relative;
  min-height: 100vh;
  padding: 48px 16px 40px;
  background: radial-gradient(ellipse at center, #062a0e 0%, var(--bg) 70%, #000 100%);
  text-shadow: var(--glow);
  animation: flicker 6s infinite;
}

/* curved-glass vignette (no drawn scanlines: every line on screen is made of characters) */
.screen::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.55) 100%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.8);
}

/* a horizontal rule typed out in characters; crt.js fills it */
.line.rule {
  white-space: nowrap;
  overflow: hidden;
  color: var(--dim);
}

/* a slow bright band rolling down the tube */
.roll {
  position: fixed;
  left: 0;
  right: 0;
  top: -20%;
  height: 20%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(51, 255, 102, 0), rgba(51, 255, 102, 0.05), rgba(51, 255, 102, 0));
  animation: roll 8s linear infinite;
}

@keyframes roll {
  to { transform: translateY(600%); }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 1; }
  48% { opacity: 0.93; }
  49% { opacity: 1; }
  83% { opacity: 0.97; }
  84% { opacity: 1; }
}

.term {
  position: relative;
  z-index: 1;
  width: min(100%, 860px);
  margin: 0 auto;
}

.line {
  white-space: pre-wrap;
  min-height: 1.25em;
}

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

.banner {
  white-space: pre;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.05;
  margin-bottom: 0.6em;
}

a {
  color: inherit;
  text-decoration: none;
}

.back:hover,
.back:focus-visible {
  outline: none;
  background: var(--fg);
  color: var(--bg);
  text-shadow: none;
}

.apps {
  margin: 0;
}

.app {
  display: flex;
  gap: 1ch;
  padding: 0 1ch;
  white-space: nowrap;
}

.app .num,
.app .name,
.app .desc {
  flex: none;
}

.app .name {
  text-transform: uppercase;
}

/* dot leaders between name and description */
.app .lead {
  flex: 1;
  min-width: 2ch;
  overflow: hidden;
  color: var(--faint);
}

.app .lead::after {
  content: "..................................................................................................................";
}

.app .desc {
  color: var(--dim);
}

.app[hidden] {
  display: none;
}

/* inverse video for the selected line */
.app.selected,
.app:hover {
  outline: none;
  background: var(--fg);
  color: var(--bg);
  text-shadow: none;
  box-shadow: 0 0 12px rgba(51, 255, 102, 0.6);
}

.app.selected .lead,
.app.selected .desc,
.app:hover .lead,
.app:hover .desc {
  color: var(--bg);
}

.prompt {
  display: flex;
  gap: 1ch;
  align-items: baseline;
}

.prompt label {
  flex: none;
}

.prompt input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--fg);
  font: inherit;
  text-shadow: inherit;
  caret-color: transparent;
  outline: none;
}

.prompt input::placeholder {
  color: var(--faint);
  text-shadow: none;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 0.95em;
  vertical-align: -0.1em;
  background: var(--fg);
  box-shadow: var(--glow);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.keys {
  margin-top: 1em;
  color: var(--dim);
}

.booting .reveal {
  visibility: hidden;
}

/* Matrix rain mode: glyphs fall on the text grid, letters light up as they're hit */
#rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
}

.rain-on #rain {
  display: block;
}

.rain-on .term {
  text-shadow: var(--rain-glow);
}

.rain-on .app.selected,
.rain-on .app:hover {
  text-shadow: none;
}

.toggle {
  position: fixed;
  top: 10px;
  right: 16px;
  z-index: 5;
  padding: 0 1ch;
  background: transparent;
  border: 0;
  color: var(--fg);
  font: inherit;
  text-shadow: var(--rain-glow);
  cursor: pointer;
}

.toggle:hover,
.toggle:focus-visible {
  outline: none;
  background: var(--fg);
  color: var(--bg);
  text-shadow: none;
}

@media (max-width: 640px) {
  body {
    font-size: 19px;
  }
  .banner {
    font-size: 9px;
  }
  .app {
    flex-wrap: wrap;
    white-space: normal;
    row-gap: 0;
    padding-bottom: 0.3em;
  }
  .app .lead {
    display: none;
  }
  .app .desc {
    flex-basis: 100%;
    padding-left: 5ch;
  }
  .keys {
    display: none;
  }
}

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