:root {
  --bg: #fbfaf7; --fg: #1d1c1a; --muted: #6b6963; --rule: #e6e3dc;
  --accent: #8a3b12; --accent-soft: #f4e7dd; --code-bg: #f1efe9; --aside-bg: #f5f2ea;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 42rem;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --fg: #e8e5de; --muted: #9a968d; --rule: #2c2b28;
    --accent: #e0925f; --accent-soft: #2a1f17; --code-bg: #1f1e1c; --aside-bg: #1c1b19; }
}
* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--serif); line-height: 1.6;
  font-feature-settings: "kern", "liga", "onum"; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1rem; top: 1rem; }

.wrap, .site-header, .site-footer { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }
.site-header { display: flex; justify-content: space-between; align-items: baseline; padding-top: 2rem; padding-bottom: 2.5rem; font-family: var(--sans); }
.site-title { font-weight: 600; color: var(--fg); letter-spacing: -0.01em; }
.site-tagline { display: block; color: var(--muted); font-size: 0.9rem; }
.site-nav a { color: var(--muted); margin-left: 1.1rem; font-size: 0.9rem; }
.site-nav a[aria-current="page"] { color: var(--fg); }
.site-footer { padding: 3rem 1.25rem 4rem; color: var(--muted); font-family: var(--sans); font-size: 0.85rem; border-top: 1px solid var(--rule); margin-top: 4rem; }
.sep { margin: 0 0.4em; color: var(--muted); }

/* Index */
.intro { font-size: 1.05rem; color: var(--muted); margin: 0 0 2.5rem; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.post-list time { color: var(--muted); font-family: var(--sans); font-size: 0.85rem; padding-top: 0.2rem; font-variant-numeric: tabular-nums; }
.post-list a { color: var(--fg); font-weight: 600; }
.post-list .desc { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 520px) { .post-list li { grid-template-columns: 1fr; gap: 0.15rem; } }

/* Home */
.home .bio { font-size: 1.1rem; margin: 0 0 0.75rem; }
.home .links { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); margin: 0 0 2.5rem; }
.home h2 { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 2.5rem 0 0.6rem; }
.home > p { margin: 0 0 1rem; }

/* Post */
.post-header { margin-bottom: 2.5rem; }
.post-title { font-size: 2.1rem; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5rem; font-weight: 600; }
.post-subtitle { font-size: 1.2rem; color: var(--muted); margin: 0 0 0.75rem; font-style: italic; }
.post-meta { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin: 0; }
.tldr { margin: 1.5rem 0 0; padding: 0.9rem 1.1rem; background: var(--aside-bg); border-left: 3px solid var(--accent); font-size: 0.98rem; }
.tldr strong { font-family: var(--sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin-right: 0.5em; color: var(--accent); }

.toc { font-family: var(--sans); font-size: 0.88rem; margin: 0 0 2.5rem; }
.toc summary { cursor: pointer; color: var(--muted); }
.toc-list { list-style: none; padding: 0.4rem 0 0; margin: 0; }
.toc-list li { padding: 0.15rem 0; } .toc-l3 { padding-left: 1.1rem !important; }
.toc-list a { color: var(--fg); }

.post-body h2 { font-size: 1.45rem; margin: 2.6rem 0 0.8rem; letter-spacing: -0.01em; line-height: 1.25; }
.post-body h3 { font-size: 1.12rem; margin: 2rem 0 0.5rem; font-family: var(--sans); font-weight: 600; }
.post-body h4 { font-size: 1rem; margin: 1.5rem 0 0.4rem; font-family: var(--sans); font-weight: 600; color: var(--muted); }
.post-body p { margin: 0 0 1.15rem; }
.post-body blockquote { margin: 1.5rem 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--rule); color: var(--muted); font-style: italic; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem auto; width: 30%; }
.post-body ul, .post-body ol { padding-left: 1.4rem; margin: 0 0 1.15rem; } .post-body li { margin-bottom: 0.3rem; }
.post-body img, .post-body video, .post-body svg { max-width: 100%; height: auto; }
.post-body figure { margin: 2rem 0; }
@media (min-width: 60rem) { .post-body figure.wide { margin-left: -6rem; margin-right: -6rem; } }
.post-body figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; line-height: 1.45; }
.post-body figcaption strong { color: var(--fg); }

