:root { color-scheme: light; --paper: #faf9f5; --ink: #262b28; --muted: #71766e; --line: #dedfd5; --rule: #bfc6b9; --accent: #995338; --surface: #fff; --soft: #edeee7; --quote: #535b52; --article-size: 18px; --article-width: 56vw; --article-offset: 7vw; }
html[data-theme='warm'] { --paper: #f7f1e7; --ink: #2d2923; --muted: #786f63; --line: #ded4c5; --rule: #c4b7a4; --accent: #9a593b; --surface: #fffaf1; --soft: #eee5d8; --quote: #5e5549; }
html[data-theme='slate'] { --paper: #f3f5f5; --ink: #252b2e; --muted: #687278; --line: #d7dcde; --rule: #bac3c7; --accent: #5c7180; --surface: #fbfcfc; --soft: #e7ebec; --quote: #4f5b61; }
html[data-theme='sage'] { --paper: #f4f6f0; --ink: #283027; --muted: #6c7769; --line: #d8ded3; --rule: #b9c4b3; --accent: #657e61; --surface: #fbfcf8; --soft: #e8ede3; --quote: #536050; }
html[data-theme='dusk'] { --paper: #f5f3f7; --ink: #2d2b32; --muted: #746f7b; --line: #ddd9e2; --rule: #c3bdca; --accent: #766884; --surface: #fcfbfd; --soft: #ebe7ef; --quote: #5b5661; }
html[data-mode='dark'] { color-scheme: dark; --paper: #181a18; --ink: #e8e9e3; --muted: #9ba198; --line: #353a34; --rule: #4c554b; --accent: #cc8063; --surface: #20231f; --soft: #292d28; --quote: #bdc3ba; }
html[data-mode='dark'][data-theme='warm'] { --paper: #1d1915; --ink: #eee6da; --muted: #a99c8b; --line: #40362c; --rule: #5c4b3c; --accent: #d08a63; --surface: #262019; --soft: #30271f; --quote: #c9bcaa; }
html[data-mode='dark'][data-theme='slate'] { --paper: #15191c; --ink: #e4e9eb; --muted: #96a3aa; --line: #303a40; --rule: #46545c; --accent: #8cabbc; --surface: #1c2226; --soft: #252d32; --quote: #b5c0c5; }
html[data-mode='dark'][data-theme='sage'] { --paper: #171b16; --ink: #e5ebe1; --muted: #9ca996; --line: #333c31; --rule: #4b5947; --accent: #91ae89; --surface: #1e241d; --soft: #283026; --quote: #b8c4b3; }
html[data-mode='dark'][data-theme='dusk'] { --paper: #19171c; --ink: #ebe7ee; --muted: #a59cac; --line: #39343e; --rule: #51495a; --accent: #ae9bbb; --surface: #211e25; --soft: #2b2730; --quote: #c1b7c7; }
html[data-font='georgia'] body { font-family: Georgia, 'Times New Roman', serif; }
html[data-font='charter'] body { font-family: Charter, 'Bitstream Charter', 'Sitka Text', Georgia, serif; }
html[data-font='baskerville'] body { font-family: Baskerville, 'Iowan Old Style', Palatino, Georgia, serif; }
html[data-font='palatino'] body { font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', serif; }
html[data-font='avenir'] body { font-family: 'Avenir Next', Avenir, -apple-system, BlinkMacSystemFont, sans-serif; }
html[data-font='sans'] body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
html[data-size='small'] { --article-size: 16px; }
html[data-size='medium'] { --article-size: 18px; }
html[data-size='large'] { --article-size: 20px; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 118px; }
html[data-preview-controls='off'] { scroll-padding-top: 72px; }
body { --returning-header-progress: 0; --returning-header-shift: 4px; margin: 0; overflow-x: clip; background: var(--paper); color: var(--ink); transition: background-color .2s ease, color .2s ease; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
button, .masthead, .tabs, aside, .eyebrow, footer, figcaption { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.experiment-bar { position: sticky; top: 0; z-index: 30; min-height: 46px; padding: 5px 24px; display: flex; align-items: center; justify-content: flex-end; gap: 18px; border-bottom: 1px solid var(--line); background: var(--soft); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
html[data-preview-controls='off'] .experiment-bar { display: none; }
.experiment-label { color: var(--muted); font-size: 8px; letter-spacing: .16em; opacity: .58; }
.preview-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; letter-spacing: .09em; opacity: .42; cursor: pointer; transition: opacity .18s ease; }
.preview-toggle:hover, .preview-toggle:focus-within { opacity: 1; }
.preview-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; width: 24px; height: 12px; border: 1px solid var(--rule); border-radius: 999px; transition: border-color .18s ease; }
.toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background-color .2s ease; }
.preview-toggle input:checked + .toggle-track { border-color: var(--accent); }
.preview-toggle input:checked + .toggle-track::after { background: var(--accent); transform: translateX(12px); }
.layout-controls { display: flex; align-items: center; gap: 13px; color: var(--muted); opacity: .42; transition: opacity .18s ease; }
.layout-controls:hover, .layout-controls:focus-within { opacity: 1; }
.range-control { display: grid; gap: 2px; width: 130px; font-size: 8px; letter-spacing: .09em; }
.range-meta { display: flex; align-items: baseline; gap: 5px; }
.range-control output { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.range-control input { width: 130px; height: 10px; margin: 0; accent-color: var(--accent); cursor: ew-resize; }
.range-control button { margin-left: auto; border: 0; padding: 0; background: none; color: var(--muted); font-size: 7px; letter-spacing: .08em; opacity: .42; cursor: pointer; }
.range-control button:hover, .range-control button:focus-visible { color: var(--accent); opacity: 1; }
.masthead { max-width: 1440px; margin: auto; padding: 30px 40px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 32px; border-bottom: 1px solid var(--line); }
.identity { justify-self: start; text-decoration: none; font-size: 14px; font-weight: 550; }
.byline { justify-self: center; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-decoration: none; }
.edition { font-size: 10px; letter-spacing: .15em; color: var(--muted); }
.masthead-meta { justify-self: end; display: flex; align-items: center; }
.masthead-meta { gap: 19px; }
.mode-button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; padding: 6px; background: transparent; color: var(--muted); opacity: .38; cursor: pointer; transition: opacity .18s ease, background-color .18s ease; }
.mode-button:hover, .mode-button:focus-visible { opacity: 1; background: var(--soft); }
.mode-button svg { grid-area: 1 / 1; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sun-icon, html[data-mode='dark'] .moon-icon { display: none; }
html[data-mode='dark'] .sun-icon { display: block; }
.appearance { display: flex; align-items: center; }
.appearance { gap: 7px; opacity: .42; transition: opacity .18s ease; }
.appearance:hover, .appearance:focus-within { opacity: 1; }
.appearance select { max-width: 105px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 22px 4px 9px; background: transparent; color: var(--muted); font: 10px/1.2 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; cursor: pointer; }
.tabs { position: sticky; top: 46px; z-index: 20; max-width: 1440px; margin: auto; display: flex; justify-content: center; gap: 32px; border-bottom: 1px solid var(--line); background: var(--paper); }
html[data-preview-controls='off'] .tabs { top: 0; }
.tabs a { padding: 20px 0 16px; text-decoration: none; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { border-color: var(--accent); color: var(--accent); }
.tabs span { font-size: 10px; color: var(--muted); margin-right: 9px; }
.returning-identity, .returning-meta { position: absolute; top: 50%; opacity: var(--returning-header-progress); pointer-events: none; transform: translateY(-50%) translateY(var(--returning-header-shift)); transition: opacity .16s ease-out, transform .16s ease-out; }
.returning-identity { left: 40px; font-size: 12px; font-weight: 550; }
.returning-meta { right: 40px; display: flex; align-items: center; gap: 13px; color: var(--muted); }
.returning-meta > span { margin: 0; font-size: 8px; letter-spacing: .14em; }
.returning-meta .mode-button { width: 25px; height: 25px; }
.returning-header-interactive .returning-meta { pointer-events: auto; }
.layout { position: relative; left: var(--article-offset); width: min(var(--article-width), calc(100vw - 48px)); margin: auto; padding: 66px 0 0; transition: width .12s ease, left .12s ease; }
aside { position: fixed; top: 168px; left: max(24px, calc((100vw - 1560px) / 2)); width: min(220px, calc(16vw - 48px)); font-size: 12px; max-height: calc(100vh - 198px); overflow: auto; padding-right: 12px; }
.toc-title { color: var(--muted); font-size: 9px; letter-spacing: .15em; margin-bottom: 20px; }
#contents a { display: block; color: var(--muted); line-height: 1.5; padding: 7px 0 7px 12px; border-left: 1px solid var(--line); text-decoration: none; }
#contents a.sub { padding-left: 23px; font-size: 11px; }
#contents a:hover, #contents a.active { color: var(--accent); border-left-color: var(--accent); }
main { min-width: 0; }
.eyebrow { font-size: 10px; letter-spacing: .14em; color: var(--accent); display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
#reading-time { letter-spacing: .03em; color: var(--muted); }
article { font-size: var(--article-size); line-height: 1.78; overflow-wrap: break-word; }
h1 { font-size: clamp(38px, 4.2vw, 58px); line-height: 1.09; letter-spacing: -.045em; font-weight: 400; margin: 0 0 42px; text-wrap: balance; }
h2 { font-size: 30px; line-height: 1.25; letter-spacing: -.025em; font-weight: 400; margin: 66px 0 24px; padding-top: 27px; border-top: 1px solid var(--line); }
h3 { font-size: 24px; line-height: 1.35; font-weight: 400; margin: 44px 0 18px; }
h4, h5 { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; margin: 35px 0 16px; }
p { margin: 0 0 23px; }
strong { font-weight: 600; }
ul, ol { padding-left: 24px; margin: 20px 0 30px; }
li { padding-left: 4px; margin: 10px 0; }
li::marker { color: var(--accent); }
li > ul, li > ol { margin-top: 8px; margin-bottom: 15px; }
blockquote { margin: 25px 0; padding: 5px 0 5px 23px; border-left: 2px solid var(--accent); color: #535b52; }
blockquote p { margin: 0; }
code { font-size: .8em; background: var(--soft); padding: 2px 4px; border-radius: 3px; }
pre { max-width: 100%; overflow: auto; background: var(--soft); padding: 22px; font-size: 15px; line-height: 1.6; }
pre code { padding: 0; }
.table-scroll { overflow-x: auto; contain: inline-size paint; margin: 28px 0 36px; max-width: 100%; }
table { border-collapse: collapse; width: max-content; max-width: 100%; margin-inline: auto; font: 12px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 65px; }
th { color: var(--quote); font-size: 10px; font-weight: 600; background: var(--soft); border-top: 1px solid var(--rule); }
td:first-child { min-width: 112px; }
td:not(:first-child) { white-space: nowrap; }
.prose-table td { white-space: normal; }
.prose-table td:last-child { min-width: 260px; }
tbody tr:last-child td { border-bottom-color: var(--rule); }
td p { margin: 0; }
figure { width: 100%; margin: 38px auto; }
.compact-figure { width: min(720px, 100%); }
.figure-images { display: flex; align-items: center; gap: 14px; }
.figure-button { display: block; min-width: 0; border: 1px solid var(--line); padding: 12px; background: var(--surface); cursor: zoom-in; border-radius: 3px; flex: 1; }
.figure-button img { display: block; width: 100%; height: auto; max-height: 680px; object-fit: contain; }
.figure-button:hover { border-color: var(--muted); }
figcaption { color: var(--muted); font-size: 12px; line-height: 1.65; max-width: 760px; margin: 13px auto 0; text-align: center; }
figcaption em { font-style: normal; }
.katex { font-size: 1em; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 9px 0; max-width: 100%; }
footer { font-size: 11px; color: var(--muted); display: flex; align-items: baseline; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding: 25px 0 60px; margin-top: 80px; }
.article-credit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
#repo-link[aria-disabled='true'] { cursor: not-allowed; opacity: .55; text-decoration: none; }
dialog { width: 96vw; max-width: 1500px; max-height: 94vh; border: none; border-radius: 5px; padding: 45px 24px 24px; background: var(--surface); }
dialog::backdrop { background: rgb(22 28 24 / .8); backdrop-filter: blur(5px); }
#close-figure { position: absolute; top: 12px; right: 18px; background: none; border: 0; padding: 8px; cursor: pointer; color: #394738; }
#close-figure span { font-size: 24px; }
.image-stage { overflow: auto; text-align: center; }
#expanded { max-width: 100%; max-height: 72vh; object-fit: contain; }
.skip { position: absolute; top: -100px; }
.skip:focus { top: 10px; background: var(--surface); padding: 10px; z-index: 30; }
.back-to-top { position: fixed; right: 28px; bottom: 25px; width: 32px; height: 28px; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.back-to-top.visible { opacity: .18; pointer-events: auto; }
.back-to-top:hover, .back-to-top:focus-visible { opacity: .9; }
.back-to-top span { position: absolute; top: 12px; width: 18px; height: 1px; background: var(--ink); }
.back-to-top span:first-child { left: 1px; transform: rotate(-42deg); }
.back-to-top span:last-child { right: 1px; transform: rotate(42deg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.error { color: #8b3228; border: 1px solid currentColor; padding: 20px; }
@media (max-width: 1000px) { aside { position: static; width: auto; max-height: none; margin-bottom: 38px; padding: 0; } }
@media (max-width: 1100px) { .returning-meta > span { display: none; } }
@media (max-width: 850px) { .experiment-bar { padding: 6px 12px; gap: 10px; } .experiment-label, .preview-toggle, .layout-controls, .returning-identity, .returning-meta { display: none; } .appearance { width: 100%; justify-content: flex-end; opacity: .58; } .appearance select { max-width: 92px; } .masthead { grid-template-columns: 1fr auto; row-gap: 10px; padding: 22px; } .byline { grid-column: 1 / -1; grid-row: 2; } .edition { display: none; } .tabs { margin: 0; padding: 0 22px; gap: 25px; } .layout { left: auto; width: auto; margin: 0 22px; padding-top: 30px; } aside { margin-bottom: 30px; } .toc-title { margin-bottom: 12px; } article { line-height: 1.75; } h1 { margin-bottom: 30px; } h2 { font-size: 27px; margin-top: 45px; } .figure-button { padding: 5px; } .figure-images { flex-direction: column; } table { max-width: none; } th, td { padding: 9px 12px; max-width: 420px; } .back-to-top { right: 18px; bottom: 18px; } }
@media (max-width: 600px) { footer { align-items: flex-start; flex-direction: column; } #next-view { align-self: flex-end; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .experiment-bar, aside, .tabs, .eyebrow, footer { display: none; } .layout { display: block; left: auto; width: auto; margin: 0; padding: 0; } body { background: white; } .masthead { padding: 0 0 20px; } figure, tr { break-inside: avoid; } }
