
:root {
  color-scheme: dark;
  --bg: #222222;
  --text: #f3eee6;
  --muted: #b8b0a6;
  --book-h: clamp(390px, 58vh, 650px);
  --motion: 680ms cubic-bezier(.2,.78,.18,1);
  --book-gap: clamp(18px, 4vw, 78px);
  --side-pad: clamp(36px, 8vw, 110px);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.04), transparent 36%),
    linear-gradient(180deg, #2c2c2c 0%, #242424 44%, #202020 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
button, a { font: inherit; }
.library {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
}
.brand {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: clamp(24px, 4.2vh, 48px) 20px 8px;
  color: #f0ebe4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.35vw, 1.35rem);
  font-weight: 700;
  line-height: .83;
  letter-spacing: .28em;
  text-indent: .28em;
  user-select: none;
}
.brand span:last-child {
  font-size: .72em;
  letter-spacing: .42em;
  text-indent: .42em;
  margin-top: .48em;
  color: #c9c0b7;
}
.shelf-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0 0 20px;
  perspective: 1600px;
}
.shelf-scroll {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 84px var(--side-pad) 56px;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
}
.shelf-scroll::-webkit-scrollbar { display: none; }
.bookshelf {
  position: relative;
  width: max-content;
  min-width: 100%;
  min-height: calc(var(--book-h) + 80px);
  display: flex;
  justify-content: center;
  align-items: end;
  gap: var(--book-gap);
  padding: 0 1vw;
  transform-style: preserve-3d;
}
.book-item {
  position: relative;
  width: var(--spine-w, 54px);
  height: var(--book-h);
  flex: 0 0 auto;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transform-style: preserve-3d;
  isolation: isolate;
}
.book-item:focus-visible {
  outline: 2px solid rgba(255,255,255,.82);
  outline-offset: 8px;
  border-radius: 2px;
}
.book {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
  transition: transform var(--motion), filter var(--motion);
  will-change: transform;
}
.book-spine,
.book-cover {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  backface-visibility: hidden;
}
.book-spine {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  object-fit: fill;
  box-shadow:
    -2px 0 4px rgba(0,0,0,.28),
    3px 2px 8px rgba(0,0,0,.35),
    inset -2px 0 rgba(255,255,255,.06);
  transform-origin: 50% 50%;
  transition: transform var(--motion), opacity 360ms ease, filter var(--motion);
}
.book-cover {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 0;
  width: auto;
  height: 100%;
  aspect-ratio: 780 / 1200;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 24px 44px rgba(0,0,0,.54), 0 5px 14px rgba(0,0,0,.42);
  transform-origin: 6% 50%;
  transform: translate3d(-49%, 0, -36px) rotateY(88deg) scale(.965);
  transition: transform var(--motion), opacity 220ms ease 90ms, filter var(--motion);
  will-change: transform, opacity;
}
.page-block {
  position: absolute;
  z-index: 3;
  left: 45%;
  bottom: 2px;
  width: auto;
  height: calc(100% - 7px);
  aspect-ratio: 780 / 1200;
  opacity: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.55) 0 1px, rgba(221,213,196,.7) 1px 3px),
    #d4ccba;
  transform-origin: 6% 50%;
  transform: translate3d(-49%, 0, -42px) rotateY(88deg) scale(.95);
  transition: transform var(--motion), opacity 220ms ease;
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
}
.book-item::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 180px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,.36) 0%, rgba(0,0,0,.18) 45%, transparent 72%);
  transform: translateX(-50%) scaleX(.55);
  opacity: .7;
  transition: transform var(--motion), opacity var(--motion);
  pointer-events: none;
}
.book-item:hover,
.book-item:focus-visible,
.book-item.is-open { z-index: 100; }
.book-item:hover::after,
.book-item:focus-visible::after,
.book-item.is-open::after {
  transform: translateX(-50%) scaleX(1.15);
  opacity: .9;
}
.book-item:hover .book,
.book-item:focus-visible .book,
.book-item.is-open .book {
  transform: translate3d(0, -18px, 120px) rotateZ(-.35deg);
  filter: brightness(1.03);
}
.book-item:hover .book-spine,
.book-item:focus-visible .book-spine,
.book-item.is-open .book-spine {
  transform: translate3d(-14px, 5px, -15px) rotateY(-34deg);
  opacity: .36;
  filter: brightness(.72);
}
.book-item:hover .page-block,
.book-item:focus-visible .page-block,
.book-item.is-open .page-block {
  opacity: .95;
  transform: translate3d(-50%, -5px, 58px) rotateY(0deg) scale(.988);
}
.book-item:hover .book-cover,
.book-item:focus-visible .book-cover,
.book-item.is-open .book-cover {
  opacity: 1;
  transform: translate3d(-50%, -10px, 72px) rotateY(0deg) rotateZ(.35deg) scale(1);
}
.book-item.locked:hover .book-cover,
.book-item.locked:focus-visible .book-cover,
.book-item.locked.is-open .book-cover { filter: saturate(.9); }
.coming-soon[hidden] { display: none; }
.coming-soon {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}
.coming-soon-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(11,11,11,.66);
  backdrop-filter: blur(9px);
  cursor: default;
}
.coming-soon-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(34,34,34,.96);
  box-shadow: 0 28px 90px rgba(0,0,0,.55);
  text-align: center;
  animation: modal-in 330ms cubic-bezier(.2,.8,.2,1) both;
}
.coming-soon-kicker { margin: 0 0 12px; color: #aaa197; font-size: .7rem; font-weight: 700; letter-spacing: .24em; }
.coming-soon-card h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.25rem, 8vw, 4.25rem); font-weight: 500; }
.coming-soon-quote {
  min-height: 4.5em;
  margin: 24px auto 30px;
  max-width: 440px;
  color: #d5cec7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 2.3vw, 1.25rem);
  line-height: 1.55;
}
.coming-soon-close {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.28);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.coming-soon-close:hover,
.coming-soon-close:focus-visible {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.58);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.975); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 760px) {
  :root { --book-h: clamp(350px, 54vh, 500px); }
  .brand { padding-top: 25px; font-size: 1rem; }
  .shelf-scroll {
    padding: 78px 46vw 48px;
    scroll-snap-type: x proximity;
  }
  .bookshelf {
    min-width: max-content;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 20px;
  }
  .book-item { scroll-snap-align: center; }
  .book-item:nth-child(1) { --spine-w: 31px !important; }
  .book-item:nth-child(2) { --spine-w: 38px !important; }
  .book-item:nth-child(3) { --spine-w: 58px !important; }
  .book-item:nth-child(4) { --spine-w: 66px !important; }
  .book-item:nth-child(5) { --spine-w: 63px !important; }
  .book-item:nth-child(6) { --spine-w: 52px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
.book-item:hover .book-cover,
.book-item:focus-visible .book-cover,
.book-item.is-open .book-cover { pointer-events: auto; }
