:root {
  color-scheme: light;
  --page: #b7beac;
  --panel: #c9cebd;
  --panel-soft: #d2d5c5;
  --ink: #252d25;
  --muted: #404a3b;
  --accent: #594515;
  --accent-deep: #d5b447;
  --line: #7b866f;
  --focus: #584113;
  --body-font: "Seravek", "Gill Sans", "Trebuchet MS", sans-serif;
  --heading-font: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --measure: 68ch;
  --shell: 78rem;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --space-small: 0.75rem;
  --space-body: 1.5rem;
  --space-section: 3rem;
  --space-chapter: 5rem;
  --target: 3rem;
  --radius: 1.5rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 1.25rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
body, button { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); }
figure { margin: 0; }
a { color: var(--ink); text-decoration-thickness: 0.075em; text-underline-offset: 0.23em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
p { margin: 0 0 var(--space-body); max-width: var(--measure); }
ul { margin: 0; padding: 0; }
li { font-size: 1.25rem; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 700;
}
h1, h2, h3 { margin: 0; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.75rem, 5.5vw, 5.2rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 2.7vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: 1.65rem; letter-spacing: -0.01em; }
strong { font-weight: 700; }
button { font: inherit; }
::selection { background: var(--accent-deep); color: var(--ink); }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -6rem;
  z-index: 10;
  min-height: var(--target);
  padding: var(--space-small) var(--space-body);
  background: var(--ink);
  color: var(--page);
  border-radius: 999px;
}
.skip-link:focus { top: 1rem; color: var(--page); }
.site-header { border-bottom: 1px solid var(--line); background: var(--panel); }
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-body);
  max-width: var(--shell);
  min-height: 6rem;
  margin: auto;
  padding: 1rem var(--gutter);
}
.header-start, .header-end {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}
.header-end { justify-content: flex-end; }
.site-header a {
  display: inline-flex;
  align-items: center;
  min-width: var(--target);
  min-height: var(--target);
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  padding: 0.375rem 0.3rem;
}
.site-header a:hover, .site-header a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.guide-identity { gap: 0.875rem; white-space: nowrap; letter-spacing: 0; }
.guide-identity span { font-family: var(--heading-font); font-size: 1.1875rem; font-weight: 700; }
.identity-rule {
  width: 1.5rem;
  height: 1.5rem;
  background: var(--accent-deep);
  border-radius: 50%;
  flex-shrink: 0;
}
.chapter-kind, .section-kicker {
  display: inline-block;
  padding: 0.4rem 0.875rem;
  border-radius: 999px;
  background: var(--panel-soft);
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--accent);
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 1.2rem;
}
.home-main { max-width: var(--shell); margin: auto; padding: 0 var(--gutter); }
.home-opening {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.85fr);
  align-items: center;
  gap: var(--space-section);
  padding: 3.5rem 0 var(--space-section);
}
.opening-copy h1 { max-width: 15ch; margin-bottom: 1.5rem; }
.guide-framing { font-size: 1.375rem; line-height: 1.45; max-width: 44ch; }
.opening-line {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.opening-copy > p:last-of-type { color: var(--muted); max-width: 44ch; }
.opening-illustration {
  width: 100%;
  max-width: 23rem;
  justify-self: end;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--panel);
  border-top: 6px solid var(--accent-deep);
}
.opening-illustration img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; }
.opening-illustration img, .chapter-illustration img { filter: grayscale(1); }
.opening-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 2rem; }
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.8rem 1.25rem;
  background: var(--accent-deep);
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.125rem;
  line-height: 1.3;
}
.primary-link:hover { background: var(--panel-soft); color: var(--ink); border-color: var(--accent); }
.plain-link { display: inline-flex; min-height: var(--target); align-items: center; gap: 0.75rem; font-size: 1.125rem; }
.home-orientation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: var(--space-section);
  padding: var(--space-section) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.orientation-copy { border-left: 1px solid var(--line); padding-left: var(--space-section); }
