@font-face { font-family: "IM Fell French Canon"; src: url("/fonts/im-fell-french-canon-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell French Canon"; src: url("/fonts/im-fell-french-canon-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/fonts/courier-prime-latin-400-normal.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/fonts/courier-prime-latin-700-normal.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  --ground: #0E1216; --surface: #1B222A; --ink: #EDE6D6; --ink-dim: #B4AFA2;
  --lamp: #E3A23A; --lamp-ink: #0E1216; --lichen: #8FA597; --rule: #3A444E;
  --f-display: "IM Fell French Canon", "Literata", Georgia, serif;
  --f-text: "Literata", Georgia, "Times New Roman", serif;
  --f-mono: "Courier Prime", "Courier New", monospace;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2.25rem; --s7: 3.5rem; --s8: 5.5rem;
  --gap: 1.5rem; --page: 84rem; --edge: clamp(1rem, 3.2vw, 2.75rem);
  color-scheme: dark;
}
:root[data-theme="light"] { --ground: #F4EFE3; --surface: #E9E1CF; --ink: #14181D; --ink-dim: #4A4F52; --lamp: #8F540A; --lamp-ink: #F4EFE3; --lichen: #465A4E; --rule: #BDB49E; color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
body { margin: 0; overflow-x: clip; background: var(--ground); color: var(--ink); font: 400 1.0625rem/1.62 var(--f-text); font-feature-settings: "kern", "liga", "onum"; text-rendering: optimizeLegibility; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote, pre, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

h1 { font: 400 clamp(2rem, 1.3rem + 2.6vw, 3.25rem)/1.08 var(--f-display); letter-spacing: -.005em; text-wrap: balance; margin-bottom: var(--s5); }
h2 { font: 400 1.5rem/1.2 var(--f-display); margin: var(--s7) 0 var(--s3); padding-top: var(--s3); border-top: 1px solid var(--rule); }
h3 { font: 600 1.0625rem/1.4 var(--f-text); margin: var(--s5) 0 var(--s2); }
p + p, p + ul, p + ol, ul + p, ol + p, figure + p, p + figure, .table-wrap + p, p + .table-wrap { margin-top: var(--s4); }
strong, b { font-weight: 600; }
code, .mono, time, kbd, samp { font: 400 .8125em/1.5 var(--f-mono); font-feature-settings: "zero", "tnum"; letter-spacing: .01em; }
.dim { color: var(--ink-dim); }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--ink-dim); }
a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--ground); }
.held-link { text-decoration: none; }

.skip { position: absolute; left: var(--edge); top: -4rem; background: var(--ink); color: var(--ground); padding: var(--s2) var(--s4); font: 400 .8125rem var(--f-mono); z-index: 7; }
.skip:focus { top: var(--s2); }

.rule-button { font: 500 .75rem/1 var(--f-mono); letter-spacing: .04em; color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 0; padding: .7em 1em; min-height: 2.75rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.rule-button:hover { background: var(--ink); color: var(--ground); }

/* The seven cloths a document can be bound in; picked from its shelfmark and publisher, and they say nothing about it. */
.cloth-oxblood { --cloth: #6A2C29; } .cloth-forest { --cloth: #2C4F40; } .cloth-navy { --cloth: #27405F; } .cloth-ochre { --cloth: #94712B; } .cloth-slate { --cloth: #48525D; } .cloth-umber { --cloth: #59422F; } .cloth-bone { --cloth: #CBBF9F; }
.chip { display: inline-block; width: .5rem; height: .95rem; margin-right: .5rem; vertical-align: -.15rem; background-color: var(--cloth); background-image: linear-gradient(90deg, rgba(0, 0, 0, .4), rgba(255, 255, 255, .1) 30%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .4)); border-radius: 1px; }

/* The reading lamp: a warm wash from the top right of every page but the front, which has its own. */
body:not(.p-home)::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 30rem; z-index: -1; pointer-events: none; background: radial-gradient(52rem 24rem at 84% -5rem, rgba(227, 162, 58, .11), transparent 70%); }
:root[data-theme="light"] body:not(.p-home)::before { background: radial-gradient(52rem 24rem at 84% -5rem, rgba(143, 84, 10, .1), transparent 70%); }
body { position: relative; }

