:root {
  --paper: #f5f1e8;
  --paper-light: #fcfaf4;
  --ink: #233d32;
  --ink-soft: #4e6256;
  --forest: #2c5141;
  --sage: #dce4d1;
  --sage-deep: #a8b898;
  --rule: #bac6b0;
  --clay: #825238;
  --clay-light: #eee2d3;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --reading-width: 68ch;
  --page-width: 1160px;
  --page-gutter: clamp(22px, 5vw, 72px);
  --section-space: clamp(44px, 6vw, 76px);
  --leaf-radius: 110px 24px 110px 24px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; }
button, input, a { -webkit-tap-highlight-color: transparent; }
a {
  color: var(--forest);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  min-height: 44px;
  min-width: 44px;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 5px;
}
[hidden] { display: none !important; }
h1, h2, h3, h4, p, figure, dl { margin: 0; }
ul, ol { margin: 0; }
::selection { background: var(--sage); color: var(--ink); }
.skip-link {
  position: fixed;
  inset: 10px auto auto 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper-light);
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; outline-color: var(--paper-light); }
.masthead {
  max-width: calc(var(--page-width) + var(--page-gutter) * 2);
  margin: auto;
  padding: 36px var(--page-gutter) 26px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--rule);
}
.masthead__mark {
  flex: 0 0 38px;
  height: 46px;
  border: 1.5px solid var(--forest);
  border-radius: 32px 3px 32px 3px;
  position: relative;
  transform: rotate(13deg);
}
.masthead__mark::after {
  content: "";
  width: 1px;
  height: 37px;
  background: var(--forest);
  position: absolute;
  top: 4px;
  left: 18px;
  transform: rotate(31deg);
}
.masthead__name {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.15;
}
.masthead__name-detail {
  display: block;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.5;
}
.masthead__purpose {
  margin-left: auto;
  font-size: 16px;
  color: var(--ink-soft);
}
.breadcrumb {
  max-width: calc(var(--page-width) + var(--page-gutter) * 2);
  margin: 10px auto 0;
  padding: 0 var(--page-gutter);
  font-size: 16px;
}
.breadcrumb__list { display: flex; flex-wrap: wrap; gap: 0 14px; list-style: none; padding: 0; }
.breadcrumb__item { display: flex; align-items: center; gap: 14px; min-height: 48px; }
.breadcrumb__item + .breadcrumb__item::before { content: "/"; color: var(--ink-soft); }
.breadcrumb__link { display: inline-flex; align-items: center; padding: 8px 0; }
.breadcrumb__item [aria-current] { color: var(--ink-soft); }
.chapter {
  max-width: calc(var(--page-width) + var(--page-gutter) * 2);
  margin: auto;
  padding: 44px var(--page-gutter) 100px;
}
.chapter__hero { padding-bottom: 48px; max-width: 900px; }
.chapter__eyebrow {
  font-family: var(--mono);
  font-size: 16px;
  margin-bottom: 22px;
  color: var(--clay);
}
.chapter__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(46px, 5.1vw, 72px);
  line-height: 1.07;
  letter-spacing: -.035em;
  text-wrap: balance;
  max-width: 21ch;
}
.chapter__deck { font-size: 20px; max-width: 60ch; line-height: 1.6; margin-top: 26px; }
.chapter__section {
  margin-top: var(--section-space);
  padding: 0 0 0 30px;
  border-left: 2px solid var(--sage-deep);
  max-width: 850px;
}
.chapter__group { display: contents; }
.chapter__hero + .chapter__section,
.chapter__hero + .chapter__group > .chapter__section:first-child { margin-top: 14px; }
.chapter__heading, .introduction__heading, .chapter-shelf__heading, .source-list__heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(29px, 3vw, 38px);
  letter-spacing: -.018em;
  line-height: 1.2;
  text-wrap: balance;
  margin-bottom: 20px;
}
.chapter__prose { max-width: var(--reading-width); margin-top: 18px; }
.chapter__list { max-width: var(--reading-width); padding-left: 24px; margin-top: 22px; }
.chapter__item { margin: 0 0 15px; padding-left: 9px; }
.chapter__item::marker { color: var(--clay); font-size: 16px; }
.chapter__reading { margin-top: 44px; max-width: var(--reading-width); }
.chapter__link { display: inline-flex; align-items: center; gap: 20px; padding-block: 10px; }
.chapter__link-arrow { flex-shrink: 0; font-size: 22px; }
.chapter__action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 22px;
  margin-top: 22px;
  border-radius: 4px 25px 4px 25px;
  background: var(--forest);
  color: var(--paper-light);
  text-decoration: none;
  font-weight: 500;
}
.chapter__action:hover { background: var(--ink); }
.chapter__action:focus-visible { outline-offset: 6px; }
.guide--home .chapter {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  column-gap: 70px;
  padding-top: 42px;
}
.chapter__hero--home { grid-column: 1; padding-bottom: 32px; }
.chapter__hero--home .chapter__title { font-size: clamp(48px, 5.4vw, 78px); line-height: 1.04; max-width: 15ch; }
.chapter__hero--home .chapter__deck { font-size: 19px; }
.introduction { display: contents; }
.introduction__reading { grid-column: 1; grid-row: 2; }
.introduction__heading { font-size: 28px; margin-bottom: 14px; }
.introduction__reading .chapter__prose { margin-top: 12px; }
.introduction__reading .chapter__list { margin-top: 16px; }
.route-map {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  position: relative;
  background: var(--sage);
  padding: 60px 40px 44px;
  border-radius: var(--leaf-radius);
  border: 1px solid var(--rule);
  min-width: 0;
}
.route-map::before {
  content: "";
  position: absolute;
  top: 17px;
  right: 20px;
  width: 102px;
  height: 72px;
  border: 1px solid var(--sage-deep);
  border-radius: 95% 0 95% 0;
  transform: rotate(-16deg);
  pointer-events: none;
}
.route-map__eyebrow { font-family: var(--mono); font-size: 16px; position: relative; margin-bottom: 32px; max-width: 23ch; }
.route-map__list { list-style: none; padding: 0 0 0 20px; position: relative; }
.route-map__list::before { content: ""; position: absolute; left: 0; top: 30px; bottom: 50px; border-left: 1px solid var(--forest); }
.route-map__step { background: var(--paper-light); padding: 23px 24px; margin-bottom: 23px; border-radius: 3px 25px 3px 25px; position: relative; }
.route-map__dot { position: absolute; left: -26px; top: 28px; width: 13px; height: 13px; background: var(--forest); border-radius: 50%; border: 3px solid var(--sage); }
.route-map__title { display: block; font-family: var(--serif); font-size: 25px; font-weight: 400; line-height: 1.2; margin-bottom: 8px; }
.route-map__detail { display: block; font-size: 16px; line-height: 1.6; }
.route-map__caption { font-size: 16px; margin-top: 26px; padding-left: 20px; }
.guide--home .chapter > .chapter__section { grid-column: 1 / -1; margin-top: 88px; }
.chapter-shelf { grid-column: 1 / -1; margin-top: 90px; padding-top: 46px; border-top: 1px solid var(--rule); }
.chapter-shelf__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 42px; padding: 0; margin-top: 32px; list-style: none; }
.chapter-shelf__item { border-top: 1px solid var(--rule); }
.chapter-shelf__link { display: grid; grid-template-columns: minmax(0, 1fr) 24px; padding: 24px 8px; text-decoration: none; gap: 8px 16px; height: 100%; }
.chapter-shelf__link:hover { background: var(--sage); }
.chapter-shelf__title { font-family: var(--serif); font-size: 27px; line-height: 1.25; }
.chapter-shelf__detail { grid-column: 1; font-size: 16px; line-height: 1.55; color: var(--ink-soft); max-width: 42ch; }
.chapter-shelf__arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 26px; }
.glossary { margin-top: 48px; max-width: 850px; }
.glossary__controls { background: var(--sage); padding: 26px; border-radius: 4px 32px 4px 32px; margin-bottom: 34px; }
.glossary__label { display: block; margin-bottom: 12px; font-weight: 500; font-size: 18px; }
.glossary__search-row { display: flex; gap: 16px; align-items: center; }
.glossary__input { min-width: 0; width: 100%; min-height: 54px; border: 1px solid var(--forest); padding: 10px 14px; border-radius: 3px; background: var(--paper-light); color: var(--ink); }
.glossary__input::placeholder { color: var(--ink-soft); opacity: 1; }
.glossary__clear { flex-shrink: 0; min-height: 54px; min-width: 44px; padding: 10px 16px; border: 1px solid var(--forest); background: var(--forest); color: var(--paper-light); border-radius: 3px; cursor: pointer; }
.glossary__clear:hover { background: var(--ink); }
.glossary__status { font-size: 16px; margin-top: 14px; }
.glossary__entry { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr); gap: 28px; padding: 24px 0; border-top: 1px solid var(--rule); }
.glossary__term { font-family: var(--serif); font-size: 27px; line-height: 1.25; }
.glossary__meaning { font-size: 18px; margin: 0; max-width: 46ch; }
.glossary__empty { border-top: 1px solid var(--rule); padding-top: 24px; }
.source-list { margin-top: 62px; scroll-margin-top: 26px; }
.source-list__items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 38px; padding: 0; list-style: none; margin-top: 26px; }
.source-list__item { padding: 20px 0 26px; border-top: 1px solid var(--rule); }
.source-list__title { font: inherit; }
.source-list__link { display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 18px; font-weight: 500; padding: 8px 0; line-height: 1.45; }
.source-list__link span { flex-shrink: 0; font-size: 24px; }
.source-list__detail { margin-top: 12px; font-size: 16px; line-height: 1.65; max-width: 56ch; color: var(--ink-soft); }
.colophon { background: var(--ink); color: var(--paper); padding: 36px var(--page-gutter); border-radius: 80px 0 0 0; }
.colophon__text { max-width: var(--reading-width); margin: auto; font-size: 16px; line-height: 1.75; }
.guide--missing .chapter { min-height: 65vh; }