.orientation-copy p:last-child { margin-bottom: 0; }
.term-library { padding: var(--space-chapter) 0 var(--space-section); scroll-margin-top: 2rem; }
.term-library > h2 { max-width: 26ch; }
.term-intro { color: var(--muted); margin-top: 1rem; }
.term-group { margin-top: 2.5rem; }
.term-group h3 { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--line); }
.term-group ul { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.term-group li:nth-child(even) { border-left: 1px solid var(--line); padding-left: 1.5rem; }
.term-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 1rem;
  padding: 1.1rem 0.25rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  min-height: 6rem;
}
.term-name { font-family: var(--heading-font); font-weight: 700; font-size: 1.5rem; line-height: 1.3; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.term-preview { grid-column: 1; font-size: 1.125rem; line-height: 1.35; color: var(--muted); }
.term-arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 1.5rem; color: var(--accent); }
.term-entry:hover .term-name { color: var(--accent); }
.home-decision {
  padding: var(--space-section);
  background: var(--panel);
  border-top: 6px solid var(--accent-deep);
  border-radius: var(--radius);
  margin: var(--space-section) 0 var(--space-chapter);
}
.home-decision h2 { max-width: 32ch; margin-bottom: 1.5rem; }
.decision-links { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; }
.decision-links a { display: inline-flex; align-items: center; gap: 0.75rem; min-height: var(--target); font-size: 1.125rem; }

.chapter-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 46rem);
  justify-content: center;
  gap: clamp(2rem, 4vw, 4rem);
  padding: var(--space-chapter) var(--gutter);
  max-width: var(--shell);
  margin: auto;
}
.chapter-rail { padding: 0.25rem 1.5rem 0 0; border-right: 1px solid var(--line); }
.chapter-rail > p { font-family: var(--heading-font); font-size: 1.125rem; letter-spacing: 0; color: var(--muted); }
.chapter-rail nav { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.chapter-rail a { display: flex; align-items: center; min-height: var(--target); font-size: 1.125rem; }
.rail-rule { display: block; height: 0.375rem; width: 3rem; border-radius: 999px; background: var(--accent-deep); margin-top: 3rem; }
.chapter { min-width: 0; }
.chapter-heading { margin-bottom: 2.5rem; }
.chapter-heading h1 { font-size: clamp(2.6rem, 5.5vw, 4.8rem); margin-bottom: 1.5rem; }
.chapter-dek { font-size: 1.5rem; line-height: 1.4; color: var(--muted); max-width: 42ch; }
.term-definition { border-top: 5px solid var(--accent-deep); border-radius: var(--radius); padding: 1.5rem 1.75rem; background: var(--panel); margin-bottom: var(--space-section); }
.term-definition p { margin-bottom: 0; font-size: 1.375rem; line-height: 1.5; }
.chapter-section { margin-top: var(--space-section); }
.chapter-section h2 { margin-bottom: 1.5rem; }
.chapter-section p:last-child { margin-bottom: 0; }
.chapter-illustration { width: 100%; max-width: 24rem; margin: 1.5rem 0 2.5rem; padding: 1rem; border-radius: var(--radius); background: var(--panel); }
.chapter-illustration img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.visit-questions { list-style: none; margin: 0 0 1.5rem; }
.visit-questions li { padding: 0.8rem 0 0.8rem 1.25rem; border-bottom: 1px solid var(--line); position: relative; }
.visit-questions li::before { content: ""; position: absolute; height: 0.375rem; width: 0.375rem; border-radius: 50%; left: 0; top: 1.6rem; background: var(--accent); }
.related-words { margin-top: var(--space-section); padding-top: var(--space-body); border-top: 1px solid var(--line); }
.related-words h2 { font-size: 1.375rem; margin-bottom: 1rem; }
.related-words ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; }
.related-words a { display: inline-flex; align-items: center; min-height: var(--target); font-size: 1.125rem; }
.chapter-next { margin: 2.5rem 0; }
.chapter-next a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 1rem;
  min-height: 6rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border-radius: var(--radius);
  border-bottom: 4px solid var(--accent-deep);
  text-decoration: none;
}
.chapter-next a > span:first-child { font-size: 1rem; color: var(--muted); }
.chapter-next strong { grid-column: 1; font-family: var(--heading-font); font-size: 1.75rem; line-height: 1.3; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.next-arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--accent); font-size: 1.5rem; }
.chapter-notes { padding: 1.75rem 0; border-top: 1px solid var(--line); margin-bottom: var(--space-section); }
.chapter-notes h2 { font-size: 1.35rem; margin-bottom: 0.875rem; }
.source-list { list-style: none; }
.source-link { display: inline-flex; align-items: center; gap: 0.25rem; min-height: var(--target); padding: 0.5rem 0; font-size: 1.125rem; line-height: 1.4; }
.source-link span { flex-shrink: 0; color: var(--accent); }
.urgent-help { background: var(--panel-soft); border: 2px solid var(--accent); border-radius: var(--radius); padding: 1.5rem; margin-bottom: var(--space-section); }
.urgent-help h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.urgent-help p:last-child { font-family: var(--heading-font); font-weight: 700; font-size: 1.4rem; margin-bottom: 0; }
.comparison-intro { color: var(--muted); }
.comparison-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.comparison-controls button { min-height: var(--target); min-width: var(--target); font-size: 1.125rem; padding: 0.5rem 1rem; background: var(--panel); border: 2px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; }
.comparison-controls button:hover { background: var(--panel-soft); border-color: var(--accent); }
.comparison-controls button[aria-pressed="true"] { background: var(--accent-deep); border-color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }
.comparison-status { font-size: 1.125rem; color: var(--muted); margin-bottom: var(--space-body); }
.visit-panels { display: grid; gap: var(--space-body); }
.visit-option { background: var(--panel); padding: 1.5rem; border-top: 5px solid var(--accent-deep); border-radius: var(--radius); }
.visit-option h3 { margin-bottom: 1rem; }
.visit-option p { margin-bottom: 0.5rem; }
.visit-option .visit-questions { margin-bottom: 0; }

