/* Printed text stays on the visible paper while the front cover opens. */
.book-scene[data-phase=cover] .spread{display:block!important}
.book-scene[data-phase=cover] .spread .left-page{visibility:hidden}
.opening-chapter{position:absolute;inset:16% 12% 23% 34%;display:flex;flex-direction:column;justify-content:center;min-width:0;min-height:0;overflow:hidden;container-type:inline-size;color:#352516}
.opening-chapter h2{font-size:clamp(16px,18cqw,38px);line-height:1.12;margin:0;color:#352516;flex-shrink:0;letter-spacing:-.035em;overflow-wrap:normal;word-break:normal;hyphens:none}
.opening-chapter em{color:#745024}
.opening-chapter .chapter,.leaf-face .chapter{color:#352516}
/* Only the parchment moves. The leather binding and page stack stay behind. */
.turning-leaf{top:6.5%;left:50%;width:41%;height:84.5%}
.leaf-face{background-size:256.41% 123.46%;background-position:83.607% 42.105%;background-color:#e8cea0;border-radius:0 1.2% 1.2% 0;box-shadow:1px 0 2px #3e281f33}
.leaf-back{background-size:277.778% 123.46%;background-position:20.3125% 42.105%;border-radius:1.2% 0 0 1.2%}
.leaf-front .leaf-content{inset:11.243% 7.317% 10.65% 14.634%}
.leaf-back .leaf-content{inset:11.243% 14.634% 16.568% 19.512%}

/* Short reading rests; most of the scroll moves a cover or page. */
.journey{height:360vh;height:360svh}

/* Finish reading by turning the rear board from right to left. */
.book-scene[data-phase=closing] .spread .right-page{visibility:hidden}
.closing-board{position:absolute;left:50%;top:0;width:50%;height:100%;overflow:hidden;transform-origin:0 50%;visibility:hidden;z-index:6;backface-visibility:hidden;-webkit-backface-visibility:hidden;will-change:transform}
.closing-board>img{display:block;width:200%;max-width:none;height:100%;object-fit:fill;transform:translateX(-50%)}
.closing-board .right-page{inset:16% 24% 18% 12%}
.closing-board:after{content:'';position:absolute;inset:4% 6% 5% 0;background:linear-gradient(90deg,#392008,transparent);opacity:var(--board-shade,0);pointer-events:none}
.back-cover{position:absolute;left:-5.5%;top:-4%;width:61%;height:108%;transform-origin:91% 50%;visibility:hidden;z-index:6;backface-visibility:hidden;-webkit-backface-visibility:hidden;will-change:transform}
.back-cover>img{display:block;width:100%;height:100%;object-fit:fill;transform:scaleX(-1);filter:drop-shadow(0 12px 16px #0006)}

/* Black leather, gold binding, and matching parchment for every moving face. */
.leaf-face{background-image:url('open-book.v3.webp')}
/* Match the original cover footprint despite tighter generated outer margins. */
.cover>img{width:94%;height:94%}
.back-cover>img{width:94%;height:94%;margin-left:6%}
