/* ROM GUARD — terminal.
   Monospace throughout, amber CRT. No rounded corners; the only ornament is rules and prompts.
   Amber rather than green so it does not fight the red used for danger. */

:root {
  --bg: #0a0a0a;
  --bg-alt: #121110;
  --fg: #ffb000;          /* amber, the primary */
  --fg-dim: #8a6510;
  --fg-bright: #ffd88a;
  --danger: #ff3b2f;
  --ok: #3ddc84;
  --line: #3a2c0c;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono",
          "Noto Sans Mono CJK JP", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fg-bright); text-underline-offset: 3px; }
a:hover { background: var(--fg); color: var(--bg); text-decoration: none; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ---- header ---- */
header.site { border-bottom: 1px solid var(--line); background: var(--bg); }
header.site .wrap {
  display: flex; align-items: center; gap: 24px;
  min-height: 56px; flex-wrap: wrap;
}
.brand {
  font-weight: 700; font-size: 16px; letter-spacing: 0.1em;
  color: var(--fg-bright); text-decoration: none; white-space: nowrap;
}
.brand::before { content: "$ "; color: var(--fg-dim); }
.brand span { color: var(--danger); }
.brand:hover { background: none; color: var(--fg-bright); }

nav.site {
  display: flex; gap: 18px; overflow-x: auto;
  font-size: 12.5px; padding: 6px 0;
}
nav.site a { color: var(--fg-dim); text-decoration: none; white-space: nowrap; }
nav.site a::before { content: "~"; }
nav.site a:hover { background: none; color: var(--fg); }
nav.site a[aria-current] { color: var(--bg); background: var(--fg); padding: 0 6px; }
nav.site a[aria-current]::before { content: "~"; }

main { padding: 40px 0 72px; }

/* ---- headings ---- */
h1 {
  font-size: 24px; line-height: 1.5; font-weight: 700;
  margin: 0 0 8px; color: var(--fg-bright);
}
h1::before { content: "# "; color: var(--fg-dim); }

h2 {
  font-size: 17px; font-weight: 700; margin: 52px 0 14px;
  padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--fg-bright);
}
h2::before { content: "## "; color: var(--fg-dim); }

h3 { font-size: 14px; font-weight: 700; margin: 28px 0 8px; color: var(--fg); }
h3::before { content: "### "; color: var(--fg-dim); }

p { margin: 0 0 16px; }
strong { color: var(--fg-bright); font-weight: 700; }
.lead { color: var(--fg); margin-bottom: 32px; }

/* ---- panels = output blocks ---- */
.panel {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-left: 3px solid var(--fg-dim);
  padding: 16px 18px;
  margin: 20px 0;
}
.panel.danger { border-color: var(--danger); border-left-color: var(--danger); }
.panel.warn { border-color: var(--line); border-left-color: var(--fg); }
.panel.ok { border-color: var(--line); border-left-color: var(--ok); }
.panel > :last-child { margin-bottom: 0; }

.verdict { font-weight: 700; margin-bottom: 10px; color: var(--fg-bright); }
.verdict::before { content: ">> "; color: var(--fg-dim); }
.panel.danger .verdict { color: var(--danger); }
.panel.danger .verdict::before { content: "!! "; color: var(--danger); }
.panel.ok .verdict { color: var(--ok); }

