body {
  font-family: Palatino, Georgia, serif;
}
.frontmatter, .chapter {
  min-height: calc(100vh - 1em);
}
/* the cover: a tint of the accent color fading to white, text centered */
.frontmatter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2em 1.5em 12vh;
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent) 14%, #fff), #fff 75%);
  .title h1 {
    font-size: clamp(2em, 7vw, 3em);
    line-height: 1.2;
    /* the same underline as in the chapter numbers */
    &::after {
      content: "";
      display: block;
      width: 3em;
      margin: .6em auto 0;
      border-bottom: 4px solid var(--accent);
    }
  }
  .author h2 {
    letter-spacing: .08em;
  }
}
@media (min-width: 79.002em) {
  body:not(.pagesjs) .chapter-toc {
    display: none;
  }
}
.chapter-toc {
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 1em;
  margin-bottom: 2em;
}
.chapter {
  [id^="chp:"] > .main-number {
    &::before { content: "Chapter "; }
    &::after { content: none; }
  }
  h1 {
    margin: 1em auto 3em;
    &:has(+ .epigraph) { margin-bottom: 2em; }
    /* parts and normal chapter titles */
    &:not(.part) {
      border-bottom: 1px solid;
      .section-number {
        display: inline-block;
        border-bottom: 4px solid;
        margin-bottom: -4px;
      }
    }
    &.part {
      text-align: center;
      text-transform: uppercase;
      .section-number {
        display: block;
        &::before { content: "Part "; }
      }
    }
  }
}
article h2 { border-bottom-style: dashed; }
/* part titles stand out in the TOC, separated from the items above */
#TOC li:has(> a[href^="#prt:"]) {
  font-weight: bold;
  &:not(:first-child) { margin-top: 1em; }
}
.cross-ref-prt::before { content: "Part "; }

.pagesjs .pagesjs-page.page-front:first-child {
  padding: 0;
  .pagesjs-header, .pagesjs-footer {
    display: none;
  }
  .pagesjs-front {
    margin: 0;
    padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);
    height: 100%;
  }
}
