:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --ink: #142923;
  --deep: #101d1c;
  --muted: #4c5c51;
  --line: #b5b9a8;
  --amber: #eeb460;
  --ochre: #78501c;
  --serif: Georgia, serif;
  --mono: "Courier New", monospace;
  --gutter: clamp(1.125rem, 5vw, 5.5rem);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 Arial, sans-serif;
}

a {
  color: inherit;
  text-underline-offset: .24em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: .25rem;
}

.page {
  width: min(calc(100% - 2 * var(--gutter)), 81rem);
  margin-inline: auto;
}

.skip {
  position: absolute;
  top: .5rem;
  left: var(--gutter);
  z-index: 2;
  padding: .65rem .85rem;
  transform: translateY(calc(-100% - 1rem));
  background: var(--paper);
}

.skip:focus {
  transform: none;
}

.site-head, .site-foot {
  background: var(--deep);
  color: var(--paper);
}

.site-head-inner, .site-foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.7rem;
}

.wordmark {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  flex: none;
}

.wordmark img {
  display: block;
  width: clamp(5rem, 7vw, 7.3rem);
  height: auto;
  filter: brightness(1.6);
}

.panorama, .site-foot a:not(.wordmark) {
  display: grid;
  align-items: center;
  min-height: 2.75rem;
  font-size: .95rem;
}

.reader-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, .5fr);
  align-items: end;
  gap: 2.5rem;
  padding-block: clamp(3.25rem, 8vw, 7rem) clamp(2.75rem, 6.5vw, 5.5rem);
  border-bottom: 1px solid var(--ink);
}

.caption {
  margin: 0 0 .95rem;
  color: var(--ochre);
  font: 700 .875rem/1.25 var(--mono);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.reader-intro h1 {
  margin: 0;
  font: 400 clamp(3.5rem, 7.9vw, 7.9rem)/.95 var(--serif);
  letter-spacing: -.0625em;
}

.reader-deck {
  max-width: 24rem;
  padding: .5rem 0 .25rem 1.4rem;
  border-left: 3px solid var(--amber);
}

.reader-deck p:first-child {
  margin: 0 0 1.25rem;
  color: var(--ink);
  font: 400 clamp(1.25rem, 1.95vw, 1.65rem)/1.3 var(--serif);
}

.reader-deck .caption {
  margin: 0;
}

.reading-grid {
  display: grid;
  grid-template-columns: minmax(13rem, .75fr) minmax(0, 2.6fr);
  align-items: start;
  gap: clamp(1.8rem, 5.6vw, 5.5rem);
  padding: clamp(2.25rem, 5vw, 4.25rem) 0 5rem;
}

.reading-index {
  position: sticky;
  top: 2rem;
  max-height: calc(100dvh - 4rem);
  overflow: auto;
  padding: .4rem 1rem .4rem .3rem;
  border-right: 1px solid var(--line);
}

.reading-index ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

.reading-index a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding-block: .25rem;
  font-size: .95rem;
  line-height: 1.25;
  text-decoration-color: var(--line);
}

.reading-index a:hover {
  text-decoration-color: currentColor;
}

.reading-index a:focus-visible {
  outline-offset: -.12rem;
}

.reading {
  max-width: 46rem;
}

.chapter {
  --chapter-start: 0rem;
  position: relative;
  scroll-margin-top: 1.35rem;
}

.chapter:target::before {
  content: "";
  position: absolute;
  inset-block-start: calc(var(--chapter-start) + .14rem);
  inset-inline-start: -.72rem;
  inline-size: 2px;
  block-size: 2.6rem;
  background-color: var(--ochre);
}

.chapter + .chapter {
  --chapter-start: clamp(2.3rem, 4.65vw, 4.25rem);
  margin-top: clamp(2.85rem, 6vw, 5.5rem);
  padding-top: var(--chapter-start);
  border-top: 1px solid var(--line);
}

.chapter > p:not(.caption) {
  max-width: 64ch;
}

.chapter h2, .chapter h3 {
  margin: 0 0 1.35rem;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.05;
  text-wrap: pretty;
}

.chapter h2 {
  font-size: clamp(2.1rem, 4.3vw, 4.25rem);
  letter-spacing: -.045em;
}

.chapter h3 {
  margin-top: 2rem;
  margin-bottom: .7rem;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.chapter p, .method dd {
  margin: 0 0 1.1em;
  font-size: clamp(1rem, 1.75vw, 1.125rem);
  line-height: 1.62;
}

.chapter .caption {
  margin-bottom: .85rem;
  font: 700 .875rem/1.25 var(--mono);
}

.chapter .loop {
  margin: 1.5rem 0 .35rem;
  font: 400 clamp(1.1rem, 1.85vw, 1.5rem)/1.32 var(--serif);
}

.chapter .signature {
  color: var(--muted);
  font-size: .95rem;
}

.chapter-link {
  display: table;
  align-content: center;
  min-height: 2.75rem;
  padding-block: .45rem;
  color: var(--ochre);
  font-weight: 700;
  font-size: .95rem;
}

.method {
  margin: 1.75rem 0 1rem;
}

.method > div {
  display: grid;
  grid-template-columns: minmax(8.5rem, 1fr) minmax(0, 2.7fr);
  gap: .4rem 1.25rem;
  padding-block: .9rem;
  border-top: 1px solid var(--line);
}

.method dt {
  font: 400 1.25rem/1.4 var(--serif);
}

.method dd {
  margin: 0;
}

.chapter .pull {
  max-width: 28ch;
  padding-left: 1rem;
  border-left: 3px solid var(--amber);
  font: italic 400 clamp(1.25rem, 2.7vw, 1.72rem)/1.3 var(--serif);
}

.comparison {
  margin: 1.8rem 0;
  padding-block: 1rem;
  border-block: 1px solid var(--line);
}

.comparison dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.comparison dl div + div {
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.comparison dd {
  margin: 0;
  font: 400 clamp(1.8rem, 4.6vw, 3.25rem)/1.3 var(--serif);
}

.comparison figcaption {
  margin-top: .75rem;
  color: var(--muted);
  font-size: .875rem;
}

.conversation {
  display: table;
  margin-bottom: .5rem;
  padding: .7rem 1.15rem;
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

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

@media (max-width: 49rem) {
  .reader-intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
  }

  .reading-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.65rem;
  }

  .reading-index {
    position: static;
    max-height: none;
    padding: 0 0 1.1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reading-index ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.25rem;
  }
}

@media (max-width: 28rem) {
  .reader-intro h1 {
    font-size: clamp(2.9rem, 11vw, 3.5rem);
  }

  .method > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .site-head, .site-foot, .reading-index, .chapter-link, .conversation, .skip {
    display: none;
  }

  .page, .reading {
    width: 100%;
    max-width: none;
  }

  .reading-grid {
    display: block;
  }

  .chapter h2, .chapter h3 {
    break-after: avoid;
  }
}
