/* An independent, stationary book frame driven by native document scrolling. */
html { scroll-padding-top: 0; scroll-snap-type: y mandatory; scroll-behavior: auto; }
body { --book-gutter: clamp(28px, 4.2vw, 72px); --book-head: 84px; --book-foot: 76px; --page-type: 23px; --page-leading: 1.7; background: #080808; color: #e8e8e8; }
body::selection { background: #e9e9e9; color: #111; }
.book-frame { position: fixed; inset: 0; height: 100dvh; min-height: 0; display: grid; grid-template-rows: var(--book-head) minmax(0, 1fr) var(--book-foot); background: #080808; }
body .book-frame .site-header { height: var(--book-head); margin: 0 var(--book-gutter); border-color: #333; }
body .book-frame .header-actions { gap: 30px; }
body .book-frame .site-header .text-button { font-size: 14px; }
.book-stage { position: relative; min-height: 0; overflow: clip; isolation: isolate; }
.book-stop { height: var(--scroll-step, 100vh); scroll-snap-align: start; scroll-snap-stop: always; }
[hidden] { display: none !important; }

/* The same enlarged, faster Bloom globe forms the cover. */
body .book-frame .book-cover { position: absolute; inset: 0; min-height: 0; height: 100%; padding: 24px var(--book-gutter); }
body .book-cover .observatory-copy h1 { font-size: clamp(64px, 6.4vw, 102px); }
body .book-cover .cover-title-intro { display: block; font-size: .67em; line-height: 1.2; margin-bottom: .18em; color: #b5b5b5; }
body .book-cover .observatory-copy h1 .cover-title-name { display: block; line-height: 1.06; white-space: nowrap; color: #e8e8e8; }
body .book-cover .observatory-read { font-size: 16px; margin-top: 36px; }
body .book-cover .globe-figure { width: 100%; max-width: min(100%, calc(100dvh - 255px)); margin: 0; justify-self: center; }

/* The Margin layout stays still. Only the page and its chapter state change. */
.book-reader { position: absolute; inset: 0; height: 100%; min-height: 0; display: grid; grid-template-columns: 235px minmax(0, 690px) 162px; justify-content: space-between; gap: clamp(32px, 4vw, 64px); padding: 28px var(--book-gutter) 24px; background: #101010; visibility: hidden; pointer-events: none; }
.book-reader.is-active { visibility: visible; pointer-events: auto; }
.book-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.book-page-heading { flex: none; }
body[data-reading] .book-reader .manuscript-meta { font-size: 14px; min-height: 23px; align-items: baseline; }
body[data-reading] .book-reader .manuscript-title { font-size: clamp(52px, 5vw, 74px); line-height: .98; height: 2.12em; display: flex; align-items: center; margin: 12px 0 15px; letter-spacing: -.025em; }
.book-reader .manuscript-title span { display: block; text-wrap: balance; }
body[data-reading] .book-reader .manuscript-rule { min-height: 45px; padding: 12px 0; border-top-color: #777; align-items: center; }
.book-chapter-pages { font: 400 12px/1.5 var(--mono); letter-spacing: 0; color: #b0b0b0; }
.page-copy { flex: 1; min-height: 0; margin-top: 25px; overflow: hidden; font: 400 var(--page-type)/var(--page-leading) Georgia, 'Times New Roman', serif; letter-spacing: 0; color: #e0e0e0; overflow-wrap: break-word; }
.page-flow { display: flow-root; }
.page-fragment { margin: 0 0 .92em; }
.page-fragment:last-child { margin-bottom: 0; }
.page-fragment.salutation { font-size: 1.1em; font-style: italic; color: #ededed; }
.page-fragment.list-item { padding-left: 1.25em; text-indent: -1.25em; margin-bottom: .7em; }
.page-fragment.continued { text-indent: 0; }
.page-fragment.signature { margin-top: 8px; font: 400 19px/1.5 Georgia, serif; }
.page-fragment.signature .signature-name { font-size: 47px; line-height: 1.2; }
.book-measure { position: fixed; top: 0; left: -12000px; margin: 0; visibility: hidden; pointer-events: none; flex: none; }
body[data-reading] .book-reader .manuscript-sidebar { position: static; min-width: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #444 transparent; }
body[data-reading] .book-reader .sidebar-volume { font-size: 94px; margin: 0 0 24px; }
body[data-reading] .book-reader .manuscript-nav-item { min-height: 62px; font-size: 16px; padding: 14px 9px; }
body[data-reading] .book-reader .volume-tabs { margin-bottom: 18px; }
body[data-reading] .book-reader .volume-tabs button { min-height: 48px; }
body[data-reading] .book-reader .marginalia { min-height: 0; padding: 216px 0 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #444 transparent; }
body[data-reading] .book-reader .margin-note { margin: 0 0 15px; padding: 13px 0 16px; gap: 9px; font-size: 14px; color: #888; opacity: .7; }
body[data-reading] .book-reader .margin-note[aria-current=true] { color: #eee; opacity: 1; border-top-color: #aaa; }
body[data-reading] .book-reader .note-number { font-size: 29px; }
body[data-reading] .book-reader .margin-note > .eyebrow { font-size: 11px; }

/* Page controls and the chapter strip stay at the same place on every page. */
.book-footer { position: relative; background: #080808; padding: 0 var(--book-gutter); }
.book-progress { height: 12px; display: flex; gap: 5px; align-items: flex-start; }
.book-progress button { position: relative; flex: 1; height: 16px; min-width: 0; background: transparent; }
.book-progress button::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: #383838; }
.book-progress button.is-read::before { background: #888; }
.book-progress button[aria-current=page]::before { background: #efefef; height: 3px; }
.book-progress button:hover::before { background: white; }
.book-footer-line { display: flex; align-items: center; justify-content: space-between; gap: 25px; height: calc(var(--book-foot) - 12px); }
.book-location { min-width: 0; font: 400 14px/1.4 var(--sans); color: #c7c7c7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-location > span { display: inline-block; padding-left: 12px; }
.book-page-controls { display: flex; align-items: center; gap: 18px; flex: none; }
.book-page-controls button { width: 44px; height: 44px; border: 1px solid #777; border-radius: 50%; display: grid; place-items: center; color: #eee; font: 400 24px var(--sans); }
.book-page-controls button:hover:not(:disabled) { background: #eee; color: #111; }
.book-page-controls button:disabled { border-color: #333; color: #555; }
#book-page-number { font: 400 13px/1 var(--mono); color: #bdbdbd; min-width: 72px; text-align: center; }
.book-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.book-frame:has(.book-reader.is-active) .site-header { background: #101010; }
.book-frame:has(.book-reader.is-active) { background: #101010; }

@media (max-width: 1200px) {
  .book-reader { grid-template-columns: 214px minmax(0, 690px); gap: 40px; }
  body[data-reading] .book-reader .marginalia { display: none; }
}
@media (max-width: 900px) {
  body { --book-gutter: 28px; }
  .book-reader { grid-template-columns: 180px minmax(0, 1fr); gap: 28px; }
  body[data-reading] .book-reader .manuscript-nav-item { font-size: 15px; grid-template-columns: 20px minmax(0, 1fr) 12px; gap: 7px; padding-left: 7px; padding-right: 7px; }
  body[data-reading] .book-reader .manuscript-title { font-size: 54px; }
  body { --page-type: 22px; }
}
@media (max-width: 700px) {
  body { --book-gutter: 24px; --book-head: 68px; --book-foot: 74px; --page-type: 21px; --page-leading: 1.7; }
  body .book-frame .site-header { margin: 0 24px; gap: 12px; }
  body .book-frame .brand { font-size: 19px; gap: 10px; }
  body .book-frame .brand img { width: 23px; height: 28px; }
  body .book-frame .header-actions { gap: 20px; }
  body .book-frame .site-header .text-button { font-size: 13px; gap: 9px; }
  body .book-frame .book-cover { display: flex; flex-direction: column; align-items: stretch; padding: 29px var(--book-gutter) 10px; }
  body .book-cover .observatory-copy h1 { font-size: clamp(49px, 14.5vw, 69px); }
  body .book-cover .observatory-read { font-size: 14px; margin-top: 20px; }
  body .book-cover .globe-figure { position: absolute; bottom: 4px; left: 16%; width: 74%; max-width: min(74%, calc(100dvh - 432px)); margin: 0; align-self: auto; }
  body .book-cover .globe-stage { pointer-events: auto; }
  .book-reader { display: block; padding: 24px var(--book-gutter) 25px; }
  body[data-reading] .book-reader .manuscript-sidebar { display: none; }
  .book-main { height: 100%; }
  body[data-reading] .book-reader .manuscript-meta { font-size: 13px; }
  body[data-reading] .book-reader .manuscript-title { font-size: clamp(46px, 12.8vw, 62px); height: 2.2em; margin: 8px 0 13px; }
  body[data-reading] .book-reader .manuscript-rule { min-height: 43px; padding: 10px 0; }
  body[data-reading] .book-reader .manuscript-rule > .eyebrow { font-size: 13px; }
  .page-copy { margin-top: 22px; }
  .book-chapter-pages { font-size: 11px; }
  .book-footer-line { gap: 15px; }
  .book-location { font-size: 12px; }
  .book-page-controls { gap: 9px; }
  .book-page-controls button { width: 44px; height: 44px; font-size: 22px; }
  #book-page-number { min-width: 63px; font-size: 12px; }
  .book-progress { gap: 4px; }
}
@media (max-width: 370px) {
  body { --book-gutter: 20px; }
  body .book-frame .site-header { margin: 0 20px; }
  body .book-frame .brand { font-size: 18px; }
  .book-location { max-width: 106px; }
  body .book-cover .observatory-copy h1 { font-size: 47px; }
  body .book-cover .globe-figure { max-width: min(74%, calc(100dvh - 395px)); }
}
@media (max-height: 650px) and (min-width: 701px) {
  body { --book-head: 64px; --book-foot: 60px; --page-type: 21px; --page-leading: 1.6; }
  .book-reader { padding-top: 16px; padding-bottom: 18px; }
  body[data-reading] .book-reader .manuscript-title { font-size: 49px; height: 1.95em; margin: 7px 0 9px; }
  body[data-reading] .book-reader .sidebar-volume { font-size: 64px; margin-bottom: 15px; }
  body[data-reading] .book-reader .marginalia { padding-top: 158px; }
  .page-copy { margin-top: 18px; }
  body .book-cover .observatory-copy h1 { font-size: clamp(48px, 6vw, 75px); }
  body .book-cover .observatory-read { margin-top: 20px; }
  body .book-cover .globe-figure { max-width: min(100%, calc(100dvh - 180px)); }
  body .book-cover::after { height: 150px; }
}
@media (max-height: 470px) {
  body { --book-head: 56px; --book-foot: 55px; --page-type: 20px; --page-leading: 1.5; }
  .book-reader { grid-template-columns: minmax(0, 680px); justify-content: center; padding: 12px var(--book-gutter); }
  body[data-reading] .book-reader .manuscript-sidebar { display: none; }
  body[data-reading] .book-reader .manuscript-title { font-size: 39px; height: 1.2em; margin: 4px 0 8px; }
  body[data-reading] .book-reader .manuscript-meta { font-size: 12px; min-height: 18px; }
  body[data-reading] .book-reader .manuscript-rule { padding: 6px 0; min-height: 30px; }
  .page-copy { margin-top: 12px; }
  .page-fragment.signature { flex-direction: row; align-items: baseline; gap: 8px; }
  .page-fragment.signature .signature-name { font-size: 30px; }
  body .book-frame .book-cover { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 10px var(--book-gutter); }
  body .book-cover .observatory-copy h1 { font-size: 42px; }
  body .book-cover .observatory-read { margin-top: 10px; font-size: 13px; }
  body .book-cover .globe-figure { position: relative; bottom: auto; left: auto; width: 100%; max-width: calc(100dvh - 160px); justify-self: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  #scroll-track, .book-footer, .book-cover { display: none !important; }
  .book-frame { position: static; height: auto; display: block; }
  .book-stage { overflow: visible; }
  .book-reader { position: static; display: block; visibility: visible; padding: 0; }
  .book-page-heading { display: none; }
  .page-copy { overflow: visible; margin: 0; color: #000; font-size: 12pt; }
  .page-fragment { break-inside: avoid; }
}

/* Keep the globe's position after removing its former controls. */
body .book-cover .globe-figure { padding-bottom: 44px; }
body[data-reading] .index-top > .eyebrow { text-transform: none; }
@media (max-width: 370px) {
  body .book-frame .brand { font-size: 17px; gap: 8px; }
}
