/* ===== All books: an arched bookcase drawn in thin lines; the seal and "All books" in the arch; four books to a shelf ===== */
.shelfp{--cw:clamp(118px,12vw,200px);--gapw:clamp(52px,6.4vw,112px);--pad:clamp(18px,3vw,46px);--ln:color-mix(in srgb,var(--ink) 32%,transparent);
  box-sizing:content-box;max-width:calc(var(--cw) * 4 + var(--gapw) * 3 + var(--pad) * 2);margin:0 auto;padding:clamp(20px,4vh,44px) clamp(14px,3vw,40px) 80px}
.case{position:relative}
/* the outline (arch + sides) is an SVG drawn by shelves.js, so it can draw itself in */
.case-line{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.case-line path{fill:none;stroke:var(--ln);stroke-width:1;vector-effect:non-scaling-stroke;stroke-dasharray:1;stroke-dashoffset:1;
  animation:case-draw 1.9s cubic-bezier(.87,0,.13,1) .1s forwards}
@keyframes case-draw{to{stroke-dashoffset:0}}
.arch{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(12px,2vh,20px);
  height:var(--archh,300px);padding:calc(var(--archh,300px) * .1) 0 calc(var(--archh,300px) * .06);box-sizing:border-box;opacity:0;animation:case-in .9s ease-out 1.3s forwards}
.archseal{width:clamp(64px,7vw,104px);height:auto;display:block}
.arch h1{margin:0;font:500 clamp(15px,1.4vw,20px)/1 var(--text, "EB Garamond", serif);letter-spacing:.32em;text-transform:uppercase;color:var(--ink);padding-left:.32em}
@keyframes case-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
/* shelves: each one a thin board the books stand on */
.shelves{display:flex;flex-direction:column}
.shelf{position:relative;display:flex;align-items:flex-end;justify-content:space-between;padding:clamp(26px,4vh,40px) var(--pad) 0}
.shelf::before{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:var(--ln);transform:scaleX(0);
  animation:shelf-in 1.1s cubic-bezier(.76,0,.24,1) forwards;animation-delay:calc(1.2s + var(--i,0) * .12s)}
.shelves>.shelf:first-child::after{content:"";position:absolute;left:0;right:0;top:0;height:1px;background:var(--ln);transform:scaleX(0);
  animation:shelf-in 1.1s cubic-bezier(.76,0,.24,1) 1.1s forwards}
@keyframes shelf-in{to{transform:scaleX(1)}}
.shelf>*{opacity:0;animation:book-in .8s cubic-bezier(.2,.7,.2,1) forwards;animation-delay:calc(1.7s + var(--i,0) * .12s)}
@keyframes book-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.sb{position:relative;z-index:1;flex:none;width:var(--cw);aspect-ratio:2/3;display:block;background:#fff;transition:translate .25s cubic-bezier(.2,.7,.2,1)}
.sb img{display:block;width:100%;height:100%;object-fit:cover;-webkit-user-drag:none}
.sb:hover,.sb:focus-visible{translate:0 -6px}
.sbp{position:absolute;left:0;bottom:0;height:3px;width:var(--p);background:var(--red)}
/* phantom spines: a group stands against one of its two books; the one spine that leans pivots on its bottom corner
   (so it never sinks below the board) and its foot sits exactly far enough out for its top to rest on its neighbour */
.phg{flex:1 1 0;min-width:0;display:flex;align-items:flex-end;gap:2px;height:calc(var(--cw) * 1.5)}
.phg.l{justify-content:flex-start;padding-left:2px}
.phg.r{justify-content:flex-end;padding-right:2px}
.ph[hidden]{display:none}
.ph{--ph:calc(var(--cw) * 1.5 * var(--h) / 100);position:relative;flex:none;width:var(--w);height:var(--ph);background:color-mix(in srgb,var(--ink) 9%,var(--paper))}
.ph.lean-l{transform-origin:0 100%;rotate:calc(var(--r) * -1);margin-left:calc(var(--ph) * sin(var(--r)))}
.ph.lean-r{transform-origin:100% 100%;rotate:var(--r);margin-right:calc(var(--ph) * sin(var(--r)))}
html.night .ph{background:color-mix(in srgb,var(--ink) 12%,var(--paper))}
@media (max-width:700px){.shelfp{--cw:clamp(56px,18vw,120px);--gapw:clamp(14px,4vw,40px);--pad:10px}.phg{gap:1px}}
@media (prefers-reduced-motion:reduce){.case-line path,.arch,.shelf::before,.shelves>.shelf:first-child::after,.shelf>*{animation:none;opacity:1;transform:none;stroke-dashoffset:0}}
