/* ==========================================================================
   THOUGHT DUMPSTER — 8-bit console system
   The page is a machine: fixed HUD strips top and bottom, a "screen" between
   them, and content composed from framed panels, catalogs and readouts.
   Palette comes from _config.yml.
   ========================================================================== */

@import url("crt-syntax.css");

:root {
  --bg:        #000a02;
  --panel:     #031207;
  --green:     #33ff66;
  --green-hi:  #ccffdb;
  --green-mid: #19b347;
  --green-dim: #0d7a33;
  --line:      #0a4d22;
  --amber:     #ffb000;
  --bad:       #ff5b5b;

  --glow:        0 0 6px rgba(51, 255, 102, 0.28);
  --glow-strong: 0 0 1px currentColor, 0 0 10px rgba(51, 255, 102, 0.40);

  --font-display: 'Press Start 2P', 'Courier New', monospace;
  --font-body: 'IBM Plex Mono', ui-monospace, 'Menlo', monospace;
  --font-glyph: ui-monospace, 'Menlo', 'DejaVu Sans Mono', 'Courier New', monospace;

  --hud-top: 6.4rem;
  --hud-bottom: 2.2rem;
  --shadow: 4px 4px 0 var(--line);
  --shadow-lg: 7px 7px 0 var(--line);
  --screen-max: min(100%, 112rem);
  --screen-pad: clamp(1.25rem, 2.5vw, 3.5rem);
}

/* --- Reset ---------------------------------------------------------------- */

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

html { font-size: 100%; background: #000; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--green);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 70% at 50% 0%, rgba(25, 179, 71, 0.10), transparent 60%),
    radial-gradient(ellipse 100% 60% at 50% 100%, rgba(25, 179, 71, 0.05), transparent 60%);
  background-attachment: fixed;
  overflow-wrap: break-word;
}

body.is-locked { overflow: hidden; }

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; }

ul, ol, dl, dd, figure { margin: 0; padding: 0; }
li { list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: var(--green-hi); text-decoration: none; }
a:hover { color: var(--green); }

::selection { background: var(--green); color: #000; text-shadow: none; }

::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: #000; border-left: 2px solid var(--line); }
::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

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

/* Blinking block cursor */
.caret::after {
  content: "\2588";
  font-family: var(--font-glyph);
  margin-left: 0.2em;
  animation: blink 1.1s steps(1, end) infinite;
}

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

/* ==========================================================================
   CRT tube
   ========================================================================== */

.crt-scanlines, .crt-vignette, .crt-flicker, .crt-power {
  position: fixed; inset: 0; pointer-events: none;
}

.crt-scanlines {
  z-index: 9002;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.28) 3px, rgba(0, 0, 0, 0.28) 4px);
}

.crt-scanlines::after {
  content: "";
  position: absolute; left: 0; right: 0;
  height: 22vh;
  background: linear-gradient(to bottom,
    rgba(51, 255, 102, 0) 0%, rgba(51, 255, 102, 0.035) 50%, rgba(51, 255, 102, 0) 100%);
  animation: roll 9s linear infinite;
}

@keyframes roll { 0% { top: -25vh; } 100% { top: 100vh; } }

.crt-vignette {
  z-index: 9001;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.45) 100%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.7);
}

.crt-flicker {
  z-index: 9003;
  background: rgba(51, 255, 102, 0.02);
  animation: flicker 5s steps(2, end) infinite;
}

@keyframes flicker {
  0%, 96%, 100% { opacity: 0.10; }
  97% { opacity: 0.32; }
  98% { opacity: 0.05; }
  99% { opacity: 0.25; }
}

/* Power-on: a scanline snaps open into a full picture. Kept as a standalone
   overlay — animating body's children would break the fixed HUD strips. */
.crt-power { z-index: 9500; background: #000; animation: power-fade 0.7s ease-out both; }

.crt-power::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--green-mid);
  transform-origin: center;
  animation: power-line 0.7s ease-out both;
}

@keyframes power-fade { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }

@keyframes power-line {
  0%   { transform: scaleY(0) scaleX(0.15); opacity: 0; }
  14%  { transform: scaleY(0.006) scaleX(1); opacity: 1; }
  42%  { transform: scaleY(0.006) scaleX(1); opacity: 1; }
  100% { transform: scaleY(1) scaleX(1); opacity: 0; }
}

