:root {
  --paper: #f8f5ee;
  --surface: #fffdf8;
  --ink: #1f1d1a;
  --heading: #171512;
  --muted: #6b655d;
  --rule: #ddd5c7;
  --rule-strong: #c9bba3;
  --link: #7d3f22;
  --link-strong: #5f2c13;
  --code-bg: #f1ece2;
  --page-width: 60rem;
  --text-width: 53rem;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
}

body > header {
  width: min(100%, var(--page-width));
  margin-inline: auto;
}

body > main {
  width: min(100%, var(--text-width));
  margin-right: auto;
  margin-left: max(0px, calc((100% - var(--page-width)) / 2));
}

body > header {
  padding-top: 2.5rem;
  margin-bottom: 1.5rem;
}

body > nav[aria-label="Page navigation"] {
  width: min(100%, var(--text-width));
  margin-right: auto;
  margin-left: max(0px, calc((100% - var(--page-width)) / 2));
}

body > main {
  padding: 1.75rem 1.5rem 2rem;
  border: 1px solid var(--rule);
  border-radius: 0.8rem;
  background: var(--surface);
}

.page-art {
  float: right;
  margin: 0.2rem 0 0.75rem 1rem;
}

.index-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
  gap: 1.15rem 1.8rem;
  align-items: start;
  margin-bottom: 1.2rem;
}

.index-intro__copy {
  min-width: 0;
}

.index-intro .page-art {
  grid-column: 2;
  grid-row: 1;
  float: none;
  margin: 45px 0 0;
  justify-self: end;
}

.page-art--circle {
  width: min(17.04rem, 56.13vw);
  aspect-ratio: 1;
  padding: 0.4rem;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 20px rgba(31, 29, 26, 0.06);
}

.page-art img {
  display: block;
  width: 100%;
  height: 100%;
}

.page-art--circle img {
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
}

.page-art--index img {
  transform: scale(1);
  transform-origin: center center;
  object-position: center center;
}

hr {
  clear: both;
}

@media (max-width: 720px) {
  body > main {
    padding: 1.2rem 1rem 1.5rem;
  }

  .index-intro {
    display: block;
  }

  .index-intro .page-art {
    width: min(15rem, calc(100% - 0.5rem));
    margin: 0 auto 0.9rem;
    justify-self: center;
  }

  .page-art {
    float: none;
    width: min(15rem, calc(100% - 0.5rem));
    margin: 0 auto 0.9rem;
  }

  .page-art--circle {
    padding: 0.28rem;
    box-shadow: 0 6px 14px rgba(31, 29, 26, 0.05);
  }
}

body > header p {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 0.92rem;
}

body > header > p:first-of-type {
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

body > header p.section-label,
body > header p.chapter-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body > header p.section-label {
  margin-bottom: 0.3rem;
  color: var(--link);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

body > header p.chapter-label {
  font-size: 0.76rem;
}

body > header p.edition-label {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
dt {
  color: var(--heading);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.6rem, 3.2vw, 2.48rem);
  line-height: 1.05;
  text-wrap: balance;
}

h2 {
  margin: 3rem 0 1rem;
  font-size: 1.5rem;
  line-height: 1.15;
}

h3 {
  margin: 2rem 0 0.75rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

p,
li,
dd {
  font-size: 1.05rem;
  line-height: 1.75;
}

p,
ul,
ol,
dl,
pre,
blockquote,
hr {
  margin: 0 0 1.2rem;
}

ul,
ol {
  padding-left: 1.35rem;
}

li + li {
  margin-top: 0.45rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--link-strong);
}

body > header a {
  color: inherit;
  text-decoration: none;
}

body > header a:hover {
  text-decoration: underline;
}

code {
  padding: 0.08em 0.33em;
  border: 1px solid var(--rule);
  border-radius: 0.28rem;
  background: var(--code-bg);
  font-family: "SFMono-Regular", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
}

pre {
  overflow: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 0.55rem;
  background: var(--surface);
}

pre code {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
}

dl {
  margin-top: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--rule-strong);
}

dt {
  margin-bottom: 0.35rem;
  font-size: 0.94rem;
  font-weight: 700;
}

dd {
  margin-left: 0;
  color: var(--muted);
}

body > nav[aria-label="Page navigation"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.15rem;
  align-items: baseline;
  padding: 0.95rem 1.2rem;
  margin-bottom: 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.45rem;
  background: rgba(255, 253, 248, 0.72);
}

body > nav[aria-label="Page navigation"] p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: nowrap;
}

