/* The manuscript remains a normal document; this layer gives it a book view. */
[hidden] { display: none !important; }
.skip { z-index: 100; }
html[data-reader="book"] { scroll-behavior: auto; overflow: hidden; }
html[data-reader="book"] body { height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #eeede7; }
html[data-reader="book"] .site-header { width: 100%; max-width: none; flex: 0 0 auto; padding: 15px 24px; min-height: 52px; gap: 1rem; border-color: #d7d5cc; }
html[data-reader="book"] .site-header nav { font-size: .75rem; gap: 1.4rem; }
.reader-toolbar, .reader-navigation, .reader-hint, .folio-running, .folio-number, .folio-turn, .folio-toc { font-family: "Timeless Grotesk", Arial, sans-serif; font-variation-settings: "STYL" 0; font-weight: 420; }
.reader-toolbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; width: min(100% - 48px, 1280px); margin: 0 auto; padding: 12px 0; font-size: .8125rem; }
.reader-location { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.reader-location label { margin: 0; font-size: .6875rem; color: #65645e; white-space: nowrap; }
.reader-location select { width: 24rem; max-width: 42vw; min-height: 38px; padding: .45rem 1.5rem .45rem .6rem; font-size: .75rem; border-color: transparent; border-bottom-color: #ceccc3; background: transparent; text-overflow: ellipsis; }
.reader-mode { display: flex; flex: 0 0 auto; align-items: center; gap: 3px; padding: 3px; border: 1px solid #cfcdc3; border-radius: 24px; }
.reader-mode button { background: transparent; border: 0; border-radius: 20px; font-size: .75rem; padding: 7px 15px; min-height: 34px; color: #51514a; white-space: nowrap; }
.reader-mode button[aria-pressed="true"] { background: #252820; color: #fffef9; }
.reader-mode button:focus-visible { outline-offset: 2px; }
.book-reader { flex: 1 1 auto; min-height: 0; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; padding: 4px 24px 12px; overflow: clip; }
.reader-canvas { min-height: 0; min-width: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding: 12px 12px 18px; }
.book-stage { position: relative; flex: 0 0 auto; min-width: 0; isolation: isolate; touch-action: pinch-zoom; }
.book-stage::before { content: ""; position: absolute; z-index: -1; inset: 3px -3px -5px; border: 1px solid #c8c5b9; border-radius: 2px; background: repeating-linear-gradient(to bottom, #faf9f4 0 1px, #d6d2c6 1px 2px); box-shadow: 0 2px 3px #332a1729, 0 16px 30px #332a172b, 0 2px 0 5px #cecabd; }
.page-book { width: 100%; height: 100%; margin: auto; outline-offset: 8px; }
.folio { color: var(--ink); background: #faf9f4; border: 1px solid #e5e2d8; overflow: hidden; }
.folio.--left { background: linear-gradient(90deg, #faf9f4 85%, #f6f4ed 94%, #e8e4d9 99%, #d0cbbc); border-radius: 2px 0 0 2px; border-right-color: #c6c0b1; }
.folio.--right { background: linear-gradient(90deg, #ddd7c8, #f4f1e8 3%, #faf9f4 11%, #faf9f4 98%, #f1eee5); border-radius: 0 2px 2px 0; }
.folio-inner { --folio-margin: clamp(24px, calc(var(--page-width) * .085), 44px); height: 100%; display: flex; flex-direction: column; padding: var(--folio-margin); }
.book-reader[data-orientation="landscape"] .folio.--left:not(.folio-front-cover) .folio-inner { padding-right: calc(var(--folio-margin) + 4px); }
.book-reader[data-orientation="landscape"] .folio.--right:not(.folio-front-cover) .folio-inner { padding-left: calc(var(--folio-margin) + 4px); }
/* The reader opens inside the book; the preceding cover can be turned back to. */
.folio.folio-cover-spacer { border: 0; background: transparent; box-shadow: none; }
.book-reader[data-orientation="landscape"] .book-stage[data-at-cover="true"]::before { left: calc(50% + 1px); }

.folio-running { flex: 0 0 auto; font-size: .5625rem; letter-spacing: .065em; text-transform: uppercase; margin-bottom: 1.6rem; line-height: 1.4; color: #65645d; }
.folio-body { flex: 1; min-height: 0; overflow: hidden; overflow-wrap: anywhere; font-size: 1.0625rem; line-height: 1.5; font-kerning: normal; font-variant-ligatures: common-ligatures; }
.folio-body p { text-wrap: pretty; }
.folio-body :is(h1,h2,h3) { overflow-wrap: anywhere; }
.folio-body h2 { font-size: 1.9rem; line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
.folio-body h3 { font-size: 1.0625rem; line-height: 1.3; }
.folio-number { flex: 0 0 auto; padding-top: .7rem; margin-top: auto; font-size: .625rem; text-align: right; line-height: 1.2; color: #67655c; }
.folio.--left .folio-number { text-align: left; }
.folio-turn { position: absolute; z-index: 8; bottom: 0; width: 42px; height: 42px; padding: 0; border: 0; background: transparent; color: transparent; font: inherit; font-size: 0; opacity: .75; transition: opacity 160ms, background 160ms; touch-action: none; cursor: grab; }
.folio-turn[data-direction="prev"] { left: 0; border-radius: 0 100% 0 0; }
.folio-turn[data-direction="next"] { right: 0; border-radius: 100% 0 0 0; }
.folio-turn::after { content: ""; position: absolute; bottom: 12px; width: 8px; height: 8px; border-bottom: 1px solid #6b6b5b; opacity: 0; transition: opacity 160ms; }
.folio-turn[data-direction="prev"]::after { left: 12px; border-left: 1px solid #6b6b5b; }
.folio-turn[data-direction="next"]::after { right: 12px; border-right: 1px solid #6b6b5b; }
.folio-turn:is(:hover, :focus-visible)::after { opacity: .6; }
.folio-turn:hover { opacity: 1; background: #6c725e0a; }
.book-reader[data-state="flipping"] .book-stage, .book-reader[data-state="flipping"] .book-stage * { cursor: grabbing; }
.reader-curl-layer { user-select: none; }
.folio-turn:disabled { opacity: 0; pointer-events: none; }
.reader-navigation { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(100%, var(--book-width, 1180px)); margin: 0 auto; font-size: .75rem; }
.reader-navigation button { font-size: inherit; background: transparent; border: 1px solid #d0cec4; border-radius: 20px; padding: 7px 14px; min-width: 92px; min-height: 36px; color: #323b29; white-space: nowrap; }
.reader-navigation button:hover:not(:disabled) { background: #e2e2d7; border-color: #b2b49f; }
.reader-navigation button:disabled { opacity: .3; cursor: default; }
.reader-navigation p { font-size: .6875rem; text-align: center; color: #585a4e; }
.reader-hint { margin-top: 6px; text-align: center; font-size: .625rem; color: #686a60; }
/* Source elements are repaginated without maintaining another manuscript. */
.folio .opening { display: flex; flex-direction: column; border: 0; padding: 0; gap: 0; }
.folio .opening h1 { font-size: clamp(2rem, calc(var(--page-width) * .12), 3.4rem); line-height: 1.03; letter-spacing: -.035em; font-weight: 400; }
.folio .opening .subtitle { font-family: "Timeless Grotesk", Arial, sans-serif; font-size: .9375rem; line-height: 1.45; font-style: normal; margin-top: 1.3rem; }
.folio .opening-note { display: grid; grid-template-columns: 1fr 1.2fr; gap: .55rem 1.1rem; margin-top: 1.35rem; padding: 0; font-size: .6875rem; }
.folio .opening-note p:last-child { grid-column: 1 / -1; }
.folio .opening-note p { margin: 0; }
.folio .premise { margin-top: 1.35rem; font-size: 1rem; line-height: 1.5; font-weight: 400; }
.folio .orientation > p, .folio .essay-section > p { margin-top: 1rem; }
.folio .contents { position: static; border: 0; padding: 0; font-size: .75rem; }
.folio .contents nav { display: grid; grid-template-columns: 1fr; gap: .65rem; }
.folio .contents .aside-note { display: block; max-width: none; margin-top: 1.25rem; }
.folio .contents nav span { display: inline; margin-right: .6rem; }
.folio .part-heading { display: block; padding-bottom: 1.6rem; }
.folio .part-heading h2 { font-family: "Timeless Grotesk", Arial, sans-serif; font-size: .625rem; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.folio .part-heading .caption { display: none; }
.folio .chapter { border: 0; }
.folio .chapter summary { display: block; padding: 0; list-style: none; cursor: default; }
.folio .chapter summary::after { display: none; }
.folio .chapter-number { display: block; font-size: .6875rem; font-variant-numeric: tabular-nums; letter-spacing: .08em; margin-bottom: .9rem; color: #65645d; }
.folio .chapter-title { font-size: 1.9rem; line-height: 1.1; letter-spacing: -.025em; font-weight: 400; text-wrap: balance; }
.folio .chapter-question { font-family: "Timeless Grotesk", Arial, sans-serif; font-size: .875rem; font-weight: 420; line-height: 1.5; margin-top: 1.15rem; }
.folio .chapter summary:hover .chapter-title { color: inherit; }
.folio .chapter-body { padding: 0; margin-top: 1.3rem; }
.folio .chapter-body > p + p { margin-top: .85rem; }
.folio .chapter-body > .chapter-output { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid #d6d2c7; font-size: .9375rem; line-height: 1.5; }
.folio .chapter-output > strong { font-family: "Timeless Grotesk", Arial, sans-serif; font-size: .6875rem; font-weight: 550; letter-spacing: .045em; text-transform: uppercase; }
.folio .folio-flow-start, .folio .folio-continuation { margin-top: 0 !important; }
.folio .chapter-output.folio-continuation { padding-top: 0; border-top: 0; }
.folio-body li.folio-continuation { list-style: none; }
.folio-cover:not(.folio-continuation-leaf) .folio-running,
.folio:has(.chapter summary) .folio-running { visibility: hidden; }
.folio-chapter-opener .folio-body { display: flex; flex-direction: column; justify-content: center; }
.folio .essay-section { border: 0; padding: 0; margin: 0; }
.folio .case-controls { display: grid; grid-template-columns: 1fr; gap: .7rem; margin: 0 0 1rem; }
.folio .case-controls label { font-size: .6875rem; }
.folio .case-controls select { font-size: .75rem; min-height: 2.4rem; padding-block: .35rem; }
.folio .case-spread { display: block; margin-top: 1.1rem; }
.folio .case-spread article { padding-top: .85rem; }
.folio .case-response { border-top: 1px solid var(--link); padding-top: .85rem; }
.folio .case-response h3 { margin-bottom: .85rem; }
.folio :is(dt, label) { font-weight: 500; }
.folio dt { margin-top: .8rem; }
.folio dd { margin-top: .25rem; }
.folio :is(ol, ul) { padding-left: 1.15rem; }
.folio li + li { margin-top: .55rem; }
.folio #case-actions { margin-block: .7rem; }
.folio .case-conclusion { margin-top: 1rem; }
.folio .caption { font-size: .6875rem; line-height: 1.45; }
.folio .reading { padding: 0; margin-top: 1.1rem; }
.folio .reading li { padding-top: .75rem; }
.folio .reading li + li { margin-top: .75rem; }
.folio footer { display: flex; flex-direction: column; border: 0; padding: 0; gap: 1.5rem; font-size: .875rem; }
.folio footer .caption { margin: 0; }
.folio-toc { list-style: none; padding: 0 !important; margin-top: 1.1rem; }
.folio-toc li { border-top: 1px solid #d9d6cb; padding-block: .5rem; margin: 0 !important; }
.folio-toc a { display: flex; align-items: baseline; gap: .7rem; color: var(--ink); text-decoration: none; font-size: .75rem; }
.folio-toc a:hover { color: var(--link); }
/* Plain text is a full reading mode, with comfortable lines and persistent controls. */
html[data-reader="text"] .reader-toolbar { position: sticky; top: 0; z-index: 20; width: 100%; max-width: none; padding: 10px max(24px, calc((100% - 1280px) / 2)); background: #f8f7f3f5; backdrop-filter: blur(12px); border-bottom: 1px solid #d9d6cb; }
html[data-reader="text"] { scroll-padding-top: calc(var(--reader-toolbar-height, 112px) + 16px); }
html[data-reader="text"] #reading-source [id] { scroll-margin-top: 0; }
html[data-reader="text"] .document-body { max-width: 68ch; }
html[data-reader="text"] :is(.orientation > p, .essay-section > p, .chapter-body) { font-size: 1.0625rem; line-height: 1.6; }
html[data-reader="text"] .chapter-title { font-size: 1.4rem; }
html[data-reader="text"] .chapter-body { line-height: 1.6; }
#reading-source, #reading-source :is(.opening, .opening > *, .document-layout, .document-body, .contents, .contents nav, .chapter, .chapter-body) { min-width: 0; }
#reading-source :is(h1, h2, h3, p, a, .chapter-title, .chapter-question) { overflow-wrap: anywhere; }
.reader-example-jump { float: left; padding: 0; border: 0; background: none; color: var(--link); font: inherit; text-decoration: underline; text-underline-offset: .2em; }
@media (min-width: 1600px) { .folio-body { font-size: 1.0625rem; } }
@media (max-width: 760px) {
  html[data-reader="book"] .site-header { padding: 12px 18px; flex-direction: row; align-items: center; min-height: 46px; font-size: .875rem; }
  html[data-reader="book"] .site-header nav { gap: .8rem; font-size: .6875rem; }
  .reader-toolbar { width: calc(100% - 36px); gap: .65rem; padding: 8px 0; }
  .reader-location { flex: 1; }
  .reader-location label { display: none; }
  .reader-location select { max-width: 100%; width: 100%; font-size: .6875rem; min-width: 0; }
  .reader-mode { gap: 1px; padding: 2px; }
  .reader-mode button { padding: 6px 10px; font-size: .6875rem; min-height: 34px; }
  .book-reader { padding: 2px 16px 10px; }
  .reader-canvas { padding: 8px 7px 14px; }
  .folio .opening h1 { font-size: clamp(2rem, calc(var(--page-width) * .12), 3.4rem); }
  .folio .opening .subtitle { font-size: 1rem; margin-top: 1rem; }
  .folio .opening-note { margin-top: 1.1rem; gap: .6rem 1rem; }
  .folio .premise { margin-top: 1.2rem; font-size: .9375rem; }
  .folio .chapter-title { font-size: 1.8rem; }
  .reader-navigation { font-size: .6875rem; gap: .5rem; }
  .reader-navigation button { min-width: 82px; min-height: 36px; padding-inline: 12px; }
  .reader-navigation p { font-size: .625rem; }
  .reader-hint { font-size: .5625rem; }
  html[data-reader="text"] .reader-toolbar { padding-inline: 18px; }
  #reading-source :is(.opening, .document-layout) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) { html[data-reader="book"] .site-header nav { display: none; } }
@media (max-width: 420px) {
  .reader-toolbar { flex-wrap: wrap; justify-content: flex-end; }
  .reader-location { flex: 1 1 12rem; }
  .reader-navigation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3px 12px; }
  .reader-navigation p { grid-column: 1 / -1; grid-row: 1; }
  .reader-navigation button:first-child { grid-column: 1; grid-row: 2; justify-self: start; }
  .reader-navigation button:last-child { grid-column: 2; grid-row: 2; justify-self: end; }
  #reading-source .contents nav { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 520px) and (orientation: landscape) {
  html[data-reader="book"] .site-header { padding-block: 7px; min-height: 34px; }
  .reader-toolbar { padding-block: 4px; }
  .book-reader { padding-bottom: 5px; }
  .reader-canvas { padding-block: 4px 9px; }
  .reader-hint { display: none; }
  .folio-inner { --folio-margin: 20px; padding: 14px 20px; }
  .folio-running { margin-bottom: .7rem; }
  .folio-number { padding-top: .4rem; }
}
/* A phone is the page: use the whole reading area between compact controls. */
@media (max-width: 560px) {
  html[data-reader="book"] .site-header { display: none; }
  html[data-reader="book"] .reader-toolbar { width: 100%; padding: 7px 12px; flex-wrap: nowrap; gap: 8px; }
  html[data-reader="book"] .reader-location { flex: 1 1 0; min-width: 0; }
  html[data-reader="book"] .reader-location select { min-height: 38px; }
  .book-reader { padding: 0; }
  .reader-canvas { padding: 0; }
  .book-stage::before { display: none; }
  .folio { border: 0; border-radius: 0; }
  .folio.--right, .folio.--left { background: #faf9f4; border-radius: 0; }
  .folio-inner { padding: clamp(20px, 6vw, 28px); }
  .reader-navigation { display: flex; width: 100%; gap: 8px; padding: 8px 12px; }
  .reader-navigation button { min-width: 76px; min-height: 36px; padding-inline: 10px; }
  .reader-navigation p { min-width: 0; font-size: .625rem; }
  .reader-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .folio-turn, .folio-turn::after { transition: none; } }
@media print {
  .skip, #reader-controls, #book-reader { display: none !important; }
  #reading-source { display: block !important; }
  html[data-reader], html[data-reader] body { height: auto; overflow: visible; display: block; background: white; }
}
