:root {
  color-scheme: light dark;
  --paper: light-dark(#fffdf7, #202322);
  --ink: light-dark(#222725, #edece1);
  --soft: light-dark(#58605e, #b4bab3);
  --link: light-dark(#234b76, #abcbee);
  --rule: light-dark(#c9cbc2, #515953);
  --mono: ui-monospace, Menlo, Consolas, monospace;
  font: 106.25%/1.5 Georgia, 'Times New Roman', serif;
  background: var(--paper);
  color: var(--ink);
}
:root[data-theme=dark] { color-scheme: dark }
:root[data-theme=light] { color-scheme: light }
* { box-sizing: border-box }
body { margin: 0; font-size: medium }
main { max-width: 58rem; margin: clamp(2rem, 7vh, 5rem) auto; padding: 0 clamp(1.15rem, 4vw, 2.5rem) }
a { color: var(--link); text-underline-offset: .15em; text-decoration-thickness: 1px }
a:hover { text-decoration-style: dotted }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px }
h1, h2, h3 { font-weight: normal; line-height: 1.15; text-wrap: balance }
h1 { margin: 0 0 .5em; font-size: clamp(2.35rem, 5vw, 3rem); letter-spacing: -.035em }
h2 { font-size: 1.52rem }
.home { width: 100%; max-width: 68rem; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 3.5rem); align-items: start }
.profile { border-right: 1px solid var(--rule); padding-right: 1.5rem }
.profile img { display: block; margin-bottom: 1rem }
.profile p { margin: .85rem 0 }
.profile ul, .index ul:not(.works) { list-style: disc; padding-inline-start: 1.2em; margin: 1.25rem 0 }
.profile li + li, .index ul:not(.works) > li + li { margin-top: .4rem }
.small, button, time, .byline, figcaption, .bar, aside { font: .76rem/1.55 var(--mono) }
button { appearance: none; border: 0; padding: .2em 0; background: transparent; color: var(--soft); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px }
nav a, .index > a, .profile .small a, button { color: var(--soft); text-decoration: underline dotted 1.5px; text-underline-offset: .2em }
button[aria-pressed=true] { color: var(--ink); font-weight: bold }
.home > [data-toggle=theme] { position: absolute; inset-block-start: .35rem; inset-inline-end: 1.15rem }
body:has(.home-footer) { display: grid; grid-template-rows: 1fr auto; grid-template-columns: minmax(0, 1fr); min-height: 100svh }
.home-footer { text-align: end; padding: .35rem 1.15rem }
.home > .index { align-self: center }
.index h2 { margin: 2rem 0 .6rem; padding-bottom: .35rem; border-bottom: 1px solid var(--rule) }
.index h2:first-child { margin-top: 0 }
.index .works { padding: 0; list-style: none }
.index p, .index .works { margin: .5rem 0 }
.index details + .works { margin-block-start: 1.5rem }
.works li + li { margin-top: .7rem }
.works li { display: flex; gap: 1rem; align-items: baseline }
time, .byline, figcaption, aside { color: var(--soft) }
.bar { display: flex; gap: 1rem; align-items: baseline; border-bottom: 1px solid var(--rule); padding-bottom: .6rem; margin-bottom: 2.1rem }
.bar > :first-child { margin-inline-end: auto }
.bar-links { display: inline-flex; gap: .75rem }
.reader { display: grid; grid-template-columns: minmax(0, 64ch) minmax(7rem, 1fr); gap: clamp(2rem, 5vw, 3.5rem); align-items: start }
article { min-width: 0; line-height: 1.55; overflow-wrap: break-word }
article :is(h1, h2, h3) { line-height: 1.2 }
article h1 { margin-bottom: .2em }
.byline { margin: .4rem 0 1.7rem }
article h2 { margin: 2.1rem 0 .6rem }
article h3 { font-size: 1.23rem; margin: 1.5rem 0 .5rem }
article p { margin: 1em 0 }
article ul, article ol { padding-left: 1.5rem }
blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 2px solid var(--rule) }
pre, article table, .katex:has(> math[display=block]) { display: block; max-width: 100%; overflow-x: auto }
.katex:has(> math[display=block]) { padding-block: .75em; overflow-y: hidden }
pre { font: .83rem/1.35 var(--mono); padding: .6rem 0 }
img { max-width: 100% }
figure { margin: 1.6rem 0 }
figure img { display: block; width: auto; height: auto; margin: auto }
figcaption { margin-top: .5rem; border-top: 1px solid var(--rule); padding-top: .5rem }
aside { position: sticky; top: 2rem; border-left: 1px solid var(--rule); padding-left: 1rem }
aside span { color: var(--ink) }
aside ul { padding: 0; margin: .6em 0 0; list-style: none }
aside li + li { margin-top: .45em }
[data-focus=true] aside { display: none }
[data-focus=true] .reader, .reader:not(:has(aside)) { display: block; max-width: 64ch; margin-inline: auto }
@media (min-width: 1100px) {
  .home { margin-block: 0; padding-block: 1rem; align-content: center }
}
@media (min-width: 1100px) and (max-height: 820px) {
  .profile img { float: right; width: 64px; margin: 0 0 .5rem 1rem }
  .profile p, .profile ul { margin-block: .6rem }
}
@media (width < 1100px) {
  .home { display: block; max-width: 42rem }
  .profile { border: 0; padding: 0; margin-bottom: 2.2rem }
  .profile img { float: right; margin: 0 0 .8rem 1rem; width: 64px }
}
@media (max-width: 720px) {
  .profile > p.small { text-align: center }
  .reader { display: flex; flex-direction: column; gap: 1.35rem }
  .reader > * { max-width: 100% }
  aside { order: -1; position: static; border: 0; padding: 0 }
  aside nav ul { display: flex; flex-wrap: wrap; gap: .25em 1em }
  aside li + li { margin: 0 }
}
@media (max-width: 480px) {
  .page .reader { max-width: 40ch; margin-inline: auto }
  .reader article { width: 100% }
}
@media print {
  :root { color-scheme: light !important }
  .bar, aside, button { display: none }
  main { max-width: none; margin: 0 }
  .reader { display: block }
  figure { break-inside: avoid }
}