body > nav[aria-label="Page navigation"] + main {
  padding-top: 1.5rem;
}

.site-tools {
  width: min(100%, var(--text-width));
  margin-right: auto;
  margin-bottom: 1rem;
  margin-left: max(0px, calc((100% - var(--page-width)) / 2));
}

.site-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: center;
  justify-content: flex-end;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  background: rgba(255, 253, 248, 0.72);
}

.site-search__label,
.search-result__eyebrow {
  color: var(--muted);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.site-search__input {
  min-width: min(100%, 17rem);
  flex: 1 1 18rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.site-search__button {
  padding: 0.72rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--link);
  color: white;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.site-search__button:hover {
  background: var(--link-strong);
}

.site-search__input:focus {
  outline: 2px solid rgba(125, 63, 34, 0.24);
  outline-offset: 2px;
}

main + nav[aria-label="Page navigation"] {
  margin-top: 2rem;
}

body > footer {
  width: min(100%, var(--page-width));
  margin: 2.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

body > footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

main > nav {
  padding-top: 0.25rem;
}

main > nav[aria-label="Book contents"] section + section {
  margin-top: 2rem;
}

main > nav[aria-label="Book contents"] section > p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

main > nav[aria-label="Book contents"] section ol,
main > nav[aria-label="Book contents"] section ul {
  margin-bottom: 0;
}

main > nav li {
  margin-bottom: 0.45rem;
}

main > nav li a {
  color: var(--heading);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-weight: 600;
  text-decoration: none;
}

main > nav li a:hover {
  color: var(--link-strong);
  text-decoration: underline;
}

.glossary-nav ul {
  columns: 2;
  column-gap: 2rem;
}

.glossary-nav li {
  break-inside: avoid;
}

.glossary dl {
  margin-top: 1rem;
  padding-left: 1rem;
}

.glossary dd {
  color: var(--ink);
}

.glossary dd p {
  margin-bottom: 0.55rem;
}

.glossary dd p:last-child {
  margin-bottom: 0;
}

.glossary strong {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 0.94rem;
}

.section-intro {
  margin-bottom: 1.5rem;
  padding: 0.95rem 1rem;
  border-left: 3px solid var(--rule-strong);
  background: rgba(255, 253, 248, 0.78);
}

.section-intro strong {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

.search-shell .site-search {
  justify-content: flex-start;
  margin-bottom: 1.25rem;
}

.search-summary {
  margin-bottom: 1rem;
  color: var(--muted);
}

.search-results {
  padding-left: 0;
  list-style: none;
}

.search-result {
  margin-bottom: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--rule);
  border-radius: 0.7rem;
  background: rgba(255, 253, 248, 0.7);
}

.search-result__eyebrow,
.search-result__context {
  margin: 0 0 0.4rem;
}

.search-result__title {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--heading);
}

.search-result__title a {
  color: var(--heading);
  text-decoration: none;
}

.search-result__title a:hover {
  color: var(--link-strong);
  text-decoration: underline;
}

.search-result__context,
.search-result__excerpt {
  margin-top: 0.55rem;
  margin-bottom: 0;
}

.search-result__context {
  color: var(--muted);
  font-size: 0.94rem;
}

main > hr {
  margin: 2.4rem 0 2rem;
}

main > hr + h2 {
  margin-top: 0;
}

@media (min-width: 60rem) {
  body {
    padding-inline: 2rem;
  }

  body > header {
    padding-top: 3rem;
  }

  body > main {
    padding: 2.35rem 2.5rem 2.75rem;
  }

  .glossary-nav ul {
    columns: 3;
  }
}

@media (max-width: 40rem) {
  .site-search {
    justify-content: stretch;
  }

  .site-search__label {
    width: 100%;
  }

  .site-search__input,
  .site-search__button {
    width: 100%;
  }

  body > nav[aria-label="Page navigation"] p {
    white-space: normal;
  }
}
