/* A single volume in a quiet, full-screen antique study. */
:root { --book-w: min(1080px, calc(100vw - 100px)); }
html { background: #17100c; }
body { background: #17100c; overflow-x: clip; }
.study-backdrop, .study-shade { position: fixed; inset: 0; pointer-events: none; }
.study-backdrop { background-color: #211810; background-image: url('assets/textures/antique-study.jpg'); background-size: cover; background-position: center; }
.study-shade { background: radial-gradient(ellipse at 50% 42%, transparent 25%, #0d080743 66%, #0b070aba 100%), linear-gradient(0deg, #130d0dc4, transparent 27%); }
.immersive-reader { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 28px 0 22px; isolation: isolate; }
.reading-space { position: relative; width: 100%; padding: 0 38px; overflow: visible; }
.book-scene { --book-h: clamp(500px, calc(100svh - 170px), 790px); height: calc(var(--book-h) + 16px); width: var(--book-w); max-width: 100%; padding: 8px 0; z-index: 2; }
.book { width: 100%; transition: transform 1250ms cubic-bezier(.23,.72,.2,1); }
.book-orbit { transition: transform 1250ms cubic-bezier(.23,.72,.2,1); }
.book-orbit:has(.is-closed) { animation: quiet-float 9s ease-in-out infinite; }
.book-scene:before { bottom: -18px; height: 38px; opacity: .8; background: #080301; filter: blur(24px); transition: width 1s, left 1s, opacity 1s; }
.book-scene:has(.is-closed):before { width: 46%; left: 27%; opacity: .9; }
.cover-design { box-shadow: inset 0 0 40px #1509016b, inset 4px 0 5px #eac78255, inset -2px -3px 4px #ddb37a45, 12px 16px 24px #08030066; }
.cover-title h1 { font-size: clamp(64px, 6.4vw, 94px); }
.cover-title { position: relative; }
.cover-inset { inset: 25px 29px 25px 36px; }
.page-content { padding: 27px 36px 22px; gap: 12px; }
.chapter-heading h2 { font-size: 46px; }
.intro-page .chapter-heading h2 { font-size: 49px; }
.running-head { padding-bottom: 11px; margin-bottom: 0; }
.sheet-face:after { background: linear-gradient(90deg, #37200f44, transparent 18%, #fff0c80a 60%, #2b160d20); }
.turning-sheet { filter: none; }
.turning-sheet.is-cover-turn .sheet-front { overflow: visible; }
.turning-sheet.is-cover-turn .sheet-front:after { display: none; }
.sheet-front { box-shadow: 12px 5px 24px #1a0c0230; }
.sheet-back { box-shadow: -12px 5px 24px #1a0c0230; }
.leaf-strip { position: absolute; left: 100%; top: 0; width: calc(var(--leaf-width) / 8); height: 100%; transform-origin: left center; transform-style: preserve-3d; transform: rotateY(var(--curl, 0deg)); }
.turning-sheet > .leaf-strip { left: 0; transform: none; }
.strip-face { position: absolute; inset: 0 -.25px 0 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--paper); transform: translateZ(.15px); }
.strip-back { transform: rotateY(180deg) translateZ(.15px); }
.strip-content { position: absolute; top: 0; left: calc(var(--slice) * var(--leaf-width) / -8); width: var(--leaf-width); height: 100%; color: var(--ink); background: url('assets/textures/aged-paper.jpg') center / 100% 100%; }
.strip-back .strip-content { left: calc((var(--slice) - 7) * var(--leaf-width) / 8); }
.strip-face:after { content: ''; position: absolute; inset: 0; background: #513118; opacity: var(--leaf-shade, 0); pointer-events: none; }
.strip-back:after { background: #fff2cd; }
.book.is-animating .binding { z-index: 22; }
.book.is-cover-moving .board-left, .book.is-cover-moving .stack-left { visibility: hidden; }
.book.is-cover-moving .edge-bottom { left: 50%; width: 50%; }
.page-grip { width: 48px; height: 48px; transition: filter .25s; }
.page-grip:hover { filter: brightness(1.13); }

/* Light originates at the binding and expands into the foreground. */
.book-light { position: absolute; width: min(1080px, 86vw); height: 100%; left: 50%; top: 0; transform: translateX(-50%); pointer-events: none; z-index: 5; opacity: 0; visibility: hidden; }
.book-light.is-active { visibility: visible; }
.book-light span { position: absolute; display: block; pointer-events: none; mix-blend-mode: screen; }
.light-halo { width: 82%; height: 105%; left: 9%; top: -12%; background: radial-gradient(ellipse, #ffdc7d46, #d99d3018 38%, transparent 69%); filter: blur(32px); }
.light-ray { transform-origin: 50% 75%; bottom: 18%; left: 5%; width: 90%; height: 115%; background: linear-gradient(0deg, #ffe4a7a1, #fbd06c48 27%, #f5c67108 85%, transparent); clip-path: polygon(48% 90%, 52% 90%, 96% 0, 4% 0); filter: blur(14px); }
.ray-left { transform: rotate(-24deg) scaleX(.65); opacity: .55; }
.ray-center { transform: scaleX(.85); opacity: .7; }
.ray-right { transform: rotate(24deg) scaleX(.6); opacity: .45; }
.light-bloom { width: 56%; height: 54%; left: 22%; top: 34%; background: radial-gradient(ellipse, #fff5d9b3, #ffd27555 25%, #e6b66514 48%, transparent 70%); filter: blur(18px); }

/* Small reader controls stay below the book; tools only appear on request. */
.reader-dock { position: relative; display: flex; align-items: center; justify-content: center; gap: 22px; width: min(520px, calc(100% - 36px)); margin: 22px auto 0; z-index: 30; }
.reader-controls { flex: 1; margin: 0; padding: 0; gap: 22px; max-width: 370px; }
.page-control { min-width: 36px; min-height: 40px; width: 40px; padding: 0; border: 1px solid #b59a6526; border-radius: 50%; color: #dbc798; background: #1c120e47; backdrop-filter: blur(10px); }
.page-control > span { font: 22px var(--serif); }
.page-control:disabled { opacity: .25; }
.page-control:hover:not(:disabled) { border-color: #b99b67a6; background: #51382066; }
.reading-progress { min-width: 140px; }
.page-caption { font-size: 10px; letter-spacing: .16em; color: #d9c59e; }
.chapter-dots { gap: 5px; margin-top: 7px; }
.chapter-dot { width: 18px; height: 18px; }
.reader-hint { position: relative; font-size: 9px; letter-spacing: .13em; color: #ba9f77; margin: 12px auto 0; padding: 0 16px; }
.reader-tools { position: relative; color: #cbb38a; flex: none; }
.reader-tools summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px; font-size: 11px; padding: 12px 3px; }
.reader-tools summary::-webkit-details-marker { display: none; }
.reader-tools summary > span:first-child { font-size: 23px; line-height: 1; }
.reader-tools summary:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
.tools-panel { position: absolute; bottom: calc(100% + 16px); left: 0; min-width: 250px; padding: 17px; border: 1px solid #b89a6340; border-radius: 8px; background: #241910ed; box-shadow: 0 12px 45px #0008; backdrop-filter: blur(18px); }
.scene-controls { margin: 0; padding: 0; flex-wrap: wrap; gap: 14px; }
.view-switch { width: 100%; justify-content: center; }
.view-switch button { flex: 1; min-height: 36px; }
.book-shortcuts { border-top: 1px solid #b89a6330; padding-top: 12px; margin-top: 14px; display: flex; justify-content: space-between; gap: 18px; }
.book-shortcuts button { background: none; padding: 5px 0; font-size: 12px; color: #d2ba8e; }
.no-script { position: relative; }
.contact-page .end-mark { font-size: 72px; margin-top: 0; }
.contact-page .copy-status:empty { display: none; }
.book-close { align-self: center; display: inline-flex; align-items: center; gap: 13px; padding: 9px 20px; border: 1px solid #9b78468c; border-radius: 2px; background: #8660300b; color: #6d4e28; font: 500 19px var(--serif); transition: background .25s, box-shadow .25s; }
.book-close:hover, .book-close:focus-visible { background: #b88a3020; box-shadow: 0 0 22px #c5933030; }
.book-close > span { font-size: 20px; }

@media (min-width: 761px) and (max-height: 850px) {
  .cover-inset { inset: 22px 27px 22px 34px; padding: 18px 23px; }
  .cover-title h1 { font-size: clamp(65px, 8.4svh, 85px); }
  .cover-kicker { margin-bottom: 16px; font-size: 10px; }
  .cover-author { margin-bottom: 17px; }
  .cover-subtitle { font-size: 21px; }
  .cover-rule { margin-top: 20px; }
  .page-content { padding: 21px 30px 19px; gap: 10px; }
  .page-content > p:not([class]), .drop-cap, .career-block > p:not([class]), .approach-item p { font-size: 14px; line-height: 1.6; }
  .chapter-heading h2 { font-size: 40px; }
  .intro-page .chapter-heading h2 { font-size: 44px; }
  .running-head, .small-label { font-size: 10px; }
  .contents-list button { padding-block: 8px; }
  .contents-page .chapter-heading h2 { font-size: 53px; }
  .timeline p, .toolkit-list p { font-size: 13px; }
  .journey-page .chapter-heading h2 { font-size: 36px; }
  .journey-page .timeline > div > span { font-size: 10px; }
  .journey-page .timeline { gap: 8px; }
  .journey-page .timeline h3 { font-size: 21px; }
  .toolkit-list > div { padding-block: 7px; }
  .toolkit-page .chapter-heading h2 { font-size: 40px; }
  .toolkit-list h3 { font-size: 23px; }
  .contact-page { gap: 9px; }
  .end-mark { font-size: 70px; margin-top: 0; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .page-content { padding-inline: 24px; }
  .cover-kicker { font-size: 10px; }
  .cover-inset { padding-inline: 22px; }
  .book-stat-row { gap: 18px; }
}
@media (max-width: 760px) {
  :root { --book-w: min(440px, calc(100vw - 46px)); }
  .immersive-reader { padding: 20px 0; }
  .reading-space { padding: 0 20px; overflow: clip; }
  .book-scene { --book-h: clamp(490px, calc(100svh - 160px), 740px); padding: 8px 0; height: calc(var(--book-h) + 20px); }
  .book-orbit:has(.is-closed) { animation: none; }
  .book.is-cover-moving .edge-bottom { left: 0; width: 100%; }
  .cover-inset { inset: 20px 22px 20px 26px; padding: 19px 19px; }
  .cover-title h1 { font-size: clamp(56px, 18vw, 80px); }
  .cover-kicker { font-size: 9px; margin-bottom: 18px; }
  .cover-edition { font-size: 9px; }
  .cover-subtitle { font-size: 20px; }
  .cover-author { margin-bottom: 20px; }
  .cover-author p { font-size: 11px; }
  .cover-author > span, .cover-instruction { font-size: 10px; }
  .cover-rule { margin-block: 21px 13px; }
  .page-content { padding: 24px 26px 20px; }
  .chapter-heading h2, .intro-page .chapter-heading h2 { font-size: 43px; }
  .reader-dock { gap: 18px; margin-top: 18px; width: min(380px, calc(100% - 42px)); }
  .reader-controls { gap: 10px; }
  .reader-hint { font-size: 8px; letter-spacing: .09em; }
  .reading-progress { min-width: 110px; }
  .chapter-dots { gap: 1px; }
  .book-light { width: 100%; }
  .light-bloom { width: 80%; left: 10%; }
  .light-ray { left: -10%; width: 120%; }
  .study-backdrop { background-position: 47% center; }
}
@media (max-width: 350px) {
  .cover-inset { inset: 17px 16px 17px 20px; padding-inline: 13px; }
  .cover-title h1 { font-size: 53px; }
  .cover-kicker { font-size: 8px; }
  .page-content { padding-inline: 20px; }
  .reader-tools summary > span:last-child { display: none; }
  .reader-dock { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-light { display: none; }
  .book, .book-orbit, .book-scene:before { transition: none; animation: none !important; }
}
