/* variables */ :root { --font-size: 12pt; --line-height: 1.625; --font-family: monospace; /* font-derived vertical and horizontal units */ --v-un: calc(var(--font-size) * var(--line-height)); --h-un: 1ch; /* font-derived column width */ --col-w: clamp(33.33vw, 80ch, 100vw); /* colors */ --fg-c: #000000; --bg-c: #e2e2e2; --link-c: #856cff; --visited-c: #ff1170; --active-c: #fa3500; } @media (prefers-color-scheme: dark) { :root { --fg-c: #e2e2e2; --bg-c: #000000; } } /* reset */ * { box-sizing: border-box; margin: unset; hyphens: auto; } ::selection { color: var(--bg-c); background-color: var(--fg-c); } /* root */ :root { color: var(--fg-c); background-color: var(--bg-c); font: var(--font-size)/var(--line-height) var(--font-family); scrollbar-width: thin; scrollbar-color: var(--link-c) rgba(0,0,0,0); } body { margin: 0; } /* content sectioning */ address { font-style: unset; } h1, h2, h3, h4, h5, h6 { font-size: unset; } h1, h2 { font-weight: bold; } h3, h4, h5, h6 { font-style: italic; } /* text content */ :is(h1, h2, h3, h4, h5, h6) { margin-block-start: calc(2 * var(--v-un)); margin-block-end: var(--v-un); } :is(blockquote, div, dl, figure, hr, menu, ol, p, pre, ul) + :is(blockquote, div, dl, figure, hr, menu, ol, p, pre, ul) { margin-block-start: var(--v-un); } blockquote { margin-inline: calc(4 * var(--h-un)); } dt { font-style: italic; } dd { padding-inline-start: calc(4 * var(--h-un)); } ol, ul, menu { padding-inline-start: calc(4 * var(--h-un)); } :is(ol, ul, menu) :is(ol, ul, menu) { margin-block: unset; } li :is(blockquote, div, dl, figure, hr, menu, ol, p, pre, ul) { margin-block: unset; } ul>li::marker { content: "- "; } hr { color: unset; border: unset; text-align: center; } hr:after { content: "---"; } pre { margin-inline: calc(4 * var(--h-un)); color: var(--link-c); overflow-y: scroll; } /* inline text semantics */ a { cursor: pointer; text-decoration: underline; } a:link { color: var(--link-c); } a:link:active { color: var(--active-c); } a:visited { color: var(--visited-c); } a:visited:active { color: var(--active-c); } code { color: var(--link-c); } /* layout */ body>main { width: 100vw; height: 100vh; display: grid; grid-auto-flow: column; grid-auto-columns: var(--col-w); overflow-x: scroll; scroll-snap-type: x proximity; } body>main>* { overflow-y: scroll; padding: var(--v-un) var(--h-un); scroll-snap-align: center; } article:focus { outline: none; } body>main>article#start>h1>a::before { content: "> "; } body>main>article#start>h1>a:after { content: " <"; } /* toc */ nav.toc { margin-block: var(--v-un); } /* footnotes */ aside.footnotes { margin-block: var(--v-un); } aside.footnotes>hr { font-weight: bold; } /* fenced divs */ div.horizontal { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: calc(2 * var(--h-un)); overflow-x: scroll; scroll-snap-type: x proximity; } div.horizontal>* { margin-block: unset; scroll-snap-align: center; } /* math */ .display.math { display: block; text-align: center; } /* fenced pres */ pre.center { text-align: center; }