/* A solid hardback: both boards, recessed paper block, and all exposed edges.
   Keep the 3D parent free of opacity/filter/overflow grouping properties. */
.book-object {
  --book-depth: 60px;
  --board: 4px;
  --half-depth: calc(var(--book-depth) / 2);
  --paper-depth: calc(var(--book-depth) - var(--board) * 2);
  --paper-front: calc(var(--half-depth) - var(--board));
  --cloth: #294737;
  --foil: #d6c08e;
  width: 268px;
  height: 374px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform: rotateY(-36deg) rotateX(-12deg) rotateZ(-3deg);
  animation: none;
  transition: transform .8s cubic-bezier(.22,1,.36,1);
}
.book-object.is-extracting {
  animation: take-solid-book 1s cubic-bezier(.22,1,.36,1) backwards;
}
.book-object:hover {
  transform: rotateY(-44deg) rotateX(-15deg) rotateZ(-2deg);
}
.book-object.kuuran { --cloth: #b6a380; --foil: #403a2c; }
.book-stage { perspective: 1100px; }
.front-cover {
  position: absolute;
  inset: 0;
  transform: translateZ(var(--half-depth));
  transform-origin: left center;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  background: none;
  box-shadow: none;
  border-radius: 3px 6px 6px 3px;
  overflow: visible;
  transition: transform .85s cubic-bezier(.4,0,.2,1);
}
.front-cover::after { display: none; }
.cover-face, .cover-lining {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.cover-face {
  color: var(--foil);
  background: linear-gradient(90deg,#07150970,transparent 5%,#f2e8b91b 8%,transparent 11%,#0002 97%,#fff3),var(--cloth);
  box-shadow: inset 0 0 0 1px #f8efbe28,inset 0 -2px 3px #07110880;
  overflow: hidden;
  transform: translateZ(.1px);
}
.cover-face::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .15;
  background: repeating-linear-gradient(0deg,#fff3 0 .5px,transparent .5px 2px),repeating-linear-gradient(90deg,#0008 0 .5px,transparent .5px 3px);
}
.cover-lining {
  transform: translateZ(calc(0px - var(--board))) rotateY(180deg);
  background: linear-gradient(90deg,#a08e6750,transparent 12%),#d9ceb2;
  box-shadow: inset 0 0 0 7px var(--cloth),inset 0 0 0 8px #95886470;
}
.cover-board-edge, .cover-board-top, .cover-board-bottom,
.book-back-rim, .book-back-top, .book-back-bottom {
  position: absolute;
  background: linear-gradient(#fff2,#0005),var(--cloth);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.cover-board-edge {
  top: 0; right: 0; width: var(--board); height: 100%;
  transform-origin: right;
  transform: translateZ(calc(0px - var(--board))) rotateY(90deg);
}
.cover-board-top {
  top: 0; left: 0; width: 100%; height: var(--board);
  transform-origin: top;
  transform: translateZ(calc(0px - var(--board))) rotateX(90deg);
}
.cover-board-bottom {
  top: 100%; left: 0; width: 100%; height: var(--board);
  transform-origin: top;
  transform: rotateX(-90deg);
}
.book-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,#0004,transparent 10%,#fff1 85%,#0003),var(--cloth);
  border-radius: 3px 6px 6px 3px;
  transform: translateZ(calc(0px - var(--half-depth))) rotateY(180deg);
  box-shadow: inset 0 0 0 1px #ece1b838;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book-back-rim {
  top: 0; right: 0; width: var(--board); height: 100%;
  transform-origin: right;
  transform: translateZ(calc(0px - var(--half-depth))) rotateY(90deg);
}
.book-back-top {
  top: 0; left: 0; width: 100%; height: var(--board);
  transform-origin: top;
  transform: translateZ(calc(0px - var(--half-depth))) rotateX(90deg);
}
.book-back-bottom {
  top: 100%; left: 0; width: 100%; height: var(--board);
  transform-origin: top;
  transform: translateZ(calc(0px - var(--paper-front))) rotateX(-90deg);
}
.book-paper-front {
  position: absolute;
  inset: 6px;
  background: linear-gradient(90deg,#8f7a5650,transparent 12%,#fff1 90%,#84715040),#e2d7bb;
  transform: translateZ(var(--paper-front));
  box-shadow: inset 0 0 0 1px #b9a88799;
  border-radius: 0 2px 2px 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.endpaper-frame {
  position: absolute;
  inset: 28px;
  border: 1px solid #aa98754d;
}
.book-pages {
  top: 6px; bottom: 6px; right: 6px;
  width: var(--paper-depth);
  transform-origin: right;
  transform: translateZ(calc(0px - var(--paper-front))) rotateY(90deg);
  background: repeating-linear-gradient(90deg,#ae9e7c 0 .6px,#ded2b7 .6px 1.8px,#f1e7d0 1.8px 2.4px);
  box-shadow: inset 0 9px 8px #7d684329,inset 0 -12px 9px #79613b3d,inset -3px 0 5px #907c5470;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book-top, .book-bottom {
  position: absolute;
  left: 6px;
  width: calc(100% - 12px);
  height: var(--paper-depth);
  transform-origin: top;
  background: repeating-linear-gradient(0deg,#b7a785 0 .6px,#eee3c9 .6px 1.8px,#d1c3a4 1.8px 2.4px);
  box-shadow: inset 10px 0 10px #6e5d3e42,inset -4px 0 5px #b19a7140;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book-top {
  top: 6px;
  transform: translateZ(calc(0px - var(--paper-front))) rotateX(90deg);
}
.book-bottom {
  top: calc(100% - 6px);
  transform: translateZ(var(--paper-front)) rotateX(-90deg);
  filter: brightness(.84);
}
.book-spine {
  inset: 0 auto 0 0;
  width: var(--book-depth);
  transform-origin: left;
  transform: translateZ(calc(0px - var(--half-depth))) rotateY(-90deg);
  background: linear-gradient(90deg,#0007,#ffffff14 42%,#0001 70%,#0007),var(--cloth);
  border-radius: 5px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book-ground-shadow {
  width: 315px;
  height: 45px;
  bottom: -6px;
  background: #0009;
  filter: blur(13px);
  transform: rotate(-5deg) skewX(-15deg);
}
.book-stage.is-opening .book-object {
  transform: translateX(30px) rotateY(-6deg) rotateX(-10deg) rotateZ(0deg);
}
.book-stage.is-opening .front-cover {
  transform: translateZ(var(--half-depth)) rotateY(-115deg);
}
.book-stage.is-opening .book-ground-shadow { opacity: .65; }
@keyframes take-solid-book {
  from { transform: translateX(-130px) translateY(50px) rotateY(-82deg) rotateZ(-5deg) scale(.72); }
  to { transform: rotateY(-36deg) rotateX(-12deg) rotateZ(-3deg); }
}
@media (max-width:800px) {
  .book-object { width: 224px; height: 316px; --book-depth: 56px; }
}
@media (max-width:600px) {
  .book-object { width: 208px; height: 289px; --book-depth: 54px; }
  .book-ground-shadow { width: 244px; bottom: -7px; }
  .book-stage { height: 328px; }
}
@media (max-width:360px) {
  .book-object { width: 194px; height: 270px; --book-depth: 52px; }
}
@media (prefers-reduced-motion:reduce) {
  .book-object, .front-cover { animation: none!important; transition: none!important; }
}
html.flat .book-object,html.flat .front-cover { animation: none!important; transition: none!important; }
