/*
 * Real, rendered 3D book mockup — used in place of a stock "cover photo"
 * since these sample case studies don't have an actual printed book to
 * photograph yet. Pure CSS 3D (perspective + rotateY), so it's a genuine
 * live element, not an image standing in for one.
 */
.book-mockup {
  --book-w: 190px;
  --book-h: 270px;
  --book-depth: 26px;
  width: var(--book-w);
  height: var(--book-h);
  position: relative;
  perspective: 1400px;
  margin-inline: auto;
}

.book-mockup__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(-32deg);
  transition: transform 0.6s var(--ease-out);
}
.book-mockup:hover .book-mockup__inner,
.book-mockup.is-active .book-mockup__inner {
  transform: rotateY(-14deg);
}

.book-mockup__cover,
.book-mockup__back {
  position: absolute;
  inset: 0;
  border-radius: 3px 8px 8px 3px;
  backface-visibility: hidden;
}
.book-mockup__cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1.4rem;
  box-shadow: 3px 6px 18px rgba(0,0,0,0.35);
  overflow: hidden;
}
.book-mockup__back {
  transform: translateZ(calc(var(--book-depth) * -1));
  filter: brightness(0.7);
}

.book-mockup__cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-mockup__pages {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: calc(100% - 1px);
  width: var(--book-depth);
  background: repeating-linear-gradient(to bottom, #f4efe2 0 2px, #ddd3ba 2px 3px);
  transform-origin: left center;
  transform: rotateY(90deg);
  border-radius: 0 3px 3px 0;
}

.book-mockup__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--book-depth);
  transform-origin: left center;
  transform: rotateY(90deg) translateZ(0) translateX(calc(var(--book-depth) * -1));
  border-radius: 3px 0 0 3px;
  filter: brightness(0.82);
}

.book-mockup__shadow {
  position: absolute;
  left: 8%;
  right: -18%;
  bottom: -14px;
  height: 22px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.35), transparent 72%);
  filter: blur(2px);
  z-index: -1;
}

/* ---------- Cover content ---------- */
.book-mockup__eyebrow {
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}
.book-mockup__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.15;
  font-weight: 700;
}
.book-mockup__author {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ---------- Motifs (simple decorative marks per genre) ---------- */
.book-mockup__motif { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; }

/* ---------- Size variants ---------- */
.book-mockup--sm { --book-w: 140px; --book-h: 200px; --book-depth: 18px; }
.book-mockup--sm .book-mockup__title { font-size: 1rem; }

.book-mockup--lg { --book-w: 260px; --book-h: 370px; --book-depth: 34px; }
.book-mockup--lg .book-mockup__title { font-size: 1.7rem; }
.book-mockup--lg .book-mockup__cover { padding: 2.2rem 2rem; }

/* ---------- Hero floating parallax variant ---------- */
.book-mockup--floating { animation: book-float 6s ease-in-out infinite; }
@keyframes book-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

/* ---------- Hero fanned book cluster (3 covers, staggered) ---------- */
.book-cluster {
  position: relative;
  height: 380px;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}
.book-cluster__item {
  position: absolute;
  top: 50%;
  left: 50%;
}
.book-cluster__item--0 { transform: translate(-50%, -50%) translateX(-38%) rotate(-9deg); z-index: 1; }
.book-cluster__item--1 { transform: translate(-50%, -50%) translateY(-6%) scale(1.15); z-index: 2; }
.book-cluster__item--2 { transform: translate(-50%, -50%) translateX(38%) rotate(9deg); z-index: 1; }

/* The float animation lives on the book-mockup itself (nested one level
   inside .book-cluster__item) so it composes with, rather than overwrites,
   the parent's static position/rotation/scale transform above. */
.book-cluster__item .book-mockup { animation: book-float 6s ease-in-out infinite; }
.book-cluster__item--0 .book-mockup { animation-delay: 0s; }
.book-cluster__item--1 .book-mockup { animation-delay: 0.6s; }
.book-cluster__item--2 .book-mockup { animation-delay: 1.2s; }

@media (max-width: 1024px) {
  .book-cluster { height: 300px; max-width: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-cluster__item { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .book-mockup__inner { transition: none; }
  .book-mockup--floating { animation: none; }
}
