.cover-portal{padding:0;background:none;border:0;color:var(--ink);border-radius:2px;filter:none;cursor:zoom-in}.cover-portal .book-cover{box-shadow:0 22px 60px #0005;transition:transform .25s ease}.cover-portal:hover .book-cover{transform:translateY(-4px)}.cover-hint{display:block;font:13px/1.6 system-ui,sans-serif;color:var(--bronze);padding:18px 0 0}.cover-portal:focus-visible,.cover-choice:focus-visible{outline:3px solid var(--bronze);outline-offset:7px}.book-hero .book-editions{width:min(100%,370px);justify-self:center}.book-intro{max-width:640px}body:has(#cover-gallery[open]),body:has(#cover-zoom[open]){overflow:hidden}
#cover-gallery,#cover-zoom{color:var(--ink);background:#17191a;border:1px solid #666057;border-radius:12px;padding:0;max-height:92dvh}#cover-gallery{width:min(1120px,calc(100% - 24px));overflow:auto}#cover-gallery::backdrop,#cover-zoom::backdrop{background:#080909e8;backdrop-filter:blur(5px)}.gallery-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:24px 28px;border-bottom:1px solid #45443e}.gallery-heading p{margin:0 0 8px}.gallery-heading h2{margin:0;font:500 clamp(30px,4vw,44px)/1 Georgia,serif}.cover-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;padding:28px}.cover-choice{background:transparent;padding:0;color:var(--ink);text-align:left;display:flex;flex-direction:column;gap:5px;min-width:0;cursor:zoom-in;font-weight:400}.cover-thumb{height:360px;width:100%;display:grid;place-items:center;background:#212425;border:1px solid #3b3f3e;border-radius:6px;padding:14px;margin-bottom:10px}.cover-thumb img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;box-shadow:0 8px 25px #0003}.cover-choice[data-cover="hardcover"] img{box-shadow:none}.cover-choice strong{font:500 23px/1.3 Georgia,serif}.cover-choice>span:last-child{color:var(--muted);font-size:13px}
#cover-zoom{width:min(1500px,calc(100% - 16px));height:94dvh;max-height:94dvh;overflow:hidden}.zoom-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px;border-bottom:1px solid #45443e;background:#17191a}.zoom-toolbar h2{font:500 24px/1.2 Georgia,serif;margin:0}.zoom-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.zoom-controls button{padding:8px 13px;min-height:44px}.zoom-controls output{min-width:44px;text-align:center;font-size:13px}#zoom-viewport{height:calc(100% - 76px);overflow:auto;padding:20px;overscroll-behavior:contain;background:#252827}#zoom-image{display:block;max-width:none;margin:0 auto;height:auto;cursor:zoom-in}#zoom-image.is-zoomed{cursor:zoom-out}.book-toc li{padding-block:5px;overflow-wrap:anywhere}
@media(max-width:700px){.book-hero .book-editions{width:min(100%,340px)}.book-hero .book-editions .book-cover{width:100%;height:auto;max-height:none}.cover-grid{grid-template-columns:1fr;padding:20px;gap:28px}.cover-thumb{height:330px}.gallery-heading{padding:20px;position:sticky;top:0;background:#17191a;z-index:1}.zoom-toolbar{display:block;padding:12px}.zoom-toolbar h2{font-size:21px;margin-bottom:10px}.zoom-controls{gap:6px;justify-content:space-between}.zoom-controls button{padding:8px 10px;font-size:14px}#zoom-viewport{height:calc(100% - 108px);padding:10px}.book-hero h1{font-size:clamp(35px,10vw,60px)}nav>span{font-size:14px}}
@media(prefers-reduced-motion:reduce){.cover-portal .book-cover{transition:none}.cover-portal:hover .book-cover{transform:none}}
/* Explicit image boxes prevent intrinsic image size from escaping thumbnails. */
.cover-thumb{display:block;overflow:hidden}.cover-thumb img{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;box-shadow:none}
.cover-choice[data-cover$="-wrap"]{grid-column:span 1}.cover-choice[data-cover$="-wrap"] .cover-thumb{height:250px}.cover-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(min-width:701px){.cover-choice[data-cover="paperback-wrap"],.cover-choice[data-cover="hardcover-wrap"]{grid-column:span 3}.cover-choice[data-cover$="-wrap"] .cover-thumb{height:420px}}
@media(max-width:700px){.cover-grid{grid-template-columns:1fr}.cover-choice[data-cover$="-wrap"] .cover-thumb{height:240px}}

/* Exact wrap panels hinge open; the book remains a gallery button. */
.book-hero .book-editions{width:100%;max-width:620px;gap:8px;min-width:0}
.cover-portal .hardcover-hero{display:block;width:100%;height:auto;overflow:visible}
.hardcover-position{transform:translate(-175px,20px);transition:transform 1.1s cubic-bezier(.22,.7,.2,1)}
.hardcover-front{transform:matrix(.9,-.055,0,1,0,0);transition:transform 1.1s cubic-bezier(.22,.7,.2,1)}
.hardcover-spine{transform:matrix(1,-.5,0,1,0,16.2);transition:transform 1.1s cubic-bezier(.22,.7,.2,1)}
.hardcover-back{transform:matrix(-.9,.055,0,1,0,0);opacity:0;transition:transform 1.1s cubic-bezier(.22,.7,.2,1),opacity .25s linear}
.hardcover-pages{opacity:1;transition:opacity .4s ease}
.book-editions.is-open .hardcover-position,.cover-portal:focus-visible .hardcover-position{transform:translate(0,0)}
.book-editions.is-open .hardcover-front,.cover-portal:focus-visible .hardcover-front{transform:matrix(.85,.1,0,1,0,0)}
.book-editions.is-open .hardcover-spine,.cover-portal:focus-visible .hardcover-spine{transform:matrix(1,0,0,1,0,0)}
.book-editions.is-open .hardcover-back,.cover-portal:focus-visible .hardcover-back{transform:matrix(.85,-.1,0,1,0,0);opacity:1}
.book-editions.is-open .hardcover-pages,.cover-portal:focus-visible .hardcover-pages{opacity:0}
.cover-hint{padding-top:0}.hardcover-toggle{font:13px/1.5 system-ui,sans-serif;padding:8px 14px;border:1px solid #75644e;background:transparent;color:var(--ink);min-height:40px}
.hardcover-toggle:focus-visible{outline:2px solid var(--bronze);outline-offset:4px}
@media(max-width:700px){.book-hero .book-editions{width:100%;max-width:480px}.cover-hint{font-size:12px}}
@media(prefers-reduced-motion:reduce){.hardcover-position,.hardcover-front,.hardcover-back,.hardcover-spine,.hardcover-pages{transition:none}}
