@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --paper: #ffffff;
  --ground: #fbfbfb;
  --ink: #252421;
  --muted: #777570;
  --hairline: #e6e5e1;
  --blue: #294fc4;
  --serif: "EB Garamond", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --prose-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: 40px;
  min-height: 100vh;
}

.reading-shell {
  grid-column: 2 / span 3;
  width: min(100%, 736px);
  justify-self: center;
}

.chapter-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid rgba(35, 34, 31, 0.13);
  background: color-mix(in srgb, var(--ground) 93%, transparent);
  backdrop-filter: blur(14px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.desktop-crumbs,
.chapter-actions,
.mobile-title {
  display: flex;
  align-items: center;
}

.desktop-crumbs {
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
}

.desktop-crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.desktop-crumbs strong {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
}

.icon-link {
  display: grid;
  width: 15px;
  height: 20px;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 16px;
}

.chapter-actions {
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  place-items: center;
}

.icon-button:hover,
.icon-button[aria-expanded="true"] {
  background: #efeeea;
}

.icon-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.25;
}

.mobile-title,
.mobile-only {
  display: none;
}

.settings-popover {
  position: absolute;
  top: 60px;
  right: 0;
  width: 176px;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--paper);
  box-shadow: 0 14px 40px rgb(0 0 0 / 9%);
}