/* ---- tags ---- */
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.06em; padding: 1px 7px;
  border: 1px solid var(--fg-dim); color: var(--fg-dim);
  vertical-align: middle;
}
.tag.danger { color: var(--bg); background: var(--danger); border-color: var(--danger); }
.tag.warn { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.tag.ok { color: var(--bg); background: var(--ok); border-color: var(--ok); }
.tag.unknown { border-style: dashed; }
.tag.unknown::before { content: "? "; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 16px 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px dashed var(--line); vertical-align: top; }
tr:first-child th {
  border-bottom: 1px solid var(--fg-dim);
  color: var(--fg-dim); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase;
}
th { font-weight: 700; color: var(--fg-bright); }
tr:last-child td, tr:last-child th { border-bottom: none; }
.scroll { overflow-x: auto; border: 1px solid var(--line); }
.scroll table { margin: 0; }

code { color: var(--fg-bright); background: var(--bg-alt); padding: 0 4px; }
pre {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-left: 3px solid var(--fg-dim);
  padding: 14px 16px; overflow-x: auto;
  font-size: 13px; line-height: 1.7; color: var(--fg);
}
pre code { background: none; padding: 0; }

ul, ol { margin: 0 0 16px; padding-left: 0; list-style: none; }
ol { counter-reset: n; }
li { margin-bottom: 8px; padding-left: 24px; position: relative; }
ul > li::before { content: "-"; position: absolute; left: 6px; color: var(--fg-dim); }
ol > li::before {
  counter-increment: n; content: counter(n) ".";
  position: absolute; left: 0; color: var(--fg-dim);
}

/* ---- the check ---- */
.check { border: 1px solid var(--line); background: var(--bg-alt); margin: 24px 0; }
.field { padding: 18px; border-bottom: 1px dashed var(--line); }
.field:last-child { border-bottom: none; }
.field label { display: block; margin-bottom: 12px; }
.step { color: var(--fg-dim); margin-right: 8px; }

select, button {
  font: inherit; font-family: var(--mono);
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); padding: 9px 12px;
}
select { width: 100%; max-width: 440px; }
button { cursor: pointer; }
button:hover { border-color: var(--fg); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button::before { content: "[ ] "; color: var(--fg-dim); }
.choices button[aria-pressed="true"] { border-color: var(--fg); color: var(--fg-bright); }
.choices button[aria-pressed="true"]::before { content: "[x] "; color: var(--fg); }

.src { font-size: 12.5px; color: var(--fg-dim); line-height: 1.65; }
.src a { color: var(--fg-dim); }
.src a:hover { background: var(--fg-dim); color: var(--bg); }

/* ---- coverage meter ---- */
.meter { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--fg-dim); flex-wrap: wrap; }
.meter strong { color: var(--fg); }
.meter .bar {
  flex: 1 1 180px; max-width: 260px; height: 14px;
  background: var(--bg-alt); border: 1px solid var(--line);
}
.meter .bar i {
  display: block; height: 100%;
  background: repeating-linear-gradient(90deg, var(--fg) 0 4px, transparent 4px 8px);
}

/* ---- footer ---- */
footer.site {
  border-top: 1px solid var(--line);
  color: var(--fg-dim); font-size: 12.5px;
  padding: 24px 0 56px;
}
footer.site p { margin: 0 0 8px; }
footer.site p:first-child::before { content: "$ "; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  h1 { font-size: 20px; }
  h2 { font-size: 16px; margin-top: 40px; }
  header.site .wrap { gap: 12px; padding-top: 8px; padding-bottom: 4px; }
  .field { padding: 14px; }
  .panel { padding: 14px; }
}

/* ---- CRT ----
   A scanline mask, a slow flicker and a phosphor glow. Everything here is decoration,
   so it all sits behind prefers-reduced-motion and none of it takes pointer events. */
body {
  text-shadow: 0 0 5px rgba(255, 176, 0, 0.22);
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, rgba(0, 0, 0, 0.30) 0 1px, transparent 1px 3px);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 176, 0, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  animation: crt-flicker 7s infinite steps(1);
}
@keyframes crt-flicker {
  0%, 100% { opacity: 1 }
  6%  { opacity: 0.86 }
  6.4%{ opacity: 1 }
  22% { opacity: 0.92 }
  22.3%{ opacity: 1 }
  57% { opacity: 0.8 }
  57.5%{ opacity: 1 }
  58% { opacity: 0.9 }
  58.4%{ opacity: 1 }
  83% { opacity: 0.88 }
  83.3%{ opacity: 1 }
}

/* blinking block cursor */
.cursor::after,
h1::after {
  content: "\2588";
  margin-left: 0.14em;
  color: var(--fg);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }

/* boot log */
.boot {
  border: none; border-left: 3px solid var(--line);
  background: transparent; color: var(--fg-dim);
  font-size: 12.5px; line-height: 1.65;
  margin: 0 0 28px; padding: 2px 0 2px 14px;
  min-height: 6.2em; white-space: pre-wrap;
}
.boot b { color: var(--fg); font-weight: 400; }
.boot .ok { color: var(--ok); }
.boot .no { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none }
  h1::after, .cursor::after { animation: none }
  body { text-shadow: none }
  body::before { background: none }
}

/* ---- wordmark ----
   A shell prompt reads as a logo here without needing a logo. */
.brand b { font-weight: 700; color: var(--fg-bright); }
.brand i { font-style: normal; color: var(--fg-dim); }
.brand::after {
  /* Static block: the prompt. The blinking one belongs to the h1, where you are "typing". */
  content: "\2588"; margin-left: 0.1em; color: var(--fg-dim);
}
.brand:hover b { color: #fff; }

.banner {
  border: none; background: transparent; padding: 0;
  margin: 0 0 20px; color: var(--fg);
  font-size: 15px; line-height: 1.1; letter-spacing: 0;
  overflow-x: auto;
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.45);
}
@media (max-width: 640px) { .banner { font-size: 11px } }
