/* The moving catalogue is a library of slim books, using the original covers. */
#gallery { background: radial-gradient(ellipse at 50% 40%, #29232e 0, #121015 57%, #080709 100%); }
#gallery .tile {
  overflow: visible;
  background: transparent;
  box-shadow: none;
  border-radius: 2px 5px 5px 2px;
}
.book-object {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  transform: perspective(850px) rotateY(-13deg);
  transform-origin: 45% 50%;
  transition: transform .55s cubic-bezier(.2,.8,.2,1), filter .45s;
  filter: brightness(1);
}
.book-object::after {
  content: '';
  position: absolute;
  top: 100%; left: 7%; width: 95%; height: 15%;
  background: radial-gradient(ellipse at 50% 5%, #0009, transparent 70%);
  transform: skewX(-24deg);
  z-index: -1;
}
.book-pages {
  position: absolute;
  top: 4px; bottom: -2px; left: 7px; right: -7px;
  border: 1px solid #d7cfb9;
  border-radius: 1px 4px 4px 1px;
  background: repeating-linear-gradient(90deg, #d6d0bf 0 1px, #f6f0df 1px 2px, #e6dfcf 2px 3px);
  box-shadow: 1px 0 0 #6a6254, 3px 3px 0 #28222b, 10px 14px 17px #0008;
  transform: skewY(1deg);
}
.book-jacket {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 2px 4px 4px 2px;
  background: #252029;
  box-shadow: -3px 0 4px #0007, inset 0 0 0 1px #fff2;
}
#gallery #world .book-jacket img {
  width: 100%; height: 100%;
  object-fit: fill;
  filter: none;
  scale: 1;
  border-radius: inherit;
}
.book-jacket::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #0007 0, #ffffff28 1.5%, #0003 3%, #0006 4%, #ffffff1c 5.5%, transparent 9%, transparent 96%, #0003 100%),
    linear-gradient(135deg, #ffffff13, transparent 38%, #0000000a);
  box-shadow: inset 0 1px 0 #ffffff60, inset 0 -2px 1px #0005, inset -1px 0 0 #fff3;
}
#gallery .tile.focused .book-object,
#gallery .tile:focus-visible .book-object {
  transform: perspective(850px) rotateY(-4deg) translateY(-6px);
  filter: brightness(1.08);
}
#world.has-focus .tile:not(.focused) .book-object { filter: brightness(.76) saturate(.96); }
#gallery .tile:focus-visible { outline-offset: 10px; }
@media (max-width: 700px) {
  .book-pages { right: -5px; }
  .book-object { transform: perspective(650px) rotateY(-10deg); }
}
@media (prefers-reduced-motion: reduce) {
  .book-object { transition: none; }
  #gallery .tile.focused .book-object, #gallery .tile:focus-visible .book-object { transform: perspective(850px) rotateY(-13deg); }
}
