:root {
  color-scheme: light;
  --paper: #e4dac5;
  --surface: #f0e8d8;
  --ink: #30271f;
  --muted: #655747;
  --line: #b7a78b;
  --accent: #792e24;
  --bronze: #ac8a57;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --display: Georgia, "Times New Roman", serif;
  font: 15px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #161311;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 50% 0, #50372a 0, #211b17 45%, #141210 100%); }
html { scroll-padding-top: 24px; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { color: #f8efdb; background: #792e24; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; }
h1 { font: 400 clamp(2rem, 4vw, 3.4rem)/1.1 var(--display); letter-spacing: -.025em; margin-bottom: 0; overflow-wrap: anywhere; }
h2 { font: 400 1.5rem var(--display); }
h3 { font-size: 1.05rem; }
img, video, svg { max-width: 100%; height: auto; }
.site-shell { max-width: 1240px; width: calc(100% - 64px); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; border-left: 1px solid #6e573d; border-right: 1px solid #6e573d; box-shadow: 0 0 70px #0009; }
.site-header { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 300px; color: #f4e6cd; background: linear-gradient(0deg, #130e0bf2, #160f0c20 65%, #160f0c15), var(--vault-image) center 35% / cover; border-top: 4px solid #6c4c31; }
.site-header::before { content: ""; position: absolute; inset: 12px 12px 65px; border: 1px solid #b18c505c; pointer-events: none; }
.identity { align-self: center; display: flex; flex-direction: column; align-items: center; text-decoration: none; padding: 45px 20px 35px; text-shadow: 0 2px 12px #000, 0 0 25px #000; }
.identity:hover { color: #fff1ce; }
.identity-caption { font: .65rem var(--mono); text-transform: uppercase; letter-spacing: .22em; color: #dfc99f; margin-bottom: 14px; }
.identity-name { font: 400 clamp(2.5rem, 5vw, 4.7rem)/1 var(--display); letter-spacing: .07em; text-transform: uppercase; }
.site-header nav { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 0; background: #1d1612e8; border-top: 1px solid #826442; border-bottom: 3px solid #723a2d; }
.site-header nav a { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 12px 30px; font: .75rem var(--mono); text-decoration: none; border-left: 1px solid #554333; }
.site-header nav a:last-child { border-right: 1px solid #554333; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: #fff0cd; background: #6c3027; box-shadow: inset 0 -3px #ba9060; }
.site-header a:focus-visible, .site-footer a:focus-visible { outline-color: #ead4a6; }
main { flex: 1; min-width: 0; padding: 36px 38px 48px; background: var(--paper); background-image: repeating-linear-gradient(90deg, transparent 0 5px, #70593803 5px 6px); }
.reference-index { display: block; }
.directory-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 22px; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.directory-heading .eyebrow { flex-basis: 100%; margin: 0; }
.eyebrow { font: .63rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .15em; color: var(--muted); margin-bottom: 15px; }
.directory-heading h1 { font-size: 2.6rem; }
.directory-count { margin-left: auto; font: .68rem var(--mono); color: var(--muted); }
.section-directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.directory-section { min-width: 0; position: relative; background: var(--surface); border: 1px solid #9d8868; box-shadow: inset 0 0 0 4px #d7c9ae, 0 3px 5px #40301f18; padding: 4px; }
.directory-section > header { display: flex; align-items: baseline; gap: 12px; padding: 19px 18px; background: linear-gradient(120deg, #36291f, #57412e 55%, #31251d); color: #f2e3c9; border-bottom: 2px solid #8b5037; }
.section-number { flex-shrink: 0; border: 1px solid #ae8d5d; padding: 3px 7px; font: .72rem var(--mono); color: #e9cc98; }
.directory-section h2 { margin: 0 0 7px; font-size: 1.65rem; }
.directory-section h2 a { text-decoration: none; }
.directory-section h2 a:hover { color: #ffdaa5; }
.directory-section h2 a:focus-visible { outline-color: #ead4a6; }
.directory-section header p { color: #d5c1a0; font-size: .78rem; margin: 0; }
.entry-count { margin-left: auto; color: #dac39f; font: .62rem var(--mono); white-space: nowrap; }
.directory-links { padding: 0; margin: 0; list-style: none; }
.directory-links li { padding: 17px 18px; border-bottom: 1px solid #c8b99d; overflow-wrap: anywhere; }
.directory-links li:last-child { border-bottom: 0; }
.directory-links li:hover { background: #fff4de; }
.directory-links a { font: 600 .92rem/1.5 var(--mono); color: var(--accent); }
.directory-links p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
.entry-kind { color: var(--muted); font-size: .65rem; }
.page-heading { border-bottom: 1px solid #a08a66; margin-bottom: 28px; padding-bottom: 24px; }
.back-link { display: inline-block; font: .73rem var(--mono); color: var(--muted); text-decoration: none; margin-bottom: 22px; }
.lead { color: var(--muted); margin: 14px 0 0; font-size: .95rem; }
.metadata { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; font: .7rem var(--mono); color: var(--muted); }
.tag { display: inline-block; padding: 3px 7px; border: 1px solid #b6a17e; color: #6a3426; text-decoration: none; font: .68rem/1.5 var(--mono); overflow-wrap: anywhere; }
.tag:hover { background: #f6e7ca; border-color: var(--accent); }
.reference-list { display: grid; gap: 12px; }
.reference-row { min-width: 0; padding: 20px; border: 1px solid #b6a17e; border-left: 4px solid #815139; background: var(--surface); }
.reference-row h2 { margin: 0 0 8px; font: 500 1.05rem var(--mono); }
.reference-row p { color: var(--muted); font-size: .85rem; margin: 0; }
.reference-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 0; list-style: none; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.article-layout:has(.toc) { grid-template-columns: 190px minmax(0, 1fr); }
.toc { position: sticky; top: 24px; align-self: start; font-size: .76rem; }
.toc summary { font: 600 .73rem/1.6 var(--mono); padding: 10px 0; border-top: 3px double #8b6442; cursor: pointer; }
.toc ol { padding-left: 17px; margin: 12px 0; }
.toc li { margin-bottom: 8px; }
.toc a { color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.prose { min-width: 0; padding: 24px; background: #f5eddf; border: 1px solid #beae91; overflow-wrap: anywhere; font-size: .93rem; }
.prose p, .prose ul, .prose ol { max-width: 80ch; }
.prose h2 { font: 400 1.5rem/1.3 var(--display); margin: 32px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.prose h3 { margin-top: 26px; }
.prose a { color: var(--accent); }
.prose pre { max-width: 100%; overflow: auto; padding: 16px; background: #e9dfcd !important; border: 1px solid #bfae8f; white-space: pre; overflow-wrap: normal; font-size: .75rem; line-height: 1.65; tab-size: 4; }
.prose code { font-family: var(--mono); }
.prose :not(pre) > code { background: #e9dfcd; padding: 2px 4px; font-size: .86em; }
.prose table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; font-size: .82rem; }
.prose td, .prose th { min-width: 100px; padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font: .7rem var(--mono); background: #ded0b8; }
.prose td:first-child { min-width: 240px; }
.prose tbody tr:nth-child(even) { background: #ede2ce; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid #8b5037; color: var(--muted); }
.term-list { list-style: none; padding: 0; margin: 0; }
.term-list li { border-bottom: 1px solid var(--line); background: var(--surface); }
.term-list a { display: flex; justify-content: space-between; padding: 18px; font: .85rem var(--mono); }
.term-list span { color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 30px; font: .75rem var(--mono); }
.text-link { display: inline-block; padding: 12px 0; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 4px double #ad8a5c; padding: 45px 38px; color: #e5d0a9; font: .7rem var(--mono); background: linear-gradient(#1a120ce8, #1a120cd9), var(--vault-image) center 85% / cover; }
.site-footer a { padding: 10px 0; }
.site-footer a:hover { color: #fff4d5; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; background: var(--surface); padding: 10px; }
.skip-link:focus { top: 10px; }
@media (max-width: 1000px) {
  .entry-count { display: none; }
  .article-layout:has(.toc) { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .toc > details > nav > ol { columns: 2; }
}
@media (max-width: 700px) {
  .site-shell { width: calc(100% - 24px); }
  .site-header { min-height: 240px; }
  .site-header nav a { flex: 1; padding: 12px 10px; min-height: 48px; font-size: .68rem; }
  .site-header::before { inset: 9px 9px 57px; }
  .identity { padding: 40px 15px 32px; }
  .identity-caption { font-size: .57rem; letter-spacing: .12em; }
  .identity-name { font-size: 2.55rem; letter-spacing: .045em; }
  main { padding: 26px 18px 32px; }
  .section-directory { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .directory-heading h1 { font-size: 2.15rem; }
  .directory-section > header { gap: 10px; padding: 17px 14px; }
  .directory-section h2 { font-size: 1.45rem; }
  .directory-links li { padding: 15px 14px; }
  .site-footer { padding: 26px 18px; }
  .prose { padding: 15px 12px; }
  .prose pre { padding: 12px; }
  .toc > details > nav > ol { columns: 1; }
}
@media print {
  body { background: white; }
  .site-shell { width: 100%; border: 0; box-shadow: none; }
  .site-header, .site-footer, .toc, .back-link, .skip-link { display: none; }
  main { padding: 0; background: white; }
  .directory-section { box-shadow: none; }
  .prose { padding: 0; border: 0; }
  .prose pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .prose table { display: table; font-size: 9pt; }
}