/* ==========================================================================
   HUD — fixed machine chrome
   ========================================================================== */

.hud {
  position: fixed;
  left: 0; right: 0;
  z-index: 1000;
  background: #000;
  font-family: var(--font-display);
  text-shadow: none;
}

/* --- Top strip --- */

.hud--top {
  top: 0;
  border-bottom: 2px solid var(--green-dim);
  box-shadow: 0 2px 0 #000, 0 4px 0 var(--line), 0 8px 24px rgba(0, 0, 0, 0.9);
}

.hud__ident {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--screen-max);
  margin: 0 auto;
  padding: 0.75rem var(--screen-pad) 0.55rem;
}

.hud__brand {
  font-size: 0.78rem;
  color: var(--green);
  text-decoration: none;
  text-shadow: var(--glow-strong);
  white-space: nowrap;
}

.hud__brand::before { content: "> "; color: var(--green-dim); }

.hud__brand:hover { color: var(--green-hi); }

.hud__brand--logo img { height: 2rem; image-rendering: pixelated; }

.hud__readouts {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-left: auto;
  font-size: 0.5rem;
  color: var(--green-dim);
}

.readout { display: inline-flex; align-items: center; gap: 0.45rem; }
.readout b { font-weight: 400; color: var(--line); }
.readout__val { color: var(--green-mid); }

.led {
  width: 0.5rem; height: 0.5rem;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hud__toggle {
  display: none;
  font-size: 0.55rem;
  color: var(--green);
  border: 2px solid var(--green-dim);
  padding: 0.45rem 0.6rem;
}

.hud__toggle:hover, .hud__toggle[aria-expanded="true"] { background: var(--green); color: #000; }

/* --- Menu row --- */

.hud__menu {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0;
  max-width: var(--screen-max);
  margin: 0 auto;
  padding: 0 var(--screen-pad) 0.4rem;
  border-top: 1px solid var(--line);
}

.mi {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.54rem;
  color: var(--green-mid);
  text-decoration: none;
  border: 0;
  position: relative;
}

.mi__key {
  color: #000;
  background: var(--green-dim);
  padding: 0.22em 0.35em;
  line-height: 1;
}

.mi__label { text-transform: uppercase; }

.mi:hover, .mi:focus-visible { background: var(--green); color: #000; }
.mi:hover .mi__key, .mi:focus-visible .mi__key { background: #000; color: var(--green); }

/* Dropdown group */
.mi--group { cursor: default; }

.mi__sub {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  min-width: 11rem;
  background: #000;
  border: 2px solid var(--green-dim);
  box-shadow: var(--shadow);
  padding: 0.25rem;
  z-index: 5;
}

.mi--group:hover .mi__sub, .mi--group:focus-within .mi__sub { display: block; }

.mi__sub a {
  display: block;
  padding: 0.5rem 0.6rem;
  font-size: 0.52rem;
  color: var(--green-mid);
  text-decoration: none;
  text-transform: uppercase;
}

.mi__sub a:hover { background: var(--green); color: #000; }

/* Compact the strip once scrolled */
.hud--top.is-compact .hud__ident { padding-top: 0.45rem; padding-bottom: 0.35rem; }
.hud--top.is-compact .hud__readouts { opacity: 0.5; }

/* --- Bottom strip --- */

.hud--bottom {
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  height: var(--hud-bottom);
  padding: 0 var(--screen-pad);
  border-top: 2px solid var(--line);
  font-size: 0.45rem;
  color: var(--green-dim);
}

.hint { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }

.hint b {
  font-weight: 400;
  color: #000;
  background: var(--line);
  padding: 0.22em 0.35em;
  line-height: 1;
}

.hud__spacer { flex: 1; }
.hint--sig { color: var(--line); }

/* ==========================================================================
   Screen
   ========================================================================== */

.screen {
  padding: calc(var(--hud-top) + 2.5rem) var(--screen-pad) calc(var(--hud-bottom) + 3rem);
}

.screen__inner { max-width: var(--screen-max); margin: 0 auto; }

/* Section heading, e.g. ">> ENTRY CATALOG" */
.screen__title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--green-hi);
  text-shadow: var(--glow-strong);
  margin: 3rem 0 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--line);
  text-transform: uppercase;
}

.screen__title-mark { color: var(--green-dim); }
.screen__title-count { color: var(--green-dim); font-size: 0.62rem; }

/* ==========================================================================
   Panels — framed blocks with a label riding the top border
   ========================================================================== */

.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(25, 179, 71, 0.06), transparent 65%), #000;
  border: 2px solid var(--green-dim);
  box-shadow: var(--shadow-lg), inset 0 0 60px rgba(25, 179, 71, 0.06);
  padding: 2.2rem 1.8rem 1.8rem;
  margin: 0 0 2.5rem;
}

