/* Bits & Backprops — warm paper, indigo ink, unhurried reading. */
:root { color-scheme: light; --paper: #f9f7f2; --ink: #282824; --muted: #65645d; --indigo: #384c70; --rule: #dedbd2; --wash: #efede6; --serif: Georgia, "Times New Roman", serif; --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
html { scroll-padding-top: 2rem; }
body { background: var(--paper); color: var(--ink); font: 19px/1.8 var(--serif); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
.wrapper { max-width: 700px; padding: 0 28px; margin: 0 auto; }
a, a:visited { color: var(--indigo); }
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--indigo); outline-offset: 5px; }
::selection { background: #dce2ec; color: var(--ink); }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 10; background: var(--paper); padding: 10px 16px; }
.skip-link:focus { top: 10px; }
.site-header { background: var(--paper); border: 0; min-height: 0; padding: 24px 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-title, .site-title:visited { float: none; color: var(--ink); font: 17px/1.5 var(--serif); letter-spacing: -.3px; margin: 0; }
.site-nav { float: none; line-height: 1.5; position: static; border: 0; background: transparent; display: flex; gap: 22px; }
.site-nav .page-link, .site-nav .page-link:not(:last-child) { font: 14px/1.5 var(--sans); color: var(--muted); margin: 0; padding: 0; }
.site-nav .page-link[aria-current="page"] { color: var(--indigo); text-decoration: underline; text-underline-offset: 5px; }
.page-content { padding: 24px 0 70px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--serif); font-weight: 400; color: var(--ink); letter-spacing: -.025em; line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
p { margin-bottom: 1.3em; }
.eyebrow, .section-label, .post-meta, .intro-byline, .series-label, .post-tags, .back-link, .site-footer, figcaption, .tag-cloud { font-family: var(--sans); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .17em; color: var(--muted); margin: 0 0 18px; }
.notebook-intro { text-align: center; padding: 4px 0 40px; }
.home-art { display: block; width: 150px; height: 150px; object-fit: contain; margin: 0 auto 26px; }
.notebook-intro h1 { font-size: clamp(2.5rem, 7vw, 3.8rem); margin: 0 0 20px; }
.intro-copy { font-size: 21px; line-height: 1.6; max-width: 500px; margin: 0 auto 20px; color: #514f49; }
.intro-byline { font-size: 13px; color: var(--muted); margin: 0; }
.section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
.section-label h2 { font: 11px/1.5 var(--sans); text-transform: uppercase; letter-spacing: .14em; margin: 0; }
.section-label a { font-size: 13px; }
.post-list { list-style: none; margin: 0; }
.post-list > li { padding: 30px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.post-list h3 { margin: 10px 0 12px; font-size: 26px; }
.post-link { display: inline; color: var(--ink); font-size: inherit; }
.post-link:visited { color: var(--ink); }
.post-excerpt { font-size: 17px; line-height: 1.7; color: #55534e; margin: 0; }
.series-label { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.post-meta { color: var(--muted); font-size: 13px; line-height: 1.9; }
.chapter-art { margin: 0 auto 20px; text-align: center; }
.chapter-art img { display: block; width: 160px; height: 160px; object-fit: contain; margin: 0 auto; }
.chapter-art figcaption { margin-top: 12px; }
.post-header { text-align: center; margin-bottom: 32px; border: 0; padding-bottom: 0; }
.post-title { font-size: clamp(1.9rem, 4.5vw, 2.65rem); line-height: 1.17; letter-spacing: -.035em; text-wrap: balance; margin: 0 0 22px; }
.post-subtitle { font-size: 20px; color: #55534e; font-style: italic; margin: 0 0 22px; }
.post-header .post-meta { margin: 0; }
.post-header::after { content: ""; display: block; height: 1px; width: 48px; background: var(--rule); margin: 22px auto 0; }
.post-content { margin-bottom: 52px; }
.post-content h1, .post-content h2 { margin: 2.3em 0 .85em; font-size: 30px; }
.post-content h3 { font-size: 24px; margin: 1.8em 0 .75em; }
.post-content h4 { font-size: 21px; margin-top: 1.5em; }
.post-content > :first-child { margin-top: 0; }
.post-content li { margin-bottom: .4em; }
.post-content a { text-decoration: underline; text-decoration-color: #b9c0ce; text-underline-offset: .18em; }
.post-content img { max-width: 100%; height: auto; border-radius: 2px; }
.post-content figure { margin: 2em 0; }
figcaption { color: var(--muted); font-size: 13px; line-height: 1.7; margin-top: 10px; }
blockquote { color: #55534e; border-left: 2px solid #a7afbd; padding: 4px 0 4px 22px; font-size: inherit; letter-spacing: 0; font-style: italic; }
blockquote > :last-child { margin-bottom: 0; }
pre, code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; background: var(--wash); border-color: var(--rule); border-radius: 3px; }
code { padding: 2px 5px; }
pre { padding: 20px; line-height: 1.65; overflow: auto; }
pre code { padding: 0; background: transparent; }
.highlighter-rouge .highlight, .highlight { background: var(--wash); }
/* Keep wide technical material inside the reading column on small screens. */
table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-color: var(--rule); color: var(--ink); font-size: 15px; }
table th { background: var(--wash); }
table td, table th { border-color: var(--rule); }
.post-content iframe { max-width: 100%; border: 1px solid var(--rule); }
.mermaid { overflow-x: auto; }
.mermaid svg { max-width: 100%; height: auto; }
.MathJax_Display { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--rule); }
.post-end { border-top: 1px solid var(--rule); padding-top: 24px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 25px; font-size: 13px; }
.post-tag { padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; }
.back-link { font-size: 12px; }
.tag-cloud { margin: 24px 0; text-align: left; }
.tag-cloud h3 { font-size: 24px; }
.tag-cloud .tag-cloud-item { background: transparent; border: 1px solid var(--rule); border-radius: 3px; color: var(--indigo); font-size: 12px; margin: 0 8px 10px 0; padding: 6px 10px; }
.tag-cloud .tag-cloud-item:hover { background: var(--wash); }
.tag-list { margin: 40px 0; }
.tag-list h4 { margin: 10px 0; font-size: 24px; }
.site-footer { border-top: 1px solid var(--rule); padding: 25px 0 35px; color: var(--muted); font-size: 12px; }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; gap: 18px; }
@media (max-width: 600px) {
  body { font-size: 18px; }
  .wrapper { padding: 0 22px; }
  .site-header { padding: 22px 0; }
  .header-inner { align-items: flex-start; flex-direction: column; gap: 14px; }
  .site-nav { width: auto; }
  .page-content { padding-top: 24px; }
  .notebook-intro { padding-bottom: 42px; }
  .intro-copy { font-size: 19px; }
  .chapter-art img { width: 140px; height: 140px; }
  .post-header { margin-bottom: 36px; }
  .post-subtitle { font-size: 18px; }
  .post-list h3 { font-size: 23px; }
  .post-content h1, .post-content h2 { font-size: 27px; }
  .footer-inner { flex-direction: column; gap: 12px; }
  pre { padding: 16px; }
}
@media print {
  body { color: #000; background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .post-end, .skip-link { display: none; }
  .wrapper { max-width: none; padding: 0; }
  .page-content { padding: 0; }
  .chapter-art img { width: 90px; height: 90px; }
  pre { white-space: pre-wrap; }
}

.post-toc { border-block: 1px solid var(--rule); padding: 16px 0; margin-bottom: 36px; font: 14px/1.7 var(--sans); }
.post-toc summary { cursor: pointer; color: var(--indigo); }
.post-toc > ul { margin-top: 20px; }

.header-inner::after, .footer-inner::after { display: none; }

.topic-index { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 40px; font: 14px/1.5 var(--sans); }
.topic-index .tag-cloud-item { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; padding: 9px 13px; border: 1px solid var(--rule); border-radius: 3px; }
.topic-index .tag-cloud-item:hover { background: var(--wash); }
.topic-count { color: var(--muted); font-size: 12px; }
.topic-alias { display: block; scroll-margin-top: 24px; }
.tag-list > h2 { font-size: 27px; margin-bottom: 10px; }
.tag-list .post-list > li:last-child { border-bottom: 0; }
.embed-link { display: inline-block; background: var(--paper); border: 1px solid var(--rule); padding: 8px 14px; border-radius: 3px; font: 14px/1.5 var(--sans); }
.post-content video { display: block; max-width: 100%; height: auto; }

.analysis-embed { margin: 24px 0; }
.analysis-embed > p { margin-bottom: 14px; }
.dataset-embed { overflow-x: auto; }

.related-posts { margin: 28px 0; }
.related-posts h2 { font-size: 23px; margin-bottom: 14px; }
.related-posts ul { margin-left: 20px; font-size: 17px; }
.related-posts li { margin-bottom: 10px; }
