/* Drawn-frame book. The graphite IS the texture. */
.book-page {
  --paper: #e7dfd2;
  --graphite: #2c2824;
  background: var(--paper);
  color: var(--graphite);
  font-family: ui-serif, Georgia, serif;
  min-height: 100vh;
}
.book-page .site-header {
  background: rgba(231, 223, 210, 0.92);
  border-bottom-color: rgba(44, 40, 36, 0.1);
}
.book-page .brand { color: var(--graphite); }
.book-page .nav a { color: #6e675d; }
.book-page .nav a.active,
.book-page .nav a:hover { color: var(--graphite); text-shadow: none; }

.book-stage {
  min-height: calc(100vh - 3.2rem);
  display: grid;
  place-items: center;
  padding: 4.5rem 1rem 2rem;
  perspective: 1600px;
}
.book-camera {
  width: min(92vw, 920px);
  transform-style: preserve-3d;
  transform: rotateX(6deg);
}
.book-volume {
  position: relative;
  transform-style: preserve-3d;
  box-shadow: 0 22px 48px rgba(40, 24, 12, 0.18);
}
.book-frame {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  opacity: 0;
  transition: opacity 0.55s ease;
}
.book-frame.is-on {
  opacity: 1;
}
.book-frame:not(.is-on) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-leaf {
  position: absolute;
  top: 12%;
  right: 8%;
  width: 42%;
  height: 72%;
  transform-origin: left center;
  transform-style: preserve-3d;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(40, 24, 12, 0.18), transparent 12%),
    rgba(244, 236, 220, 0.08);
  box-shadow: 8px 0 18px rgba(40, 24, 12, 0.12);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.book-volume.is-turning .book-leaf {
  opacity: 1;
  transform: rotateY(-118deg);
}

.book-hint {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.92rem;
  color: #6e675d;
}

.book-hit {
  position: fixed;
  top: 3.4rem;
  bottom: 0;
  width: 42vw;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 6;
}
.book-hit--left { left: 0; }
.book-hit--right { right: 0; }

@media (prefers-reduced-motion: reduce) {
  .book-frame, .book-leaf { transition: none; }
  .book-camera { transform: none; }
}
