/* Foundations: system fonts, one accent, and a small set of shared dimensions. */
:root {
  --paper: #fcfcf9;
  --sidebar: #f3f4ef;
  --ink: #282e29;
  --muted: #686e66;
  --line: #e0e4dc;
  --green: #285b46;
  --tint: #e5ece2;
  --sidebar-width: 254px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.65 var(--sans); }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--green); }
button, input { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
img, svg { max-width: 100%; }
img { height: auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 400; }
.icon { flex-shrink: 0; vertical-align: middle; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 10px 18px; background: var(--green); color: white; }
.skip-link:focus { top: 12px; color: white; }

/* The unenhanced sidebar stays accessible even if JavaScript is unavailable. */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width); padding: 38px 20px 24px; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
.identity { display: flex; flex-direction: column; text-decoration: none; padding: 0 14px; margin-bottom: 48px; }
.monogram { width: 49px; height: 49px; display: grid; place-content: center; grid-auto-flow: column; background: var(--green); color: #fff; border-radius: 12px; margin-bottom: 18px; font: 29px/1 var(--serif); letter-spacing: -2px; }
.monogram span { color: #bdd19b; }
.identity-name { font-size: 18px; font-weight: 600; letter-spacing: -.5px; }
.identity-caption { color: var(--muted); font-size: 11px; margin-top: 5px; }
.nav-label, .eyebrow, .count-label { font: 10px/1.6 var(--mono); text-transform: uppercase; letter-spacing: 1.5px; }
.nav-label { padding-left: 14px; color: var(--muted); margin-bottom: 12px; }
.nav-link { display: flex; align-items: center; gap: 13px; padding: 10px 13px; margin: 3px 0; border-radius: 5px; font-size: 13px; text-decoration: none; color: #525b50; min-height: 44px; }
.nav-link:hover { background: #ebeee7; }
.nav-link.is-active { background: var(--tint); color: var(--green); font-weight: 600; }
.nav-link:nth-last-child(2) { margin-top: 28px; }
.nav-count { margin-left: auto; font: 11px var(--mono); }
.sidebar-bottom { margin-top: auto; padding: 55px 14px 0; color: var(--muted); font-size: 11px; }
.sidebar-bottom p { font-family: var(--serif); font-style: italic; font-size: 13px; }
.sidebar-bottom a { display: inline-block; margin-right: 18px; padding: 8px 0; text-decoration: none; }
.site-body { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; flex-shrink: 0; height: 76px; padding: 0 42px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar-location { display: flex; align-items: center; gap: 17px; min-width: 0; }
.menu-toggle { display: grid; place-items: center; min-width: 40px; height: 40px; border: 0; border-radius: 5px; background: transparent; }
.menu-toggle:hover { background: var(--tint); }
.topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.topbar-title > span:first-child { color: #9aa294; padding: 0 12px; }
.topbar-title > span:last-child { color: var(--ink); }
.search-link { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 12px; text-decoration: none; color: var(--muted); }
.search-link .icon { width: 16px; }
kbd { font: 10px var(--mono); border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px; margin-left: 18px; }
main { flex: 1; min-width: 0; }
main:focus { outline: none; }
.site-footer { max-width: 1084px; width: 100%; margin: auto auto 0; padding: 24px 52px; display: flex; justify-content: space-between; gap: 20px; font-size: 11px; color: var(--muted); }
.site-footer a { text-decoration: none; }
.js.sidebar-collapsed .sidebar { transform: translateX(-100%); visibility: hidden; }
.js.sidebar-collapsed .site-body { margin-left: 0; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 20; border: 0; background: rgb(25 35 25 / 30%); }

/* Homepage: generous reading space and a compact, illustrative SVG. */
.home-wrap { max-width: 1084px; padding: 0 52px; margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: center; gap: 38px; padding: 67px 0 60px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--green); margin-bottom: 21px; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #6b8860; vertical-align: 1px; }
.hero h1 { font: 52px/1.12 var(--serif); letter-spacing: -2px; margin-bottom: 24px; }
.hero h1 em { color: var(--green); font-weight: 400; }
.hero-copy > p:not(.eyebrow) { max-width: 410px; color: var(--muted); font-size: 14px; line-height: 1.85; margin-bottom: 27px; }
.primary-link { display: inline-flex; align-items: center; gap: 17px; padding: 11px 16px; border-radius: 4px; background: var(--green); color: #fff; text-decoration: none; font-size: 12px; }
.primary-link:hover { background: #1d4535; color: #fff; }
.primary-link .icon { width: 17px; }
.quiet-link { display: inline-block; font-size: 11px; color: var(--muted); margin: 15px 0 0 15px; text-decoration: none; }
.hero-diagram { transform: rotate(-7deg); padding-top: 12px; }
.hero-diagram svg { display: block; }
.hero-diagram span { display: block; text-align: center; color: #6d7b66; font: italic 12px var(--serif); margin-top: 16px; }
.subject-section { padding: 36px 0 40px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 21px; }
.section-heading h2 { font: 24px/1.3 var(--serif); letter-spacing: -.5px; margin: 0; }
.count-label { color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.subject-card { position: relative; padding: 21px 20px 19px; border: 1px solid var(--line); border-radius: 5px; text-decoration: none; background: #f8f9f4; }
.subject-card:hover { background: var(--tint); border-color: #becfba; }
.subject-number { display: block; color: var(--muted); font: 10px var(--mono); margin-bottom: 28px; }
.subject-card > .icon { position: absolute; right: 19px; top: 19px; color: var(--green); width: 24px; height: 24px; }
.subject-card h3 { font: 21px var(--serif); letter-spacing: -.4px; margin-bottom: 9px; }
.subject-card h3 span { float: right; font: 15px var(--sans); color: var(--muted); }
.subject-card p { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 0; max-width: 190px; }
.text-link { display: inline-flex; gap: 10px; align-items: center; font: 12px var(--sans); color: var(--green); text-decoration: none; }
.recent-section { padding: 4px 0 24px; }
.note-list { border-top: 1px solid var(--line); }
.note-row { display: flex; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); padding: 26px 0; }
.note-row-content { flex: 1; min-width: 0; }
.note-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font: 10px var(--mono); margin-bottom: 9px; }
.note-meta > span:first-child { color: var(--green); }
.note-title { font: 25px/1.3 var(--serif); letter-spacing: -.4px; margin-bottom: 8px; }
.note-title a { text-decoration: none; }
.note-title a:hover { text-decoration: underline; }
.note-row p { font-size: 13px; color: var(--muted); margin-bottom: 11px; }
.note-topics { display: flex; gap: 12px; color: var(--muted); font: 9px var(--mono); }
.note-arrow { font-size: 24px; color: #7c8b73; padding-right: 8px; }
.home-note { display: flex; gap: 20px; align-items: center; padding: 23px 0 33px; }
.home-note > span { font-size: 28px; color: var(--green); }
.home-note p { color: var(--muted); font-size: 12px; line-height: 1.9; margin: 0; }
.home-note a { color: var(--green); }

/* Shared reading pages, article metadata, and native solution disclosures. */
.page-wrap { max-width: 900px; padding: 57px 52px 70px; margin: 0 auto; }
.page-heading { margin-bottom: 38px; }
.page-heading h1 { font: 48px/1.14 var(--serif); letter-spacing: -1.6px; margin-bottom: 22px; overflow-wrap: break-word; }
.page-description { font-size: 16px; line-height: 1.8; color: var(--muted); max-width: 630px; }
.back-link { display: inline-block; margin-bottom: 36px; text-decoration: none; color: var(--muted); font-size: 12px; }
.article .page-heading { border-bottom: 1px solid var(--line); padding-bottom: 25px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; list-style: none; }
.tags a { display: inline-block; padding: 3px 8px; border-radius: 3px; background: var(--sidebar); text-decoration: none; color: var(--green); font: 10px/1.7 var(--mono); }
.prose { font-size: 16px; line-height: 1.9; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.4em; }
.prose a { color: var(--green); }
.prose h2 { font: 30px/1.3 var(--serif); margin: 1.7em 0 .65em; letter-spacing: -.6px; }
.prose h3 { font: 22px/1.4 var(--serif); margin: 1.5em 0 .4em; }
.prose li { padding-left: 4px; }
.prose blockquote { border-left: 3px solid #9bad8e; margin: 25px 0; padding: 2px 0 2px 24px; color: var(--muted); }
.prose blockquote p { margin: 8px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 35px 0; }
.prose img { display: block; margin: 25px auto; border-radius: 4px; }
.prose details { border: 1px solid var(--line); border-radius: 5px; background: #f7f8f2; padding: 16px 22px; margin: 28px 0; }
.prose summary { color: var(--green); font-size: 14px; font-weight: 600; }
.prose details[open] summary { margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.prose details > :last-child { margin-bottom: 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
code { font-family: var(--mono); font-size: .82em; padding: 2px 5px; background: #edf0e8; border-radius: 3px; }
pre { overflow-x: auto; padding: 22px; background: #f0f2ec; border: 1px solid var(--line); border-radius: 5px; line-height: 1.6; }
pre code { padding: 0; background: transparent; border-radius: 0; font-size: 12px; }
.highlight .c, .highlight .c1, .highlight .cm { color: #67725f; font-style: italic; }
.highlight .k, .highlight .kn, .highlight .kd, .highlight .ow { color: #824065; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #326943; }
.highlight .nf, .highlight .nc, .highlight .nb { color: #225980; }
.highlight .mi, .highlight .mf { color: #98512a; }
/* Override MathJax's inline minimum width on numbered equations. */
mjx-container[display="true"] { min-width: 0 !important; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 8px 0; }
.article-footer { padding: 26px 0; margin-top: 38px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.article-footer p { margin-bottom: 4px; }
.article-footer a { color: var(--green); }
.post-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; border-top: 1px solid var(--line); padding-top: 25px; }
.post-pagination a { font-family: var(--serif); text-decoration: none; }
.post-pagination .eyebrow { display: block; margin-bottom: 7px; font-size: 9px; }
.topic-links { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 30px; }
.topic-links a { border: 1px solid var(--line); border-radius: 4px; padding: 8px 13px; font-size: 12px; text-decoration: none; }
.topic-links [aria-current] { background: var(--green); border-color: var(--green); color: #fff; }
.pagination { display: flex; justify-content: space-between; gap: 15px; padding: 28px 0; font-size: 12px; color: var(--muted); }
.pagination a { color: var(--green); }
.empty-state { border-top: 1px solid var(--line); padding: 40px 0; }
.empty-symbol { font-size: 35px; color: var(--green); }
.empty-state h2 { font: 29px var(--serif); margin: 12px 0; }
.empty-state p { color: var(--muted); max-width: 440px; }

/* Search loads its index only after a visitor enters a query. */
.search-form label { display: block; font-size: 13px; margin-bottom: 10px; }
.search-field { display: flex; align-items: center; gap: 12px; border: 1px solid #aebda5; border-radius: 5px; padding: 6px 6px 6px 15px; background: #fff; }
.search-field > .icon { color: var(--muted); }
.search-field input { min-width: 0; width: 100%; border: 0; padding: 7px 0; background: transparent; font-size: 14px; color: var(--ink); }
.search-field input:focus { outline: none; }
.search-field:focus-within { outline: 2px solid var(--green); outline-offset: 3px; }
.search-field button, .secondary-button { padding: 9px 15px; border: 0; border-radius: 3px; background: var(--green); color: #fff; font-size: 12px; }
.search-status { color: var(--muted); font-size: 13px; margin: 24px 0; }
.search-result { padding: 24px 0; border-top: 1px solid var(--line); }
.search-result h2 { font-size: 25px; margin: 5px 0 10px; }
.search-result h2 a { text-decoration: none; }
.search-result p { font-size: 14px; color: var(--muted); margin-bottom: 0; }
.search-result .eyebrow { font-size: 10px; }
mark { color: var(--ink); background: #e1ebbd; border-radius: 2px; }

/* Content formats and research share the site's existing reading styles. */
.solution-label { color: var(--green); }
.solution-note, .collection-empty { color: var(--muted); font-size: 13px; }
.solution-content > :last-child { margin-bottom: 0; }
.module-overview { background: var(--sidebar); border-left: 3px solid var(--green); padding: 24px; margin-bottom: 35px; font-size: 14px; }
.module-overview h2 { font: 25px var(--serif); margin: 0 0 18px; }
.module-overview p { margin-bottom: 8px; }
.module-overview ul { padding-left: 20px; margin-bottom: 0; }
.module-overview dl, .research-facts { margin: 0 0 20px; }
.module-overview dt, .research-facts dt { color: var(--muted); font-size: 12px; }
.module-overview dd, .research-facts dd { margin: 0; }
.module-overview dl > div, .research-facts > div { margin-bottom: 12px; }
.module-preview { margin-top: 45px; padding-top: 28px; border-top: 1px solid var(--line); }
.module-preview > h2 { font: 32px/1.3 var(--serif); margin-bottom: 18px; }
.module-preview > p:not(.eyebrow) { color: var(--muted); }
.check-understanding { margin: 25px 0; padding: 18px; border: 1px solid var(--line); border-radius: 5px; }
.check-understanding summary { color: var(--green); font-size: 14px; }
.check-understanding p { margin: 18px 0 0; }
.research-spotlight { padding: 24px 0; }
.research-intro { margin: -10px 0 42px; max-width: 610px; color: var(--muted); }
.research-card { border: 1px solid var(--line); background: #f4f6ee; border-radius: 5px; overflow: hidden; margin-bottom: 20px; }
.research-card-body { padding: 30px; }
.research-card .eyebrow { margin-bottom: 15px; }
.research-card h2, .research-card h3 { font: 28px/1.35 var(--serif); letter-spacing: -.5px; margin: 0 0 14px; max-width: 640px; }
.research-card h2 a, .research-card h3 a { text-decoration: none; }
.research-card h2 a:hover, .research-card h3 a:hover { text-decoration: underline; }
.research-card p:not(.eyebrow) { font-size: 14px; color: var(--muted); }
.research-card p.research-authors { color: var(--ink); }
.research-card p.research-status { font-size: 12px; }
.research-card .research-institution { font-size: 12px; }
.research-cover { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.research-links { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 20px 0 0; }
.research-links a { display: inline-flex; gap: 16px; align-items: center; padding: 7px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; text-decoration: none; font-size: 12px; color: var(--green); }
.research-facts { display: flex; flex-wrap: wrap; column-gap: 30px; font-size: 14px; }
.media-figure { margin: 30px 0; }
.media-figure video, .video-embed { display: block; width: 100%; border: 0; border-radius: 5px; background: var(--sidebar); }
.video-embed { aspect-ratio: 16 / 9; }
.media-figure figcaption { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* SVG graphing uses native sliders; no plotting library is downloaded. */
.graph-widget { padding: 24px; margin: 28px 0; border: 1px solid var(--line); border-radius: 5px; background: #f7f8f3; }
.graph-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.graph-heading h3 { margin: 0; font: 23px/1.4 var(--serif); }
.graph-heading .graph-equation { margin: 0; font: 13px/1.7 var(--mono); color: var(--green); }
.function-plot { display: block; width: 100%; height: auto; overflow: hidden; margin-top: 20px; }
.plot-grid { fill: none; stroke: #d9dfd2; stroke-width: 1; }
.plot-axes { fill: none; stroke: #87947e; stroke-width: 1.2; }
.plot-labels { font: 12px var(--mono); text-anchor: middle; fill: #56644e; }
.plot-reference { fill: none; stroke: #94a587; stroke-width: 2; stroke-dasharray: 5 5; }
.plot-curve { fill: none; stroke: var(--green); stroke-width: 3; }
.plot-vertex { fill: var(--green); stroke: var(--paper); stroke-width: 2; }
.plot-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 11px; margin: 0 0 22px; }
.graph-controls { display: grid; grid-template-columns: minmax(135px, 1fr) minmax(0, 1.4fr); gap: 12px 24px; align-items: center; }
.graph-controls label { font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 15px; }
.graph-controls label > span { color: var(--green); font-family: var(--mono); font-size: 11px; }
.graph-controls input { width: 100%; min-width: 0; min-height: 30px; accent-color: var(--green); cursor: pointer; }
.graph-actions { display: flex; gap: 20px; justify-content: space-between; align-items: center; margin-top: 22px; }
.graph-actions .graph-feedback { color: var(--muted); font-size: 12px; margin: 0; }
.graph-actions button { flex-shrink: 0; }
.graph-widget .graph-values { background: transparent; border: 0; border-top: 1px solid var(--line); padding: 15px 0 0; margin: 20px 0 0; font-size: 12px; }
.graph-values summary { color: var(--green); }
.graph-values table { display: table; margin-top: 15px; width: 100%; max-width: 28rem; border-collapse: collapse; }
.graph-values th, .graph-values td { padding: 6px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.graph-values caption { text-align: left; padding-bottom: 10px; color: var(--muted); }

/* Shared activity controls; the rest of each lesson is ordinary Markdown. */
.activity-badge { font: 11px/1.7 var(--mono); color: var(--muted); }
.graph-widget > p { font-size: 14px; }
.graph-widget .activity-result { padding: 14px 0; margin: 8px 0; font-size: 14px; color: var(--green); }
.activity-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.card-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card-columns > div { min-width: 0; text-align: center; }
.card-columns p { font: 12px var(--mono); margin-bottom: 12px; }
.card-pile { list-style: none; margin: 0 0 15px; padding: 0; display: grid; gap: 6px; }
.prose .card-pile li { padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; font: 18px/1.5 var(--serif); }
.card-columns button { padding: 9px 5px; width: 100%; font-size: 12px; }
button:disabled { cursor: default; opacity: .55; }
.plot-secant { fill: none; stroke: #a85928; stroke-width: 2.5; }
.plot-second-point { fill: #a85928; stroke: var(--paper); stroke-width: 2; }
.probability-table { margin: 20px 0; width: 100%; }
.probability-table caption { text-align: left; color: var(--muted); font-size: 12px; }
.probability-bar { height: 34px; border: 1px solid var(--green); background: repeating-linear-gradient(135deg, #e6ece1 0 5px, #bccdb5 5px 7px); overflow: hidden; border-radius: 3px; }
.probability-bar > span { display: block; height: 100%; background: var(--green); }
.sample-notice { padding: 15px 20px; background: var(--sidebar); border-left: 3px solid var(--green); font-size: 14px; }

/* Advanced plots start as ordinary images. Their libraries load on request. */
.advanced-stage { min-width: 0; margin: 16px 0; }
.prose .advanced-preview { display: block; width: 100%; margin: 0; }
.advanced-view { width: 100%; height: clamp(280px, 48vw, 400px); overflow: hidden; }
.advanced-view > canvas { display: block; width: 100%; height: 100%; }
.advanced-launch { align-items: center; font-size: 13px; }
.advanced-widget .advanced-status { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.advanced-controls { border: 0; padding: 10px 0 0; margin: 16px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.advanced-controls legend { font: 16px var(--serif); padding: 0 10px 0 0; }
.advanced-controls > p { font-size: 13px; margin: 8px 0 12px; }
.advanced-controls .secondary-button { padding: 8px 12px; font-size: 12px; }
.advanced-controls .activity-buttons { gap: 8px; }

@media (min-width: 1600px) {
  .hero { padding-top: 85px; padding-bottom: 75px; }
  .hero h1 { font-size: 60px; }
}
@media (max-width: 1150px) {
  :root { --sidebar-width: 228px; }
  .home-wrap, .page-wrap { padding-left: 34px; padding-right: 34px; }
  .hero { grid-template-columns: minmax(0, 1fr) 160px; gap: 25px; }
  .hero h1 { font-size: 43px; }
  .quiet-link { margin-left: 0; display: block; }
  .subject-card { padding: 18px 14px; }
  .subject-card h3 { font-size: 19px; }
  .identity { padding-left: 8px; padding-right: 0; }
}
@media (max-width: 800px) {
  .sidebar { position: static; width: auto; padding: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .identity { margin-bottom: 20px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-link:nth-last-child(2) { margin-top: 3px; }
  .sidebar-bottom { padding-top: 25px; }
  .site-body, .js.sidebar-collapsed .site-body { margin-left: 0; }
  .js .sidebar { position: fixed; width: min(280px, calc(100% - 76px)); height: 100dvh; padding-top: 32px; border-right: 1px solid var(--line); }
  .js .sidebar nav { display: block; }
  .js .sidebar .identity { margin-bottom: 35px; }
  .js:not(.sidebar-open) .sidebar { transform: translateX(-100%); visibility: hidden; }
  .js.sidebar-open { overflow: hidden; }
  /* Preserve the reading position and let clicks pass through to the drawer. */
  .js.sidebar-open .topbar { z-index: 40; pointer-events: none; background: transparent; border-color: transparent; }
  .js.sidebar-open .topbar-title, .js.sidebar-open .search-link { visibility: hidden; }
  .js.sidebar-open .menu-toggle { position: fixed; right: 17px; top: 13px; z-index: 40; background: var(--paper); pointer-events: auto; }
  .js.sidebar-open .menu-toggle .icon { display: none; }
  .js.sidebar-open .menu-toggle::after { content: '×'; font-size: 25px; }
  .topbar { height: 67px; padding: 0 22px; }
  .home-wrap, .page-wrap { padding-left: 28px; padding-right: 28px; }
  .hero { grid-template-columns: minmax(0, 1fr) 190px; padding: 50px 0; }
  .hero h1 { font-size: 48px; }
  .site-footer { padding: 24px 28px; }
}
@media (max-width: 560px) {
  .graph-widget { padding: 16px; }
  .plot-labels { font-size: 20px; }
  .graph-controls { grid-template-columns: 1fr; gap: 4px; }
  .graph-controls input { margin: 0 0 10px; }
  .graph-actions { flex-direction: column; align-items: flex-start; gap: 12px; }
  .research-card-body { padding: 22px; }
  .research-card h2, .research-card h3 { font-size: 25px; }
  .home-wrap, .page-wrap { padding-left: 23px; padding-right: 23px; }
  .page-wrap { padding-top: 38px; }
  .topbar-title { max-width: 165px; }
  .topbar-title > span:first-child { padding: 0 6px; }
  .topbar { padding: 0 15px; gap: 10px; }
  .topbar-location { gap: 6px; }
  .search-link kbd { display: none; }
  .hero { display: block; padding-top: 39px; padding-bottom: 38px; }
  .hero h1 { font-size: clamp(38px, 10vw, 49px); letter-spacing: -1.8px; }
  .hero-diagram { display: none; }
  .hero-copy > p:not(.eyebrow) { font-size: 14px; }
  .quiet-link { display: inline-block; margin-left: 12px; }
  .subject-section { padding-top: 30px; padding-bottom: 32px; }
  .subject-grid { grid-template-columns: 1fr; gap: 10px; }
  .subject-card { padding: 18px 20px 18px 66px; }
  .subject-number { position: absolute; left: 18px; top: 24px; font-size: 11px; }
  .subject-card > .icon { display: none; }
  .subject-card p { max-width: none; }
  .subject-card h3 { font-size: 22px; }
  .section-heading h2 { font-size: 23px; }
  .count-label { font-size: 8px; }
  .section-heading .text-link { font-size: 11px; }
  .note-title { font-size: 24px; }
  .note-topics { flex-wrap: wrap; }
  .note-arrow { display: none; }
  .page-heading h1 { font-size: 39px; }
  .page-description { font-size: 15px; }
  .prose { font-size: 15px; }
  .prose details { padding: 15px; }
  .post-pagination { gap: 15px; }
  .site-footer { flex-wrap: wrap; gap: 7px; padding: 24px 23px; }
  .search-field { gap: 7px; padding-left: 10px; }
  .search-field input { font-size: 16px; }
  .search-field button { padding: 9px 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .sidebar, .site-body { transition: transform .2s ease, margin-left .2s ease; }
  .subject-card { transition: background .15s ease, border-color .15s ease; }
}
@media print {
  .sidebar, .topbar, .site-footer, .back-link, .article-footer, .post-pagination, .skip-link { display: none !important; }
  .site-body { margin: 0; }
  .page-wrap { max-width: none; padding: 0; }
  body { font-size: 11pt; background: white; color: black; }
  .prose { font-size: 11pt; }
  h2, h3 { break-after: avoid; }
  pre { white-space: pre-wrap; }
}
