/* Cinematic, controllable atmosphere. Photos carry the light; text stays still. */
.atmosphere{position:absolute;inset:0;overflow:hidden;z-index:-1;pointer-events:none;background:var(--color-ink);isolation:isolate}
.atmosphere-room-track{position:absolute;inset:-5%;transform:translate3d(var(--room-x,0px),var(--room-y,0px),0);transition:transform 1100ms var(--ease-out)}
.atmosphere-drift{width:100%;height:100%;transform:scale(1.07);transform-origin:70% 45%}
.atmosphere .atmosphere-room{position:static;width:100%;height:100%;object-fit:cover;object-position:center;transform:none;opacity:1;z-index:auto;transition:none}
.atmosphere-light{position:absolute;inset:-20%;mix-blend-mode:screen;opacity:.44;transform:translate3d(var(--light-x,0px),var(--light-y,0px),0);transition:opacity 900ms ease,transform 1300ms var(--ease-out)}
.atmosphere-light img{width:100%;height:100%;object-fit:cover;opacity:.5;transform:translateX(-4%) rotate(-3deg);transform-origin:80% 0}
[data-scene].is-lit .atmosphere-light{opacity:.95}
[data-scene].is-lit .atmosphere-room-track{filter:brightness(1.2)}
.motion-ready:not(.motion-paused) .atmosphere-drift{animation:room-drift 16s ease-in-out infinite alternate}
.motion-ready:not(.motion-paused) .atmosphere-light img{animation:door-breath 11s ease-in-out infinite}
@keyframes room-drift{from{transform:scale(1.035) translate3d(-.8%,.3%,0)}to{transform:scale(1.1) translate3d(.8%,-.3%,0)}}
@keyframes door-breath{0%,100%{opacity:.2;transform:translate3d(-5%,1%,0) rotate(-4deg)}45%{opacity:.88;transform:translate3d(4%,-1%,0) rotate(3deg)}72%{opacity:.4;transform:translate3d(1%,0,0) rotate(0deg)}}
.scene-book{display:block;transform:perspective(1300px) rotateX(var(--book-rx,0deg)) rotateY(var(--book-ry,0deg));transition:transform 650ms var(--ease-out);transform-style:preserve-3d;transform-origin:50% 60%}
.scene-book img{box-shadow:calc(-14px + var(--shadow-x,0px)) 24px 60px rgba(0,0,0,.75);transition:box-shadow 700ms var(--ease-out)}
.motion-ready:not(.motion-paused) .cover-arrival{animation:cover-arrive 1500ms var(--ease-out) both}
@keyframes cover-arrive{from{opacity:.45;transform:perspective(1300px) translateY(24px) rotateY(-14deg) scale(.97)}to{opacity:1;transform:none}}
.scene-controls{display:flex;align-items:center;gap:12px 25px;flex-wrap:wrap}
.scene-control{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 0;border:0;border-bottom:1px solid rgba(184,149,106,.5);background:transparent;color:var(--color-text);font:14px/1.4 var(--font-body);text-underline-offset:5px;transition:color 200ms,border-color 200ms;white-space:normal}
.scene-control:hover{color:var(--color-accent-light);border-color:var(--color-accent-light)}
.scene-control[aria-pressed="true"][data-light-toggle]{color:var(--color-accent-light)}
.scene-control:disabled{cursor:default;color:var(--color-muted);border-color:transparent}
.hero-controls{position:absolute;left:24px;bottom:14px;z-index:2}
.hero .hero-inner{padding-bottom:90px}
.hero .hero-aside{bottom:115px}
.book-page .book-detail{position:relative;isolation:isolate}
.book-page .book-detail>.atmosphere{position:fixed;inset:0;z-index:-1}
.book-page .atmosphere-room-track{opacity:.56}
.book-page .atmosphere-light{opacity:.33}
.book-page .book-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px 35px;margin-bottom:30px}
.book-toolbar .detail-back{margin:0;flex-shrink:0}
.book-page .book-cover{position:sticky;top:130px;perspective:1300px}
.book-page .book-info{position:relative}
.book-page .book-description{color:#d9d1c5}
.book-page .book-title{max-width:100%}
.motion-ready:not(.motion-paused) .book-title{animation:title-arrive 1100ms var(--ease-out) both}
@keyframes title-arrive{from{opacity:.35;transform:translateY(16px)}to{opacity:1;transform:none}}
.book-page .story-beat{font-family:var(--font-display);font-size:23px;line-height:1.5;color:var(--color-muted);padding:20px 0 24px;margin:26px 0 15px;position:relative;transition:color 700ms ease}
.story-beat::after{content:"";display:block;width:100%;border-bottom:1px solid var(--color-accent);transform:scaleX(.05);transform-origin:left;margin-top:21px;transition:transform 1000ms var(--ease-out)}
.story-beat.is-read{color:var(--color-text)}
.story-beat.is-read::after{transform:scaleX(.32)}
.cover-caption{font-size:13px;line-height:1.6;letter-spacing:.03em;color:var(--color-accent-light);margin-top:25px;text-align:center}
@media(hover:hover) and (pointer:fine){.book-index a:hover{transform:translateY(-5px)}.book-cover:hover .scene-book{transition-duration:300ms}}
@media(max-width:1300px){.hero-controls{left:0}}
@media(max-width:800px){.hero-controls{bottom:15px}.book-page .book-toolbar{align-items:flex-start;gap:12px;flex-wrap:wrap}.book-page .book-cover{top:100px}.scene-controls{gap:10px 22px}.scene-control{font-size:13px}.book-page .atmosphere-room-track{opacity:.38}.book-page .atmosphere-light{opacity:.35}}
@media(max-width:600px){
 .hero .hero-inner{padding-bottom:32px}.hero-controls{position:static;grid-row:7;justify-content:center;margin-top:0;gap:8px 23px}
 .hero .atmosphere-room-track{opacity:.58}.hero .atmosphere-room{object-position:45% center}
 .hero .atmosphere-light{opacity:.5}.atmosphere-light{inset:-12%;transition-duration:700ms}
 .book-page .book-toolbar{display:block;margin-bottom:30px}.book-toolbar .scene-controls{margin-top:12px;justify-content:space-between;gap:10px}
 .book-page .book-cover{position:relative;top:auto;max-width:190px}.book-page .atmosphere-room{object-position:35% center}
 .book-page .book-description{font-size:17px}.book-page .story-beat{font-size:22px}.cover-caption{font-size:12px;margin-top:20px}
 .book-page .book-cover{margin-bottom:4px}.scene-control{min-height:44px}
}
@media(prefers-reduced-motion:reduce){
 .atmosphere-drift,.atmosphere-light,.atmosphere-light img,.atmosphere-room-track,.scene-book,.cover-arrival,.book-title{animation:none!important;transform:none!important;transition:none!important}
 .story-beat{color:var(--color-text)!important}.story-beat::after{transform:scaleX(.32)!important}
}
body.motion-paused .atmosphere-drift,body.motion-paused .atmosphere-room-track,body.motion-paused .atmosphere-light,body.motion-paused .atmosphere-light img,body.motion-paused .scene-book,body.motion-paused .cover-arrival{animation:none!important;transform:none!important}
body.motion-paused .atmosphere-light img{opacity:.45}
body.motion-paused .story-beat{color:var(--color-text)}
body.motion-paused .story-beat::after{transform:scaleX(.32)}
body.motion-hidden .atmosphere-drift,body.motion-hidden .atmosphere-light img{animation-play-state:paused!important}

