/* peptiledger.com — "ledger & journal" stylesheet. Hand-written for this site. */
:root {
  --paper: #f7f4ee;
  --paper-deep: #efeae0;
  --ink: #1c1a16;
  --ink-soft: #4b463f;
  --ink-faint: #7d776d;
  --hair: #d9d2c3;
  --hair-strong: #b9b09d;
  --brick: #7a3b2e;
  --brick-deep: #5e2c22;
  --sage: #e9ede4;
  --sage-ink: #3d5a4c;
  --slate: #2f4a60;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 40px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  font-optical-sizing: auto;
  font-feature-settings: "liga", "onum" 0;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brick); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brick-deep); }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.18; letter-spacing: -0.005em; margin: 0; }
h1 { font-size: clamp(30px, 4.6vw, 46px); }
h2 { font-size: clamp(24px, 3vw, 30px); }
h3 { font-size: clamp(20px, 2.2vw, 23px); }
p { margin: 0 0 1.1em; }
code, .lot-code { font-family: var(--mono); font-size: 0.86em; }
.lot-code { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-to { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip-to:focus { left: 8px; }

/* ---------- frame ---------- */
.folio { width: min(1120px, 100% - 2 * var(--gutter)); margin: 0 auto; }
.folio--reading { width: min(1180px, 100% - 2 * var(--gutter)); }
.hairline { border: 0; border-top: 1px solid var(--hair); margin: 0; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 2px solid var(--ink); background: var(--paper); }
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; }
.masthead__title { font-size: 24px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: baseline; gap: 10px; }
.masthead__title small { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.masthead__nav { display: flex; gap: 22px; }
.masthead__nav a { font-size: 15px; color: var(--ink-soft); text-decoration: none; letter-spacing: 0.01em; padding: 6px 0; border-bottom: 1px solid transparent; }
.masthead__nav a:hover, .masthead__nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.masthead__toggle { display: none; background: none; border: 1px solid var(--hair-strong); color: var(--ink); font: 500 14px var(--serif); padding: 6px 12px; cursor: pointer; }
.masthead__strap { font-size: 13px; color: var(--ink-faint); padding: 7px 0; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.masthead__strap span { font-family: var(--mono); letter-spacing: 0.04em; font-size: 11.5px; text-transform: uppercase; }
@media (max-width: 760px) {
  .masthead__toggle { display: inline-block; }
  .masthead__nav { display: none; flex-direction: column; gap: 0; padding: 4px 0 10px; }
  .masthead__nav.is-open { display: flex; }
  .masthead__nav a { padding: 10px 0; border-bottom: 1px solid var(--hair); }
  .masthead__row { flex-wrap: wrap; }
  .masthead__strap span:last-child { display: none; }
}

/* ---------- plate (title band) ---------- */
.plate { padding: clamp(36px, 7vw, 84px) 0 clamp(28px, 5vw, 56px); }
.plate--index { border-bottom: 1px solid var(--hair); }
.overline { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brick); margin: 0 0 14px; }
.plate__title { max-width: 22ch; }
.plate__dek { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.45; color: var(--ink-soft); max-width: 60ch; margin: 18px 0 0; }
.plate__dek a { color: inherit; }
.ledger-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hair); margin: 36px 0 0; }
.stat-cell { padding: 16px 18px 16px 0; border-right: 1px solid var(--hair); }
.stat-cell:last-child { border-right: 0; }
.stat-cell + .stat-cell { padding-left: 18px; }
.stat-cell dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); margin: 0 0 6px; }
.stat-cell dd { margin: 0; font-size: 20px; line-height: 1.3; }
.stat-cell dd small { display: block; font-size: 13px; color: var(--ink-faint); margin-top: 3px; }
@media (max-width: 640px) { .stat-cell { border-right: 0; border-bottom: 1px solid var(--hair); padding-left: 0 !important; } .stat-cell:last-child { border-bottom: 0; } }

