/* Plain document styling. No frameworks, no scripts. */

:root {
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --line: #c8c8c0;
  --bg: #fdfdfb;
  --link: #0b4a8f;
  --code-bg: #f1f0ea;
  --serif: Georgia, "Times New Roman", serif;
  --mono: Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 17px/1.55 var(--serif);
  color: var(--fg);
  background: var(--bg);
}

a { color: var(--link); }
a:visited { color: #5a3a8f; }

.wrap { max-width: 54rem; margin: 0 auto; padding: 0 1rem; }

/* ---- header / footer ---- */

.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.6rem; padding-top: 0.7rem; padding-bottom: 0.7rem; }
.brand { font-size: 1.35rem; font-weight: bold; text-decoration: none; color: var(--fg); }
.top nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; }
.top nav a[aria-current] { color: var(--fg); font-weight: bold; text-decoration: none; }

main.wrap { padding-top: 1.2rem; padding-bottom: 3rem; min-height: 60vh; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.foot .wrap { padding-top: 0.8rem; padding-bottom: 0.8rem; }

/* ---- text ---- */

h1 { font-size: 1.8rem; margin: 0.3rem 0 0.6rem; line-height: 1.2; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; border-bottom: 1px solid var(--line); padding-bottom: 0.15rem; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 0.3rem; }
p, ul, ol { margin: 0.6rem 0; }
li { margin: 0.15rem 0; }

.crumbs { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.note { border-left: 3px solid var(--line); padding: 0.1rem 0 0.1rem 0.8rem; color: var(--muted); }

code, pre, .mono { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--code-bg); padding: 0.05em 0.3em; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
  line-height: 1.4;
  margin: 0.6rem 0;
}
pre code { background: none; padding: 0; font-size: 1em; }

blockquote { margin: 0.6rem 0; padding-left: 0.9rem; border-left: 3px solid var(--line); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* ---- tables ---- */

.scroll { overflow-x: auto; margin: 0.6rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { border: 1px solid var(--line); padding: 0.3rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--code-bg); font-weight: bold; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td.r, th.r { text-align: right; }
td.c, th.c { text-align: center; }

/* ---- docs ---- */

.doc { max-width: 46rem; }
.doc h1 { margin-top: 0; }

/* ---- library source view ---- */

.source { font-size: 0.85rem; white-space: pre; tab-size: 4; }

@media (max-width: 40rem) {
  body { font-size: 16px; }
  th, td { padding: 0.25rem 0.4rem; }
}
