/* Reading surfaces, reusable utilities, and the chapter's small data graphics. */
:root {
  color-scheme: light;
  --paper: #fff8eb;
  --paper-deep: #f6e7cd;
  --caramel: #efc391;
  --caramel-light: #f4dcbb;
  --ink: #38251c;
  --muted: #6e4d3b;
  --rule: #c8a17b;
  --brown: #75411f;
  --focus: #1c5260;
  --serif: Georgia, 'Times New Roman', Times, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.65 var(--serif); }
button, input, textarea { font: inherit; }
button, a, summary, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { cursor: pointer; }
input { accent-color: var(--brown); }
button:disabled { cursor: default; }
button, a, summary, input, textarea { outline-offset: 5px; }
:focus-visible { outline: 3px solid var(--focus); }
h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2, h3 { font-weight: 400; }
li, figcaption, td, th, legend, summary, button, label, footer, a { font-size: max(1rem, 16px); }
input[type='checkbox'] { width: 44px; height: 44px; flex: 0 0 44px; margin: 0; }
[hidden] { display: none !important; }
.flow > * + * { margin-block-start: 1.15rem; }
.measure { max-width: 67ch; }
.tap { min-height: 44px; }
.wrap { display: flex; flex-wrap: wrap; gap: .75rem 1.2rem; align-items: center; }
.grid-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.rule-top { border-top: 1px solid var(--rule); padding-top: 2rem; }
.inset { padding: clamp(1.2rem, 4vw, 2rem); }
.paper { background: var(--paper); }
.paper-panel { background: #fffdf6; border: 1px solid var(--rule); }
.caramel-panel { background: var(--caramel); }
.caramel-wash { background: var(--caramel-light); }
.caps { font-size: 16px; line-height: 1.5; letter-spacing: .07em; text-transform: uppercase; }
.text-lead { font-size: clamp(20px, 2.3vw, 25px); line-height: 1.52; max-width: 53ch; }
.only-small { display: none; }
.primer-shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); min-height: 100vh; }
.primer-index { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; padding: 32px 26px; border-right: 1px solid #c69666; scrollbar-color: var(--brown) var(--caramel); }
.index-name { display: flex; flex-direction: column; text-decoration: none; font-size: 37px; line-height: 1.16; padding: .2rem 0 1.5rem; }
.index-tag { font-size: 16px; line-height: 1.6; padding-top: .4rem; }
.index-group + .index-group { margin-top: 22px; }
.index-label { color: #573620; padding: 0 10px 5px; }
.index-link { display: flex; align-items: center; border-radius: 3px; margin: 0 -2px; padding: 8px 12px; font-size: 17px; line-height: 1.4; text-decoration: none; }
.index-link:hover { background: #f8dfbd; }
.index-link[aria-current='page'] { background: var(--ink); color: #fff8eb; }
.primer-reading { min-width: 0; padding: 52px clamp(32px, 5.7vw, 84px) 30px; }
.chapter, .guide-footer { max-width: 930px; margin-inline: auto; }
.chapter-opening { padding-bottom: 35px; border-bottom: 1px solid var(--rule); margin-bottom: 34px; }
.chapter-kicker { color: var(--muted); }
.chapter-kicker span { padding-inline: .5em; }
.chapter-title { font-size: clamp(48px, 5.7vw, 82px); line-height: 1.06; letter-spacing: -.055em; max-width: 17ch; overflow-wrap: break-word; }
.chapter-deck { color: var(--muted); font-size: clamp(20px, 2vw, 24px); line-height: 1.5; max-width: 49ch; }
.chapter-prose { max-width: 71ch; }
.chapter-prose .chapter-section { margin-block-start: 0; }
.chapter-prose .chapter-heading { margin-top: 2.6rem; }
.chapter-heading { font-size: clamp(28px, 3vw, 35px); line-height: 1.25; letter-spacing: -.022em; max-width: 34ch; }
.chapter-link { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: fit-content; max-width: 100%; padding: 9px 0; font-size: 18px; line-height: 1.4; text-decoration: underline; }
.chapter-link span:first-child { min-width: 0; }
.chapter-link span:last-child { flex: 0 0 auto; color: var(--brown); }
.building-blocks { margin-top: 2.5rem; border-radius: 4px 40px 4px 4px; }
.block-chain { display: flex; justify-content: space-between; position: relative; gap: 8px; width: min(100%, 580px); margin: 4px 0 24px; }
.block-chain::before { content: ''; position: absolute; inset: calc(50% - 1px) 0 auto; height: 2px; background: var(--brown); }
.chain-block { position: relative; background: var(--paper); border: 2px solid var(--brown); border-radius: 50%; flex: 0 1 55px; aspect-ratio: 1; }
.chain-block:nth-child(2n) { background: var(--brown); }
.building-blocks figcaption { color: var(--ink); }
.study-comparison { margin-block: 2.2rem; border-radius: 4px; }
.study-row { margin-top: 1.4rem; }
.bar-track { background: #fdf0db; height: 16px; border-radius: 2px; margin-top: .5rem; max-width: 600px; }
.bar { display: block; height: 100%; background: var(--brown); border-radius: 2px; }
.bar-anxiety { width: 88.57142857%; }
.bar-add-on { width: 100%; }
.study-comparison figcaption { margin-top: 1.4rem; }
.chapter-endnotes { margin-top: 3.2rem; }
.chapter-endnotes h2 { font-size: 27px; line-height: 1.3; }
.notes-list { list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; max-width: 67ch; }
.note-link { display: flex; align-items: center; width: fit-content; max-width: 100%; padding: 8px 0; font-size: 17px; line-height: 1.4; }
.note-label { font-size: 17px; line-height: 1.5; padding-top: 8px; }
.chapter-note > p:last-child { font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 68ch; }
.chapter-pager { margin-top: 2.3rem; padding-bottom: 1rem; }
.pager-link { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: .35rem; padding: .5rem 0; text-decoration: none; font-size: 20px; line-height: 1.45; }
.pager-link:last-child { align-items: flex-end; text-align: right; }
.pager-link .caps { color: var(--muted); }
.pager-link:hover > span:last-child { text-decoration: underline; text-underline-offset: .25em; }
.guide-footer { margin-top: 2rem; }
.guide-footer p { font-size: 16px; line-height: 1.7; }
.footer-links a { display: flex; align-items: center; padding: 8px 0; font-size: 16px; line-height: 1.5; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 10; display: flex; align-items: center; padding: 10px 18px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 12px; }
.question-workspace { max-width: 67ch; margin-top: 2rem; }
.question-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.question-group legend { padding: 0 0 1rem; font-size: 23px; line-height: 1.4; }
.question-choice { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--rule); cursor: pointer; font-size: 18px; line-height: 1.6; }
.question-choice:has(input:checked) { color: var(--brown); }
.question-choice span { min-width: 0; }
.question-tools { margin-top: 1.3rem; }
.button-outline, .button-solid { border: 1px solid var(--brown); border-radius: 3px; padding: 11px 16px; line-height: 1.4; font-size: 17px; }
.button-outline { background: transparent; color: var(--brown); }
.button-solid { background: var(--brown); color: var(--paper); }
.button-outline:hover { background: var(--caramel-light); }
.button-solid:hover { background: var(--ink); }
.chosen-questions h3 { font-size: 26px; line-height: 1.3; }
.question-output { padding-left: 1.4rem; }
.question-output li { font-size: 18px; line-height: 1.6; }
.question-status:empty { display: none; }
.copy-fallback { display: block; width: 100%; max-width: 100%; min-height: 180px; padding: 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--brown); font-size: 16px; line-height: 1.6; resize: vertical; }
.cost-questions { max-width: 67ch; margin-top: 1.5rem; }
table { border-collapse: collapse; width: 100%; table-layout: fixed; }
caption { text-align: left; font-size: 18px; padding: 0 0 15px; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); padding: 13px 15px; font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
th { font-weight: 400; }
thead { background: var(--caramel-light); }
th:first-child { width: 29%; }
@media (max-width: 1050px) and (min-width: 801px) {
  .primer-shell { grid-template-columns: 242px minmax(0, 1fr); }
  .primer-index { padding-inline: 20px; }
  .primer-reading { padding-inline: 34px; }
}
@media (max-width: 800px) {
  .only-wide { display: none; }
  .only-small { display: block; }
  .primer-shell { display: block; }
  .primer-index { position: relative; height: auto; overflow: visible; padding: 18px 22px 0; border-right: 0; border-bottom: 1px solid #c69666; }
  .index-name { font-size: 29px; padding: 0 0 12px; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 16px; }
  .index-tag { padding: 0; font-size: 16px; }
  .chapter-index summary { display: flex; justify-content: space-between; align-items: center; list-style: none; padding: 10px 0; font-size: 17px; line-height: 1.5; cursor: pointer; border-top: 1px solid #b7875b; }
  .chapter-index summary::-webkit-details-marker { display: none; }
  .chapter-index summary span { font-size: 23px; }
  .chapter-index[open] summary span { transform: rotate(45deg); }
  .chapter-index nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; padding: 20px 0 24px; }
  .index-group + .index-group { margin: 0; }
  .index-label { padding-inline: 9px; }
  .index-link { padding-inline: 9px; }
  .primer-reading { padding: 32px 22px 26px; }
  .chapter-opening { padding-bottom: 26px; margin-bottom: 25px; }
  .chapter-title { font-size: clamp(43px, 9.6vw, 67px); letter-spacing: -.045em; }
  .chapter-kicker { font-size: 16px; letter-spacing: .04em; }
  .chapter-deck { font-size: 21px; }
  .text-lead { font-size: 21px; }
  .chapter-heading { font-size: 29px; }
  .chapter-prose .chapter-heading { margin-top: 2rem; }
  .chapter-endnotes { margin-top: 2.6rem; }
  .chain-block { flex-basis: 40px; }
  .building-blocks { border-radius: 3px 25px 3px 3px; }
  .grid-pair { gap: 1rem; }
  th, td { padding: 12px 9px; font-size: 17px; }
  th:first-child { width: 33%; }
}
@media (max-width: 350px) {
  .index-name { flex-direction: column; gap: 3px; }
  .chapter-index nav { grid-template-columns: minmax(0, 1fr); }
  .primer-reading { padding-inline: 18px; }
  .grid-pair { grid-template-columns: minmax(0, 1fr); }
  .pager-link:last-child { align-items: flex-start; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .primer-shell { display: block; }
  .primer-index, .skip-link, .question-tools, .chosen-questions .wrap, .chapter-pager, .footer-links { display: none !important; }
  .primer-reading { padding: 0; }
  body { color: #000; background: #fff; font-size: 16px; }
  .chapter-title { font-size: 40px; }
  .question-choice, .chapter-note { break-inside: avoid; }
  .chosen-questions { border-color: #777; }
  .question-workspace.has-choices .question-group { display: none; }
  .question-workspace.has-choices .question-status { display: none; }
}
