/* Book jacket viewer: the cover unfolds at its printed proportions */
.jv { position: fixed; inset: 0; z-index: 120; background: rgba(8, 8, 8, .95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 56px; opacity: 0; transition: opacity .25s; font-family: var(--sans); }
.jv[hidden] { display: none; }
.jv.is-in { opacity: 1; }
.jv__x { position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ivory); color: var(--obs); font-size: 24px; line-height: 1; z-index: 2; }
.jv__stage { width: 100%; display: flex; justify-content: center; perspective: 2800px; perspective-origin: 50% 40%; position: relative; }
.jv__stage::after { content: ""; position: absolute; left: 15%; right: 15%; bottom: -34px; height: 40px; background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, .7), transparent 70%); pointer-events: none; }

/* the rig's origin is the hinge between the spine and the front cover */
.jv__rig { position: relative; width: 0; transform-style: preserve-3d; transform-origin: 0 50%; transform: translateX(var(--closed-x)) rotateY(26deg); transition: transform 1s cubic-bezier(.45, .05, .2, 1); cursor: pointer; }
.jv__rig.is-open { transform: translateX(var(--open-x)) rotateY(0deg); }
.jv__rig.no-anim, .jv__rig.no-anim .jv__p { transition: none !important; }

.jv__p { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.45, .05, .2, 1); }
.jv__p--root { left: 0; }
.jv__p--r { left: 100%; transform-origin: left center; }
.jv__p--l { right: 100%; transform-origin: right center; }
.jv__face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.jv__face--in { transform: rotateY(180deg); }
.jv__img { position: absolute; top: 0; left: 0; background-size: 100% 100%; background-repeat: no-repeat; }
/* a little light on the boards so the folds read */
.jv__p--spine > .jv__face:first-child::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(255, 255, 255, .06) 50%, rgba(0, 0, 0, .18)); }
.jv__rig:not(.is-open) .jv__p--root > .jv__face:first-child::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .22), transparent 8%); }

.jv__label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 16px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--stone); white-space: nowrap; opacity: 0; transition: opacity .4s; pointer-events: none; }
.jv__rig.is-open .jv__label { opacity: 1; transition-delay: 1.4s; }
.jv__rig:not(.is-open) .jv__label { transition-delay: 0s; }
.jv__p--spine > .jv__label { top: auto; bottom: 100%; margin: 0 0 14px; }

.jv__ctrl button { height: 42px; padding: 0 22px; border-radius: 999px; border: 1px solid rgba(243, 240, 233, .3); background: transparent; color: var(--ivory); font: inherit; font-size: 13.5px; cursor: pointer; }
.jv__ctrl button:hover { background: var(--ivory); color: var(--obs); }

/* triggers */
button[data-book], a[data-book] { cursor: pointer; }
.bk__cover { border: 0; padding: 0; background: none; position: relative; }
.bk__cover::after { content: "Unfold the cover"; position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 6px); padding: 7px 14px; border-radius: 999px; background: rgba(22, 22, 22, .85); color: var(--ivory); font-size: 11.5px; letter-spacing: .04em; white-space: nowrap; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; }
.bk__cover:hover::after, .bk__cover:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.bk__look { background: none; border: 0; padding: 0; margin-left: 16px; color: var(--stone); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.bk__look:hover { color: var(--ivory); }
.about-books { pointer-events: auto; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .jv__rig, .jv__p { transition: none !important; } }

/* phones: no hover, so the covers wiggle now and then and say what they do */
@keyframes bookWiggle {
  0%, 82%, 100% { transform: rotate(0deg); }
  85% { transform: rotate(-3deg); }
  88% { transform: rotate(3deg); }
  91% { transform: rotate(-2deg); }
  94% { transform: rotate(1deg); }
}
@media (hover: none), (max-width: 900px) {
  .bk__cover, .about-books { animation: bookWiggle 3.6s ease-in-out infinite; transform-origin: 50% 90%; }
  .bk:nth-of-type(3) .bk__cover { animation-delay: 1.2s; }
  .bk__cover::after { content: "Tap to unfold"; opacity: 1; transform: translate(-50%, 0); }
  .about-books::after { content: "Tap to unfold"; position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); padding: 6px 13px; border-radius: 999px; background: rgba(22, 22, 22, .85); color: var(--ivory); font-size: 11.5px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .bk__cover, .about-books { animation: none !important; } }
