/*
  Reset and global element defaults only. No components live here.
*/
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  /* The wallpaper layer. Both source apps float their panels over a faint dot
     grid (study_desk draws it on a backdrop canvas at 24px pitch, ~10% alpha;
     wonder tiles the same pattern on every candidate page). Here it is a pure
     CSS tile: 2px dots, 24px pitch, offset so dots never touch the rail seam.
     Static chrome — zero motion, zero JS. */
  background: var(--bg);
  background-image: radial-gradient(circle, var(--grid-dot) 1px, transparent 1.5px);
  background-size: 24px 24px;
  background-position: 10px 10px;
  color: var(--ink2);
  font: var(--mono);
  line-height: 1.6;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
}

/* The site is monospace end to end — that is the conceit. The one exception is
   .sans, used for panel headers and stat blocks, which the dossier sets in a
   humanist sans. Two faces, no more. */
.sans { font-family: var(--sans-family); }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--ink);
}

p { margin: 0 0 1em; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
}
a:hover { color: var(--accent-hi); border-bottom-color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

ul, ol { margin: 0 0 1em; padding-left: 1.6em; }
li { margin: 0.3em 0; }
ul li::marker { color: var(--accent-dim); }
ol li::marker { color: var(--accent-dim); }

hr {
  border: 0;
  border-top: 1px solid var(--border3);
  margin: 1.8em 0;
}

code, pre, kbd, samp { font-family: var(--mono-family); font-size: 1em; }

pre {
  margin: 0 0 1em;
  padding: 12px 14px;
  background: #0a0a0a;
  border: 1px solid var(--border2);
  overflow-x: auto;
  line-height: 1.45;
}

code {
  padding: 0.1em 0.35em;
  background: #0a0a0a;
  border: 1px solid var(--border3);
  color: var(--accent-soft);
}
pre code { padding: 0; background: none; border: 0; color: var(--ink2); }

blockquote {
  margin: 0 0 1em;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--accent-dim);
  color: var(--dim);
}

img, svg, canvas, video { max-width: 100%; height: auto; display: block; }

table { border-collapse: collapse; }

button {
  font: inherit;
  font-family: var(--mono-family);
  color: var(--ink2);
  background: transparent;
  border: 1px solid var(--border2);
  padding: 3px 8px;
  cursor: pointer;
}
button:hover { color: var(--accent); background: var(--raised); border-color: var(--accent-dim); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::selection { background: rgba(0, 255, 0, 0.26); color: var(--ink); }

/* Scrollbars, quiet enough to read as chrome. */
* { scrollbar-width: thin; scrollbar-color: rgba(56, 118, 29, 0.55) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(56, 118, 29, 0.55);
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); background-clip: content-box; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 8px 14px;
  background: var(--pane);
  border: 2px solid var(--accent);
  color: var(--accent);
}
.skip-link:focus { left: 0; }
