@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fafafa;
  --ink: #292e2b;
  --muted: #606963;
  --accent: #276348;
  --line: #dedfdd;
  --selection: #d8e8d8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  scrollbar-color: var(--muted) var(--paper);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { margin: 0; }
::selection { color: var(--ink); background: var(--selection); }
a { color: var(--accent); text-underline-offset: .25em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
main:focus { outline: none; }

.skip-link { position: fixed; top: .75rem; left: 1rem; z-index: 10; padding: .75rem 1rem; background: var(--paper); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.layout { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 72px; max-width: 1092px; margin: 0 auto; padding: 88px 40px 40px; }
.reading-column { min-width: 0; }
.desktop-index { align-self: start; position: sticky; top: 40px; max-height: calc(100dvh - 80px); overflow-y: auto; padding: 8px; margin: -8px; }
nav ul { list-style: none; margin: 0; padding: 0; }
nav a { display: block; padding: 8px 0; text-decoration: none; color: var(--muted); font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
nav a:hover, nav a[aria-current="location"] { color: var(--accent); text-decoration: underline; }
nav a[aria-current="location"] { font-weight: 600; }
nav > ul > li > a { color: var(--ink); font-weight: 600; font-size: .9375rem; }
nav > ul > li + li { margin-top: 22px; }
nav ul ul { padding: 4px 0 0 12px; }
.mobile-index { display: none; }

main { font-size: 1.0625rem; line-height: 1.7; overflow-wrap: break-word; }
h1, h2, h3, h4, h5, h6 { font-family: "Source Serif 4", Georgia, serif; color: var(--ink); font-weight: 500; text-wrap: balance; line-height: 1.22; scroll-margin-top: 2rem; }
h1 { font-size: 3rem; letter-spacing: -.035em; margin: -.15em 0 24px; }
.file-extension { font-size: .7em; letter-spacing: -.02em; color: var(--accent); }
h1 + p { font-family: "Source Serif 4", Georgia, serif; font-size: 1.25rem; line-height: 1.5; color: var(--ink); margin-bottom: 24px; }
.intro-purpose { display: block; font-size: 1.5rem; }
.intro-note { display: block; margin-top: 4px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .9375rem; line-height: 1.6; color: var(--muted); }
h2 { font-size: 1.9375rem; letter-spacing: -.02em; margin: 64px 0 28px; }
h3 { font-size: 1.625rem; letter-spacing: -.015em; margin: 46px 0 14px; }
h2 + h3 { margin-top: 0; }
p { margin: 0 0 18px; }
main :is(ul, ol) { padding-left: 1.5em; }
main img { max-width: 100%; height: auto; }
main pre { overflow-x: auto; padding: 1rem; background: var(--selection); }
main :is(h2, h3, h4, h5, h6):focus { outline: none; }
main :is(h2, h3, h4, h5, h6):focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.permalink { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: 6px; vertical-align: middle; opacity: 0; }
:is(h2, h3, h4, h5, h6):hover .permalink, .permalink:focus-visible { opacity: 1; }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .8125rem; line-height: 1.6; }
.document-links { display: flex; flex-wrap: wrap; gap: 20px; }
footer a { color: var(--muted); padding: 6px 0; }

@media (max-width: 800px) {
  html { scroll-padding-top: 5rem; }
  .layout { display: block; max-width: 728px; padding: 0 24px 32px; }
  .desktop-index { display: none; }
  .mobile-index { display: block; position: sticky; top: 0; z-index: 2; margin: 0 -24px 42px; padding: 0 24px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .mobile-index summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 60px; cursor: pointer; color: var(--accent); font-size: .9375rem; list-style: none; }
  .mobile-index summary::-webkit-details-marker { display: none; }
  .mobile-index[open] summary svg { transform: rotate(180deg); }
  .mobile-index nav { max-height: calc(70dvh - 60px); overflow-y: auto; padding: 0 6px 18px; margin: 0 -6px; }
  .mobile-index nav a { min-height: 44px; display: flex; align-items: center; }
  main { font-size: 1rem; line-height: 1.7; }
  h1 { font-size: 2.875rem; }
  h1 + p { font-size: 1.1875rem; }
  h2 { font-size: 1.75rem; margin-top: 48px; }
  h3 { font-size: 1.5rem; margin-top: 38px; }
  h1, h2, h3, h4, h5, h6 { scroll-margin-top: 1rem; }
  footer a { min-height: 44px; display: inline-flex; align-items: center; }
}

@media print {
  :root { --paper: #fff; --ink: #000; --muted: #222; }
  .desktop-index, .mobile-index, .skip-link, .permalink, footer { display: none; }
  .layout { display: block; max-width: none; padding: 0; }
  main { font-size: 11pt; }
  h2, h3 { break-after: avoid; }
  p { orphans: 3; widows: 3; }
}
