/* 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 ── */
.wb { --wb-gold: #c9a45e; --wb-gold-bright: #e6c882; --wb-cream: #f5f0e6; position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  background: radial-gradient(120vmax 90vmax at 50% 40%, #13223b, #070c16 74%); color: var(--wb-cream); }
.wb[hidden] { display: none; }
html.wb-lock, html.wb-lock body { overflow: hidden; }
.wb-top { display: flex; align-items: center; gap: 14px; min-height: 48px; }
.wb-name { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 400; color: rgba(245, 240, 230, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-name .en { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 600; color: var(--wb-gold-bright); margin-right: 8px; }
.wb-web { flex: none; padding: 8px 14px; border: 1px solid rgba(201, 164, 94, .45); border-radius: 999px; font-size: 13px; color: var(--wb-gold-bright); text-decoration: none; }
.wb-web:hover { background: rgba(201, 164, 94, .14); }
.wb-stage { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; padding: 4.5vh 0; }
.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 3px rgba(230, 200, 130, .7); 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-bar { display: flex; justify-content: center; align-items: center; gap: 12px; }
.wb-btn { display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(201, 164, 94, .5); background: rgba(7, 12, 22, .55); color: var(--wb-gold-bright);
  transition: background .2s, border-color .2s; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.wb-btn:hover { background: rgba(201, 164, 94, .16); border-color: var(--wb-gold); }
.wb-btn:focus-visible { outline: 2px solid var(--wb-gold-bright); outline-offset: 2px; }
.wb-btn:disabled { opacity: .35; cursor: default; }
.wb-btn svg { width: 20px; height: 20px; }
.wb-label { min-width: 150px; margin: 0; text-align: center; font-size: 15px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.wb-hint { margin: 10px 0 0; text-align: center; font-size: 13px; color: rgba(245, 240, 230, .55); }
.wb-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .wb-btn { transition: none; } }