.panel__tab {
  position: absolute;
  top: -0.7rem; left: 1.2rem;
  background: var(--bg);
  padding: 0 0.6rem;
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--green-dim);
  text-shadow: none;
}

.panel__title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3.6vw, 1.75rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--green-hi);
  text-shadow: var(--glow-strong);
  margin: 0;
}

.panel__sub {
  font-size: 1.02rem;
  color: var(--green-mid);
  margin: 0.9rem 0 0;
}

.panel__sub::before { content: "> "; color: var(--green-dim); }

/* --- Readout grid: label / value pairs ----------------------------------- */

.readout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 1.6rem 0 0;
  padding-top: 1.3rem;
  border-top: 2px dashed var(--line);
}

.readout-grid__pair { display: flex; align-items: baseline; gap: 0.7rem; }
.readout-grid__pair--wide { grid-column: 1 / -1; flex-wrap: wrap; }

.readout-grid dt {
  font-family: var(--font-display);
  font-size: 0.48rem;
  color: var(--green-dim);
  text-shadow: none;
  white-space: nowrap;
  min-width: 5.5rem;
}

.readout-grid dt::after { content: " :"; color: var(--line); }

.readout-grid dd { margin: 0; font-size: 0.95rem; color: var(--green); }
.readout-grid--boot { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.readout-grid dd.ok { color: var(--green-hi); }
.readout-grid dd.bad { color: var(--bad); }

.readout-grid dd a {
  color: var(--green-hi);
  border-bottom: 1px dashed var(--green-dim);
}

.readout-grid dd a:hover {
  background: var(--green);
  color: #000;
  text-shadow: none;
  border-bottom-color: var(--green);
}

/* ==========================================================================
   Boot screen (home)
   ========================================================================== */

.boot {
  position: relative;
  background: linear-gradient(180deg, rgba(25, 179, 71, 0.08), transparent 70%), #000;
  border: 2px solid var(--green-dim);
  box-shadow: var(--shadow-lg), inset 0 0 80px rgba(25, 179, 71, 0.07);
  padding: 2.2rem 1.8rem 1.8rem;
  margin-bottom: 1rem;
}

.boot__logo {
  position: relative;
  display: inline-block;
  max-width: 100%;
  font-family: var(--font-glyph);
  font-size: 0.85rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--green);
  text-shadow: var(--glow-strong);
  margin: 0 0 1.8rem;
}

/* Hard raster lines cut through the wordmark - heavier and tighter than the
   global tube overlay, so the title reads as its own lit display element.
   The lines are near-black, which means they only register where they cross a
   glyph and stay invisible against the panel behind it. */
.boot__logo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 8, 2, 0.8) 2px,
    rgba(0, 8, 2, 0.8) 4px
  );
}

/* A roll bar drifting down the wordmark, like a tube that has lost vertical
   hold. Darkening rather than brightening keeps it invisible over the
   background and only dims the glyphs as it passes. */
.boot__logo::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 38%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 8, 2, 0) 0%,
    rgba(0, 8, 2, 0.55) 50%,
    rgba(0, 8, 2, 0) 100%
  );
  animation: logo-roll 4.5s linear infinite;
}

@keyframes logo-roll {
  0%   { top: -40%; }
  100% { top: 100%; }
}

.boot__title {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3.2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--green-hi);
  text-shadow: var(--glow-strong);
  margin: 0;
}

.boot__sub { font-size: 1.02rem; color: var(--green-mid); margin: 0; }
.boot__sub::before { content: "> "; color: var(--green-dim); }

/* ==========================================================================
   Entry catalog — the post index as a select screen
   ========================================================================== */