/* Masthead: the label, laid flat */
.masthead { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: center; max-width: var(--page); margin: 0 auto; padding: var(--s4) var(--edge) var(--s3); border-bottom: 1px solid var(--rule); }
.wordmark { grid-column: 1 / span 4; display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; font: 400 .9375rem/1 var(--f-display); letter-spacing: .09em; text-transform: uppercase; min-height: 2.75rem; }
.wordmark-text { display: grid; gap: .3rem; }
.descriptor { font: italic 400 .8125rem/1 var(--f-text); letter-spacing: 0; text-transform: none; color: var(--ink-dim); }
.wordmark:hover .wordmark-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em; }
.lintel .sun { fill: var(--lamp); }
.lintel .sun-out { fill: none; }
.edition-code { grid-column: 11 / span 2; justify-self: end; font: 400 .875rem/1 var(--f-text); font-feature-settings: "lnum"; letter-spacing: .02em; color: var(--ink-dim); }
.edition-code a { text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
.edition-code a:hover { color: var(--ink); }
.print-head { display: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The header: the name, the six rooms, a finder and the directory board. It stays at the top of the window. */
.mast { position: sticky; top: 0; z-index: 5; background: var(--ground); border-bottom: 3px double var(--rule); }
.mast-bar { position: relative; display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.75rem); max-width: var(--page); margin: 0 auto; padding: .5rem var(--edge); }
.mast .wordmark { flex: none; font-size: 1.0625rem; letter-spacing: .07em; }
.mast-nav { margin-left: auto; }
.mast-nav ul { display: flex; gap: clamp(.9rem, 1.9vw, 1.9rem); }
.mast-nav a { position: relative; display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; font: 400 1.125rem/1 var(--f-display); letter-spacing: .01em; white-space: nowrap; }
.mast-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: .5rem; height: 2px; background: var(--lamp); transform: scaleX(0); transform-origin: left; }
.mast-nav a:hover::after, .mast-nav a[aria-current]::after { transform: scaleX(1); }
.mast-find input, .dir-find input { width: 11.5rem; min-height: 2.5rem; padding: .5rem .7rem; font: 400 .8125rem/1.2 var(--f-mono); color: var(--ink); background: var(--surface); border: 1px solid var(--ink-dim); border-radius: 0; }
.mast-find input::placeholder, .dir-find input::placeholder { color: var(--ink-dim); opacity: 1; }
.mast-find input:focus, .dir-find input:focus { border-color: var(--ink); }
.mast-dir > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .6rem; min-height: 2.5rem; padding: 0 .9rem; border: 1px solid var(--ink); font: 700 .75rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; user-select: none; }
.mast-dir > summary::-webkit-details-marker { display: none; }
.mast-dir > summary::before { content: ""; width: .95rem; height: .7rem; background: linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat; }
.mast-dir > summary:hover, .mast-dir[open] > summary { background: var(--ink); color: var(--ground); }
.dir-panel { position: absolute; left: var(--edge); right: var(--edge); top: calc(100% + 3px); max-height: calc(100vh - 5.5rem); overflow-y: auto; padding: var(--s5) var(--s5) var(--s4); background: var(--surface); border: 1px solid var(--rule); border-top: .4rem solid #2B2118; box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .55); }
.dir-find { display: none; margin-bottom: var(--s5); }
.dir-find input { width: 100%; }
.dir-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--s5) var(--gap); }
.dir-h { font: 400 .875rem/1.3 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); padding-bottom: .45rem; margin-bottom: .3rem; border-bottom: 1px solid var(--rule); }
.dir-cols a { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: .42rem 0; text-decoration: none; font-size: 1rem; line-height: 1.3; }
.dir-cols a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.dir-cols a[aria-current] { color: var(--lamp); }
.dir-cols .n { font: 400 .75rem/1 var(--f-mono); color: var(--ink-dim); }
.dir-shelves ul { columns: 2; column-gap: var(--gap); }
.dir-shelves li { break-inside: avoid; }
.dir-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s5); margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); font: 400 .75rem/1.5 var(--f-mono); color: var(--ink-dim); }
.dir-foot a { text-decoration-color: var(--rule); }
@media (max-width: 74rem) {
  .mast-nav, .mast-find { display: none; }
  .mast-dir { margin-left: auto; }
  .dir-find { display: block; }
  .dir-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 34rem) {
  .dir-panel { left: 0; right: 0; padding: var(--s4) var(--edge); border-left: 0; border-right: 0; }
  .dir-cols { grid-template-columns: 1fr; }
  .mast .wordmark { font-size: .9375rem; }
}