/* Tables */
.post-body table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.86rem; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; margin: 1.5rem 0; }
.post-body th, .post-body td { padding: 0.45rem 0.7rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.post-body th { font-weight: 600; border-bottom: 2px solid var(--fg); white-space: nowrap; }
.post-body td.num, .post-body th.num { text-align: right; }

/* Code */
code, pre { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
pre { background: var(--code-bg); padding: 0.9rem 1.1rem; border-radius: 6px; overflow-x: auto; line-height: 1.5; margin: 1.5rem 0; }
pre code { font-size: 0.82rem; }
.highlight .c, .highlight .c1, .highlight .cm { color: var(--muted); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn { color: var(--accent); }
.highlight .s, .highlight .s1, .highlight .s2 { color: #3b6e3b; }
.highlight .m, .highlight .mi, .highlight .mf { color: #3a5fa0; }
@media (prefers-color-scheme: dark) {
  .highlight .s, .highlight .s1, .highlight .s2 { color: #9ccc8a; }
  .highlight .m, .highlight .mi, .highlight .mf { color: #8fb4ff; }
}

/* Math */
mjx-container[display="true"] { margin: 1.4rem 0 !important; overflow-x: auto; overflow-y: hidden; }

/* Callouts: <div class="note" markdown="1">…</div>; also .warn and .method */
.note, .warn, .method { margin: 1.6rem 0; padding: 0.9rem 1.1rem; border-radius: 4px; background: var(--aside-bg); font-size: 0.96rem; }
.note::before, .warn::before, .method::before { display: block; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.3rem; }
.note::before { content: "note"; } .warn::before { content: "caveat"; } .method::before { content: "method"; }
.warn { border-left: 3px solid #b8860b; }
.note > :last-child, .warn > :last-child, .method > :last-child { margin-bottom: 0; }

/* Footnotes */
.footnotes { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--muted); }
.footnotes ol { padding-left: 1.2rem; } .footnotes li { margin-bottom: 0.5rem; }
sup[role="doc-noteref"] a, .footnote { font-family: var(--sans); font-size: 0.75em; }
.reversefootnote { margin-left: 0.3em; text-decoration: none; }

/* Post footer */
.post-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.88rem; }
.tags { margin: 0 0 1rem; } .tag { display: inline-block; background: var(--accent-soft); color: var(--accent); padding: 0.1em 0.55em; border-radius: 999px; font-size: 0.78rem; margin-right: 0.4em; }
.cite summary { cursor: pointer; color: var(--muted); } .cite pre { font-size: 0.78rem; margin-top: 0.6rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; } .post-nav .right { margin-left: auto; text-align: right; }

/* Page */
.page h1 { font-size: 1.9rem; letter-spacing: -0.015em; margin: 0 0 1.5rem; }

/* Trace cards: verbatim reasoning excerpts.
   <div class="trace lethal"> <p class="trace-head"><span class="tag">lethal prior</span><span class="meta">model · sample · channel</span></p> <pre>…</pre> <p class="gloss">…</p> </div>
   variants: .prior .evidence .applicable .lethal */
:root { --t-prior: #8a3a22; --t-prior-bg: #f0ded7; --t-evid: #2f5a78; --t-evid-bg: #dce7ee; --t-good: #26543c; --t-good-bg: #dce9e0; }
@media (prefers-color-scheme: dark) { :root { --t-prior: #e2a38c; --t-prior-bg: #46271d; --t-evid: #9fc2da; --t-evid-bg: #22333f; --t-good: #9fd1b4; --t-good-bg: #22392c; } }
.trace { margin: 1.6rem 0; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--code-bg); }
.trace .trace-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0; padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--rule); font-family: var(--sans); }
.trace .tag { font-family: var(--mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.45rem; border-radius: 2px; }
.trace .meta { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.trace pre { margin: 0; padding: 0.8rem 0.9rem; background: transparent; border-radius: 0; white-space: pre-wrap; word-break: break-word; font-size: 0.78rem; line-height: 1.55; }
.trace .gloss { margin: 0; padding: 0.6rem 0.9rem 0.75rem; font-size: 0.92rem; color: var(--muted); border-top: 1px dashed var(--rule); background: var(--bg); }
.trace .gloss strong { color: var(--fg); }
.trace.prior .tag, .trace.lethal .tag { background: var(--t-prior-bg); color: var(--t-prior); }
.trace.lethal .tag { outline: 1px solid var(--t-prior); }
.trace.lethal { border-left: 3px solid var(--t-prior); }
.trace.evidence .tag { background: var(--t-evid-bg); color: var(--t-evid); }
.trace.evidence { border-left: 3px solid var(--t-evid); }
.trace.applicable .tag { background: var(--t-good-bg); color: var(--t-good); }
.trace.applicable { border-left: 3px solid var(--t-good); }

/* Definition blocks */
.defn { margin: 1.4rem 0; padding-left: 1rem; border-left: 2px solid var(--accent); }
.defn > p:first-child { margin-bottom: 0.5rem; }
.defn .term { font-family: var(--sans); font-weight: 600; }
.defn .test { font-size: 0.92rem; color: var(--muted); }

/* Standalone score tag, used in prose: <span class="score-tag"><b>model</b> · mean sample error <b>0.94</b> · field median 0.94</span> */
.score-tag { display: inline-block; margin: -0.6rem 0 1.4rem; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); padding: 0.2rem 0.6rem; border: 1px solid var(--rule); border-radius: 999px; white-space: nowrap; }
.score-tag b { font-weight: 500; color: var(--fg); }

/* Prefill rows: <div class="prefills"> <div class="prefill prior"><span class="ptag">prior_only</span><p>…</p></div> … </div>
   variants: .neutral .prior .evidence */
.prefills { margin: 1.4rem 0 1.8rem; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.prefill { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.8rem; padding: 0.7rem 0.9rem; border-top: 1px solid var(--rule); background: var(--code-bg); }
.prefill:first-child { border-top: 0; }
.prefill .ptag { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.45rem; border-radius: 2px; height: fit-content; text-align: center; margin-top: 0.15rem; }
.prefill p { margin: 0; font-family: var(--mono); font-size: 0.78rem; line-height: 1.55; }
.prefill.neutral p { color: var(--muted); font-style: italic; }
.prefill.neutral .ptag { background: var(--bg); color: var(--muted); border: 1px solid var(--rule); }
.prefill.prior .ptag { background: var(--t-prior-bg); color: var(--t-prior); }
.prefill.prior { border-left: 3px solid var(--t-prior); }
.prefill.evidence .ptag { background: var(--t-evid-bg); color: var(--t-evid); }
.prefill.evidence { border-left: 3px solid var(--t-evid); }
@media (max-width: 520px) { .prefill { grid-template-columns: 1fr; gap: 0.3rem; } }
.prefill .pcite { margin: 0.35rem 0 0; font-family: var(--sans); font-size: 0.72rem; color: var(--muted); line-height: 1.45; }
.prefill .pcite a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--rule); }

/* Closing statement: <div class="closing" markdown="1"> … </div> */
.closing { margin: 3rem 0 1rem; padding: 1.4rem 0 0; border-top: 1px solid var(--rule); font-size: 1.12rem; line-height: 1.55; }
.closing p { margin: 0 0 0.9rem; }
.closing p:first-child::first-letter { color: var(--accent); }
.closing strong { font-weight: 600; }
.closing .coda { font-family: var(--sans); font-size: 0.88rem; color: var(--muted); margin-top: 1.2rem; }

/* Takeaway: subtle emphasis for a summarising paragraph. <div class="takeaway" markdown="1"> … </div> */
.takeaway { margin: 1.8rem 0; padding: 0.2rem 0 0.2rem 1.1rem; border-left: 3px solid var(--accent); font-size: 1.04rem; }
.takeaway p { margin: 0 0 0.7rem; } .takeaway p:last-child { margin-bottom: 0; }
.takeaway strong { font-weight: 600; }

/* Papers list (papers/index.md) */
.post-list .desc a.paper-extra { color: var(--muted); font-weight: 400; text-decoration: underline; text-decoration-color: var(--rule); }
