:root {
  color-scheme: light;
  --paper: #fcfbf8;
  --white: #fff;
  --ink: #172433;
  --body: #304050;
  --muted: #56636d;
  --line: #dfdfd7;
  --accent: #22564c;
  --accent-soft: #e9f0e9;
  --title-font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body-font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --tool-rail: 166px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font: 1.04rem/1.76 var(--body-font);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-underline-offset: .19em; }
a:hover { color: var(--ink); }
a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 2px solid #337867;
  outline-offset: 4px;
}
section:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: .5rem 1rem;
  background: var(--white);
}
.skip-link:focus { transform: none; }

.masthead { border-block-start: 4px solid var(--accent); border-block-end: 1px solid var(--line); }
.masthead-inner {
  width: min(100% - 80px, 1360px);
  min-height: 67px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.wordmark {
  color: var(--ink);
  font: 750 .98rem/1 var(--body-font);
  letter-spacing: .13em;
  text-decoration: none;
  width: fit-content;
}
.call {
  font-size: .79rem;
  color: var(--muted);
  font-weight: 630;
  letter-spacing: .075em;
}
.author-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}
.author-link:hover { color: var(--ink); }

.layout {
  display: grid;
  grid-template-columns: var(--tool-rail) minmax(0, 850px) var(--tool-rail);
  justify-content: center;
  gap: clamp(24px, 4vw, 64px);
  padding-inline: 32px;
}
main { grid-column: 2; grid-row: 1; min-width: 0; }
.hero {
  padding: clamp(3.2rem, 7vw, 6.4rem) 0 clamp(2.6rem, 6vw, 4.65rem);
  text-align: center;
}
h1, h2, h3 { margin: 0; color: var(--ink); }
h1, .chapter > h2, .case-list h3, .question {
  font-family: var(--title-font);
  font-weight: 600;
  line-height: 1.05;
}
h1 {
  font-size: clamp(3.25rem, 7.55vw, 7rem);
  letter-spacing: -.071em;
  text-wrap: balance;
}
.subtitle {
  max-width: 31rem;
  margin: 1.3rem auto 0;
  font: 400 clamp(1.2rem, 2.2vw, 1.61rem)/1.28 var(--title-font);
  text-wrap: balance;
}
.byline {
  margin: 1.58rem auto 0;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 680;
}
.byline span {
  display: inline-block;
  margin-left: .72rem;
  padding-left: .76rem;
  border-left: 1px solid #bcc6bf;
  color: var(--muted);
  font-weight: 500;
}
.hero-intro {
  position: relative;
  max-width: 680px;
  margin: 2rem auto 0;
  padding-top: 1.7rem;
  border-top: 1px solid var(--line);
}
.hero-intro p:last-child {
  text-align: left;
  margin: .8rem 0 0;
}
.question {
  font-size: clamp(1.42rem, 2.65vw, 2rem);
  font-style: italic;
  color: var(--accent);
  text-wrap: balance;
  margin: 0;
}
.chapter {
  border-top: 1px solid var(--line);
  padding: clamp(2.45rem, 5vw, 4.25rem) 0;
}
section, article, figure, .references-list [id] { scroll-margin-top: 28px; }
.chapter > h2 {
  font-size: clamp(2.4rem, 4.68vw, 4rem);
  letter-spacing: -.046em;
  text-wrap: balance;
}
.chapter h3 {
  font-size: 1.2rem;
  line-height: 1.32;
  margin: 1.5rem 0 .45rem;
}
.chapter p { margin: .55rem 0 1.15rem; }
.chapter .lead {
  color: var(--ink);
  font-family: var(--title-font);
  font-size: clamp(1.28rem, 2.12vw, 1.58rem);
  line-height: 1.46;
  margin: .9rem 0 1.8rem;
}
.case-list { border-block: 1px solid var(--line); }
.case-list article {
  display: grid;
  grid-template-columns: minmax(150px, .34fr) minmax(0, .66fr);
  gap: clamp(16px, 3.3vw, 44px);
  padding: 1.5rem 0;
}
.case-list article + article { border-top: 1px solid var(--line); }
.case-list h3 { font-size: clamp(1.55rem, 2.51vw, 2rem); margin: 0; letter-spacing: -.026em; }
.case-list p { margin: 0; }
.citation { white-space: normal; font-size: .85em; }