/* ---------- index of guides ---------- */
.index-list { list-style: none; margin: 0; padding: 0; counter-reset: guide; }
.index-item { display: grid; grid-template-columns: 64px 1fr; gap: 0 20px; padding: 24px 0; border-bottom: 1px solid var(--hair); }
.index-item__num { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); padding-top: 7px; letter-spacing: 0.06em; }
.index-item__title { font-size: 23px; font-weight: 500; line-height: 1.25; }
.index-item__title a { color: var(--ink); text-decoration: none; }
.index-item__title a:hover { color: var(--brick); text-decoration: underline; }
.index-item__desc { color: var(--ink-soft); margin: 8px 0 0; font-size: 17px; max-width: 70ch; }
.index-item__meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; letter-spacing: 0.04em; text-transform: uppercase; }
.index-item__meta b { font-weight: 500; color: var(--sage-ink); }
@media (max-width: 640px) { .index-item { grid-template-columns: 1fr; } .index-item__num { padding-top: 0; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 42px 0 10px; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.section-title h2 { font-size: 20px; letter-spacing: 0.01em; }
.section-title a { font-size: 14px; }
.home-twin { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; margin: 44px 0 0; }
@media (max-width: 860px) { .home-twin { grid-template-columns: 1fr; } }
.side-plate { background: var(--paper-deep); padding: 22px 24px 24px; align-self: start; }
.side-plate h2 { font-size: 20px; margin-bottom: 10px; }
.side-plate p { font-size: 16px; color: var(--ink-soft); }
.side-plate ul { margin: 0 0 12px; padding-left: 18px; font-size: 16px; }
.side-plate li { margin: 0 0 6px; }

/* ---------- leaf (article) ---------- */
.leaf { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; align-items: start; padding: 0 0 56px; }
@media (max-width: 960px) { .leaf { grid-template-columns: 1fr; gap: 24px; } }
.leaf__head { padding: clamp(28px, 5vw, 60px) 0 24px; }
.leaf__head .plate__title { max-width: 26ch; }
.subtitle-line { font-style: italic; font-size: clamp(17px, 1.9vw, 20px); line-height: 1.45; color: var(--ink-soft); margin: 14px 0 0; max-width: 60ch; }
.dek { font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--ink-soft); margin: 18px 0 0; max-width: 62ch; }
.leaf__meta { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 22px 0 0; padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hair); font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-faint); text-transform: uppercase; }
.leaf__meta b { font-weight: 500; color: var(--ink); }
.crumb-trail { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding: 14px 0 0; letter-spacing: 0.03em; }
.crumb-trail a { color: var(--ink-faint); text-decoration: none; }
.crumb-trail a:hover { color: var(--brick); }
.crumb-trail span { padding: 0 7px; }

.toc-rail { position: sticky; top: 18px; font-size: 14.5px; border-left: 2px solid var(--ink); padding-left: 16px; }
.toc-rail h2 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 10px; font-weight: 500; }
.toc-rail ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-rail li { margin: 0 0 7px; padding-left: 26px; position: relative; line-height: 1.35; }
.toc-rail li::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); position: absolute; left: 0; top: 2px; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.toc-rail a { color: var(--ink-soft); text-decoration: none; }
.toc-rail a:hover { color: var(--brick); text-decoration: underline; }
@media (max-width: 960px) {
  .toc-rail { position: static; order: -1; border-left: 0; padding: 16px 18px; background: var(--paper-deep); }
  .toc-rail ol { columns: 2; column-gap: 24px; }
  .toc-rail li { break-inside: avoid; }
}
@media (max-width: 560px) { .toc-rail ol { columns: 1; } }

.body-copy { max-width: var(--measure); }
.body-copy > h2 { margin: 2.1em 0 0.6em; padding-top: 0.5em; border-top: 1px solid var(--hair); scroll-margin-top: 20px; }
.body-copy > h2:first-child { border-top: 0; margin-top: 1em; }
.body-copy > h3 { margin: 1.6em 0 0.5em; }
.body-copy ul, .body-copy ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.body-copy li { margin: 0 0 0.45em; }
.body-copy li > ul, .body-copy li > ol { margin-top: 0.4em; }
.body-copy blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--hair-strong); color: var(--ink-soft); font-style: italic; }
.body-copy blockquote p:last-child { margin-bottom: 0; }
.body-copy strong { font-weight: 600; }
.body-copy hr { border: 0; border-top: 1px solid var(--hair); margin: 2em 0; }
.body-copy pre { background: var(--paper-deep); padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.5; border-left: 3px solid var(--hair-strong); }
.body-copy pre code { font-size: inherit; }
.body-copy p code { background: var(--paper-deep); padding: 1px 5px; }

/* tables */
.datatable { overflow-x: auto; margin: 1.4em 0 1.8em; -webkit-overflow-scrolling: touch; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.4; }
.ledger-table caption { text-align: left; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); padding: 0 0 8px; }
.ledger-table th, .ledger-table td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--hair); }
.ledger-table th { font-weight: 600; border-bottom: 1.5px solid var(--ink); font-size: 14px; }
.ledger-table td:last-child, .ledger-table th:last-child { padding-right: 0; }
.ledger-table .numeric { font-family: var(--mono); font-size: 0.9em; white-space: nowrap; }

/* asides */
.aside-note { background: var(--paper-deep); border-left: 3px solid var(--slate); padding: 16px 20px 6px; margin: 1.6em 0; font-size: 16.5px; }
.aside-note__title { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); margin: 0 0 8px; font-weight: 500; }
.aside-note p:last-child { margin-bottom: 10px; }
.aside-note--case { border-left-color: var(--brick); }
.aside-note--case .aside-note__title { color: var(--brick); }