.catalog { border-top: 2px solid var(--line); }

.catalog__row { border-bottom: 2px solid var(--line); }

.catalog__link {
  display: grid;
  grid-template-columns: 3.4rem 1fr auto;
  align-items: start;
  gap: 0 1.2rem;
  padding: 1.1rem 0.8rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.08s steps(2, end);
}

.catalog__idx {
  font-family: var(--font-display);
  font-size: 0.62rem;
  color: var(--green-dim);
  text-shadow: none;
  border: 2px solid var(--line);
  padding: 0.5rem 0;
  text-align: center;
  line-height: 1;
}

.catalog__main { min-width: 0; }

.catalog__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.catalog__title {
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 1.9vw, 0.88rem);
  line-height: 1.6;
  color: var(--green-hi);
  text-shadow: var(--glow-strong);
}

.catalog__date {
  font-family: var(--font-display);
  font-size: 0.5rem;
  color: var(--green-dim);
  text-shadow: none;
  white-space: nowrap;
}

.catalog__sub { display: block; font-size: 0.92rem; color: var(--green-mid); margin-top: 0.5rem; }

.catalog__excerpt {
  display: block;
  font-size: 0.92rem;
  color: var(--green-mid);
  margin-top: 0.6rem;
  opacity: 0.9;
}

