/* Atlas Bright interactive Library — standalone additions only. */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.library-page{background:#fff}
.library-page .site-header{z-index:300}
.library-hero{position:relative;overflow:hidden;padding:86px 0 76px;background:
radial-gradient(circle at 80% 18%,rgba(123,67,239,.17),transparent 28%),
radial-gradient(circle at 67% 70%,rgba(22,189,243,.12),transparent 28%),
linear-gradient(135deg,#061641 0%,#071b55 48%,#25146c 100%);color:#fff}
.library-hero:before{content:"";position:absolute;inset:0;background-image:radial-gradient(circle,rgba(255,255,255,.4) 0 1px,transparent 1.5px);background-size:46px 46px;opacity:.12;mask-image:linear-gradient(to bottom,#000,transparent 80%)}
.library-hero-grid{display:grid;grid-template-columns:1.03fr .97fr;gap:64px;align-items:center;position:relative;z-index:1}
.library-hero .breadcrumbs{color:#9fb0dc}.library-hero .breadcrumbs a{color:#9bdcff}
.library-eyebrow{background:rgba(255,255,255,.09);border-color:rgba(255,255,255,.16);color:#fff;box-shadow:none}
.library-hero h1{color:#fff;font-size:clamp(3rem,6vw,5.6rem);max-width:740px}
.library-hero .lead{color:#ced9fa;max-width:680px}
.library-hero .btn-secondary{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18);color:#fff}
.library-hero-note{display:flex;gap:20px;flex-wrap:wrap;margin-top:27px;color:#b9c7ee;font-size:.9rem;font-weight:750}
.library-hero-note span{display:flex;align-items:center;gap:8px}.library-hero-note b{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;background:rgba(255,184,23,.13);border:1px solid rgba(255,184,23,.28);color:#ffd462}
.library-hero-scene{min-height:460px;position:relative;display:grid;place-items:center;perspective:1000px}
.library-window-glow{position:absolute;width:350px;height:350px;border-radius:50%;background:radial-gradient(circle,#5b4ce0 0%,rgba(66,66,189,.38) 30%,transparent 72%);filter:blur(4px);opacity:.6}
.library-hero-mark{position:relative;width:205px;height:205px;padding:25px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.15);box-shadow:0 30px 90px rgba(0,0,0,.25),inset 0 0 50px rgba(73,156,255,.08);backdrop-filter:blur(8px)}
.library-hero-mark:before,.library-hero-mark:after{content:"";position:absolute;border:1px solid rgba(92,164,255,.24);border-radius:50%;inset:-34px}.library-hero-mark:after{inset:-72px;border-color:rgba(255,184,23,.13)}
.library-hero-mark img{width:140px;filter:drop-shadow(0 12px 28px rgba(0,0,0,.25))}
.hero-mini-shelf{position:absolute;bottom:28px;left:50%;transform:translateX(-50%);width:min(440px,92%);height:112px;border-bottom:18px solid #7a4b27;box-shadow:0 16px 24px rgba(0,0,0,.22);display:flex;align-items:end;justify-content:center;gap:7px;padding:0 28px 10px}
.hero-mini-shelf:after{content:"";position:absolute;left:0;right:0;bottom:-18px;height:5px;background:#c98b4f;opacity:.65}
.hero-mini-shelf span{width:45px;height:82px;border-radius:5px 7px 1px 1px;background:linear-gradient(90deg,color-mix(in srgb,var(--mini),#000 24%),var(--mini) 55%,color-mix(in srgb,var(--mini),#fff 12%));box-shadow:inset -4px 0 9px rgba(255,255,255,.12),4px 5px 10px rgba(0,0,0,.24);transform:rotate(var(--r,0deg))}.hero-mini-shelf span:nth-child(2){height:95px;--r:-2deg}.hero-mini-shelf span:nth-child(3){height:104px}.hero-mini-shelf span:nth-child(4){height:88px;--r:2deg}.hero-mini-shelf span:nth-child(5){height:98px}
.library-star{position:absolute;color:#ffd054;text-shadow:0 0 20px rgba(255,203,69,.6);animation:libraryTwinkle 3.4s ease-in-out infinite}.library-star-one{top:12%;right:10%;font-size:24px}.library-star-two{left:12%;top:34%;font-size:13px;animation-delay:.8s}.library-star-three{right:18%;bottom:33%;font-size:15px;animation-delay:1.5s}
@keyframes libraryTwinkle{50%{opacity:.35;transform:scale(.75)}}

.library-intro-section{padding:88px 0 100px;background:linear-gradient(#f8faff,#f3f5fc)}
.library-section-head{display:grid;grid-template-columns:1fr auto;gap:30px;align-items:end;margin-bottom:40px}.library-section-head h2{margin:8px 0 12px}.library-section-head p{color:var(--muted,#63708f);max-width:780px;margin:0}.library-kicker{font-size:.79rem;font-weight:900;letter-spacing:.16em;color:#167cf8}
.library-legend{font-size:.82rem;font-weight:800;color:#5d6a88;display:flex;align-items:center;gap:8px;white-space:nowrap}.legend-dot{width:9px;height:9px;border-radius:50%;display:inline-block}.legend-production{background:#ffb817}.legend-planned{background:#8390b2;margin-left:9px}
.library-room{position:relative;overflow:hidden;border-radius:34px;padding:32px 32px 50px;background:
radial-gradient(circle at 50% -10%,rgba(82,121,255,.14),transparent 38%),linear-gradient(145deg,#061641,#0a2059 58%,#111b48);border:1px solid rgba(255,255,255,.08);box-shadow:0 30px 80px rgba(9,25,74,.22)}
.library-room:before{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.02) 1px,transparent 1px);background-size:52px 52px;opacity:.45;pointer-events:none}
.library-room-top{position:relative;display:flex;align-items:center;gap:20px;justify-content:center;color:#ffd26b;font-size:.75rem;letter-spacing:.24em;margin:0 auto 30px}.library-room-top span{height:1px;width:90px;background:linear-gradient(90deg,transparent,rgba(255,210,107,.5))}.library-room-top span:last-child{background:linear-gradient(90deg,rgba(255,210,107,.5),transparent)}
.library-shelves{position:relative;z-index:1;display:grid;gap:33px}.library-shelf-block{min-width:0}.library-shelf-label{display:flex;align-items:baseline;gap:12px;padding:0 9px 10px;color:#fff}.library-shelf-label span{font-size:.74rem;font-weight:900;color:#ffbf28}.library-shelf-label h3{color:#fff;font-size:1rem;letter-spacing:.03em}.library-shelf-label small{margin-left:auto;color:#8599ca;font-weight:700}
.library-shelf-row{position:relative;padding:0 20px 22px}.library-books-row{height:240px;display:flex;align-items:flex-end;justify-content:center;gap:10px;overflow:visible;padding:0 14px 4px}
.library-wood-shelf{position:absolute;left:0;right:0;bottom:0;height:25px;border-radius:5px;background:linear-gradient(#c38b55 0 18%,#85502e 19% 75%,#5a321f 76%);box-shadow:0 11px 17px rgba(0,0,0,.38),inset 0 2px rgba(255,230,182,.4)}
.library-wood-shelf span{display:block;position:absolute;left:6%;right:6%;bottom:-10px;height:10px;background:#40251a;border-radius:0 0 6px 6px;opacity:.7}
.shelf-book{--accent:#167cf8;--accent2:#7b43ef;position:relative;flex:0 0 72px;height:214px;padding:0;border:0;background:transparent;cursor:pointer;transform:rotate(var(--tilt)) translateY(0);transform-origin:center bottom;transition:transform .28s ease,filter .28s ease;filter:drop-shadow(6px 8px 8px rgba(0,0,0,.28));z-index:1}
.shelf-book:hover,.shelf-book:focus-visible{transform:rotate(0deg) translateY(-15px) scale(1.035);filter:drop-shadow(8px 16px 12px rgba(0,0,0,.34));z-index:5;outline:none}.shelf-book:focus-visible .shelf-book-spine{box-shadow:0 0 0 3px #fff,0 0 0 6px #ffb817}
.shelf-book-spine{position:absolute;inset:0;border-radius:6px 8px 2px 2px;display:flex;flex-direction:column;align-items:center;background:linear-gradient(90deg,color-mix(in srgb,var(--accent),#000 34%) 0%,var(--accent) 22%,color-mix(in srgb,var(--accent2),#fff 5%) 72%,color-mix(in srgb,var(--accent2),#000 22%) 100%);border:1px solid rgba(255,255,255,.13);overflow:hidden;box-shadow:inset 4px 0 10px rgba(255,255,255,.09),inset -7px 0 13px rgba(0,0,0,.2)}
.shelf-book-spine:before{content:"";position:absolute;inset:4px;border:1px solid rgba(255,255,255,.16);border-radius:4px;pointer-events:none}.shelf-book-top{position:absolute;left:4px;right:4px;top:-4px;height:8px;border-radius:50%;background:#f6eddb;z-index:2;box-shadow:inset 0 -3px #d7c7a9}
.spine-mark{width:36px;height:36px;margin-top:14px;border-radius:10px;background:rgba(255,255,255,.12);display:grid;place-items:center}.spine-mark img{width:29px}.spine-volume{margin-top:10px;color:#ffe397;font-size:.58rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.shelf-book-spine strong{writing-mode:vertical-rl;transform:rotate(180deg);height:105px;margin:7px 0;color:#fff;font-size:.69rem;line-height:1.12;letter-spacing:.01em;text-align:left}.spine-symbol{margin-top:auto;margin-bottom:10px;color:#fff;font-size:1.35rem;font-weight:900}.shelf-status{position:absolute;left:50%;bottom:6px;transform:translateX(-50%);z-index:3;background:#ffbf28;color:#4a3000;font-size:.42rem;font-weight:950;letter-spacing:.08em;padding:4px 5px;border-radius:5px;white-space:nowrap}
.library-instruction{text-align:center;color:#63708f;margin:22px 0 0;font-size:.94rem}.library-instruction span{font-weight:900;color:#071b55}
.library-why-section{background:#fff}.library-info-card>span{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#eef3ff;color:#167cf8;font-weight:900;margin-bottom:18px}.library-bottom-section{padding-top:74px}.library-cta-panel{background:linear-gradient(120deg,rgba(255,255,255,.07),rgba(255,255,255,.035));border:1px solid rgba(255,255,255,.12)}

.library-stage{position:fixed;inset:0;z-index:500;display:grid;place-items:center;padding:24px;perspective:1500px}.library-stage[hidden]{display:none}.library-stage-backdrop{position:absolute;inset:0;background:rgba(3,10,35,.78);backdrop-filter:blur(13px);opacity:0;transition:opacity .26s ease}.library-stage.is-open .library-stage-backdrop{opacity:1}.library-stage-panel{position:relative;width:min(980px,100%);min-height:650px;border:1px solid rgba(255,255,255,.12);border-radius:30px;background:radial-gradient(circle at 50% 25%,rgba(72,83,185,.23),transparent 34%),linear-gradient(145deg,#07184c,#08133b);box-shadow:0 40px 110px rgba(0,0,0,.5);padding:26px 34px 25px;display:grid;grid-template-rows:auto 1fr auto auto;align-items:center;justify-items:center;color:#fff;opacity:0;transform:translateY(24px) scale(.96);transition:opacity .26s ease,transform .3s cubic-bezier(.2,.85,.25,1)}.library-stage.is-open .library-stage-panel{opacity:1;transform:none}
.library-stage-close{position:absolute;right:18px;top:16px;width:42px;height:42px;border-radius:50%;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.08);color:#fff;font-size:1.6rem;cursor:pointer;z-index:3}.library-stage-copy{text-align:center;padding:4px 54px 10px}.library-stage-volume{display:block;color:#ffca44;font-size:.72rem;font-weight:900;letter-spacing:.14em;text-transform:uppercase}.library-stage-copy h2{color:#fff;font-size:clamp(1.45rem,3vw,2.35rem);margin:7px 0}.library-stage-copy p{margin:0;color:#9fb0dc;font-size:.9rem}
.library-featured-book{width:300px;height:425px;border:0;padding:0;background:transparent;cursor:pointer;perspective:1800px;position:relative}.library-featured-book:focus-visible{outline:3px solid #ffbf28;outline-offset:9px;border-radius:13px}.library-book-3d{position:absolute;inset:0;display:block;transform-style:preserve-3d;transition:transform .75s cubic-bezier(.2,.72,.18,1);filter:drop-shadow(24px 26px 24px rgba(0,0,0,.36))}.library-book-3d.is-flipped{transform:rotateY(180deg)}
.library-book-face{position:absolute;inset:0;border-radius:8px 14px 14px 8px;overflow:hidden;backface-visibility:hidden;-webkit-backface-visibility:hidden;border:1px solid rgba(255,255,255,.18)}.library-book-front{--accent:#167cf8;--accent2:#7b43ef;background:linear-gradient(145deg,color-mix(in srgb,var(--accent),#071b55 42%),var(--accent) 44%,var(--accent2));box-shadow:inset 9px 0 15px rgba(0,0,0,.22),inset -4px 0 12px rgba(255,255,255,.1)}.library-book-back{--accent:#167cf8;--accent2:#7b43ef;transform:rotateY(180deg);background:linear-gradient(160deg,color-mix(in srgb,var(--accent2),#071b55 52%),#071b55 74%);padding:30px 27px 24px;text-align:left;display:flex;flex-direction:column;box-shadow:inset -7px 0 13px rgba(0,0,0,.2)}.library-book-pages{position:absolute;top:8px;right:-8px;bottom:7px;width:14px;border-radius:2px 8px 8px 2px;background:repeating-linear-gradient(to right,#fff7e9 0 2px,#e7dcc6 2px 3px);transform:translateZ(-4px);box-shadow:4px 2px 8px rgba(0,0,0,.3)}
.cover-glow{position:absolute;width:270px;height:270px;border-radius:50%;right:-95px;top:-78px;background:radial-gradient(circle,rgba(255,255,255,.23),transparent 68%)}.cover-network{position:absolute;inset:0;background-image:radial-gradient(circle at 78% 25%,rgba(255,255,255,.55) 0 2px,transparent 2.5px),radial-gradient(circle at 69% 36%,rgba(255,255,255,.38) 0 2px,transparent 2.5px),radial-gradient(circle at 86% 45%,rgba(255,255,255,.4) 0 2px,transparent 2.5px);opacity:.8}.cover-brand{position:absolute;left:24px;right:24px;top:22px;display:flex;align-items:center;gap:8px;color:#fff;font-size:.63rem;letter-spacing:.16em}.cover-brand img{width:30px;height:30px;object-fit:contain}.cover-volume{position:absolute;left:25px;top:84px;color:#ffe08d;font-size:.68rem;font-weight:900;letter-spacing:.13em}.cover-symbol{position:absolute;right:24px;top:78px;width:62px;height:62px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);border-radius:20px;display:grid;place-items:center;color:#fff;font-size:2rem;font-weight:900;backdrop-filter:blur(5px)}.cover-title{position:absolute;left:25px;right:25px;top:160px;color:#fff;text-align:left;font-size:1.7rem;line-height:1.04;letter-spacing:-.04em}.cover-themes{position:absolute;left:25px;right:25px;bottom:68px;display:flex;flex-wrap:wrap;gap:5px}.cover-themes span{font-size:.57rem;font-weight:800;padding:4px 6px;border-radius:999px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);color:#eef3ff}.cover-foot{position:absolute;left:25px;right:25px;bottom:25px;color:#fff1bc;font-size:.47rem;font-weight:900;letter-spacing:.07em;text-align:left}
.back-kicker{font-size:.68rem;color:#ffd368;font-weight:900;letter-spacing:.1em;text-transform:uppercase}.library-book-back>strong{font-size:1.45rem;line-height:1.06;margin-top:10px;color:#fff}.library-book-back p{font-size:.78rem;line-height:1.5;color:#d2dcfa;margin:13px 0}.back-rule{height:1px;background:rgba(255,255,255,.16);margin:3px 0 12px}.back-label{font-size:.55rem;letter-spacing:.13em;font-weight:900;color:#9fb0dc}.back-themes{display:flex;flex-wrap:wrap;gap:5px;margin-top:9px}.back-themes span{font-size:.55rem;padding:4px 6px;border-radius:999px;background:rgba(255,255,255,.08);color:#fff;border:1px solid rgba(255,255,255,.12)}.back-status{align-self:flex-start;margin-top:auto;font-size:.62rem;font-weight:900;padding:6px 8px;border-radius:8px;background:rgba(255,255,255,.1);color:#d7e1ff}.back-status.production{background:#ffbf28;color:#4b3100}.back-brand{display:flex;align-items:center;gap:7px;margin-top:14px;color:#fff;font-size:.58rem;letter-spacing:.12em}.back-brand img{width:24px}
.library-stage-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:10px}.library-stage-actions .btn-secondary{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.15);color:#fff}.library-link-muted{opacity:.78}.library-stage-progress{display:flex;align-items:center;gap:8px;margin-top:17px;color:#6477a9;font-size:.57rem;font-weight:900;letter-spacing:.08em}.library-stage-progress i{width:32px;height:1px;background:#354b7f}.library-stage-progress span.active{color:#ffd05a}.library-stage-open{overflow:hidden}

@media(max-width:1050px){.library-hero-grid{grid-template-columns:1fr}.library-hero-scene{min-height:390px}.library-books-row{justify-content:flex-start;overflow-x:auto;overflow-y:visible;padding-left:18px;padding-right:18px;scrollbar-width:thin}.shelf-book{flex-basis:70px}.library-room{padding-left:18px;padding-right:18px}}
@media(max-width:760px){.library-hero{padding:62px 0 55px}.library-hero h1{font-size:clamp(2.8rem,14vw,4.3rem)}.library-hero-scene{min-height:320px}.library-hero-mark{width:160px;height:160px}.library-hero-mark img{width:108px}.hero-mini-shelf{height:95px;bottom:5px}.hero-mini-shelf span{width:37px;height:68px}.hero-mini-shelf span:nth-child(2),.hero-mini-shelf span:nth-child(5){height:80px}.hero-mini-shelf span:nth-child(3){height:88px}.library-intro-section{padding:65px 0 75px}.library-section-head{grid-template-columns:1fr}.library-legend{white-space:normal;flex-wrap:wrap}.library-room{border-radius:24px;padding-top:24px}.library-books-row{height:220px}.shelf-book{height:195px;flex-basis:64px}.shelf-book-spine strong{height:93px;font-size:.63rem}.library-stage{padding:12px}.library-stage-panel{min-height:min(720px,calc(100vh - 24px));padding:20px 14px 17px;border-radius:24px;overflow:auto}.library-stage-copy{padding:0 44px 8px}.library-featured-book{width:min(260px,70vw);height:min(370px,99vw)}.cover-title{font-size:1.42rem;top:140px}.cover-volume{top:74px}.cover-symbol{top:69px;width:54px;height:54px}.cover-themes{bottom:60px}.library-stage-actions .btn{min-height:44px;padding:0 15px}.library-stage-progress{margin-top:13px}}
@media(max-width:420px){.library-hero-note{gap:11px;font-size:.8rem}.library-shelf-label small{display:none}.library-room{padding-left:8px;padding-right:8px}.library-shelf-row{padding-left:4px;padding-right:4px}.library-books-row{gap:7px}.library-stage-copy h2{font-size:1.3rem}.library-stage-copy p{font-size:.8rem}.library-featured-book{width:230px;height:330px}.cover-title{font-size:1.24rem;top:125px}.cover-brand{top:16px;left:18px}.cover-volume{left:18px;top:62px}.cover-symbol{right:18px;top:58px}.cover-themes{left:18px;right:18px;bottom:54px}.cover-foot{left:18px;right:18px;bottom:18px}.library-book-back{padding:24px 21px 19px}.library-book-back>strong{font-size:1.22rem}.library-book-back p{font-size:.71rem}}
@media(prefers-reduced-motion:reduce){.library-star{animation:none}.shelf-book,.library-book-3d,.library-stage-backdrop,.library-stage-panel{transition:none!important}}

/* Library interaction v2 — real shelf pull/return movement + true back cover flip. */
.shelf-book.is-selected{opacity:0;pointer-events:none}

/* Flip each face rather than rotating the whole book. This prevents mirrored front-cover rendering in some browsers. */
.library-book-3d{transform:none!important;transition:none!important}
.library-book-face{transform-style:preserve-3d;transition:transform .72s cubic-bezier(.2,.72,.18,1),opacity .24s ease}
.library-book-front{transform:rotateY(0deg) translateZ(1px)}
.library-book-back{transform:rotateY(180deg) translateZ(1px)}
.library-book-3d.is-flipped .library-book-front{transform:rotateY(-180deg) translateZ(1px)}
.library-book-3d.is-flipped .library-book-back{transform:rotateY(0deg) translateZ(2px)}
.library-book-3d.is-flipped .library-book-pages{transform:rotateY(180deg) translateZ(-4px)}

/* The modal is measured first, then revealed while a shared book element flies in from its shelf position. */
.library-stage.is-measuring .library-stage-panel{opacity:0;transform:none;transition:none}
.library-stage.is-pulling .library-stage-backdrop,.library-stage.is-returning .library-stage-backdrop{opacity:1}
.library-stage.is-pulling .library-stage-panel,.library-stage.is-returning .library-stage-panel{opacity:1;transform:none}
.library-stage.is-pulling .library-stage-copy,
.library-stage.is-pulling .library-stage-actions,
.library-stage.is-pulling .library-stage-progress,
.library-stage.is-pulling .library-featured-book{opacity:0;pointer-events:none}
.library-stage.is-returning .library-stage-copy,
.library-stage.is-returning .library-stage-actions,
.library-stage.is-returning .library-stage-progress{opacity:.42;pointer-events:none}
.library-stage.is-returning .library-featured-book{opacity:0;pointer-events:none}
.library-stage-copy,.library-stage-actions,.library-stage-progress,.library-featured-book{transition:opacity .22s ease}

/* Temporary shared element used for the shelf-to-stage and stage-to-shelf animation. */
.library-flying-book{position:fixed;z-index:900;overflow:hidden;border-radius:8px 14px 14px 8px;pointer-events:none;transform-origin:50% 100%;background:linear-gradient(145deg,color-mix(in srgb,var(--accent),#071b55 42%),var(--accent) 44%,var(--accent2));border:1px solid rgba(255,255,255,.2);box-shadow:inset 9px 0 15px rgba(0,0,0,.22),inset -4px 0 12px rgba(255,255,255,.1),24px 28px 34px rgba(0,0,0,.42);will-change:transform,filter,opacity}
.library-flying-book:after{content:"";position:absolute;right:0;top:7px;bottom:7px;width:10px;border-radius:1px 8px 8px 1px;background:repeating-linear-gradient(to right,#fff7e9 0 2px,#e7dcc6 2px 3px);box-shadow:-2px 0 6px rgba(0,0,0,.16)}
.library-flying-book .cover-title{z-index:2}.library-flying-book .cover-brand,.library-flying-book .cover-volume,.library-flying-book .cover-symbol,.library-flying-book .cover-themes,.library-flying-book .cover-foot{z-index:2}

@media(prefers-reduced-motion:reduce){
  .library-book-face{transition:none!important}
  .library-flying-book{display:none!important}
}

/* Library interaction v3 — keep the existing Atlas Bright look, add a more physical shelf pull / return. */
.shelf-book{transition:transform .28s ease,filter .28s ease,opacity .16s ease}
.shelf-book.is-extracting{z-index:40!important;filter:drop-shadow(10px 22px 15px rgba(0,0,0,.4));pointer-events:none}
.shelf-book.is-selected{opacity:0;pointer-events:none}
.shelf-book.is-landing{z-index:40!important;pointer-events:none}

.library-stage.is-pulling .library-stage-backdrop{opacity:.72}
.library-stage.is-pulling .library-stage-panel{opacity:1;transform:none}
.library-stage.is-pulling .library-stage-copy,
.library-stage.is-pulling .library-stage-actions,
.library-stage.is-pulling .library-stage-progress,
.library-stage.is-pulling .library-featured-book{opacity:0;pointer-events:none}

.library-stage.is-returning .library-stage-backdrop{opacity:.42;transition:opacity .72s ease}
.library-stage.is-returning .library-stage-panel{opacity:.35;transform:scale(.985);transition:opacity .46s ease,transform .46s ease}
.library-stage.is-returning .library-stage-copy,
.library-stage.is-returning .library-stage-actions,
.library-stage.is-returning .library-stage-progress,
.library-stage.is-returning .library-featured-book{opacity:0;pointer-events:none}

.library-flying-book{
  transform-style:preserve-3d;
  -webkit-transform-style:preserve-3d;
  overflow:visible;
  border-radius:8px 14px 14px 8px;
}
.library-flying-book:before{
  content:"";
  position:absolute;
  left:-11px;
  top:3px;
  bottom:3px;
  width:15px;
  border-radius:5px 0 0 5px;
  background:linear-gradient(90deg,color-mix(in srgb,var(--accent),#000 48%),color-mix(in srgb,var(--accent),#000 16%));
  transform-origin:right center;
  transform:rotateY(-88deg);
  box-shadow:inset 2px 0 rgba(255,255,255,.14),inset -3px 0 rgba(0,0,0,.3);
}
.library-flying-book:after{
  right:-8px;
  top:8px;
  bottom:7px;
  width:13px;
  transform:translateZ(-5px);
}
.library-flying-book .cover-glow,
.library-flying-book .cover-network,
.library-flying-book .cover-brand,
.library-flying-book .cover-volume,
.library-flying-book .cover-symbol,
.library-flying-book .cover-title,
.library-flying-book .cover-themes,
.library-flying-book .cover-foot{backface-visibility:hidden;-webkit-backface-visibility:hidden}

@media(prefers-reduced-motion:reduce){
  .shelf-book.is-extracting,.shelf-book.is-landing{transform:none!important}
  .library-stage.is-returning .library-stage-backdrop,.library-stage.is-returning .library-stage-panel{transition:none!important}
}

/* Source-spine motion is CSS-driven so the final shelf slot remains geometrically stable. */
.shelf-book.is-extracting{transform:rotate(0deg) translateY(-23px) scale(1.055)!important}
.shelf-book.is-landing{opacity:1!important;transform:rotate(0deg) translateY(-22px) scale(1.05)!important}

/* Library interaction v4 — same Atlas Bright design, slower human-paced movement and a true 3D shelf presence. */

/* Keep the stage visually open: the selected book floats in the room rather than sitting inside a modal card. */
.library-stage-panel{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.library-stage-close{
  background:rgba(7,27,85,.56);
  border-color:rgba(255,255,255,.19);
  box-shadow:0 10px 28px rgba(0,0,0,.22);
  backdrop-filter:blur(8px);
}

/* Make the books that remain on the shelf read as physical objects, not flat strips. */
.shelf-book{
  perspective:900px;
  transform-style:preserve-3d;
}
.shelf-book-spine{
  transform:rotateY(-7deg) translateZ(3px);
  transform-origin:left center;
  transform-style:preserve-3d;
  overflow:visible;
}
.shelf-book-spine::after{
  content:"";
  position:absolute;
  top:5px;
  right:-8px;
  bottom:4px;
  width:11px;
  border-radius:1px 5px 5px 1px;
  background:repeating-linear-gradient(to right,#fff7e9 0 2px,#e4d6bd 2px 3px);
  transform:rotateY(76deg);
  transform-origin:left center;
  box-shadow:3px 2px 6px rgba(0,0,0,.25);
  opacity:.92;
}
.shelf-book-top{
  transform:translateZ(4px);
}
.shelf-book:hover .shelf-book-spine,
.shelf-book:focus-visible .shelf-book-spine{
  transform:rotateY(-4deg) translateZ(6px);
}

/* Slower physical handling — the spine lifts, then the book travels and turns in the hand. */
.shelf-book{
  transition:transform .48s cubic-bezier(.22,.72,.18,1),filter .48s ease,opacity .2s ease;
}
.shelf-book.is-extracting{
  transform:rotate(0deg) translateY(-27px) translateZ(18px) scale(1.065)!important;
}
.shelf-book.is-landing{
  opacity:1!important;
  transform:rotate(0deg) translateY(-24px) translateZ(14px) scale(1.055)!important;
}

/* Preserve the real book depth during the shared-element flight. */
.library-flying-book{
  transform-origin:50% 84%;
  border-radius:8px 14px 14px 8px;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}
.library-flying-book::before{
  left:-17px;
  width:22px;
  top:3px;
  bottom:3px;
  transform:rotateY(-82deg) translateZ(1px);
  border-radius:6px 0 0 6px;
}
.library-flying-book::after{
  right:-12px;
  width:18px;
  top:8px;
  bottom:7px;
  transform:rotateY(77deg) translateZ(-6px);
  transform-origin:left center;
}

/* Book flip should feel deliberate rather than snappy. */
.library-book-face{
  transition:transform 1.05s cubic-bezier(.22,.72,.18,1),opacity .32s ease!important;
}

/* The background still focuses attention, but the large surrounding card is gone. */
.library-stage-backdrop{
  transition:opacity .48s ease;
}
.library-stage-copy,.library-stage-actions,.library-stage-progress,.library-featured-book{
  transition:opacity .34s ease;
}

@media(max-width:760px){
  .library-stage-panel{padding-left:10px;padding-right:10px}
  .shelf-book-spine::after{right:-6px;width:9px}
}

@media(prefers-reduced-motion:reduce){
  .shelf-book-spine,.shelf-book-spine::after{transform:none!important}
}