/* tally (checklist) */
.tally { border: 1.5px solid var(--ink); padding: 22px 26px 18px; margin: 2.2em 0; background: var(--sage); position: relative; }
.tally::before { content: "Checklist"; position: absolute; top: -11px; left: 18px; background: var(--sage); padding: 0 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage-ink); }
.tally h2 { font-size: 21px; margin: 0 0 12px; border: 0 !important; padding: 0 !important; }
.tally ul { list-style: none; margin: 0; padding: 0; }
.tally li { position: relative; padding: 0 0 0 30px; margin: 0 0 9px; font-size: 16.5px; }
.tally li::before { content: ""; position: absolute; left: 0; top: 5px; width: 15px; height: 15px; border: 1.5px solid var(--sage-ink); background: #fff; }
.tally p { font-size: 16px; color: var(--ink-soft); }

/* qna (FAQ) */
.qna { margin: 2.2em 0 0; }
.qna h2 { border-top: 1px solid var(--hair); padding-top: 0.5em; margin: 0 0 0.6em; }
.qna__item { border-bottom: 1px solid var(--hair); }
.qna__item summary { cursor: pointer; padding: 14px 28px 14px 0; font-weight: 500; font-size: 18px; line-height: 1.35; list-style: none; position: relative; }
.qna__item summary::-webkit-details-marker { display: none; }
.qna__item summary::after { content: "+"; position: absolute; right: 2px; top: 12px; font-family: var(--mono); color: var(--ink-faint); font-size: 18px; }
.qna__item[open] summary::after { content: "–"; }
.qna__a { padding: 0 0 14px; color: var(--ink-soft); font-size: 17px; max-width: 64ch; }
.qna__a p:last-child { margin-bottom: 0; }

/* sources */
.sources { margin: 2.4em 0 0; }
.sources h2 { border-top: 1px solid var(--hair); padding-top: 0.5em; margin: 0 0 0.6em; }
.sources ol { padding-left: 1.6em; font-size: 15.5px; color: var(--ink-soft); }
.sources li { margin: 0 0 0.6em; }
.sources li a { word-break: break-word; }
.sources__note { font-size: 14px; color: var(--ink-faint); margin: 12px 0 0; }

.maintainer-line { margin: 40px 0 0; padding: 16px 0 0; border-top: 2px solid var(--ink); font-size: 15px; color: var(--ink-soft); }
.maintainer-line a { color: inherit; }
.leaf-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 32px 0 0; font-size: 15px; }
.leaf-nav a { text-decoration: none; color: var(--ink); display: block; padding: 12px 0; border-top: 1px solid var(--hair); }
.leaf-nav a small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
.leaf-nav a:hover { color: var(--brick); }
.leaf-nav a:last-child { text-align: right; }
@media (max-width: 560px) { .leaf-nav { grid-template-columns: 1fr; } .leaf-nav a:last-child { text-align: left; } }

/* ---------- registry ---------- */
.registry-table { font-size: 14.5px; }
.registry-table td { font-size: 14.5px; }
.registry-table .lot-code { font-size: 13px; }
.registry-notes { max-width: var(--measure); font-size: 16px; color: var(--ink-soft); }
.registry-notes h2 { font-size: 20px; margin: 1.8em 0 0.5em; }
.submission-box { border: 1px dashed var(--hair-strong); padding: 18px 22px; margin: 28px 0; font-size: 16px; max-width: var(--measure); }
.submission-box h2 { font-size: 19px; margin-bottom: 8px; }
.action-link { display: inline-block; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper); background: var(--ink); padding: 10px 16px; text-decoration: none; }
.action-link:hover { background: var(--brick); color: var(--paper); }
.action-link--quiet { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.action-link--quiet:hover { background: var(--ink); color: var(--paper); }

/* ---------- glossary ---------- */
.alpha-nav { display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--mono); font-size: 13px; margin: 24px 0 8px; }
.alpha-nav a { color: var(--ink-soft); text-decoration: none; padding: 2px 4px; }
.alpha-nav a:hover { color: var(--brick); }
.alpha-nav span { color: var(--hair-strong); padding: 2px 4px; }
.gloss-group { margin: 30px 0 0; }
.gloss-group h2 { font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; color: var(--ink-faint); border-bottom: 1px solid var(--ink); padding-bottom: 6px; scroll-margin-top: 20px; }
.gloss-list { margin: 0; max-width: 76ch; }
.gloss-term { font-weight: 600; margin: 20px 0 4px; font-size: 19px; scroll-margin-top: 20px; }
.gloss-term small { font-weight: 400; color: var(--ink-faint); font-size: 14px; margin-left: 8px; }
.gloss-def { margin: 0; color: var(--ink-soft); font-size: 16.5px; }
.gloss-def a { white-space: nowrap; }