.catalog__thumb {
  width: 6.5rem; height: 6.5rem;
  border: 2px solid var(--line);
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.catalog__thumb img {
  max-width: 100%; max-height: 100%;
  filter: saturate(0.35) contrast(1.1) brightness(0.9);
}

/* Selected row inverts like a menu cursor */
.catalog__row:hover .catalog__link,
.catalog__link:focus-visible {
  background: rgba(25, 179, 71, 0.10);
}

.catalog__row:hover .catalog__idx {
  background: var(--green);
  color: #000;
  border-color: var(--green);
}

.catalog__row:hover .catalog__thumb { border-color: var(--green-dim); }
.catalog__row:hover .catalog__thumb img { filter: none; }

.catalog__tags { display: block; padding: 0 0.8rem 1.1rem 5.4rem; }

/* ==========================================================================
   Tags
   ========================================================================== */

.taglist { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.48rem;
  text-transform: uppercase;
  color: var(--green-mid);
  text-decoration: none;
  text-shadow: none;
  border: 2px solid var(--line);
  padding: 0.35rem 0.5rem;
}

.tag::before { content: "#"; color: var(--green-dim); }

.tag:hover { background: var(--green); color: #000; border-color: var(--green); }
.tag:hover::before, .tag:hover .tag__count { color: #000; }

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

.taglist--matrix { gap: 0.45rem; }

.tagsection { scroll-margin-top: calc(var(--hud-top) + 1rem); }

/* ==========================================================================
   File list — tag sections and search results
   ========================================================================== */

.filelist { border-top: 2px solid var(--line); }

.filelist__row { border-bottom: 1px solid var(--line); }

.filelist__link {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  color: inherit;
}

.filelist__link::before {
  content: "";
  position: absolute;
}

.filelist__date {
  font-family: var(--font-display);
  font-size: 0.46rem;
  color: var(--green-dim);
  text-shadow: none;
  align-self: center;
}

.filelist__name { font-size: 0.95rem; color: var(--green-mid); }

.filelist__row:hover .filelist__link { background: var(--green); }
.filelist__row:hover .filelist__date,
.filelist__row:hover .filelist__name { color: #000; text-shadow: none; }

.filelist__row--empty {
  padding: 1rem 0.8rem;
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: var(--green-dim);
}

/* ==========================================================================
   Document body (posts and pages)
   ========================================================================== */

.doc { font-size: 1.02rem; line-height: 1.75; color: var(--green); }

/* The console runs wide so code, tables and images can use the room. Running
   prose stays left-aligned at a readable measure, flush with the panel chrome
   above it - the way text sits in an actual terminal. */
.doc > p,
.doc > ul,
.doc > ol,
.doc > dl,
.doc > blockquote,
.doc > h1, .doc > h2, .doc > h3, .doc > h4, .doc > h5, .doc > h6 {
  max-width: 100ch;
}

.doc a { color: var(--green-hi); text-decoration: none; border-bottom: 1px dashed var(--green-dim); }
.doc a:hover { background: var(--green); color: #000; text-shadow: none; border-bottom-color: var(--green); }

.doc p { margin: 1.3rem 0; }

.doc h1, .doc h2, .doc h3, .doc h4, .doc h5, .doc h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.55;
  color: var(--green-hi);
  text-shadow: var(--glow-strong);
  margin: 3rem 0 1.2rem;
}

.doc h1 { font-size: clamp(0.95rem, 3vw, 1.35rem); }
.doc h2 { font-size: clamp(0.85rem, 2.4vw, 1.1rem); }
.doc h3 { font-size: clamp(0.75rem, 2vw, 0.92rem); }
.doc h4 { font-size: 0.78rem; }
.doc h5, .doc h6 { font-size: 0.68rem; color: var(--green-mid); }

.doc h1::before, .doc h2::before, .doc h3::before {
  content: "// ";
  color: var(--green-dim);
  text-shadow: none;
}

.doc > :first-child { margin-top: 0; }

.doc ul, .doc ol { margin: 1.3rem 0; padding-left: 1.6rem; }
.doc li { margin: 0.35rem 0; list-style: none; }

.doc ul > li::before {
  content: "\25AA";
  font-family: var(--font-glyph);
  color: var(--green-dim);
  display: inline-block;
  width: 1.2em;
  margin-left: -1.2em;
}

.doc ol { counter-reset: doc-ol; }
.doc ol > li { counter-increment: doc-ol; }
.doc ol > li::before {
  content: counter(doc-ol) ".";
  color: var(--green-dim);
  display: inline-block;
  width: 1.6em;
  margin-left: -1.6em;
}

.doc blockquote {
  border-left: 6px double var(--green-dim);
  background: rgba(25, 179, 71, 0.05);
  padding: 0.9rem 1.4rem;
  margin: 2rem 0;
  color: var(--green-mid);
}

.doc blockquote p:last-child { margin-bottom: 0; }

.doc hr { border: 0; border-top: 2px dashed var(--line); margin: 2.8rem 0; }

.doc img {
  display: block;
  margin: 2rem auto;
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  background: #000;
}

.doc .caption {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--green-dim);
  margin: -1.2rem 0 2rem;
}

.doc .caption::before { content: "[ "; }
.doc .caption::after { content: " ]"; }

.doc table {
  width: 100%;
  margin: 2rem 0;
  border: 2px solid var(--green-dim);
  border-collapse: collapse;
  font-size: 0.9rem;
}

.doc th, .doc td { border: 1px solid var(--line); padding: 0.5rem 0.8rem; text-align: left; }

.doc th {
  font-family: var(--font-display);
  font-size: 0.52rem;
  text-transform: uppercase;
  background: rgba(25, 179, 71, 0.12);
  color: var(--green-hi);
  text-shadow: none;
}

.doc tr:hover td { background: rgba(25, 179, 71, 0.07); }

/* --- Code ----------------------------------------------------------------- */

code, kbd, pre, samp { font-family: var(--font-body); }

.doc code {
  font-size: 0.88rem;
  color: var(--green-hi);
  background: rgba(25, 179, 71, 0.13);
  border: 1px solid var(--line);
  padding: 0.05em 0.35em;
  text-shadow: none;
}

.doc a code { color: inherit; }

.doc pre {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--green);
  background: #000;
  border: 2px solid var(--green-dim);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.2rem 1.1rem;
  margin: 0;
  overflow-x: auto;
  text-shadow: none;
}

.doc pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }

/* Terminal label on each code block */
.doc .highlight, .doc div.highlighter-rouge { position: relative; margin: 2.2rem 0; }

.doc .highlight::before, .doc div.highlighter-rouge::before {
  content: "\2591\2591\2591  CODE  \2591\2591\2591";
  font-family: var(--font-glyph);
  position: absolute;
  top: -0.65rem; left: 1rem;
  z-index: 2;
  background: var(--bg);
  padding: 0 0.5rem;
  font-size: 0.62rem;
  color: var(--green-dim);
  text-shadow: none;
}

.doc .highlight pre { margin: 0; }
.doc .highlight table, .doc .highlight td { border: 0; margin: 0; padding: 0; }
.doc .lineno { color: var(--line); border-right: 1px solid var(--line); padding-right: 0.6rem; user-select: none; }

/* ==========================================================================
   Cover image
   ========================================================================== */

.cover { position: relative; margin-bottom: 2rem; border: 2px solid var(--line); box-shadow: var(--shadow); }

.cover__img {
  height: 16rem;
  background-position: center;
  background-size: cover;
  filter: saturate(0.3) contrast(1.1) brightness(0.75);
}

.cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 10, 2, 0.35), rgba(0, 10, 2, 0.8));
  pointer-events: none;
}

