:root{color-scheme:light;--ink:#18342b;--paper:#f6f2e8;--edge:#ddd4c0;--leaf:#28473a}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:1rem/1.5 system-ui,sans-serif}
a{color:inherit;text-underline-offset:.25em}a:focus-visible,button:focus-visible,#shelf:focus-visible{outline:3px solid #9a3b1c;outline-offset:4px}
.skip{position:absolute;top:.5rem;left:.5rem;transform:translateY(-200%);z-index:2;background:white;padding:.75rem}.skip:focus{transform:none}
header{border-bottom:1px solid var(--edge)}.mast,main{width:min(100% - 3rem,82rem);margin:auto}
.mast{min-height:4.5rem;display:flex;align-items:center;justify-content:space-between;gap:1rem}.mast a{font-size:.9rem;padding:.6rem 0}
.brand{font:700 1.25rem Georgia,serif;letter-spacing:.025em}
.intro{padding:clamp(2rem,6vw,5rem) 0 1rem}.review{margin:0;color:#476154;font-size:.79rem;font-weight:700;text-transform:uppercase;letter-spacing:.12em}
h1{font:400 clamp(2.8rem,7vw,6rem)/.98 Georgia,serif;letter-spacing:-.055em;margin:.45rem 0 .85rem}.lead{margin:0;color:#405a4e}
.toolbar{display:flex;align-items:center;justify-content:space-between;min-height:4.2rem;gap:1rem}.toolbar p{font-size:.88rem;margin:0}.buttons:not([hidden]){display:flex;gap:.5rem}
button{min-width:44px;min-height:44px;border:1px solid #64776b;border-radius:50%;background:transparent;color:var(--ink);font-size:1.25rem;cursor:pointer}button[aria-disabled=true]{opacity:.5;cursor:default}
/* The shelf scrolls natively, including touch and scroll snapping. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.intro{padding-top:clamp(1.4rem,3vw,2.6rem)}
h1{font-size:clamp(2.6rem,5.8vw,5rem)}
.toolbar{min-height:3.6rem}
#shelf {
  --single: clamp(142px, 13.5vw, 186px);
  --set: calc(var(--single) * 1.64);
  --height: clamp(235px, 24vw, 330px);
  --end-left: var(--single);
  --end-right: var(--set);
  display:flex; align-items:stretch; margin:0; padding:43px 0 10px; list-style:none;
  overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory;
  overscroll-behavior-x:contain; touch-action:pan-x pan-y pinch-zoom;
  isolation:isolate; scrollbar-color:#806b48 #e8dfcc;
  background:radial-gradient(ellipse at 50% 20%,#fffaf0 0%,#e9dfc8 90%);
  border:1px solid #d4c5a9; border-radius:14px;
}
#shelf::before,#shelf::after{content:"";flex:0 0 max(0px,calc((100% - var(--end-left))/2))}
#shelf::after{flex-basis:max(0px,calc((100% - var(--end-right))/2))}
#shelf li {
  position:relative; flex:0 0 var(--single); min-width:0;
  scroll-snap-align:center; z-index:var(--layer,1);
}
#shelf li:has(.set){flex-basis:var(--set)}
#shelf li:focus-within{z-index:12}
.selection {
  display:grid; grid-template-rows:auto auto auto; justify-items:center;
  height:100%; min-width:0; padding:0 4px 8px;
  text-decoration:none; border-radius:6px; position:relative;
}
.selection:focus-visible {outline-offset:-3px}
.display{
  height:calc(var(--height) + 12px); width:100%; display:flex;
  align-items:center; justify-content:center; gap:0; pointer-events:none;
}
.edition{display:grid;justify-items:center;align-items:end;grid-template-rows:1fr 18px;min-width:0;}
.book {
  display:block; width:calc(var(--height)*680/930); height:var(--height);
  transform:translateY(var(--lift,0px)) perspective(1050px) rotateY(var(--yaw,12deg)) scale(var(--scale,.82));
  transform-origin:center 83%; opacity:var(--opacity,.88);
}
.book img{width:100%;height:100%;display:block;object-fit:contain}
.edition:only-child .book{grid-row:1}
.edition:has(.volume) .book{width:calc(var(--height)*.64);max-width:none}
.edition:has(.volume){width:48%}
.volume{white-space:nowrap;font-size:.72rem;align-self:center}
.title{font:700 clamp(.87rem,1.6vw,1.14rem)/1.18 Georgia,serif;text-align:center;padding:0 .15rem}
.set{font-size:.72rem;color:#405a4e;margin-top:.15rem}
.current .title,.selection:hover .title,.selection:focus-visible .title{text-decoration:underline;text-underline-offset:.22em}
footer{padding:1.05rem 0 1.6rem}
footer a{font-weight:650;display:inline-block;margin-right:1.1rem;padding:.4rem 0}
@media(max-width:740px){
  .mast,main{width:calc(100% - 1.5rem)}
  #shelf{--single:clamp(123px,34vw,154px);--set:calc(var(--single)*1.63);--height:clamp(164px,50vw,230px)}
  .edition:has(.volume) .book{width:calc(var(--height)*.56)}
  .display{height:calc(var(--height) + 18px)}
}
@media(prefers-reduced-motion:reduce){ .book{transform:scale(var(--scale,.82));} }
@media(max-width:740px){#shelf{padding-top:37px}}