.crumbs { max-width: var(--page); margin: 0 auto; padding: var(--s3) var(--edge) 0; font: 400 .75rem/1.6 var(--f-mono); color: var(--ink-dim); }
.crumbs ol { display: flex; flex-wrap: wrap; }
.crumbs li { padding: .35rem 0; }
.crumbs li + li::before { content: "/"; padding: 0 .6em; color: var(--rule); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* The register grid: margin 1 to 2, text 3 to 9, plates and slips 10 to 12 */
.sheet, .wide { max-width: var(--page); margin: 0 auto; padding: var(--s6) var(--edge) var(--s8); }
.sheet { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
.sheet > .margin { grid-column: 1 / span 2; padding-top: .55rem; display: grid; gap: var(--s3); justify-items: start; }
.sheet > main { grid-column: 3 / span 7; min-width: 0; }
.sheet.t-section > main, .sheet.t-shelf > main { grid-column: 3 / -1; }
.sheet > .slip { grid-column: 10 / span 3; padding-top: .55rem; border-top: 1px solid var(--rule); font-size: .9375rem; }
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.shelfmark { font: 500 1.0625rem/1.2 var(--f-mono); letter-spacing: .04em; }
.margin .sidenote, .margin p.dim { font: 400 .75rem/1.55 var(--f-mono); color: var(--ink-dim); }
.margin a { text-decoration-color: var(--rule); }

.badge { display: inline-flex; align-items: center; gap: .5em; font: 500 .6875rem/1 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; text-decoration: none; padding: .5em .65em .45em; border: 1px solid currentColor; color: var(--ink); }
.badge:hover { background: var(--ink); color: var(--ground); }
.badge-editorial { color: var(--lichen); }
.badge.stamp { border-width: 2px; outline: 1px solid currentColor; outline-offset: 2px; transform: rotate(-3deg); }

.lede { font-size: 1.25rem; line-height: 1.5; color: var(--ink); max-width: 34em; }
main > p, main > ul, main > ol, main > figure, main section > p, main section > ul, main section > ol { max-width: 41rem; }
main ul:not([class]) > li, main ol:not([class]) > li { position: relative; padding-left: 1.4em; }
main ul:not([class]) > li::before { content: ""; position: absolute; left: .2em; top: .78em; width: .55em; height: 1px; background: var(--ink-dim); }
main ol:not([class]) { counter-reset: n; }
main ol:not([class]) > li { counter-increment: n; }
main ol:not([class]) > li::before { content: counter(n); position: absolute; left: 0; font: 400 .75rem/2.3 var(--f-mono); color: var(--ink-dim); }
main li + li { margin-top: var(--s2); }
ul.plain > li { padding-left: 0; }

.refs { font: 400 .625rem/1 var(--f-mono); vertical-align: .55em; margin-left: .25em; white-space: nowrap; }
.refs a { text-decoration: none; color: var(--ink-dim); padding: .5em .2em; }
.refs a + a::before { content: ","; margin-right: .3em; }
.refs a:hover { color: var(--ink); text-decoration: underline; }

/* Verbatim extract: the two bars of the badge, down the left edge */
.extract { margin: var(--s5) 0; padding-left: 1.4rem; border-left: 9px double var(--ink); max-width: 41rem; }
.extract-label { font: 500 .6875rem/1.4 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: var(--s2); }
.extract blockquote { font-size: 1.0625rem; }
.extract blockquote p + p { margin-top: var(--s3); }
.extract figcaption, .src-cite { display: block; margin-top: var(--s3); font: 400 .75rem/1.6 var(--f-mono); color: var(--ink-dim); }

ol.steps { counter-reset: step; max-width: 41rem; margin-top: var(--s5); }
ol.steps > li { counter-increment: step; position: relative; padding: var(--s3) 0; border-top: 1px solid var(--rule); }
ol.steps > li + li { margin-top: 0; }
ol.steps > li::before { content: counter(step); position: absolute; right: calc(100% + var(--gap)); top: .35rem; font: 400 1.75rem/1.2 var(--f-display); color: var(--ink-dim); }

.table-wrap { overflow-x: auto; margin: var(--s5) 0; }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
table.ruled { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
caption { text-align: left; font: 400 .75rem/1.6 var(--f-mono); color: var(--ink-dim); padding-bottom: var(--s2); }
th, td { text-align: left; vertical-align: top; padding: .5rem 1rem .5rem 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
thead th { font: 500 .6875rem/1.4 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); border-bottom: 1px solid var(--ink); white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; }

.sources { margin-top: var(--s8); }
.sources h2 { font: 500 .75rem/1.4 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; margin-top: 0; border-top: 3px double var(--ink); padding-top: var(--s3); }
.sources-note { font-size: .875rem; color: var(--ink-dim); margin-bottom: var(--s4); }
.sources ol { counter-reset: src; max-width: 41rem; }
.sources li { counter-increment: src; position: relative; padding: var(--s3) 0 var(--s3) 2.25rem; border-top: 1px solid var(--rule); font-size: .9375rem; }
.sources li::before { content: counter(src); position: absolute; left: 0; top: var(--s3); font: 400 .75rem/2 var(--f-mono); color: var(--ink-dim); }
.sources li:target { background: var(--surface); }
.sources q { quotes: "\201C" "\201D"; }
.related h2 { font-size: 1.125rem; }
.related li + li { margin-top: var(--s1); }

/* Colophon */
.colophon { border-top: 3px double var(--rule); margin-top: var(--s7); font-size: .875rem; line-height: 1.55; color: var(--ink-dim); }
.colophon-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: var(--s5); max-width: var(--page); margin: 0 auto; padding: var(--s6) var(--edge) var(--s6); }
.colophon-mark { grid-column: 1 / span 2; color: var(--ink); }
.tagline { margin-top: var(--s3); font: 400 .6875rem/1.5 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-dim); }
.colophon-text { grid-column: 3 / span 6; }
.colophon-text p { max-width: 38rem; }
.colophon-links { grid-column: 10 / span 3; font: 400 .75rem/1.5 var(--f-mono); }
.colophon-links a { display: inline-block; padding: .3rem 0; text-decoration-color: var(--rule); }
.colophon a:hover { color: var(--ink); }
.colophon-foot { grid-column: 3 / -1; display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); align-items: center; padding-top: var(--s4); border-top: 1px solid var(--rule); font: 400 .75rem/1.5 var(--f-mono); }
.colophon-foot p { margin: 0; }
.checked a { text-decoration: none; display: inline-block; padding: .5rem 0; }
.checked a:hover { text-decoration: underline; }
.theme { margin-left: auto !important; }
.theme .rule-button { color: inherit; border-color: var(--rule); }
.theme .rule-button:hover { color: var(--ground); border-color: var(--ink); }

