/* The Libra page (/libra/): every book stands spine out on one dark shelf, his own books first, then a partition,
   then the books by others he worked on. Picking a book (assets/shelf.js) takes it off and turns it to show the cover. */
html { scrollbar-gutter: stable } /* holding a book locks the scroll; the page must not shift sideways when the bar goes */
/* mirrored: the partition in the middle of the column, each group centred in its half with a bookend on its outer side */
.shelfrow { --h: 300px; display: flex; justify-content: center; align-items: flex-end; padding-top: 64px; border-bottom: 14px solid var(--char); box-shadow: 0 10px 0 -5px var(--hair) }
.shelfrow.two { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) }
.grp { position: relative; justify-self: center; display: flex; align-items: flex-end; gap: 3px }
.grp::before, .grp.co::after { content: ""; flex: none; width: 26px; height: calc(var(--h) * .4); border-bottom: 6px solid #3a3e44 } /* bookends */
.grp::before { margin-right: 4px; border-right: 6px solid #3a3e44 }
.grp.co::before { content: none }
.grp.co::after { margin-left: 4px; border-left: 6px solid #3a3e44 }
.grp-l { position: absolute; left: 50%; bottom: calc(var(--h) + 24px); transform: translateX(-50%); color: var(--grey); white-space: nowrap }
.divider { width: 9px; height: calc(var(--h) + 12px); background: var(--char); border-radius: 2px 2px 0 0 } /* a shelf partition */
.sp { position: relative; display: block; flex: none; width: var(--d); height: var(--h); cursor: pointer; transition: transform .3s cubic-bezier(.2, .75, .1, 1) }
.sp:hover, .sp:focus-visible, .sp.lifting { transform: translateY(-9px) }
.sp.out { visibility: hidden }
.spf { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0 12px; background: var(--bg); color: var(--fg); border-radius: 2px; overflow: hidden; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14) }
.spf::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgb(0 0 0 / .3), rgb(255 255 255 / .16) 26%, rgb(255 255 255 / 0) 55%, rgb(0 0 0 / .24)) }
.spf .sa { order: 2; writing-mode: vertical-rl; text-orientation: sideways; font: 600 9px/1 var(--text); letter-spacing: .14em; text-transform: uppercase; opacity: .78; white-space: nowrap }
.spf .st { order: 1; min-height: 0; max-height: 72%; writing-mode: vertical-rl; text-orientation: sideways; font: 600 16px/1.05 var(--disp); letter-spacing: -.01em; text-align: start; overflow: hidden }
.spf .st.sm { font-size: 13px; max-height: 82% }
.spf .sy { order: 3; margin-top: auto; font: 600 9.5px/1 var(--text); letter-spacing: .04em; opacity: .78 }
.shelfhint { margin: 14px 0 0 }

/* a book taken off the shelf */
/* above the consent banner (z-index 60), and it scrolls when a short screen cannot fit the cover and the details */
.held { position: fixed; inset: 0; z-index: 70; overflow-y: auto; overscroll-behavior: contain; perspective: 1800px }
.held-bg { position: fixed; inset: 0; background: rgb(231 232 229 / .93); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .45s }
.held.on .held-bg { opacity: 1 }
.held-grid { position: relative; min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; align-content: safe center; gap: clamp(28px, 5vw, 80px); padding: clamp(24px, 6vh, 72px) clamp(20px, 6vw, 96px); pointer-events: none }
/* sized by width as well as height, so the cover always fits its column; shelf.js scales the book to this box */
.held-spot { justify-self: end; width: min(100%, calc(min(64vh, 560px) * 1000 / 1405)); aspect-ratio: 1000 / 1405 }
.held-info { pointer-events: auto; max-width: 26rem; opacity: 0; transform: translateY(12px); transition: opacity .35s, transform .35s }
.held.on .held-info { opacity: 1; transform: none; transition-delay: .45s }
.held-info .ttl { font-size: clamp(30px, 4vw, 48px); font-weight: 600; letter-spacing: -.03em; line-height: 1.02; margin: 12px 0 10px }
.held-info blockquote { text-wrap: pretty; margin: 22px 0 0; padding-top: 16px; border-top: 1.5px solid var(--ink); font: 500 19px/1.3 var(--disp); letter-spacing: -.015em }
.held-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px }
.held-act a, .held-act button { display: inline-flex; align-items: center; justify-content: center; gap: .5em; height: 44px; padding: 0 22px; border: 0; border-radius: 999px; font: 600 14px var(--text); cursor: pointer; transition: background .2s, color .2s }
.held-act .go { background: var(--ink); color: var(--paper) }
.held-act .go:hover { background: var(--denim) }
.held-act .put { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink) }
.held-act .put:hover { background: var(--paper) }
.b3 { position: absolute; transform-style: preserve-3d; pointer-events: none }
.b3 > span { position: absolute; left: 50%; top: 50%; -webkit-backface-visibility: hidden; backface-visibility: hidden }
.b3 .bc { background: var(--cover) center/cover no-repeat, var(--bg); /* the book's colour behind the image, so the cover is never see-through */ border-radius: 0 3px 3px 0; box-shadow: inset 6px 0 8px -4px rgb(0 0 0 / .4), inset -1px 0 0 rgb(255 255 255 / .2), 0 18px 30px -18px rgb(20 22 25 / .6) }
.b3 .bb { background: var(--bg); filter: brightness(.85) }
.b3 .bp { background: repeating-linear-gradient(90deg, #f4f0e6 0 2px, #e4dfd2 2px 3px) } /* page edges */
.b3 .bp.h { background: repeating-linear-gradient(0deg, #f4f0e6 0 2px, #e4dfd2 2px 3px) }
@media (max-width: 760px) {
  .held-grid { grid-template-columns: minmax(0, 1fr); align-content: center; justify-items: center; gap: 22px }
  .held-spot { justify-self: center; width: min(100%, calc(min(44vh, 380px) * 1000 / 1405)) }
  .held-info .ttl { font-size: 28px }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* a phone on its side: cover and details next to each other, so both fit the height */
  .held-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); justify-items: stretch; gap: 24px; padding-block: 16px }
  .held-spot { justify-self: end; width: min(100%, calc(min(80vh, 420px) * 1000 / 1405)) }
  .held-info .ttl { font-size: 24px; margin: 6px 0 }
  .held-info blockquote { font-size: 15px; margin-top: 12px; padding-top: 10px }
  .held-act { margin-top: 16px }
}
@media (prefers-reduced-motion: reduce) {
  .sp, .held-bg, .held-info { transition: none }
  .sp:hover, .sp:focus-visible, .sp.lifting, .held-info { transform: none }
}
@media (max-width: 560px) {
  .shelfrow { --h: 280px }
  .spf .st { font-size: 14px; max-height: 80% }
  .spf .st.sm { font-size: 11.5px; max-height: 88% }
  .spf .sa { letter-spacing: .1em }
}
@media (max-width: 359px) {
  /* the smallest phones: slimmer bookends leave room for another book */
  .grp::before, .grp.co::after { width: 14px }
}