figure { margin: 1.45rem 0 2.15rem; }
.figure-link {
  display: block;
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  color: var(--accent);
}
.figure-link img { display: block; width: 100%; height: auto; }
.enlarge {
  display: grid;
  place-items: center;
  position: absolute;
  right: .6rem;
  top: .6rem;
  width: 36px;
  height: 36px;
  color: var(--accent);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  transition: background .15s, color .15s;
}
.figure-link:hover .enlarge { background: var(--accent); color: var(--white); }
.chapter .figcaption, figcaption {
  font-size: .86rem;
  line-height: 1.6;
  color: var(--muted);
  margin: .7rem 0 0;
}
figcaption strong, .figcaption strong { color: var(--ink); }
.fig-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem 1rem;
  margin: 1.45rem 0 2.15rem;
}
.fig-pair .figure-link { display: grid; align-items: center; }
.fig-pair .figcaption { grid-column: 1 / -1; margin: 0; }
.transformations { display: grid; gap: .65rem; }
.phases {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 1.5rem 0;
}
.phases li {
  border-top: 2px solid #97ada0;
  background: #f0f3ed;
  padding: .9rem 1rem 1rem;
}
.phases span { display: block; color: var(--accent); font-size: .75rem; font-weight: 650; }
.phases strong { display: block; font-size: .99rem; color: var(--ink); line-height: 1.35; margin-top: .13rem; }
.phases p { font-size: .84rem; line-height: 1.55; margin: .35rem 0 0; }
.budget-table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.35rem 0 .4rem;
  font-size: .94rem;
  font-variant-numeric: tabular-nums;
}
.budget-table th, .budget-table td { border-bottom: 1px solid var(--line); padding: .57rem .7rem; }
.budget-table th { font-weight: 500; text-align: left; }
.budget-table th:last-child, .budget-table td { text-align: right; white-space: nowrap; }
.budget-table thead th { font-size: .8rem; color: var(--muted); font-weight: 650; }
.budget-table tfoot { background: var(--accent-soft); color: var(--ink); }
.budget-table tfoot th, .budget-table tfoot td, .subtotal th, .subtotal td { font-weight: 700; }
.references-list {
  columns: 2;
  column-gap: 2.8rem;
  list-style: none;
  padding: 0;
  margin: 1.45rem 0 0;
  font-size: .86rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
}
.references-list li {
  break-inside: avoid;
  padding: .38rem 0 .38rem .9rem;
  text-indent: -.9rem;
}
.references-list li:target, .references-list span:target { background: var(--accent-soft); }
.reader-tools {
  grid-column: 3;
  grid-row: 1;
  align-self: stretch;
  min-width: 0;
}
.reader-tools-inner {
  position: sticky;
  top: 2.15rem;
  padding-top: 4rem;
}
.section-index h2 {
  color: var(--muted);
  font-size: .69rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  margin: 0 0 .65rem .68rem;
}
.section-index ul { list-style: none; margin: 0; padding: 0; }
.section-index a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: .29rem .6rem;
  border-left: 2px solid var(--line);
  text-decoration: none;
  font-size: .8rem;
  line-height: 1.28;
}
.section-index a:hover, .section-index a[aria-current="location"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.section-index a[aria-current="location"] { font-weight: 690; }
.next-section {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: .64rem;
  margin-top: 1.18rem;
  color: var(--accent);
  font-size: .77rem;
  line-height: 1.3;
  font-weight: 660;
  text-decoration: none;
}
.next-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-size: 1.78rem;
  font-weight: 480;
  line-height: 1;
  transition: background .15s, transform .15s;
}
.next-section:hover .next-icon { background: var(--ink); }
.next-section[data-direction="up"] .next-icon { transform: rotate(180deg); }
.mobile-index, .mobile-next { display: none; }

