/* The landing page's bookshelf and the book reader it opens (js/shelf.js). */

/* ── shelf ── */
.shelf-sec { position: relative; padding: 72px 20px 90px; border-top: 1px solid rgba(245, 240, 230, .1); background: rgba(7, 12, 22, .45); }
.shelf-head { max-width: 720px; margin: 0 auto; text-align: center; }
.shelf-eyebrow { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--gold, #c9a45e); }
.shelf-title { margin: 12px 0 0; font-size: clamp(28px, 4vw, 42px); font-weight: 500; line-height: 1.25; color: var(--cream, #f5f0e6); }
.shelf-lead { margin: 12px auto 0; max-width: 560px; font-size: 16px; line-height: 1.7; color: rgba(245, 240, 230, .72); }

/* Books stand on one plank; --bw is a book's width, the plank sits at the foot of the covers. */
.shelf { --bw: clamp(132px, 22vw, 210px); --lift: 44px; position: relative; max-width: 1040px; margin: 30px auto 0; }
.shelf-row { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: clamp(28px, 6vw, 72px);
  margin: 0; padding: var(--lift) 28px 0; list-style: none; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-plank { position: absolute; left: 0; right: 0; top: calc(var(--lift) + var(--bw) * 1.4136); height: 20px; border-radius: 3px;
  background: linear-gradient(180deg, #2b3c5e 0, #18263f 38%, #0c1527 100%);
  border-top: 2px solid rgba(230, 200, 130, .55); box-shadow: 0 22px 36px rgba(0, 0, 0, .55), 0 2px 0 rgba(255, 255, 255, .05) inset; pointer-events: none; }
.shelf-item { flex: 0 0 var(--bw); width: var(--bw); text-align: center; scroll-snap-align: center; position: relative; z-index: 1; }
.shelf-book { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1200px; -webkit-tap-highlight-color: transparent; }
.sb-cover { position: relative; display: block; aspect-ratio: 1100 / 1555; border-radius: 2px 5px 5px 2px; transform-origin: 50% 100%;
  box-shadow: 0 16px 26px rgba(0, 0, 0, .5), 0 2px 4px rgba(0, 0, 0, .35); transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s; }
.sb-cover img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
/* spine shading on the left, page edges on the right */
.sb-cover::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 9%; border-radius: 2px 0 0 2px; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .38), rgba(255, 255, 255, .12) 55%, rgba(0, 0, 0, 0)); }
.sb-cover::after { content: ""; position: absolute; top: 3px; bottom: 3px; right: -6px; width: 6px; border-radius: 0 3px 3px 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, #e9e2d2 0 1px, #cfc6b3 1px 2px); }
.shelf-book:hover .sb-cover, .shelf-book:focus-visible .sb-cover { transform: translateY(-12px) rotateX(5deg); box-shadow: 0 30px 40px rgba(0, 0, 0, .55), 0 2px 4px rgba(0, 0, 0, .35); }
.shelf-book.is-picked .sb-cover { transform: translateY(calc(var(--lift) * -.9)) rotate(-3deg) scale(1.05); box-shadow: 0 40px 60px rgba(0, 0, 0, .6); }
.shelf-book:focus-visible { outline: none; }
.shelf-book:focus-visible .sb-cover { outline: 2px solid var(--gold-bright, #e6c882); outline-offset: 4px; }
.sb-t { margin: 40px 0 0; font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--cream, #f5f0e6); }
.sb-m { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: rgba(245, 240, 230, .58); }
@media (max-width: 700px) {
  .shelf { --bw: clamp(124px, 38vw, 170px); --lift: 32px; }
  .shelf-row { justify-content: flex-start; padding-left: max(20px, calc(50% - var(--bw) - 14px)); }
}
@media (prefers-reduced-motion: reduce) { .sb-cover { transition: none; } .shelf-book:hover .sb-cover { transform: none; } }

/* ── reader ── */
/* Its top bar, bottom bar, contents drawer, zoom, toast and immersive mode are the main reader's (css/reader.css). */
.wb { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; height: 100vh; height: 100dvh;
  color: var(--cream); background: var(--navy-950); -webkit-user-select: none; user-select: none; }
.wb[hidden] { display: none; }
.wb:focus { outline: none; }
html.wb-lock, html.wb-lock body { overflow: hidden; }
.wb-stage { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; padding: 6px 8px; }
.wb-rig { position: relative; max-width: 100%; }
/* The renderer's canvas overhangs the book by PaperBook.PAD = 1.26, so a lifted sheet and its shadow are never clipped. */
.wb .wb-paper { position: absolute; inset: 0; outline: none; cursor: grab; }
.wb .wb-paper[data-book-state="user_fold"] { cursor: grabbing; }
.wb .wb-paper:focus-visible { box-shadow: 0 0 0 2px rgba(230, 200, 130, .55); border-radius: 4px; }
.wb .wb-paper .paper-book-canvas { position: absolute; left: -13%; top: -13%; width: 126%; height: 126%; pointer-events: none; }
.wb-poster { position: absolute; top: 0; left: 50%; height: 100%; width: auto; transform: translateX(-50%); border-radius: 3px; box-shadow: 0 24px 50px rgba(0, 0, 0, .45); }
.wb.is-live .wb-poster { display: none; }
.wb.is-flat .wb-paper { display: none; }
.wb.is-flat .wb-poster { cursor: pointer; }
.wb.is-immersive .reader-top, .wb.is-immersive .reader-bottom { display: none; }
.wb.is-immersive .wb-stage { padding: calc(var(--safe-t) + 4px) 4px calc(var(--safe-b) + 4px); }
.contents-web { display: block; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--gold-line); border-radius: 12px;
  color: var(--gold-bright); font-size: 14px; text-decoration: none; }
.contents-web[hidden] { display: none; }
@media (hover: hover) { .contents-web:hover { background: var(--gold-soft); } }
.contents-thumb span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A turn at 100% zoom lifts the book above the zoom's backdrop. */
.wb.is-zoom-flip .wb-stage { z-index: 31; pointer-events: none; }
.wb.is-zoom-flip .wb-side { visibility: hidden; }
.wb.is-zoom-flip .zoom-content { visibility: hidden; }
.wb-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 820px) { .wb-stage { padding: 8px 96px 4px; } }
@media (min-width: 820px) and (max-height: 560px) { .wb-stage { padding: 2px 76px; } }