@media (max-width: 62rem) {
  .sheet > .margin { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); padding: 0 0 var(--s4); }
  .sheet > main, .sheet > .slip { grid-column: 1 / -1; }
  .sheet > .slip { margin-top: var(--s6); }
  ol.steps > li { padding-left: 2.5rem; }
  ol.steps > li::before { right: auto; left: 0; top: .55rem; font-size: 1.375rem; }
  .masthead { row-gap: 0; padding-top: var(--s3); }
  .wordmark { grid-column: 1 / span 9; }
  .edition-code { grid-column: 10 / span 3; grid-row: 1; }
  .colophon-mark, .colophon-text, .colophon-links, .colophon-foot { grid-column: 1 / -1; }
  .colophon-links { columns: 2; }
}
@media (max-width: 40rem) { .crumbs li[aria-current] { display: none; } }
@media (max-width: 26rem) {
  body { font-size: 1rem; }
  .wordmark, .mast .wordmark { font-size: .8125rem; letter-spacing: .07em; gap: .5rem; }
  .edition-code { font-size: .75rem; }
  .descriptor { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  a, .rule-button, .badge { transition: text-decoration-color .12s linear, background-color .12s linear, color .12s linear; }
}

@media print {
  :root, :root[data-theme] { --ground: #fff; --surface: #fff; --ink: #000; --ink-dim: #333; --lamp: #000; --lamp-ink: #fff; --lichen: #333; --rule: #999; color-scheme: light; }
  body { font-size: 10.5pt; background: #fff; }
  .masthead, .mast, .crumbs, .skip, .colophon-links, .theme, .colophon-mark, .no-print, body::before, .chip { display: none !important; }
  .print-head { display: block; font: 400 7.5pt var(--f-mono); letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid #000; padding-bottom: 3pt; margin-bottom: 14pt; }
  .sheet, .wide { padding: 0; max-width: none; }
  .colophon { margin-top: 18pt; border-top: 1px solid #000; }
  .colophon-grid { padding: 8pt 0 0; display: block; }
  a { text-decoration: none; }
  a[data-mark]::after { content: " [" attr(data-mark) "]"; font: 400 .8em var(--f-mono); }
  a.at-source::after { content: " " attr(href); font: 400 .9em var(--f-mono); word-break: break-all; }
  h2, h3 { break-after: avoid; }
  .extract, li, tr { break-inside: avoid; }
}

/* No network: one quiet line at the foot of the window. */
.offline-line { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; margin: 0; padding: .6rem var(--edge); background: var(--ink); color: var(--ground); font: 400 .8125rem/1.4 var(--f-mono); }
@media print { .offline-line { display: none; } }
@media (max-width: 30rem) {
  .mast-bar { gap: .6rem; }
  .mast-dir > summary { padding: 0 .75rem; }
  .dir-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