@media (max-width: 850px) {
  .masthead { padding-top: 27px; }
  .guide--home .chapter { column-gap: 32px; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .chapter__hero--home .chapter__title { font-size: 54px; }
  .route-map { padding: 50px 25px 35px; border-radius: 85px 18px 85px 18px; }
  .route-map__step { padding: 20px 18px; }
  .route-map__title { font-size: 24px; }
  .glossary__search-row { flex-wrap: wrap; }
}

@media (max-width: 650px) {
  .masthead { gap: 16px; padding-bottom: 22px; flex-wrap: wrap; }
  .masthead__name { font-size: 27px; }
  .masthead__purpose { width: 100%; margin-left: 54px; margin-top: -2px; }
  .masthead__name-detail { font-size: 16px; margin-top: 5px; }
  .masthead__mark { flex-basis: 32px; width: 32px; height: 42px; }
  .masthead__mark::after { left: 15px; height: 34px; }
  .chapter { padding-top: 29px; padding-bottom: 70px; }
  .chapter__hero { padding-bottom: 32px; }
  .chapter__eyebrow { margin-bottom: 18px; }
  .chapter__title { font-size: 46px; line-height: 1.08; }
  .chapter__deck { font-size: 18px; margin-top: 23px; }
  .chapter__section { padding-left: 19px; }
  .chapter__heading, .chapter-shelf__heading, .source-list__heading { font-size: 30px; }
  .chapter__item { padding-left: 4px; }
  .chapter__list { padding-left: 21px; }
  .guide--home .chapter { display: block; padding-top: 28px; }
  .chapter__hero--home .chapter__title { font-size: 49px; max-width: 14ch; }
  .chapter__hero--home .chapter__deck { font-size: 18px; }
  .introduction { display: block; }
  .introduction__heading { font-size: 28px; }
  .route-map { margin-top: 44px; padding: 52px 29px 38px; border-radius: 85px 18px 85px 18px; }
  .route-map__step { padding: 22px 20px; }
  .guide--home .chapter > .chapter__section { margin-top: 52px; }
  .chapter-shelf { margin-top: 60px; padding-top: 35px; }
  .chapter-shelf__list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .chapter-shelf__title { font-size: 26px; }
  .glossary__controls { padding: 21px; }
  .glossary__search-row { gap: 13px; }
  .glossary__clear { width: 100%; }
  .glossary__entry { display: block; }
  .glossary__meaning { margin-top: 12px; }
  .source-list { margin-top: 46px; }
  .source-list__items { grid-template-columns: minmax(0, 1fr); }
  .source-list__link { gap: 14px; }
  .colophon { border-radius: 44px 0 0 0; padding-top: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  body { background: white; color: black; }
  .masthead, .breadcrumb, .glossary__controls, .skip-link { display: none; }
  .chapter { padding: 0; }
  .guide--home .chapter { display: block; }
  .introduction { display: block; }
  .route-map { margin-block: 30px; }
  .chapter__section, .glossary__entry, .source-list__item { break-inside: avoid; }
  .colophon { background: white; color: black; border-top: 1px solid black; margin-top: 32px; border-radius: 0; padding: 20px 0; }
}
