/* rutter docs — neuromancer/snow-crash skin over an accessible skeleton.
   A11y floor: WCAG 2.1 AA contrast, visible focus, reduced-motion respected,
   no information by color alone, zoom-safe rem sizing. */

:root {
  --bg: #0a0e14;
  --bg-panel: #0f1622;
  --bg-code: #0d1420;
  --ink: #c8d3e0;        /* body text — ≈11:1 on --bg */
  --ink-muted: #8fa3ba;  /* ≈6.6:1 on --bg */
  --neon: #34f5a4;       /* headings — ≈13:1 on --bg */
  --cyan: #63d8ff;       /* links — ≈10:1 on --bg */
  --magenta: #ff5fd2;    /* labels/markers — ≈6.9:1 on --bg */
  --line: #223047;
  --code-ink: #a9ecd0;
  --maxw: 46rem;
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  font-size: 1.0625rem;
}

/* --- dead-channel static + scanlines: decorative, static (no animation) --- */
.dead-channel {
  height: 6px;
  background:
    repeating-linear-gradient(90deg,
      #1a2433 0 2px, #0a0e14 2px 3px, #2a3a52 3px 5px,
      #0f1622 5px 8px, #1f2d42 8px 9px);
  border-bottom: 1px solid var(--line);
}
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(255,255,255,0.03) 0 1px, transparent 1px 3px);
  z-index: 10;
}
@media (prefers-contrast: more) {
  .scanlines { display: none; }
}

/* --- skip link --- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--neon);
  color: #06251a;
  padding: 0.5rem 1rem;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --- header / nav --- */
header.site {
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}
.site-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
}
.wordmark {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  color: var(--neon);
  text-decoration: none;
  letter-spacing: 0.08em;
}
.wordmark:hover, .wordmark:focus-visible { text-decoration: underline; }
nav.site-nav { margin-left: auto; }
nav.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}
nav.site-nav a {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.05em;
}
nav.site-nav a:hover { text-decoration: underline; }
nav.site-nav a[aria-current="page"] {
  color: var(--neon);
  border-bottom: 2px solid var(--neon);
}

/* --- hero --- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.25rem 1rem;
}
.hero .epigraph {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin: 0 0 2rem;
  border-left: 2px solid var(--magenta);
  padding-left: 0.9rem;
}
.hero h1 {
  margin: 0 0 0.6rem;
}
.cursor {
  color: var(--neon);
}
@media (prefers-reduced-motion: no-preference) {
  .cursor { animation: blink 1.2s steps(1) infinite; } /* well under 3 flashes/s */
  @keyframes blink { 50% { opacity: 0; } }
}
.hero .dek {
  color: var(--ink-muted);
  font-size: 1.15rem;
  margin: 0;
}

/* --- main content --- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

h1, h2, h3 {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.25;
  color: var(--neon);
  text-shadow: 0 0 18px rgba(52, 245, 164, 0.25);
}
h1 { font-size: 1.9rem; }
h2 {
  font-size: 1.25rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
h2::before, h3::before {
  content: "// ";
  color: var(--magenta);
  text-shadow: none;
}
h3 { font-size: 1.05rem; color: var(--cyan); margin-top: 2rem; }

p, ul, ol { max-width: 70ch; }

a { color: var(--cyan); }
a:hover { color: var(--neon); }

strong { color: #e6eef7; }
em { color: var(--ink); }

blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.1rem;
  border-left: 2px solid var(--neon);
  background: var(--bg-panel);
  color: var(--ink);
}
blockquote p { margin: 0.4rem 0; }

/* --- code --- */
code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--code-ink);
  background: var(--bg-code);
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 3px;
}
pre {
  background: var(--bg-code);
  border: 1px solid var(--line);
  border-left: 2px solid var(--neon);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: 4px;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* --- tables --- */
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  margin: 1.25rem 0;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--magenta);
}

/* --- callouts: color plus label, never color alone --- */
.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--magenta);
  background: var(--bg-panel);
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}
.callout .label {
  display: block;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--magenta);
  margin-bottom: 0.35rem;
}
.callout p:last-child { margin-bottom: 0; }

/* --- coda --- */
.coda {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--neon);
  font-size: 0.95rem;
}
.coda p { margin: 0.3rem 0; }

/* --- footer --- */
footer.site {
  border-top: 1px solid var(--line);
  background: var(--bg-panel);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.footer-inner a { color: var(--cyan); }

/* --- focus: visible everywhere, 3:1+ against every background --- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- print: drop the theatre --- */
@media print {
  .scanlines, .dead-channel { display: none; }
  body { background: #fff; color: #111; }
}