.cover__desc {
  position: absolute; right: 0; bottom: 0; z-index: 2;
  background: #000;
  border-left: 2px solid var(--line);
  border-top: 2px solid var(--line);
  color: var(--green-mid);
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
}

/* ==========================================================================
   Pager
   ========================================================================== */

.pager {
  position: relative;
  display: flex;
  gap: 1rem;
  margin: 3rem 0 2rem;
  padding: 2rem 1.2rem 1.2rem;
  border: 2px solid var(--line);
}

.pager__tab {
  position: absolute;
  top: -0.7rem; left: 1.2rem;
  background: var(--bg);
  padding: 0 0.6rem;
  font-family: var(--font-display);
  font-size: 0.48rem;
  color: var(--green-dim);
  text-shadow: none;
}

.pager__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--green-dim);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--green);
  background: #000;
  transition: transform 0.08s steps(2, end), box-shadow 0.08s steps(2, end);
}

.pager__btn--next { text-align: right; }

.pager__dir {
  font-family: var(--font-display);
  font-size: 0.52rem;
  color: var(--green-dim);
  text-shadow: none;
}

.pager__name { font-size: 0.9rem; color: var(--green-mid); }

a.pager__btn:hover {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 2px 2px 0 var(--green-dim);
  transform: translate(2px, 2px);
}

a.pager__btn:hover .pager__dir, a.pager__btn:hover .pager__name { color: #000; text-shadow: none; }

.pager__btn--empty { opacity: 0.35; border-style: dashed; box-shadow: none; }

.pager--list .pager__btn { flex: 0 1 auto; min-width: 11rem; }
.pager--list { justify-content: space-between; }

/* ==========================================================================
   Search overlay
   ========================================================================== */

.overlay {
  position: fixed; inset: 0;
  z-index: 1400;
  background: rgba(0, 6, 1, 0.96);
  padding: calc(var(--hud-top) + 2rem) var(--screen-pad) 2rem;
  overflow-y: auto;
}

.overlay__frame {
  position: relative;
  max-width: var(--screen-max);
  margin: 0 auto;
  border: 2px solid var(--green-dim);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(51, 255, 102, 0.12);
  background: #000;
  padding: 2.2rem 1.5rem 1.5rem;
}

.overlay__exit {
  position: absolute;
  top: 1rem; right: 1rem;
  font-family: var(--font-display);
  font-size: 0.5rem;
  color: var(--green-dim);
  border: 2px solid var(--line);
  padding: 0.4rem 0.55rem;
}

.overlay__exit:hover { background: var(--green); color: #000; border-color: var(--green); }

.overlay__promptline { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.5rem; }

.overlay__prompt { font-size: 1.35rem; color: var(--green-dim); }

#nav-search-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1.35rem;
  color: var(--green-hi);
  background: none;
  border: 0;
  border-bottom: 2px solid var(--line);
  padding: 0.3rem 0;
  outline: none;
}

#nav-search-input:focus { border-bottom-color: var(--green); }
#nav-search-input::placeholder { color: var(--line); }

/* ==========================================================================
   System panel (end of every screen)
   ========================================================================== */

.panel--system { margin-top: 4rem; }

.sysgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem; }

.sysgrid__label {
  font-family: var(--font-display);
  font-size: 0.48rem;
  font-weight: 400;
  color: var(--green-dim);
  text-shadow: none;
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}

