/* Эмуляция терминала 1991 года: 80 колонок, светлый монохромный текст на тёмном экране. */
:root {
  --bg: #0b0d0b;
  --ink: #d9f2d0;
  --dim: #7fa678;
  --accent: #9ee88f;
  --page: #f3efe4;
  --text: #2a2622;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.5 Georgia, "Times New Roman", serif;
}

.about {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 8px;
}

.about h1 { font-size: 28px; margin: 0 0 8px; }
.about p { margin: 0 0 10px; }
.about a { color: #1a4fb3; }
.howto { font-size: 15px; color: #4a443d; }
.link-btn {
  font: inherit;
  color: #1a4fb3;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.lang { font-size: 15px; }
.lang .current { font-weight: 700; color: var(--text); text-decoration: none; cursor: default; }
.lang .note { color: #7a7268; font-size: 14px; }

footer.about { font-size: 14px; color: #5a534b; padding-bottom: 28px; }

/* ---------- Терминал: экран 80×24 фиксированного размера, текст прокручивается, как на VT100 ---------- */
.terminal {
  --cols: 80;
  /* 1ch моноширинного шрифта ≈ 0.6em; на узком экране шрифт уменьшается, чтобы 80 колонок влезли */
  font-size: clamp(9px, calc((100vw - 60px) / 50), 15px);
  width: calc(var(--cols) * 1ch + 2.2em);
  max-width: 100%;
  margin: 8px auto 16px;
  background: #000;
  color: var(--ink);
  border: 10px solid #1d1f1c;
  border-radius: 14px;
  box-shadow: 0 0 0 2px #3a3d38, 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 0 40px rgba(0, 0, 0, 0.6);
  padding: 0.8em 1.1em;
  font-family: "Courier New", Courier, "Lucida Console", monospace;
  line-height: 1.3;
  position: relative;
  overflow: hidden;
}

/* лёгкие строки развёртки, как у ЭЛТ-монитора */
.terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.14) 2px 3px);
}

.screen {
  margin: 0;
  height: calc(23 * 1.3em); /* 23 строки текста + строка приглашения = 24 */
  overflow: auto hidden; /* на узком экране строки можно прокрутить вбок */
  white-space: pre;
  text-shadow: 0 0 2px rgba(158, 232, 143, 0.35);
}

.screen .link-no { color: var(--accent); }
.screen .dim { color: var(--dim); }

.prompt {
  display: flex;
  align-items: baseline;
  height: 1.3em;
  overflow: hidden;
}

.prompt label { white-space: pre; }

.prompt input {
  flex: 1;
  min-width: 8em;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  caret-color: var(--accent);
  padding: 0;
}

.terminal.fast .screen { text-shadow: none; }

@media (max-width: 640px) {
  .terminal { border-width: 6px; }
  .about h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .terminal::after { display: none; }
}
