@import url("style/book-style.css");
:root { --page-ratio: .8; color: var(--ink); background: #fff; font-family: var(--book-serif); font-synthesis: none; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { overflow: hidden; background: #fff; }
button { color: inherit; font: inherit; }
.room { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100dvh; padding: 22px 24px 20px; }
.book-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; width: min(100%, 1100px); margin: auto; }
.book-header h1 { margin: 0; font: 400 16px/1.3 var(--book-serif); letter-spacing: -.01em; }
.book-header a, .book-header span { font: 400 10px/1.4 var(--book-sans); color: #6e7365; text-decoration: none; }
.book-header span:last-child { text-align: right; }
.stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 16px 0; }
/* PageFlip derives leaf height from width. Reserve room for navigation. */
.book-rig { display: grid; place-items: center; width: min(100%, calc((100dvh - 140px) * var(--page-ratio) * 2), calc(640px * var(--page-ratio) * 2)); height: min(calc(100dvh - 140px), 640px); }
.book { position: relative; isolation: isolate; filter: drop-shadow(0 9px 12px rgb(29 37 21 / 15%)); transition: translate 760ms ease; }
.book[data-layout="landscape"][data-edge="front"] { translate: -25% 0; }
.book[data-layout="landscape"][data-edge="back"] { translate: 25% 0; }
.book-page { position: relative; overflow: hidden; background: var(--paper); }
.book-page.--left::before, .book-page.--right::before { position: absolute; inset-block: 0; z-index: 3; width: clamp(14px, 4%, 28px); content: ""; pointer-events: none; }
.book-page.--left::before { right: 0; background: linear-gradient(to left, rgb(28 30 24 / 12%), rgb(28 30 24 / 3%) 40%, transparent); }
.book-page.--right::before { left: 0; background: linear-gradient(to right, rgb(28 30 24 / 12%), rgb(28 30 24 / 3%) 40%, transparent); }
.controls { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 20px; width: min(100%, 280px); margin: auto; }
.controls button { border: 1px solid #dcdfd5; border-radius: 50%; width: 36px; height: 36px; padding: 0; background: #fff; font: 400 15px var(--book-sans); cursor: pointer; }
.controls button:disabled { opacity: .28; cursor: default; }
.status { display: grid; gap: 4px; text-align: center; }
.status span { font: 400 10px/1.4 var(--book-sans); letter-spacing: .04em; color: #666e5d; }
.status small { font: 400 9px/1.4 var(--book-sans); color: #969b8f; }
a:focus-visible, button:focus-visible { outline: 2px solid #6b735d; outline-offset: 4px; }
@media (max-width: 700px) { .room { padding: 16px 9px; } .book-header { grid-template-columns: 1fr auto; } .book-header h1 { font-size: 13px; } .book-header #orientation { display: none; } }
@media (prefers-reduced-motion: reduce) { .book { transition: none; } }
@media print { body { overflow: visible; } .book-header, .controls { display: none; } }