.site-footer { border-top: 1px solid var(--line); background: var(--panel); }
.footer-inner { max-width: var(--shell); margin: auto; padding: 2.5rem var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.footer-purpose { max-width: 45ch; margin: 0; font-size: 1.125rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; justify-content: flex-end; }
.site-footer a { display: inline-flex; align-items: center; min-height: var(--target); font-size: 1.125rem; }
.missing-page { max-width: 54rem; margin: auto; padding: var(--space-chapter) var(--gutter); min-height: 65vh; }
.missing-page h1 { margin-bottom: 1.5rem; }
.missing-links { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; margin-top: 2rem; }
.missing-links a { display: inline-flex; align-items: center; min-height: var(--target); font-size: 1.125rem; }

@media (max-width: 66rem) {
  .header-inner { grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; }
  .guide-identity { grid-column: 1 / -1; grid-row: 1; justify-self: start; }
  .header-start { grid-column: 1; grid-row: 2; }
  .header-end { grid-column: 2; grid-row: 2; }
  .chapter-layout { grid-template-columns: 10rem minmax(0, 1fr); gap: 2rem; }
}
@media (max-width: 46rem) {
  :root { --space-chapter: 3rem; --space-section: 2.25rem; }
  .header-inner { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
  .guide-identity { order: -1; flex-basis: 100%; }
  .header-start, .header-end { gap: 0.65rem; justify-content: flex-start; }
  .site-header a { font-size: 1rem; padding-left: 0.125rem; padding-right: 0.125rem; }
  .home-opening { grid-template-columns: 1fr; padding-top: 2.5rem; gap: 0.5rem; }
  .opening-copy h1 { font-size: clamp(2.65rem, 9.6vw, 4rem); max-width: 15ch; }
  .opening-illustration { max-width: 23rem; margin: 1.5rem auto 0; justify-self: center; }
  .home-orientation { grid-template-columns: 1fr; gap: var(--space-body); }
  .orientation-copy { border-left: 0; padding-left: 0; }
  .term-group ul { grid-template-columns: 1fr; }
  .term-group li:nth-child(even) { border-left: 0; padding-left: 0; }
  .home-decision { padding: 1.5rem; }
  .chapter-layout { display: flex; flex-direction: column; gap: 1.5rem; padding-top: 1.25rem; }
  .chapter-rail > p, .rail-rule { display: none; }
  .chapter-rail { padding: 0 0 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .chapter-rail nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
  .chapter-rail a { font-size: 1rem; }
  .chapter-heading h1 { font-size: clamp(2.5rem, 9vw, 4rem); }
  .chapter-dek { font-size: 1.35rem; }
  .term-definition { padding: 1rem 1.25rem; }
  .term-definition p { font-size: 1.25rem; }
  .chapter-illustration { max-width: 100%; }
  .chapter-section h2 { font-size: 1.65rem; }
  .chapter-next a { padding: 1rem; }
  .visit-option { padding: 1.25rem; }
  .source-link { max-width: 100%; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .site-footer nav { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
  :root { --page: #ffffff; --ink: #111111; --muted: #333333; --accent: #594515; --accent-deep: #d5b447; --panel: #ffffff; --panel-soft: #ffffff; --line: #666666; }
  body { font-size: 1.125rem; }
  .site-header, .chapter-rail, .site-footer, .comparison-controls, .comparison-status, .opening-actions { display: none !important; }
  .chapter-layout { display: block; max-width: 100%; padding: 1rem; }
  .chapter-heading h1 { font-size: 2.5rem; }
  .home-opening, .home-orientation { display: block; }
  .opening-illustration, .chapter-illustration { display: none; }
  .visit-option[hidden] { display: block !important; }
  .visit-option, .urgent-help, .term-definition { break-inside: avoid; }
}