.figure-dialog {
  position: fixed;
  inset: 0;
  max-width: min(96vw, 1400px);
  max-height: 93dvh;
  border: 0;
  border-radius: 6px;
  padding: 0;
  color: var(--ink);
  background: var(--white);
}
.figure-dialog::backdrop { background: rgb(17 33 41 / 78%); }
.figure-dialog__surface { padding: .7rem; }
.figure-dialog figure { margin: 0; }
.figure-dialog__image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 76dvh;
  margin: auto;
  object-fit: contain;
}
.figure-dialog__caption { max-width: 66rem; padding: 0 .25rem .25rem; }
.figure-dialog__close {
  display: block;
  margin: 0 0 .32rem auto;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  padding: .3rem .9rem;
  color: var(--white);
  background: var(--accent);
  font: 650 .85rem/1.2 var(--body-font);
  cursor: pointer;
}

@media (max-width: 1200px) and (min-width: 901px) {
  .layout { grid-template-columns: minmax(0, 835px) var(--tool-rail); }
  main { grid-column: 1; }
  .reader-tools { grid-column: 2; }
}
@media (max-width: 900px) {
  .layout { display: block; max-width: 760px; margin-inline: auto; padding-inline: clamp(18px, 4.3vw, 35px); }
  .masthead-inner { width: calc(100% - 38px); }
  .reader-tools { display: none; }
  .mobile-index {
    display: block;
    padding: 0 0 .15rem;
    margin-top: .55rem;
    border-bottom: 1px solid var(--line);
  }
  .mobile-index summary {
    width: fit-content;
    min-height: 44px;
    align-content: center;
    font-size: .83rem;
    font-weight: 690;
    color: var(--accent);
    cursor: pointer;
  }
  .mobile-index nav { margin-bottom: .7rem; }
  .mobile-index .section-index a { min-height: 44px; }
  .mobile-next {
    display: flex;
    z-index: 5;
    position: fixed;
    right: max(.85rem, env(safe-area-inset-right));
    bottom: max(.85rem, env(safe-area-inset-bottom));
    margin: 0;
    padding: 4px 4px 4px .7rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 3px 15px rgb(23 36 51 / 15%);
  }
  .mobile-next .next-icon { width: 44px; height: 44px; font-size: 1.45rem; }
  .mobile-next [data-next-label] { max-width: 12rem; }
  .bibliography { padding-bottom: 5.2rem; }
  main:has(:focus-visible) ~ .mobile-next:not(:focus) { visibility: hidden; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; line-height: 1.65; }
  .masthead-inner {
    grid-template-columns: auto 1fr;
    column-gap: .55rem;
    row-gap: 0;
  }
  .masthead-inner .wordmark { grid-area: 1 / 1; }
  .author-link { grid-area: 1 / 2; }
  .call {
    grid-column: 1 / -1;
    justify-self: center;
    font-size: .73rem;
    letter-spacing: .025em;
    padding-bottom: .48rem;
  }
  .hero { padding-top: 2.9rem; }
  h1 { font-size: clamp(2.7rem, 11vw, 4.1rem); }
  .hero-intro { margin-top: 1.5rem; }
  .byline span { display: block; margin: .28rem 0 0; padding: 0; border: 0; }
  .case-list article, .phases, .fig-pair { grid-template-columns: 1fr; }
  .case-list article { gap: .55rem; }
  .references-list { columns: 1; }
  .enlarge { width: 32px; height: 32px; top: .32rem; right: .32rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enlarge, .next-icon { transition: none; }
}
