:root {
  --green: #2f6b3a;
  --green-dark: #1f4a28;
  --green-light: #e8f1e6;
  --leaf: #6a9a3b;
  --text: #000;
  --muted: #5d6b5f;
  --bg: #fbfcf8;
  --rule: #d5e2d0;
}
* { box-sizing: border-box; }
html { font-size: 112.5%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;
  line-height: 1.65;
}
a { color: var(--green); }
a:hover { color: var(--green-dark); }
header.site { background: var(--green); }
header.site a, footer.site a { color: #fff; }
header.site a:hover, footer.site a:hover { color: var(--green-light); }
header.site .inner, main, footer.site .inner {
  max-width: 40rem; margin: 0 auto; padding: 0 1.25rem;
}
header.site .inner {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: .5rem; padding-top: .8rem; padding-bottom: .8rem;
}
.site-name { font-size: 1.25rem; font-weight: bold; text-decoration: none; }
nav.main a {
  margin-left: 1rem; text-decoration: none; font-family: system-ui, sans-serif; font-size: .9rem;
}
main { padding-top: 1.5rem; padding-bottom: 3rem; }
h1, h2, h3 { color: var(--text); line-height: 1.25; }
h1 { font-size: 2rem; margin: .4rem 0 1rem; }
h2 { font-size: 1.4rem; margin-top: 2rem; }
.context, .pager, .revised {
  font-family: system-ui, sans-serif; font-size: .85rem; color: var(--muted);
}
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: .5rem 0; }
.pager.bottom { border-top: 1px solid var(--rule); padding-top: .8rem; margin-top: 2.5rem; }
.pager a { text-decoration: none; }
.revised { margin-top: 1.5rem; }
blockquote {
  margin: 1.2rem 0; padding: .4rem 1rem; border-left: 4px solid var(--leaf);
  background: var(--green-light);
}
sup { line-height: 0; }
/* home */
.home h1 { font-size: 2.6rem; margin-bottom: 0; }
.home .tagline { font-size: 1.4rem; font-style: italic; margin: .2rem 0 1.8rem; }
.lead {
  font-size: 1.25rem; border-left: 5px solid var(--green); padding-left: 1rem;
}
.buttons { margin-top: 2rem; }
.button {
  display: inline-block; background: var(--green); color: #fff; padding: .6rem 1.2rem;
  border-radius: 4px; text-decoration: none; font-family: system-ui, sans-serif; margin: 0 .5rem .5rem 0;
}
.button:hover { background: var(--green-dark); color: #fff; }
.button.secondary { background: #fff; color: var(--green); border: 2px solid var(--green); }
/* contents: chapter number and title on one line, numbers in a narrow column */
ol.toc, ul.sections { padding-left: 0; list-style: none; }
ol.toc li { margin: .25rem 0; display: flex; align-items: baseline; gap: .6rem; }
.toc .num { color: var(--muted); font-family: system-ui, sans-serif; font-size: .85rem; flex: 0 0 5.6rem; }
.note { color: var(--muted); font-style: italic; }
footer.site {
  background: var(--green); color: #fff;
  font-family: system-ui, sans-serif; font-size: .8rem; padding: 1rem 0 1.5rem;
}
@media (max-width: 30rem) {
  html { font-size: 100%; }
  .home h1 { font-size: 2rem; }
  nav.main a { margin-left: 0; margin-right: 1rem; }
  .toc .num { flex-basis: 5rem; }
}

/* footnote box, calculation tables, guessing game */
aside.footnote {
  margin-top: 2.5rem; padding: .8rem 1.2rem; border: 1px solid var(--rule);
  background: #fff; font-size: .92rem;
}
aside.footnote h3 { margin-top: .2rem; font-size: 1rem; }
table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: .95rem; }
th, td { border-bottom: 1px solid var(--rule); padding: .35rem .5rem; text-align: left; vertical-align: top; }
td.n, th.n { text-align: right; white-space: nowrap; }
th { background: var(--green-light); }
.calc { font-family: Consolas, "Courier New", monospace; background: var(--green-light); padding: .5rem .8rem; }
.guess { border: 2px solid var(--green); border-radius: 6px; padding: 1rem 1.2rem; margin: 1.5rem 0; background: #fff; }
.guess p.q { font-weight: bold; margin-top: 0; }
.guess button {
  display: block; width: 100%; text-align: left; margin: .35rem 0; padding: .5rem .8rem;
  font: inherit; font-size: .95rem; background: var(--bg); border: 1px solid var(--rule); border-radius: 4px; cursor: pointer;
}
.guess button:hover { border-color: var(--green); }
.guess button.chosen { background: var(--green-light); border-color: var(--green); }
.guess .reply { min-height: 1.6em; font-style: italic; margin: .6rem 0 0; }
figure.drawing { margin: 1.5rem 0; text-align: center; }
figure.drawing svg { width: 100%; max-width: 520px; height: auto; }
figure.drawing figcaption { font-size: .85rem; color: var(--muted); font-family: system-ui, sans-serif; }
ol.toc li.part { display: block; margin-top: 1.4rem; font-weight: bold; font-size: 1.1rem; border-bottom: 1px solid var(--rule); }
