/* Shared screen skin. System fonts keep this handbook usable offline. */
:root {
  color-scheme: light;
  --ground: #f5f9f9;
  --paper: #ffffff;
  --wash: #e2eff1;
  --tide: #246b82;
  --ink: #233e48;
  --soft: #415d67;
  --brick: #9d432e;
  --line: #b8cdd1;
  --heading: Rockwell, 'Rockwell Nova', 'Roboto Slab', 'Zilla Slab', Georgia, serif;
  --body: 'Trebuchet MS', Optima, Candara, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.7;
  overflow-wrap: break-word;
}
a {
  color: var(--brick);
  text-decoration: underline;
  text-underline-offset: .22em;
  text-decoration-thickness: 1.5px;
}
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 5px; }
button, input, summary { font: inherit; }
button, input { border-radius: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.site-boundary { width: min(1240px, calc(100% - 80px)); margin-inline: auto; }
.reading-skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  transform: translateY(-180%);
  padding: 12px 20px;
  min-height: 48px;
  background: var(--paper);
  color: var(--brick);
}
.reading-skip:focus { transform: translateY(0); }
.handbook-header {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding-block: 22px;
  color: var(--paper);
}
.handbook-header::before, .chapter-opening::before, .handbook-footer::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--tide);
  box-shadow: 0 0 0 100vmax var(--tide);
  clip-path: inset(0 -100vmax);
  pointer-events: none;
}
.handbook-header, .chapter-opening, .handbook-footer { background-color: var(--tide); } /* same teal as the bleed; lets computed-style contrast checks see it */
.handbook-name {
  display: grid;
  align-content: center;
  min-height: 52px;
  color: inherit;
  text-decoration: none;
  line-height: 1.3;
}
.name-main { font-family: var(--heading); font-size: 25px; font-weight: 700; }
.name-note { margin-top: 5px; font-size: 16px; }
.handbook-navigation { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.handbook-navigation a {
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 48px;
  color: inherit;
  font-size: 17px;
}
.handbook-navigation a[aria-current='page'] { text-decoration-thickness: 3px; }
.handbook-header :focus-visible, .chapter-opening :focus-visible, .handbook-footer :focus-visible {
  outline-color: var(--paper);
}
.chapter-opening {
  position: relative;
  isolation: isolate;
  padding-block: 44px 58px;
  margin-bottom: 58px;
  color: var(--paper);
}
.opening-words { max-width: 860px; }
.chapter-home .chapter-opening {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
  padding-block: 38px 60px;
}
.chapter-label {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  margin: 0 0 18px;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading);
  font-weight: 700;
  letter-spacing: normal;
  text-wrap: balance;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(40px, 4.5vw, 62px);
  line-height: 1.14;
  margin-bottom: 24px;
  max-width: 25ch;
}
.chapter-home h1 { max-width: 18ch; font-size: clamp(42px, 4.5vw, 62px); }
.chapter-deck { max-width: 60ch; font-size: 21px; line-height: 1.6; margin-bottom: 0; }
.first-answer {
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--paper);
  color: var(--ink);
  border-left: 7px solid var(--brick);
  font-size: 19px;
  line-height: 1.6;
  max-width: 55ch;
}
.first-answer p { margin: 0; }
.editorial-photo { margin: 0; background: var(--wash); overflow: hidden; }
.editorial-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}
.photo-leaf-path { width: 100%; aspect-ratio: 1; border-radius: 50%; }
.photo-leaf-path img { object-position: 45% 50%; }
.photo-garden-seat, .photo-quiet-table {
  width: 100%;
  max-width: none;
  aspect-ratio: 2 / 1;
  margin-bottom: 42px;
  border-radius: 120px;
}
.chapter-reading {
  display: grid;
  grid-template-columns: 220px minmax(0, 820px);
  gap: 0 60px;
  justify-content: space-between;
  align-items: start;
  padding-bottom: 64px;
}
.anchor-rail { position: sticky; top: 24px; padding: 22px; background: var(--wash); }
.rail-label { margin-bottom: 10px; font-size: 18px; font-weight: 700; }
.anchor-rail ul { list-style: none; margin: 0; padding: 0; }
.anchor-rail a { display: flex; align-items: center; min-height: 48px; padding: 10px 0; font-size: 17px; line-height: 1.5; }
.rail-chapters { margin-top: 18px; padding-top: 10px; border-top: 3px solid var(--paper); }
.reading-body { min-width: 0; max-width: 820px; }
/* The existing interlude photographs span both columns without changing markup. */
.chapter-reading:has(.reading-body > .editorial-photo) { row-gap: 0; }
.chapter-reading:has(.reading-body > .editorial-photo) .reading-body { display: contents; }
.chapter-reading:has(.reading-body > .editorial-photo) .reading-body > * { grid-column: 2; }
.chapter-reading:has(.reading-body > .editorial-photo) .reading-body > .editorial-photo {
  grid-column: 1 / -1;
  grid-row: 1;
  aspect-ratio: 3 / 1;
}
.chapter-reading:has(.reading-body > .editorial-photo) .anchor-rail { grid-column: 1; grid-row: 2 / span 12; }
.reading-section { padding: 36px 0; scroll-margin-top: 24px; }
.reading-section:first-of-type { padding-top: 0; }
.reading-section:nth-of-type(2n) { background: var(--wash); padding: 34px; margin-block: 8px 20px; }
.reading-section:nth-of-type(3n) { background: var(--tide); color: var(--paper); padding: 34px; margin-block: 8px 20px; }
h2 { font-size: clamp(27px, 2.4vw, 34px); line-height: 1.3; margin-bottom: 22px; }
h2::before { content: ''; display: block; width: 44px; height: 5px; margin-bottom: 20px; background: var(--brick); }
h3 { font-size: 24px; line-height: 1.4; margin-bottom: 10px; }
p { margin-bottom: 20px; }
.reading-section p:last-child { margin-bottom: 0; }
.source-link { display: block; width: fit-content; max-width: 100%; min-height: 48px; padding-block: 10px; margin-top: 3px; font-size: 17px; line-height: 1.6; }
.related-reading { display: block; width: fit-content; max-width: 100%; min-height: 48px; padding-block: 12px; line-height: 1.5; font-size: 18px; font-weight: 700; }
.related-reading::after { content: ' →'; }
.reading-section:nth-of-type(3n) a, .reading-section:nth-of-type(3n) .index-name, .reading-section:nth-of-type(3n) .index-note { color: var(--paper); }
.reading-section:nth-of-type(3n) h2::before { background: var(--paper); }
.reading-section:nth-of-type(3n) :focus-visible { outline-color: var(--paper); }
.chapter-index { list-style: none; padding: 0; margin: 24px 0 0; }
.chapter-index li { border-top: 2px solid var(--line); }
.chapter-index a { display: grid; gap: 7px; padding-block: 22px; min-height: 88px; text-decoration: none; }
.index-name { color: var(--brick); font-family: var(--heading); font-size: 24px; line-height: 1.35; font-weight: 700; text-decoration: underline; text-underline-offset: .22em; }
.index-note { color: var(--soft); font-size: 18px; line-height: 1.6; }
.chapter-index a:hover .index-name { text-decoration-thickness: 3px; }
.visit-questions { list-style: none; margin: 20px 0; padding: 0; }
.visit-questions li { position: relative; padding: 16px 0 16px 28px; border-top: 2px solid var(--line); font-size: 18px; }
.visit-questions li::before { content: ''; position: absolute; left: 0; top: 28px; width: 10px; height: 10px; background: currentColor; border-radius: 50%; }
.chapter-recap { background: var(--brick); color: var(--paper); padding: 34px; margin-top: 24px; }
.chapter-recap h2 { font-size: 26px; }
.chapter-recap h2::before { background: var(--paper); }
.chapter-recap p { margin-bottom: 0; }
.chapter-steps { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 28px; padding-top: 10px; }
.chapter-steps a { display: flex; align-items: center; min-height: 48px; max-width: 100%; padding: 12px 18px; font-size: 18px; background: var(--brick); color: var(--paper); }
.handbook-footer { position: relative; isolation: isolate; padding-block: 32px 38px; color: var(--paper); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-bottom: 18px; }
.footer-links a { display: flex; align-items: center; min-height: 48px; font-size: 17px; color: inherit; }
.handbook-footer p { font-size: 17px; max-width: 70ch; margin-bottom: 0; }
.word-controls { margin: 28px 0; padding: 26px; background: var(--wash); color: var(--ink); }
.word-controls label { display: block; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.word-input-row { display: flex; gap: 12px; }
.word-controls input { display: block; min-width: 0; width: 100%; min-height: 52px; padding: 10px 12px; border: 2px solid var(--soft); background: var(--paper); color: var(--ink); font-size: 18px; }
.word-controls button { padding: 10px 16px; min-height: 52px; flex-shrink: 0; font-size: 18px; background: var(--brick); color: var(--paper); border: 2px solid var(--brick); }
.filter-status { font-size: 17px; min-height: 28px; margin: 14px 0 0; color: var(--soft); }
.word-list { margin: 28px 0 0; }
.word-entry { padding: 26px 0; border-top: 2px solid var(--line); }
.word-entry dt { font-family: var(--heading); font-size: 24px; font-weight: 700; line-height: 1.4; margin-bottom: 10px; }
.word-entry dd { font-size: 18px; margin: 0; }
.word-entry p { margin-bottom: 0; }
.filter-empty { font-size: 18px; margin-bottom: 0; }

@media (max-width: 1000px) {
  .site-boundary { width: calc(100% - 48px); }
  .handbook-header { flex-wrap: wrap; gap: 12px; }
  .chapter-home .chapter-opening { gap: 32px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .chapter-reading { grid-template-columns: 190px minmax(0, 1fr); gap: 0 32px; }
  .anchor-rail { padding: 18px; }
}
@media (max-width: 700px) {
  .site-boundary { width: calc(100% - 40px); }
  .handbook-header { display: block; padding-block: 20px 12px; }
  .handbook-name { margin-bottom: 12px; }
  .handbook-navigation { gap: 4px 20px; }
  .handbook-navigation a { font-size: 16px; }
  .chapter-opening, .chapter-home .chapter-opening { display: block; padding-block: 30px 36px; margin-bottom: 32px; }
  .chapter-label { margin-bottom: 16px; }
  h1, .chapter-home h1 { font-size: clamp(34px, 9vw, 44px); line-height: 1.18; max-width: 22ch; }
  .chapter-deck { font-size: 20px; }
  .first-answer { font-size: 18px; padding: 18px; margin-top: 24px; border-left-width: 5px; }
  .photo-leaf-path { width: min(100%, 300px); aspect-ratio: 1; margin: 30px auto 0; }
  .photo-garden-seat, .photo-quiet-table { aspect-ratio: 3 / 2; border-radius: 90px; margin-bottom: 32px; }
  .chapter-reading { display: block; padding-bottom: 36px; }
  .anchor-rail { position: static; margin-bottom: 32px; padding: 22px; }
  .anchor-rail ul { display: flex; flex-wrap: wrap; gap: 2px 20px; }
  .anchor-rail a { min-height: 48px; }
  .rail-chapters { margin-top: 12px; padding-top: 4px; }
  .reading-body { max-width: none; }
  .chapter-reading:has(.reading-body > .editorial-photo) .reading-body { display: block; }
  .chapter-reading:has(.reading-body > .editorial-photo) .reading-body > .editorial-photo { aspect-ratio: 3 / 2; }
  .reading-section { padding-block: 28px; }
  .reading-section:nth-of-type(2n), .reading-section:nth-of-type(3n) { padding: 24px; }
  .chapter-recap { padding: 26px; }
  .chapter-index a { padding-block: 20px; }
  .index-name { font-size: 23px; }
  .chapter-steps { display: block; }
  .chapter-steps a { width: fit-content; margin-bottom: 12px; }
  .footer-links { gap: 4px 22px; }
  .word-controls { padding: 18px; }
  .word-input-row { flex-wrap: wrap; }
  .word-controls button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; font-size: 16px; }
  .handbook-header::before, .chapter-opening::before, .handbook-footer::before,
  .handbook-navigation, .anchor-rail, .word-controls, .editorial-photo, .reading-skip { display: none; }
  .site-boundary { width: 100%; }
  .chapter-reading, .chapter-home .chapter-opening, .chapter-reading:has(.reading-body > .editorial-photo) .reading-body { display: block; }
  .chapter-opening { padding-block: 16px; }
  .chapter-opening, .handbook-header, .handbook-footer, .reading-section:nth-of-type(n), .chapter-recap, .first-answer { color: #111; background: #fff; }
  a, .index-name, .index-note, .reading-section:nth-of-type(n) a, .reading-section:nth-of-type(n) .index-name, .reading-section:nth-of-type(n) .index-note { color: #111; }
  h1, .chapter-home h1 { font-size: 38px; }
  .chapter-steps a { background: #fff; color: #111; }
  .word-entry { break-inside: avoid; }
  [data-word-entry][hidden] { display: block !important; }
  .reading-section:nth-of-type(n) { padding: 18px 0; }
}
