/* The readable base is semantic; the small islands handle handbook navigation and art. */
:root {
  color-scheme: light;
  --paper: #faf9f5;
  --white: #ffffff;
  --ink: #243640;
  --subtle: #526168;
  --blue: #234e61;
  --oat: #ede9df;
  --line: #d1d6d3;
  --citron: #e8e9b5;
  --clay: #d6a08a;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.65 var(--sans); }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(2.35rem, 4.6vw, 4rem); line-height: 1.1; letter-spacing: -.035em; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 2.5vw, 2rem); line-height: 1.2; letter-spacing: -.018em; }
h3 { font-size: 18px; font-weight: 650; line-height: 1.4; }
p + p { margin-top: 1rem; }
ul, ol { padding-left: 1.3rem; }
li { padding-left: .2rem; }
li + li { margin-top: .65rem; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .23em; }
a[href] { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 3px; }
img { display: block; max-width: 100%; height: auto; }
strong { font-weight: 650; }
::selection { background: var(--citron); color: var(--ink); }
section[id] { scroll-margin-top: 1.5rem; }
.u-measure { max-width: 68ch; }
.u-wrap { overflow-wrap: anywhere; min-width: 0; }
main, .site-header, .site-footer { width: min(1192px, calc(100% - 96px)); margin-inline: auto; }
.eyebrow { font: 16px/1.5 var(--mono); letter-spacing: .015em; color: var(--subtle); }
.deck { font-size: 20px; line-height: 1.6; color: var(--subtle); margin-top: 1.4rem; max-width: 54ch; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 8px 16px; background: var(--white); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.site-header { min-height: 108px; display: flex; justify-content: space-between; align-items: center; gap: 2rem; border-bottom: 1px solid var(--line); }
.header-start { display: flex; align-items: center; gap: 2.25rem; }
.wordmark { gap: .75rem; text-decoration: none; color: var(--ink); line-height: 1.1; }
.wordmark span:first-child { font: 32px/1 var(--serif); letter-spacing: -.055em; }
.wordmark span:last-child { max-width: 9ch; padding-left: .8rem; border-left: 1px solid var(--line); font-size: 16px; line-height: 1.2; }
.site-header nav { display: flex; align-items: center; gap: 1.5rem; }
.site-header nav a { font-size: 16px; text-decoration: none; color: var(--ink); border-bottom: 2px solid transparent; padding-block: 9px; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { border-bottom-color: var(--blue); }
.home-opener { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 4.5rem; padding-block: 64px 54px; }
.home-opener h1 { margin-top: 1.3rem; font-size: clamp(2.75rem, 5.15vw, 4.65rem); max-width: 13ch; }
.home-opener .deck { max-width: 43ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; margin-top: 1.7rem; }
.hero-actions a { font-size: 17px; gap: 1rem; }
.primary-link { background: var(--blue); color: var(--white); padding: 13px 18px; text-decoration: none; border-radius: 6px; gap: 1rem; min-height: 52px; font-size: 17px; }
.primary-link:hover { background: #173e50; text-decoration: none; }
.art { position: relative; border: 1px solid #cfd2c8; background: var(--oat); border-radius: 12px; overflow: hidden; isolation: isolate; }
.art-base { width: 100%; height: 288px; position: relative; overflow: hidden; }
.home-opener .art-base { height: 358px; }
.art img { position: absolute; z-index: 2; inset: 0; width: 100%; height: calc(100% - 70px); object-fit: cover; color: transparent; font-size: 16px; clip-path: inset(24px round 16px); }
.art figcaption { min-height: 70px; position: relative; z-index: 3; border-top: 1px solid #cfd2c8; background: var(--oat); padding: 16px 20px; font-size: 16px; line-height: 1.45; }
.sheet { position: absolute; display: block; width: 43%; height: 64%; border: 2px solid var(--blue); border-radius: 6px; background: var(--paper); left: 23%; top: 18%; }
.sheet-back { transform: rotate(-12deg); background: var(--citron); }
.sheet-front { transform: rotate(7deg); left: 32%; top: 22%; }
.sheet-front::before, .sheet-front::after { content: ""; position: absolute; inset: 24% 17% auto; height: 3px; background: var(--blue); box-shadow: 0 27px 0 var(--blue), 0 54px 0 var(--blue); }
.sheet-front::after { height: 3px; top: 72%; right: 35%; box-shadow: none; }
.art-circle { position: absolute; width: 90px; height: 90px; border: 2px solid var(--blue); border-radius: 50%; right: 9%; top: 8%; background: var(--clay); }
.art-circle::before { content: ""; position: absolute; width: 36px; height: 36px; border: 2px solid var(--blue); border-radius: 50%; left: 25px; top: 25px; }
.art-tab { position: absolute; width: 48px; height: 75px; background: var(--blue); left: 11%; bottom: 12%; border-radius: 28px 28px 5px 5px; transform: rotate(12deg); }
.art-line { position: absolute; width: 27%; height: 20%; right: -4%; bottom: 5%; border: 2px solid var(--blue); border-right: 0; border-radius: 60px 0 0 60px; transform: rotate(-20deg); }
.art-notes .art-circle { width: 74px; height: 74px; top: 12%; right: 14%; }
.art-notes .art-circle::before { display: none; }
.art-notes .art-tab { height: 146px; width: 16px; left: 15%; bottom: 15%; border-radius: 3px 3px 10px 10px; transform: rotate(18deg); }
.art-record .sheet { transform: none; top: 19%; left: 25%; }
.art-record .sheet-front { top: 25%; left: 30%; }
.art-record .art-circle { width: 98px; height: 98px; background: var(--citron); right: 21%; top: 40%; }
.art-record .art-circle::before { width: 66px; height: 66px; top: 14px; left: 14px; background: var(--paper); }
.art-record .art-tab { width: 18px; height: 74px; left: auto; right: 18%; bottom: 8%; transform: rotate(-35deg); border-radius: 5px; }
.home-summary { border-top: 1px solid var(--line); padding-block: 52px 62px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 5rem; }
.home-summary article { max-width: 66ch; }
.home-summary h2 { margin-bottom: 1.5rem; }
.route-note { align-self: start; padding: 28px; border: 1px solid var(--line); border-radius: 10px; background: #f0f2ec; }
.route-note h2 { margin-block: 1.1rem 1rem; }
.route-note a { font-size: 17px; gap: 1rem; margin-block: 12px; }
.route-note .reading-meter { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 22px; }
.chapter-index { padding-block: 48px 70px; border-top: 1px solid var(--line); }
.index-heading { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem 4rem; align-items: start; margin-bottom: 40px; }
.index-heading .eyebrow { grid-row: 1 / span 2; }
.index-heading h2 { font-size: 36px; }
.index-heading > p:last-child { grid-column: 2; max-width: 55ch; color: var(--subtle); }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; }
.chapter-group { min-width: 0; }
.chapter-group h3 { margin-bottom: 12px; color: var(--subtle); font-size: 20px; }
.chapter-group ul { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.chapter-group li { padding: 0; margin: 0; border-bottom: 1px solid var(--line); }
.chapter-group a { width: 100%; min-height: 56px; justify-content: space-between; gap: 1rem; text-decoration: none; font-size: 18px; padding: 9px 2px; }
.chapter-group a:hover { background: var(--oat); }
.chapter-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; padding-block: 52px 80px; }
.chapter-rail { align-self: start; position: sticky; top: 24px; min-width: 0; }
.chapter-rail nav ul { list-style: none; padding: 0; margin-top: 14px; }
.chapter-rail nav li { padding: 0; margin-top: 2px; }
.chapter-rail nav a { text-decoration: none; font-size: 16px; line-height: 1.45; width: 100%; padding: 8px 10px 8px 14px; border-left: 2px solid var(--line); }
.chapter-rail nav a:hover { border-left-color: var(--blue); background: var(--oat); }
.chapter-return { font-size: 16px; margin-top: 22px; text-decoration: none; }
.reading-meter { margin-top: 36px; display: grid; grid-template-columns: 1fr; gap: 8px; font: 16px/1.5 var(--mono); color: var(--subtle); }
progress { width: 100%; height: 6px; border: 0; border-radius: 4px; background: var(--line); color: var(--blue); appearance: none; }
progress::-webkit-progress-bar { border-radius: 4px; background: var(--line); }
progress::-webkit-progress-value { border-radius: 4px; background: var(--blue); }
progress::-moz-progress-bar { border-radius: 4px; background: var(--blue); }
.chapter-reading { max-width: 760px; min-width: 0; }
.chapter-opener { margin-bottom: 46px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.chapter-opener h1 { max-width: 20ch; margin-top: 1.3rem; font-size: clamp(2.5rem, 4vw, 3.7rem); }
.chapter-reading > section { margin-block: 42px; }
.chapter-reading section h2 { margin-bottom: 20px; }
.chapter-reading .semax-subtopic { margin-top: 42px; }
.chapter-reading .topic-heading { font: 650 20px/1.4 var(--sans); letter-spacing: 0; color: var(--subtle); }
.chapter-reading .topic-heading + .semax-subtopic { margin-top: 20px; }
.chapter-reading h3.section-heading { font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 2.5vw, 2rem); line-height: 1.2; letter-spacing: -.018em; margin-bottom: 20px; }
.chapter-reading section ul { margin-block: 1rem 1.4rem; }
.chapter-reading .art { margin-block: 12px 40px; max-width: 600px; }
.cross-link { margin-top: 18px; }
.cross-link a { gap: 1rem; font-size: 17px; padding-block: 6px; max-width: 100%; }
.recap { border-left: 4px solid var(--blue); background: #edf0eb; padding: 24px 26px; margin-top: 30px; max-width: 68ch; border-radius: 0 8px 8px 0; }
.recap p { font-size: 18px; }
.recap .recap-label { font: 16px/1.5 var(--mono); margin-bottom: .7rem; color: var(--blue); }
.recap-label + p { margin-top: 0; }
.fee-grid { display: grid; gap: 16px; margin-top: 24px; }
.fee-grid > div { border: 1px solid var(--line); padding: 20px 22px; border-radius: 6px; background: var(--white); }
.fee-grid h3 { margin-bottom: 8px; }
.fee-grid p { font-size: 18px; }
.source-item { border-top: 1px solid var(--line); padding-block: 14px 20px; }
.source-item > a { font-size: 18px; gap: 1rem; text-decoration: none; font-weight: 600; }
.source-item > a:hover { text-decoration: underline; }
.source-item p { margin-top: 6px; color: var(--subtle); font-size: 18px; }
.chapter-pager { display: grid; grid-template-columns: 1fr 1fr; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); gap: 24px; }
.chapter-pager a { display: grid; align-content: start; gap: 5px; text-decoration: none; font-size: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 8px; }
.chapter-pager a > span { font-size: 16px; color: var(--subtle); }
.chapter-pager a:last-child { background: var(--citron); border-color: #c6c99c; }
.chapter-pager a:last-child span[aria-hidden] { justify-self: end; color: var(--blue); }
.site-footer { border-top: 1px solid var(--line); padding-block: 30px 36px; display: flex; justify-content: space-between; gap: 2rem; align-items: start; }
.site-footer p { max-width: 47ch; font-size: 16px; }
.site-footer nav { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: end; }
.site-footer a { font-size: 16px; padding-block: 8px; }
.missing-page { min-height: 58vh; padding-block: 80px; max-width: 900px; }
.missing-page h1 { margin-block: 20px 24px; }
.missing-page p { max-width: 60ch; }
.missing-page .primary-link { margin-top: 28px; }
@media (min-width: 1500px) {
  .chapter-shell { grid-template-columns: 250px minmax(0, 1fr); gap: 90px; }
}
@media (max-width: 1050px) {
  main, .site-header, .site-footer { width: calc(100% - 64px); }
  .site-header { gap: 1rem; }
  .header-start { gap: 1.25rem; }
  .site-header nav { gap: 1rem; }
  .wordmark { gap: .5rem; }
  .wordmark span:last-child { display: none; }
  .home-opener { gap: 2.5rem; }
  .home-summary { gap: 3rem; }
  .chapter-shell { grid-template-columns: 200px minmax(0, 1fr); gap: 36px; }
  .site-footer { display: block; }
  .site-footer nav { margin-top: 16px; justify-content: start; }
}
@media (max-width: 700px) {
  body { font-size: 18px; padding-bottom: 100px; }
  main, .site-header, .site-footer { width: calc(100% - 40px); }
  .site-header { padding-block: 16px 10px; display: block; }
  .header-start { justify-content: space-between; gap: 12px; }
  .wordmark { min-height: 48px; }
  .wordmark span:first-child { font-size: 31px; }
  .site-header nav { gap: 12px; }
  .site-header nav a { font-size: 16px; }
  .site-header .header-end { margin-top: 5px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 4px; }
  .home-opener { grid-template-columns: 1fr; padding-block: 38px 36px; gap: 34px; }
  .home-opener h1 { font-size: clamp(2.65rem, 11.4vw, 3.4rem); max-width: 14ch; }
  .deck { font-size: 19px; margin-top: 1.2rem; }
  .hero-actions { gap: 9px; }
  .hero-actions a { font-size: 17px; }
  .home-opener .art-base { height: 262px; }
  .art-base { height: 236px; }
  .art figcaption { padding: 16px; }
  .home-summary { grid-template-columns: 1fr; padding-block: 36px 42px; gap: 32px; }
  .route-note { padding: 24px; }
  .chapter-index { padding-block: 36px 48px; }
  .index-heading { display: block; margin-bottom: 28px; }
  .index-heading h2 { font-size: 31px; margin-block: 16px; }
  .chapter-grid { grid-template-columns: 1fr; gap: 28px; }
  .chapter-group a { min-height: 58px; }
  .chapter-shell { display: flex; flex-direction: column; gap: 34px; padding-block: 34px 54px; }
  .chapter-rail { position: static; width: 100%; order: 2; padding: 24px 0 0; border-top: 1px solid var(--line); }
  .chapter-rail nav { display: none; }
  .chapter-return { margin-top: 0; }
  .chapter-rail .reading-meter { position: fixed; z-index: 5; bottom: 16px; left: 20px; right: 20px; margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
  .chapter-rail .reading-meter progress { grid-column: 1 / -1; grid-row: 2; }
  .chapter-rail #reading-state { grid-column: 2; grid-row: 1; }
  .chapter-reading { order: 1; width: 100%; }
  .chapter-opener { margin-bottom: 32px; padding-bottom: 26px; }
  .chapter-opener h1 { font-size: 40px; margin-top: 18px; }
  .chapter-reading > section { margin-block: 32px; }
  .chapter-reading .semax-subtopic { margin-top: 32px; }
  .chapter-reading section h2 { font-size: 27px; }
  .chapter-reading h3.section-heading { font-size: 27px; }
  .chapter-reading .topic-heading { font-size: 20px; }
  .recap { padding: 22px 20px; }
  .recap p { font-size: 18px; }
  .chapter-pager { margin-top: 34px; gap: 12px; }
  .chapter-pager a { font-size: 17px; padding: 14px; }
  .chapter-pager strong { overflow-wrap: anywhere; }
  .source-item > a { font-size: 18px; line-height: 1.5; }
  .source-item p { font-size: 18px; }
  .site-footer { padding-block: 26px 30px; }
  .site-footer nav { gap: 8px 18px; }
  .missing-page { padding-block: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto; animation: none; transition: none; }
}
@media print {
  body { color: #000; background: #fff; font-size: 16px; }
  main { width: 100%; }
  .site-header, .chapter-rail, .hero-actions, .chapter-pager, .skip-link, .reading-meter { display: none; }
  .chapter-shell, .home-opener, .home-summary { display: block; }
  .chapter-reading { max-width: none; }
  .art { break-inside: avoid; }
  .site-footer { width: 100%; }
  .site-footer nav { display: none; }
  a { color: #000; }
}
