/* Slowspan — scriptorium stylesheet.
   Monastery grimoire: parchment ground, deep manuscript green rules,
   gold-leaf ornament. No web fonts, no external requests, no monospace. */

:root {
  --bg: #f7f1e3;
  --text: #2c2a22;
  --accent: #3e5c3a;
  --accent-2: #b08a3e;
  --card: #fbf7ec;
  --rule: rgba(62, 92, 58, 0.4);
  --display: "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  --body: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.68;
}

/* ---------- skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 14px;
  z-index: 50;
}

.skip:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.masthead-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 20px;
  color: var(--accent);
  text-decoration: none;
}

.wordmark:hover { text-decoration: underline; }

.menu-button {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 16px;
  color: var(--accent);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 5px 12px;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 17px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent-2); }

@media (max-width: 620px) {
  .menu-button { display: inline-block; }
  .site-nav {
    display: none;
    width: 100%;
    border-top: 1px solid var(--rule);
    margin-top: 10px;
    padding-top: 10px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 10px; }
  .masthead-inner { flex-wrap: wrap; }
}

@media (min-width: 621px) {
  .menu-button { display: none; }
}

/* ---------- the page: double frame ---------- */

.leaf {
  position: relative;
  max-width: 640px;
  margin: 26px auto 34px;
  padding: 30px 26px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 0;
}

.leaf::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--rule);
  pointer-events: none;
}

.leaf > * { position: relative; }

@media (max-width: 420px) {
  .leaf { padding: 22px 16px; margin: 14px 8px 24px; }
}

/* ---------- type ---------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1.3;
}

h1 {
  font-size: 30px;
  font-variant: small-caps;
  margin: 0 0 14px;
}

h2 {
  font-size: 23px;
  font-variant: small-caps;
  margin: 34px 0 6px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--accent-2); /* gold-leaf rule */
}

h3 {
  font-size: 19px;
  margin: 24px 0 4px;
  color: var(--accent);
}

h4 { font-size: 17px; margin: 18px 0 4px; }

p { margin: 0 0 15px; }

a { color: var(--accent); text-decoration: underline; }

a:hover { color: var(--text); }

a:focus-visible,
button:focus-visible,
.skip:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

strong { font-weight: 700; }

.chapter-label {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-size: 15px;
  color: var(--accent);
  margin: 0 0 4px;
}

.step-indicator {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 15px;
  color: var(--text);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 5px 0;
  margin: 0 0 22px;
}

.lede { font-size: 18px; }

.dropcap::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 54px;
  line-height: 0.82;
  padding: 6px 8px 0 0;
  color: var(--accent);
}

/* ---------- lists with closed-book bullets ---------- */

ul.books {
  list-style: none;
  padding-left: 0;
  margin: 0 0 16px;
}

ul.books li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 9px;
}

ul.books li .bk {
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  color: var(--accent);
}

ol.steps-list,
ol.procedure {
  padding-left: 22px;
  margin: 0 0 16px;
}

ol.steps-list li,
ol.procedure li { margin-bottom: 11px; }

ol.steps-list::marker { color: var(--accent); }

/* ---------- ornament ---------- */

.vine {
  display: block;
  margin: 30px auto;
  width: 100%;
  max-width: 300px;
  height: 22px;
  color: var(--accent-2);
}

/* ---------- disclosure colophon ---------- */

.colophon {
  text-align: center;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  padding: 14px 10px;
  margin: 24px 0;
  font-size: 17px;
}

.colophon .colophon-label {
  display: block;
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}

.colophon p { margin: 0 0 8px; }

.colophon p:last-child { margin-bottom: 0; }

.link-note {
  font-size: 15px;
  border-left: 2px solid var(--accent-2);
  padding-left: 12px;
  margin: 0 0 18px;
}

/* ---------- boxes, tables, checklists ---------- */

.callout {
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 16px 18px;
  margin: 20px 0;
}

.callout h3 { margin-top: 0; }

.checklist {
  border: 1px solid var(--accent);
  padding: 18px 20px;
  margin: 24px 0;
}

.checklist h3 { margin-top: 0; }

ul.boxes {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

ul.boxes li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 11px;
}

ul.boxes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 16px;
}

caption {
  text-align: left;
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
}

th, td {
  border: 1px solid var(--rule);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th { background: var(--bg); font-weight: 400; font-family: var(--display); }

dl.checked dt {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-top: 14px;
}

dl.checked dd { margin: 4px 0 0; }

.glossary-strip {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  margin: 22px 0;
  font-size: 16px;
}

.glossary-strip dt { font-variant: small-caps; letter-spacing: 0.06em; color: var(--accent); }
.glossary-strip dd { margin: 2px 0 10px; }

.timeline { list-style: none; padding-left: 0; margin: 0 0 16px; }
.timeline li { border-left: 1px solid var(--accent-2); padding: 0 0 12px 16px; }
.timeline li span { display: block; font-variant: small-caps; letter-spacing: 0.06em; color: var(--accent); }

.pros-cons { margin: 18px 0; }

.print-button {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 16px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 8px 16px;
  cursor: pointer;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--rule);
  margin-top: 30px;
  padding-top: 14px;
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
}

.contents {
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 14px 18px;
  margin: 0 0 24px;
}

.contents h2 {
  font-size: 17px;
  margin: 0 0 6px;
  border-bottom: none;
  padding-bottom: 0;
}

.contents ol { margin: 0; padding-left: 20px; }

/* ---------- footer ---------- */

.colophon-foot {
  border-top: 1px solid var(--accent);
  background: var(--bg);
  margin-top: 40px;
}

.colophon-foot .foot-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 34px;
  font-size: 15px;
}

.foot-address { font-style: normal; margin: 0 0 12px; }

.foot-address .foot-name {
  font-family: var(--display);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 18px;
  color: var(--accent);
  display: block;
}

.foot-address span { display: block; }

.foot-links { margin: 0 0 12px; }

.foot-links a { margin-right: 6px; }

.foot-notice, .foot-reviewed { margin: 0 0 10px; }

/* ---------- print ---------- */

@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .masthead, .pager, .print-button, .skip, .vine, .site-nav { display: none !important; }
  .leaf { border: none; background: #fff; max-width: 100%; margin: 0; padding: 0; }
  .leaf::before { display: none; }
  .checklist { border: 1px solid #000; break-inside: avoid; page-break-inside: avoid; }
  ul.boxes li::before { border: 1px solid #000; }
  h2 { border-bottom: 1px solid #000; }
  .colophon-foot { border-top: 1px solid #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}
