/* research.usr0.xyz — typography-first stylesheet.
   Light palette on bare :root; dark tokens redefined under prefers-color-scheme. */

:root {
  --bg:        #fbfaf7;
  --fg:        #1c1b19;
  --muted:     #6b6862;
  --rule:      #e2ded5;
  --link:      #8a3324;
  --link-hov:  #b8452f;
  --code-bg:   #f2efe8;
  --code-fg:   #2d2a26;
  --kw:        #8a3324;
  --str:       #4a6b2a;
  --com:       #96918a;
  --num:       #9a5b1e;
  --measure:   36rem;

  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Palatino Linotype",
           Palatino, Georgia, "Times New Roman", serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", "Cascadia Code", Menlo, Consolas,
           "DejaVu Sans Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #16161a;
    --fg:       #e4e1da;
    --muted:    #9a958c;
    --rule:     #2f2f36;
    --link:     #e8927c;
    --link-hov: #f4b3a1;
    --code-bg:  #1e1e24;
    --code-fg:  #ddd9d2;
    --kw:       #e8927c;
    --str:      #a3c585;
    --com:      #6f6b64;
    --num:      #e0b070;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 1rem;
}

/* ---- headings ------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 650;
  margin: 2.6em 0 0.6em;
}

h1 {
  font-size: 2.05rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 0 0 0.4em;
}

h2 {
  font-size: 1.32rem;
  margin-top: 2.9em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--rule);
}

h3 { font-size: 1.08rem; margin-top: 2.1em; }
h4 { font-size: 0.98rem; color: var(--muted); }

/* Anchor links generated by markdown-it-anchor. */
.prose h2 a, .prose h3 a { color: inherit; text-decoration: none; }
.prose h2 a:hover, .prose h3 a:hover { color: var(--link); }

/* ---- body copy ------------------------------------------------------ */

p { margin: 0 0 1.15em; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--link-hov); }

strong { font-weight: 650; }

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

blockquote {
  margin: 1.5em 0;
  padding: 0.1em 0 0.1em 1.2em;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

/* ---- lists — the report is bullet-driven, so these matter ----------- */

ul, ol { margin: 0 0 1.15em; padding-left: 1.35em; }
li { margin: 0.42em 0; }
li > ul, li > ol { margin: 0.4em 0 0.55em; }

/* Sub-bullets read as supporting detail, not peers of the parent. */
li li {
  font-size: 0.95em;
  color: var(--muted);
  margin: 0.28em 0;
}
li li strong, li li a { color: var(--fg); }
li li a { color: var(--link); }

ul { list-style: none; padding-left: 1.15em; }
ul > li { position: relative; }
ul > li::before {
  content: "\2022";
  position: absolute;
  left: -0.95em;
  color: var(--muted);
}
ul ul > li::before { content: "\2013"; }

/* ---- code ----------------------------------------------------------- */

code, pre, kbd { font-family: var(--mono); }

code {
  background: var(--code-bg);
  color: var(--code-fg);
  font-size: 0.855em;
  padding: 0.12em 0.36em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.95rem 1.1rem;
  border-radius: 6px;
  overflow-x: auto;          /* wide code scrolls itself, page never does */
  font-size: 0.8rem;
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: inherit; }

.hljs-keyword, .hljs-built_in, .hljs-tag  { color: var(--kw); }
.hljs-string, .hljs-attr                  { color: var(--str); }
.hljs-comment                             { color: var(--com); font-style: italic; }
.hljs-number, .hljs-literal               { color: var(--num); }
.hljs-title, .hljs-name                   { font-weight: 600; }

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-family: var(--sans);
  font-size: 0.87rem;
  display: block;
  overflow-x: auto;
}
th, td { text-align: left; padding: 0.5em 0.8em 0.5em 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 650; }

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

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

.site-foot {
  max-width: var(--measure);
  margin: 3.5rem auto 0;
  padding: 1.1rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--link); }

@media (max-width: 600px) {
  body { font-size: 17.5px; }
  .prose { padding-top: 2.5rem; }
}
