:root {
  --paper: #faf6ee;
  --ink: #32291f;
  --ink-soft: #7a6a57;
  --ink-faint: #a4958275;
  --accent: #a6543a;
  --rule: #e6dcc9;
  --link: #7a4a2e;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 730px;
  margin: 0 auto;
  padding: 0 26px 90px;
}

/* ---------- masthead ---------- */

.masthead { padding-top: 68px; }

.masthead .kicker {
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.masthead h1 {
  font-size: 42px;
  line-height: 1.18;
  font-weight: 400;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.masthead p.lede {
  font-size: 20px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 8px;
  max-width: 60ch;
}

/* ---------- section headings ---------- */

h2.section {
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 74px 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

/* ---------- the shelf (index) ---------- */

ol.shelf {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  counter-reset: book;
}

ol.shelf li {
  counter-increment: book;
  padding: 26px 0 24px;
  border-bottom: 1px solid var(--rule);
}

ol.shelf li:first-child { padding-top: 8px; }

ol.shelf a.book {
  display: block;
  text-decoration: none;
  color: inherit;
}

ol.shelf .book-title {
  font-size: 26px;
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.15s ease;
}

ol.shelf .book-title::before {
  content: counter(book, spelling-word) " — ";
  color: var(--accent);
  font-style: italic;
}

ol.shelf a.book:hover .book-title { color: var(--accent); }

ol.shelf .book-desc {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 17.5px;
  max-width: 62ch;
}

ol.shelf .state {
  display: inline-block;
  margin-top: 10px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

ol.shelf .state.opened { color: var(--accent); }

/* ---------- chapter pages ---------- */

.back {
  display: inline-block;
  margin: 40px 0 0;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}

.back:hover { border-bottom-color: var(--link); }

.chapter-head { padding-top: 22px; }

.chapter-head .book-no {
  font-style: italic;
  color: var(--accent);
  font-size: 19px;
  margin: 0 0 6px;
}

.chapter-head h1 {
  font-size: 38px;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.chapter-head .sub {
  font-size: 19px;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0;
}

.chapter-body p { margin: 1.1em 0; max-width: 66ch; }

/* ---------- glossary ---------- */

dl.glossary { margin: 18px 0 0; }

dl.glossary div.term {
  padding: 17px 0 15px;
  border-bottom: 1px solid var(--rule);
}

dl.glossary dt {
  font-weight: 700;
  font-size: 18.5px;
  margin: 0;
}

dl.glossary dd {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 17.5px;
  max-width: 64ch;
}

/* ---------- fetched resources ---------- */

.feed { margin-top: 16px; }

.feed h3 {
  font-size: 21px;
  font-weight: 400;
  margin: 38px 0 4px;
}

.feed h3 .src {
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  vertical-align: 3px;
  margin-left: 10px;
}

.feed .hint { color: var(--ink-soft); font-style: italic; font-size: 16.5px; margin: 0 0 8px; }

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

ul.entries li {
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--rule);
  animation: fadein 0.5s ease both;
}

ul.entries a.title {
  color: var(--link);
  text-decoration: none;
  font-size: 18.5px;
  line-height: 1.45;
}

ul.entries a.title:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

ul.entries .blurb {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.6;
  max-width: 64ch;
}

ul.entries .meta {
  margin: 6px 0 0;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.status-line {
  font-style: italic;
  color: var(--ink-faint);
  padding: 12px 0;
}

.status-line.failed { color: var(--accent); }

@keyframes fadein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- margin notes ---------- */

.notes-intro { color: var(--ink-soft); font-size: 17px; max-width: 62ch; }

form.note-form { margin-top: 24px; max-width: 560px; }

form.note-form label {
  display: block;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2px;
}

form.note-form input,
form.note-form textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  font-family: Georgia, serif;
  font-size: 17.5px;
  color: var(--ink);
  padding: 6px 2px 8px;
  margin-bottom: 20px;
  outline: none;
  resize: vertical;
}

form.note-form input:focus,
form.note-form textarea:focus { border-bottom-color: var(--accent); }

form.note-form textarea { min-height: 74px; line-height: 1.6; }

button.text-button {
  border: none;
  background: none;
  font-family: Georgia, serif;
  font-size: 17.5px;
  font-style: italic;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid var(--accent);
}

button.text-button:hover { opacity: 0.75; }
button.text-button:disabled { color: var(--ink-faint); border-bottom-color: var(--ink-faint); cursor: default; }

ul.notes { list-style: none; margin: 34px 0 0; padding: 0; }

ul.notes li {
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--rule);
}

ul.notes .note-title { font-weight: 700; }
ul.notes .note-title a { color: var(--link); text-decoration: none; }
ul.notes .note-title a:hover { text-decoration: underline; }
ul.notes .note-body { margin: 5px 0 0; color: var(--ink-soft); font-size: 17px; max-width: 64ch; }

ul.notes .note-foot {
  margin-top: 7px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 12px;
  color: var(--ink-faint);
}

ul.notes button.remove {
  border: none;
  background: none;
  padding: 0;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 12px;
  color: var(--ink-faint);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 14px;
}

ul.notes button.remove:hover { color: var(--accent); }

/* ---------- updates corner ---------- */

.brief {
  margin: 30px 0 6px;
  font-size: 19.5px;
  line-height: 1.75;
  max-width: 66ch;
}

.brief .by {
  display: block;
  margin-top: 10px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

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

footer.coloophon {
  margin-top: 90px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--ink-faint);
  font-style: italic;
}

footer.coloophon a { color: var(--ink-faint); }

/* ---------- misc ---------- */

a.plain { color: var(--link); }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .masthead h1 { font-size: 32px; }
  .chapter-head h1 { font-size: 29px; }
  ol.shelf .book-title { font-size: 22.5px; }
}
