:root {
  color-scheme: light;
  --ivory: #f7f4ec;
  --olive: #59613f;
  --sand: #ddd2bf;
  --ink: #292c25;
  --muted: #625f52;
  --paper: #fffdf7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 1rem/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-wrap: anywhere;
}
a { color: var(--olive); text-underline-offset: .2em; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.wrap { width: min(calc(100% - 2.5rem), 72rem); margin-inline: auto; }
.masthead, .hero { background: var(--olive); color: var(--ivory); }
.masthead .wrap {
  display: flex;
  min-height: 4rem;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.masthead a { color: inherit; }
.wordmark { font-size: 1.9rem; line-height: 1; font-weight: 750; letter-spacing: -.055em; text-decoration: none; }
.back { min-height: 2.75rem; display: inline-flex; align-items: center; }
.hero { padding-block: clamp(1.9rem, 5vw, 4rem) clamp(3rem, 8vw, 6rem); }
.hero h1, .chapter h1 { margin: 0; font-size: clamp(1.8rem, 4.5vw, 3.35rem); line-height: 1.24; font-weight: 650; }
.hero p { margin: .5rem 0 0; }
.hero .tagline { font-size: clamp(1.05rem, 2vw, 1.3rem); }
.hero .subheading { margin-bottom: .85rem; }
.contents { padding-block: clamp(2rem, 6vw, 3.4rem); }
.contents h2, footer h2, .notes-title { margin: 0 0 1rem; font-size: 1.35rem; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; padding: 0; margin: 0; list-style: none; }
.chapter-grid a {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: .28rem;
  height: 100%;
  min-height: 9.25rem;
  padding: 1.15rem;
  background: var(--paper);
  border: 1px solid var(--sand);
  border-radius: .65rem;
  text-decoration: none;
}
.chapter-grid a:hover, .chapter-grid a:focus-visible { border-color: var(--olive); }
.chapter-grid strong { color: var(--ink); line-height: 1.45; }
.chapter-grid small { color: var(--muted); font-size: .88rem; line-height: 1.6; }
.chapter-index { color: var(--olive); font-variant-numeric: tabular-nums; font-size: .85rem; }
.chapter { padding-block: clamp(1.8rem, 5vw, 3.1rem); }
.chapter-heading { margin-bottom: 1.45rem; }
.chapter-heading .chapter-index { margin: 0 0 .45rem; }
.lead { margin: .55rem 0 0; color: var(--olive); font-size: 1.12rem; }
.design { margin: 0 auto; }
.design.portrait { max-width: 49rem; }
.design a { display: block; }
.design img { display: block; width: 100%; height: auto; border-radius: .7rem; background: var(--paper); }
.design figcaption { margin-top: .4rem; font-size: .9rem; text-align: right; }
.notes-title { margin-top: 1.8rem; }
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1.8rem; }
.notes p { margin: 0; }
.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem 1.5rem; margin-top: 2.25rem; border-top: 1px solid var(--sand); padding-top: .7rem; }
.pagination a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.pagination .next { margin-left: auto; }
footer { padding-block: 1.4rem 1.75rem; background: var(--sand); }
footer p { max-width: 55rem; margin: .4rem 0; }
@media (max-width: 52rem) {
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 36rem) {
  .wrap { width: calc(100% - 2rem); }
  .chapter-grid, .notes { grid-template-columns: 1fr; }
  .chapter-grid a { min-height: 0; }
}