.settings-popover p,
.outline-panel p {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.settings-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.settings-row button {
  height: 34px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  cursor: pointer;
  font-family: var(--serif);
}

.settings-row button:nth-child(1) { font-size: 12px; }
.settings-row button:nth-child(2) { font-size: 15px; }
.settings-row button:nth-child(3) { font-size: 19px; }
.settings-row button.active { border-color: var(--ink); }

.outline-panel {
  position: fixed;
  z-index: 30;
  inset: 64px 0 auto;
  padding: 24px 30px 28px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 40px rgb(0 0 0 / 8%);
}

.outline-panel a {
  display: block;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
  font-size: 19px;
  text-decoration: none;
}

.chapter-page article {
  position: relative;
  display: grid;
  justify-items: center;
  margin-bottom: 120px;
  padding: 80px 64px;
  background: var(--paper);
  box-shadow: 0 1px 4px 1px rgb(0 0 0 / 5%), 0 1px 1px rgb(0 0 0 / 25%);
}

.article-heading {
  width: 100%;
  padding: 40px 0 4px;
  text-align: center;
}

.eyebrow,
.chapter-page figcaption,
.source-note,
.end-mark {
  font-family: var(--mono);
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.01em;
}

.eyebrow span {
  padding: 0 9px;
  color: #b2b1ad;
}

.chapter-page h1 {
  margin: 24px auto 0;
  font-size: clamp(46px, 5vw, 54px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.dek {
  max-width: 570px;
  margin: 18px auto 0;
  color: #484642;
  font-size: 16px;
  line-height: 1.25;
}

.divider {
  margin: 42px auto;
  color: #77746e;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: -0.15em;
  text-align: center;
}

.chapter-page figure {
  width: 100%;
  margin: 58px 0 62px;
}

.chapter-page figure img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-figure {
  margin: 18px 0 66px;
}

.chapter-page figcaption {
  margin-top: 13px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-align: center;
}

.prose {
  width: min(100%, 576px);
  font-size: var(--prose-size);
  line-height: 1.58;
}

.prose p {
  margin: 0 0 24px;
}

.prose h2,
.prose h3 {
  scroll-margin-top: 100px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prose h2 {
  margin: 86px 0 28px;
}

.prose h3 {
  margin: 72px 0 28px;
}

.term {
  position: relative;
  text-decoration: underline;
  text-decoration-color: #aaa8a2;
  text-underline-offset: 3px;
}

.term::after {
  position: absolute;
  z-index: 3;
  bottom: calc(100% + 9px);
  left: 50%;
  width: max-content;
  max-width: 210px;
  padding: 7px 9px;
  border: 1px solid #333;
  background: var(--paper);
  content: attr(data-definition);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  transform: translate(-50%, 4px);
  transition: 120ms ease;
}

.term:hover::after,
.term:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.signal-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 44px 0 34px;
  padding: 30px 24px;
  border-block: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.65;
  text-align: center;
}

.signal-diagram > span {
  min-width: 90px;
  padding: 12px;
  border: 1px solid #bbb9b3;
}

.signal-diagram i {
  color: var(--muted);
  font-style: normal;
}

.signal-diagram b,
.pixel-grid {
  color: var(--blue);
  font-weight: 400;
}

.comparison {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 48px 0 24px;
  border: 1px solid var(--hairline);
}

.comparison > div {
  padding: 24px;
}

.comparison > div + div {
  border-left: 1px solid var(--hairline);
}

.comparison span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.comparison strong {
  font-size: 28px;
  font-weight: 400;
}

.comparison p {
  margin: 12px 0 0;
  color: #5e5b56;
  font-size: 13px;
  line-height: 1.45;
}

table {
  width: 100%;
  margin: 54px 0 20px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 11px 12px;
  border: 1px solid var(--hairline);
  text-align: left;
}

thead th {
  background: #f7f6f3;
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

tbody th {
  width: 30%;
  font-weight: 600;
}

.ending {
  padding-top: 12px;
}

.glossary {
  margin-top: 80px;
}

.glossary p {
  padding-left: 24px;
  font-size: 14px;
  text-indent: -24px;
}

.glossary sup {
  display: inline-block;
  width: 20px;
  font-family: var(--mono);
  font-size: 8px;
}

.end-mark {
  margin: 86px 0 48px;
  font-size: 9px;
  text-align: center;
}

.source-note {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
  text-align: center;
}

.progress-ruler {
  position: fixed;
  z-index: 15;
  top: 70px;
  right: 30px;
  display: grid;
  width: 54px;
  justify-items: end;
  font-family: var(--mono);
}

.progress-ruler output {
  position: relative;
  padding-right: 22px;
  color: var(--blue);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.progress-ruler output::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 15px;
  height: 1px;
  background: var(--blue);
  content: "";
}

.ticks {
  width: 16px;
  height: min(72vh, 590px);
  margin-top: 12px;
  background: repeating-linear-gradient(to bottom, transparent 0 9px, #c8c7c2 9px 10px);
}

.ticks::after {
  display: block;
  width: 16px;
  height: 100%;
  background: repeating-linear-gradient(to bottom, transparent 0 69px, #34332f 69px 70px);
  content: "";
}

body[data-size="compact"] { --prose-size: 15px; }
body[data-size="large"] { --prose-size: 18px; }

@media (max-width: 1040px) {
  .page-grid { display: block; }
  .reading-shell { width: min(736px, calc(100% - 64px)); margin: 0 auto; }
  .progress-ruler { right: 14px; }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 68px; }

  .reading-shell {
    width: 100%;
  }

  .chapter-bar {
    min-height: 64px;
    padding: 0 24px 0 30px;
  }

  .desktop-crumbs,
  .progress-ruler {
    display: none;
  }

  .mobile-title,
  .mobile-only {
    display: flex;
  }

  .mobile-title {
    min-width: 0;
    gap: 12px;
  }

  .mobile-title strong {
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .book-icon {
    width: 13px;
    height: 15px;
    border: 1px solid #6e6c68;
    border-radius: 2px;
    box-shadow: inset 3px 0 #ecebe7;
  }

  .settings-popover {
    top: 54px;
    right: 18px;
  }

  .chapter-page article {
    margin-bottom: 0;
    padding: 32px 15px 72px;
    box-shadow: none;
  }

  .article-heading {
    padding: 38px 15px 4px;
  }

  .chapter-page h1 {
    max-width: 330px;
    font-size: 40px;
    line-height: 0.98;
  }

  .dek {
    max-width: 320px;
    font-size: 15px;
    line-height: 1.28;
  }

  .hero-figure {
    margin: 18px -15px 10px;
    width: calc(100% + 30px);
    padding: 4px 0;
    border-block: 1px solid var(--hairline);
  }

  .chapter-page figure {
    margin: 46px -15px 50px;
    width: calc(100% + 30px);
  }

  .chapter-page figcaption {
    padding: 0 15px;
  }

  .prose {
    padding-inline: 15px;
    font-size: var(--prose-size);
    line-height: 1.56;
  }

  .prose h2 { margin-top: 72px; }
  .prose h3 { margin-top: 64px; }
  .divider { margin-block: 38px; }

  .signal-diagram {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: calc(100% + 30px);
    margin-inline: -15px;
  }

  .signal-diagram i {
    rotate: 90deg;
  }

  .comparison {
    grid-template-columns: 1fr;
  }

  .comparison > div + div {
    border-top: 1px solid var(--hairline);
    border-left: 0;
  }

  table {
    font-size: 12px;
  }

  th,
  td {
    padding: 9px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* Collection and supporting pages */

.collection-page {
  min-height: 100vh;
  color: var(--ink);
  background: var(--ground);
  font-family: var(--serif);
}

.collection-page h1,
.collection-page h2,
.collection-page h3,
.collection-page p {
  margin-top: 0;
}

.site-nav {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 112px;
  padding: 0 40px;
}

.site-brand {
  color: #264ac2;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 1px 0 0 rgb(38 74 194 / 18%);
}

.site-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-links a {
  font-size: 17px;
  text-decoration: none;
  text-underline-offset: 5px;
}

.site-links a:hover,
.site-links a[aria-current="page"] {
  text-decoration: underline;
}

.site-menu-button {
  display: none;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 17px;
  cursor: pointer;
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin: 120px 40px 0;
  padding: 30px 0 46px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.6;
  text-transform: uppercase;
}

.site-footer > a {
  color: var(--blue);
  text-decoration: none;
}

.site-footer p {
  max-width: 520px;
  margin: 0;
  text-align: right;
}

.kicker {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-link span {
  color: var(--blue);
  font-size: 16px;
}

.home-hero {
  min-height: 620px;
  padding: 92px 8vw 70px;
  text-align: center;
}

.home-hero h1 {
  margin: 28px auto 32px;
  font-size: clamp(82px, 13vw, 182px);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.72;
}

.home-dek {
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 21px;
  line-height: 1.35;
}

.home-artifacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
}

.home-artifacts figure {
  position: relative;
  margin: 0;
  padding: 28px;
  border: 1px solid var(--hairline);
  background: var(--paper);
}

.home-artifacts figure > span,
.home-artifacts figcaption {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.home-artifacts img {
  display: block;
  width: min(100%, 260px);
  margin: 22px auto;
  mix-blend-mode: multiply;
}

.home-artifacts figcaption {
  text-align: right;
}

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 80px;
  max-width: 980px;
  margin: 160px auto;
  padding: 0 40px;
}

.home-intro h2 {
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}

.home-intro p {
  font-size: 18px;
  line-height: 1.55;
}

.home-index,
.toc-list {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 0 40px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}

.section-heading h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 400;
}

.section-heading span,
.section-heading button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.toc-hero {
  display: grid;
  min-height: 410px;
  padding: 62px 40px 72px;
  place-items: start center;
}

.toc-hero h1 {
  align-self: end;
  margin: 0;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.view-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.view-switcher button {
  padding: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.view-switcher button.active {
  color: var(--blue);
}

.book-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  align-self: end;
  gap: 7px 90px;
  width: min(100%, 650px);
  margin: 52px auto 0;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.book-stats div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.book-stats dt {
  color: #989690;
}

.book-stats dd {
  margin: 0;
  color: #353430;
}

.toc-group {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.7fr);
  gap: 64px;
  padding: 74px 0 110px;
  border-top: 1px solid var(--hairline);
}

.toc-group:first-child {
  border-top: 0;
}

.toc-group-copy {
  padding-top: 7px;
}

.toc-group-copy h2 {
  margin-bottom: 26px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.toc-group-copy h2::first-line {
  color: var(--group-accent);
}

.toc-group-copy p {
  max-width: 520px;
  font-size: 17px;
  line-height: 1.55;
}

.chapter-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  align-content: start;
}

.chapter-card {
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.chapter-card-image {
  overflow: hidden;
  border: 1px solid #d9d8d3;
  background: #fff;
  box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
}

.chapter-card-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 220ms ease;
}

.chapter-card:hover .chapter-card-image img {
  transform: scale(1.018);
}

.chapter-card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 11px;
}

.chapter-card-meta h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
}

.chapter-card-meta p {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  text-transform: uppercase;
}

.chapter-card-planned .chapter-card-image {
  filter: grayscale(0.8);
  opacity: 0.6;
}

.toc-list[data-layout="grid"] .toc-group {
  display: block;
}

.toc-list[data-layout="grid"] .toc-group-copy {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  margin-bottom: 42px;
}

.toc-list[data-layout="grid"] .chapter-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-index .toc-group {
  grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1.8fr);
  padding-block: 54px;
}

.home-index .chapter-cards {
  display: block;
  border-top: 1px solid var(--hairline);
}

.home-index .chapter-card-compact {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}

.home-index .chapter-card-image {
  display: none;
}

.home-index .chapter-card-meta {
  display: contents;
}

.home-index .chapter-card-meta h3 {
  font-size: 15px;
  font-weight: 400;
}

.reference-shell,
.course-shell,
.profile-shell {
  width: min(100% - 80px, 1100px);
  margin: 0 auto;
}

.reference-heading {
  max-width: 710px;
  padding: 110px 0 100px;
}

.reference-heading h1,
.course-shell > header h1,
.profile-shell > header h1,
.not-found h1 {
  margin: 18px 0 26px;
  font-size: clamp(56px, 8vw, 108px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.86;
}

.reference-heading > p:last-child,
.course-shell > header > p,
.profile-shell > header > p {
  max-width: 620px;
  font-size: 19px;
  line-height: 1.5;
}

.glossary-tools {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-block: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--ground) 95%, transparent);
  backdrop-filter: blur(12px);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.glossary-tools input {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid #aaa8a2;
  border-radius: 0;
  outline: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 17px;
}

.glossary-tools nav {
  display: flex;
  gap: 8px;
}

.glossary-tools nav a {
  color: var(--muted);
  text-decoration: none;
}

.glossary-list section {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 0 40px;
  padding: 68px 0;
  border-bottom: 1px solid var(--hairline);
}

.glossary-list h2 {
  grid-row: 1 / span 20;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 400;
}

.glossary-list article {
  padding: 0 0 26px;
}

.glossary-list article[hidden] {
  display: none;
}

.glossary-list h3 {
  margin: 0 0 7px;
  font-size: 17px;
  font-weight: 600;
}

.glossary-list p {
  margin: 0;
  color: #5e5b56;
  font-size: 14px;
  line-height: 1.45;
}

.resource-filters {
  display: flex;
  gap: 8px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--hairline);
}

.resource-filters button {
  padding: 7px 12px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: transparent;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  cursor: pointer;
}

.resource-filters button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.resource-list article {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 42px;
  padding: 46px 0;
  border-bottom: 1px solid var(--hairline);
}

.resource-list article[hidden] {
  display: none;
}

.resource-list img {
  display: block;
  width: 100%;
  border: 1px solid var(--hairline);
}

.resource-type,
.resource-author {
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.resource-type {
  color: var(--blue);
}

.resource-list h2 {
  max-width: 620px;
  margin: 10px 0 8px;
  font-size: 31px;
  font-weight: 400;
  line-height: 1;
}

.resource-list h2 a {
  text-decoration: none;
}

.resource-list article > div > p:last-child {
  max-width: 560px;
  font-size: 16px;
  line-height: 1.45;
}

.course-shell {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 90px;
  padding-top: 80px;
}

.course-shell > header {
  padding-top: 62px;
}

.course-shell > header h1 {
  font-size: clamp(64px, 8vw, 112px);
}

.course-preview {
  position: relative;
  padding: 42px;
  border: 1px solid var(--hairline);
  background: var(--paper);
}

.course-preview img {
  display: block;
  width: 100%;
}

.course-preview span {
  position: absolute;
  right: 18px;
  bottom: 18px;
  font-family: var(--mono);
  font-size: 8px;
}

.lesson-list {
  grid-column: 1 / -1;
  margin-top: 100px;
}

.lesson-list article {
  display: grid;
  grid-template-columns: 60px 145px 1fr;
  gap: 34px;
  align-items: start;
  padding: 38px 0;
  border-top: 1px solid var(--hairline);
}

.lesson-list article > span,
.lesson-list article > div > p:first-child {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.lesson-list img {
  display: block;
  width: 100%;
  border: 1px solid var(--hairline);
}

.lesson-list h2 {
  margin: 8px 0 12px;
  font-size: 28px;
  font-weight: 400;
}

.lesson-list article > div > p:last-child {
  max-width: 520px;
  line-height: 1.5;
}

.profile-shell {
  padding-top: 100px;
}

.profile-shell > header {
  max-width: 760px;
}

.profile-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 80px 0 100px;
  border: 1px solid var(--hairline);
}

.profile-card > div {
  padding: 38px;
  text-align: center;
}

.profile-card > div + div {
  border-left: 1px solid var(--hairline);
}

.profile-card span {
  display: block;
  font-size: 62px;
  line-height: 1;
}

.profile-card small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.profile-chapters {
  columns: 2;
  column-gap: 40px;
  margin-top: 25px;
}

.profile-chapters a {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  break-inside: avoid;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
}

.profile-chapters i {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border: 1px solid #aaa8a2;
  border-radius: 50%;
}

.profile-chapters a.visited i {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: inset 0 0 0 2px var(--ground);
}

.profile-chapters small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  text-transform: uppercase;
}

.not-found {
  display: grid;
  min-height: calc(100vh - 112px);
  padding: 40px;
  place-content: center;
  text-align: center;
}

.not-found h1 {
  max-width: 760px;
}

/* Generated chapters */

.generic-article .article-heading {
  padding-top: 50px;
}

.chapter-cover {
  margin-block: 22px 84px;
}

.chapter-page .chapter-cover img {
  width: min(100%, 360px);
  margin: 0 auto;
  border: 1px solid var(--hairline);
  box-shadow: 0 14px 45px rgb(0 0 0 / 5%);
}

.planned-note {
  margin: 0 0 42px;
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  background: #f9f8f5;
}

.planned-note span {
  color: var(--group-accent);
  font-family: var(--mono);
  font-size: 8px;
}

.planned-note p {
  margin: 8px 0 0;
  font-size: 14px;
}

.concept-flow {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 48px 0 4px;
  padding: 32px 16px;
  border-block: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.concept-flow span {
  padding: 10px 12px;
  border: 1px solid #bbb9b3;
  background: #fff;
}

.concept-flow i {
  color: var(--group-accent);
  font-style: normal;
}

.chapter-end {
  width: min(100%, 576px);
  margin-top: 70px;
}

.next-chapter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 30px;
  padding: 22px 0;
  border-block: 1px solid var(--hairline);
  text-decoration: none;
}

.next-chapter span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.next-chapter strong {
  font-size: 21px;
  font-weight: 400;
}

.next-chapter i {
  color: var(--group-accent);
  font-style: normal;
}

.chapter-end .source-note {
  margin: 40px auto 0;
}

@media (max-width: 960px) {
  .site-links { gap: 18px; }
  .site-links a { font-size: 15px; }
  .toc-group { grid-template-columns: 1fr; gap: 32px; }
  .toc-list[data-layout="grid"] .chapter-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-index .toc-group { grid-template-columns: 1fr; gap: 24px; }
  .course-shell { grid-template-columns: 1fr; }
  .course-preview { max-width: 560px; }
}

@media (max-width: 680px) {
  .site-nav {
    min-height: 76px;
    padding: 0 16px;
  }

  .site-brand { font-size: 14px; }
  .site-menu-button { display: block; }

  .site-links {
    position: absolute;
    top: 64px;
    right: 12px;
    display: none;
    width: 210px;
    padding: 8px 16px;
    border: 1px solid var(--hairline);
    background: rgb(255 255 255 / 98%);
    box-shadow: 0 15px 40px rgb(0 0 0 / 8%);
  }

  .site-links.open { display: block; }
  .site-links a { display: block; padding: 10px 0; }

  .site-footer {
    display: block;
    margin: 80px 16px 0;
  }

  .site-footer p { margin-top: 20px; text-align: left; }

  .home-hero {
    min-height: 520px;
    padding: 94px 18px 40px;
  }

  .home-hero h1 {
    font-size: 76px;
    line-height: 0.78;
  }

  .home-dek { font-size: 18px; }

  .home-artifacts {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  .home-artifacts figure:nth-child(n + 2) { display: none; }

  .home-intro {
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 100px auto;
    padding: 0 30px;
  }

  .home-intro h2 { font-size: 34px; }
  .home-index, .toc-list { padding: 0 16px; }

  .toc-hero {
    min-height: 480px;
    padding: 72px 20px 48px;
  }

  .toc-hero h1 { font-size: 28px; }

  .book-stats {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
    gap: 8px;
    width: 100%;
    margin-top: 48px;
  }

  .toc-group { padding: 64px 0 92px; }
  .toc-group-copy h2 { font-size: 13px; }
  .toc-group-copy p { font-size: 16px; text-align: justify; }
  .chapter-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
  .chapter-card-meta { display: block; }
  .chapter-card-meta h3 { margin-bottom: 6px; }
  .toc-list[data-layout="grid"] .toc-group-copy { display: block; }
  .toc-list[data-layout="grid"] .chapter-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-index .chapter-cards { display: block; }

  .reference-shell,
  .course-shell,
  .profile-shell {
    width: calc(100% - 32px);
  }

  .reference-heading { padding: 82px 0 70px; }

  .reference-heading h1,
  .course-shell > header h1,
  .profile-shell > header h1,
  .not-found h1 {
    font-size: 58px;
  }

  .glossary-tools {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .glossary-tools nav {
    overflow-x: auto;
    padding: 6px 0;
  }

  .glossary-list section {
    grid-template-columns: 44px 1fr;
    gap: 0 18px;
  }

  .glossary-list article { grid-column: 2; }

  .resource-list article {
    grid-template-columns: 100px 1fr;
    gap: 20px;
  }

  .resource-list h2 { font-size: 23px; }
  .course-shell { gap: 30px; padding-top: 40px; }
  .course-preview { padding: 24px; }

  .lesson-list article {
    grid-template-columns: 34px 90px 1fr;
    gap: 14px;
  }

  .lesson-list h2 { font-size: 21px; }
  .profile-card { grid-template-columns: 1fr; }
  .profile-card > div + div { border-top: 1px solid var(--hairline); border-left: 0; }
  .profile-chapters { columns: 1; }

  .concept-flow {
    grid-template-columns: 1fr;
    justify-items: stretch;
    text-align: center;
  }

  .concept-flow i { rotate: 90deg; }
}