/* ---------- photo dossier ---------- */
.photo-dossier { list-style: none; margin: 32px 0 0; padding: 0; counter-reset: plate; }
.photo-dossier__item { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr); gap: 28px; padding: 28px 0; border-top: 1px solid var(--ink); }
@media (max-width: 820px) { .photo-dossier__item { grid-template-columns: 1fr; } }
.photo-dossier__frame { position: relative; background: var(--paper-deep); }
.photo-dossier__frame img { width: 100%; height: auto; display: block; }
.annot-pin { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--brick); color: #fff; font: 600 12px/26px var(--mono); text-align: center; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px rgba(255,255,255,0.85); }
.photo-dossier__plate { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 8px; }
.photo-dossier__plate::before { counter-increment: plate; content: "Plate " counter(plate, upper-roman) " · "; }
.photo-dossier h2 { font-size: 22px; margin: 0 0 10px; }
.annot-list { list-style: none; margin: 14px 0 0; padding: 0; font-size: 16px; }
.annot-list li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; margin: 0 0 10px; color: var(--ink-soft); }
.annot-list li b { display: inline-block; width: 24px; height: 24px; border-radius: 50%; background: var(--brick); color: #fff; font: 600 12px/24px var(--mono); text-align: center; }
.photo-dossier__facts { font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); margin: 12px 0 0; line-height: 1.6; }
.photo-dossier__facts b { color: var(--ink); font-weight: 500; }

/* ---------- simple pages ---------- */
.page-copy { max-width: var(--measure); padding-bottom: 48px; }
.page-copy h2 { margin: 1.8em 0 0.5em; padding-top: 0.4em; border-top: 1px solid var(--hair); }
.page-copy ul, .page-copy ol { padding-left: 1.4em; }
.page-copy li { margin: 0 0 0.45em; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 28px 0; }
.contact-grid > div { border-top: 2px solid var(--ink); padding: 14px 0 0; font-size: 16px; }
.contact-grid h2 { font-size: 17px; border: 0; padding: 0; margin: 0 0 8px; }
.contact-grid p { color: var(--ink-soft); margin-bottom: 8px; }
.lot-request { background: var(--paper-deep); border-left: 3px solid var(--brick); padding: 18px 22px; margin: 34px 0; max-width: var(--measure); }
.lot-request h2 { font-size: 20px; border: 0; padding: 0; margin: 0 0 8px; }
.lot-request p { font-size: 16px; color: var(--ink-soft); }
.review-log-table td:first-child { white-space: nowrap; font-family: var(--mono); font-size: 13px; }

/* ---------- colophon (footer) ---------- */
.site-colophon { margin-top: 48px; border-top: 2px solid var(--ink); background: var(--paper-deep); font-size: 15px; }
.colophon-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 34px 0 26px; }
@media (max-width: 760px) { .colophon-cols { grid-template-columns: 1fr; gap: 22px; } }
.colophon-cols h2 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 10px; font-weight: 500; }
.colophon-cols p { color: var(--ink-soft); margin: 0 0 8px; }
.colophon-cols ul { list-style: none; margin: 0; padding: 0; }
.colophon-cols li { margin: 0 0 7px; }
.colophon-cols a { color: var(--ink); text-decoration: none; }
.colophon-cols a:hover { color: var(--brick); text-decoration: underline; }
.colophon-legal { border-top: 1px solid var(--hair); padding: 14px 0 26px; font-size: 13px; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ruo-line { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; }

/* ---------- 404 ---------- */
.missing-leaf { padding: 80px 0; max-width: var(--measure); }

@media print {
  .masthead, .site-colophon, .toc-rail, .leaf-nav, .skip-to { display: none !important; }
  body { font-size: 11.5pt; background: #fff; }
  a { color: inherit; text-decoration: none; }
  .leaf { display: block; }
}

/* ---------- photo appendix ---------- */
.photo-appendix { border-top: 1px solid var(--ink); margin: 40px 0 0; padding: 20px 0 0; }
.photo-appendix h2 { font-size: 22px; margin: 0 0 10px; }
.photo-appendix p { max-width: var(--measure); color: var(--ink-soft); font-size: 16px; }
.photo-appendix__grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-appendix__grid li { background: var(--paper-deep); }
.photo-appendix__grid img { width: 100%; height: 190px; object-fit: cover; display: block; }

/* ---------- in-guide figure ---------- */
.figure { margin: 1.8em 0 2em; }
.figure img { display: block; max-height: 520px; width: auto; max-width: 100%; background: var(--paper-deep); }
.figure__cap { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--ink-faint); margin: 10px 0 0; max-width: 60ch; }