.sysgrid__val { font-size: 0.95rem; color: var(--green-mid); margin: 0.2rem 0; }
.sysgrid__val--dim { color: var(--green-dim); font-size: 0.85rem; }
.sysgrid__val a { color: var(--green-mid); text-decoration: none; border-bottom: 1px dashed var(--line); }
.sysgrid__val a:hover { background: var(--green); color: #000; text-shadow: none; }

.channels { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.channel {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.45rem;
  color: var(--green-mid);
  text-decoration: none;
  text-shadow: none;
  border: 2px solid var(--line);
  padding: 0.45rem 0.6rem;
}

.channel i { font-size: 1.15em; }
.channel:hover { background: var(--green); color: #000; border-color: var(--green); }

/* ==========================================================================
   Misc
   ========================================================================== */

#social-share-section {
  display: flex;
  gap: 0.5rem;
  margin: 2.5rem 0 0;
  padding-top: 2rem;
  border-top: 2px dashed var(--line);
}

#social-share-section .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem; height: 2.6rem;
  border: 2px solid var(--green-dim);
  color: var(--green);
  background: #000;
  box-shadow: 3px 3px 0 var(--line);
  text-decoration: none;
}

#social-share-section .btn:hover { background: var(--green); color: #000; border-color: var(--green); }

.gh-btns { margin: 0 0 2rem; }

.error__code {
  font-family: var(--font-glyph);
  font-size: 0.9rem;
  line-height: 1.15;
  color: var(--green-mid);
  margin: 0 0 1.5rem;
  overflow-x: auto;
}

.error__title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.8rem);
  font-weight: 400;
  color: var(--green-hi);
  text-shadow: var(--glow-strong);
  margin: 0;
}

.error__img { margin-top: 2rem; border: 2px solid var(--line); box-shadow: var(--shadow); filter: saturate(0.4); }

.panel--error { border-color: var(--bad); box-shadow: 7px 7px 0 rgba(255, 91, 91, 0.25); }
.panel--error .panel__tab { color: var(--bad); }

.box-note, .box-warning, .box-error, .box-success {
  padding: 1rem 1.2rem;
  margin: 2rem 0;
  border: 2px solid var(--green-dim);
  border-left-width: 6px;
  background: rgba(25, 179, 71, 0.06);
}

.box-warning { border-color: var(--amber); color: var(--amber); }
.box-error { border-color: var(--bad); color: var(--bad); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  :root { --hud-top: 4.4rem; }

  .hud__readouts { display: none; }
  .hud__toggle { display: inline-block; margin-left: auto; }

  .hud__menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0.6rem;
  }

  .hud__menu.is-open { display: flex; }

  .mi { padding: 0.7rem 0.5rem; }
  .mi--group { flex-wrap: wrap; }
  .mi__sub { position: static; display: block; border: 0; box-shadow: none; padding-left: 1.5rem; }

  .catalog__link { grid-template-columns: 2.8rem 1fr; }
  .catalog__thumb { display: none; }
  .catalog__head { flex-direction: column; gap: 0.3rem; }
  .catalog__tags { padding-left: 4.4rem; }

  .filelist__link { grid-template-columns: 1fr; gap: 0.2rem; }

  .pager { flex-direction: column; }
  .pager__btn--next { text-align: left; }
}

@media (max-width: 600px) {
  body { font-size: 0.95rem; }
  .doc { font-size: 0.98rem; }
  :root { --screen-pad: 0.9rem; }
  .panel, .boot { padding: 1.8rem 1rem 1.3rem; }
  .boot__logo { font-size: 0.42rem; }
  .hint--wide, .hint--sig { display: none; }
  .hud--bottom { gap: 0.8rem; }
  .catalog__tags { padding-left: 0.8rem; }
}

/* ==========================================================================
   Amber phosphor mode (Konami code)
   ========================================================================== */

body.amber-mode {
  --green:     #ffb000;
  --green-hi:  #ffe0a0;
  --green-mid: #cc8800;
  --green-dim: #8a5c00;
  --line:      #5a3c00;
  --glow:        0 0 1px currentColor, 0 0 8px rgba(255, 176, 0, 0.30);
  --glow-strong: 0 0 2px currentColor, 0 0 12px rgba(255, 176, 0, 0.55);
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .crt-scanlines::after, .crt-flicker, .caret::after, .led,
  .boot__logo::before { animation: none; }
  .boot__logo::before { display: none; }
  .crt-flicker { opacity: 0.1; }
  .crt-power { display: none; }
  .pager__btn, .catalog__link { transition: none; }
}
