
html { -webkit-text-size-adjust: 100%; }

body {
  max-width: 42rem;            /* ~70ch: comfortable line length */
  margin: 0 auto;
  padding: 1.2rem 1rem 3rem;
  background: #fdfdfb;
  color: #141414;
  font-family: monospace;
  font-size: 0.875rem;   /* ~14px */
  line-height: 1.5;
  word-wrap: break-word;
}

nav { margin: 0.3rem 0; }
nav a { margin-right: 0.2rem; }


h1, h2, h3, h4 {
  font-weight: normal;
  font-size: inherit;   /* same size as body text */
  text-transform: uppercase;
  line-height: 1.2;
  margin: 1.8rem 0 0;
}
h3::before { content: "# "; color: #999; }

/* Literal ASCII rules emitted by the build:
   .rule      a line of '=' under a heading (its own length)
   .rule-full a line of '-' clipped to the page width (separators). */
.rule      { line-height: 1; margin: 0 0 1rem; white-space: nowrap; overflow: hidden; }
.rule-full { line-height: 1; margin: 0.3rem 0;  white-space: nowrap; overflow: hidden; }


a { color: #0000cc; text-decoration: underline; }
a:visited { color: #551a8b; }
a:hover { background: #e8e8e8; }

/* Code */
pre, code, kbd { font-family: monospace; }
pre {
  background: #f2f2ec;
  border: 1px solid #d8d8d0;
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
}
code { background: #f2f2ec; padding: 0 0.15em; }
pre code { background: none; padding: 0; }

/* ASCII art banner: plain, no box, scrolls horizontally on small screens */
pre.ascii { background: none; border: 0; padding: 0; line-height: 1.1; }

/* Description lists (used on the home page) */
dt { font-weight: bold; }
dd { margin: 0 0 0.6rem 1.2rem; }

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

/* Backlinks block appended to wiki notes */
section.backlinks { margin-top: 2rem; }
section.backlinks ul { margin: 0.3rem 0; padding-left: 1.2rem; }

/* Footer */
footer { color: #555  ; }
footer p { margin: 0.5rem 0; }
footer blockquote { margin: 1rem 0; font-size: 0.6rem }

/* Gallery: a plain wrapping row of thumbnails, no JS */
.gallery { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.gallery a { line-height: 0; background: none; }
.gallery img { width: 14rem; max-width: 100%; border: 1px solid #ccc; }

/* Wiki graph (the only page with JavaScript) */
#graph-figure { margin: 0 0 1.4rem; }
#wiki-graph {
  width: 100%;
  height: 60vh;
  min-height: 320px;
  display: block;
  border: 2px solid #141414;
  background: #fff;
  touch-action: none;        /* let us handle drag/pan on touch */
}
#graph-figure noscript { display: block; padding: 1rem; color: #555; }
