/* =====================================================
   BOOKS — FULLSCREEN SPLIT: big coverflow left | info right
   ===================================================== */
.books { padding: 0; }

.sec-head {
  padding: 6rem 2rem 3rem;
  max-width: 1200px; margin: 0 auto;
}
.sec-desc { color: var(--muted); max-width: 500px; font-size: .97rem; }

/* ── OUTER WRAPPER ── */
.books-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   LEFT — COVERFLOW
══════════════════════════════════════════ */
.cf-left-col {
  position: sticky;
  top: 0;
  height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  overflow: hidden;
  background: var(--bg);
}

/* ambient bg from active cover */
.cf-bg-blur {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(.18) saturate(1.6);
  transform: scale(1.15);
  transition: background-image .6s ease;
  z-index: 0;
}

/* shelf */
.cf-left-col::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,
    transparent, rgba(0,200,180,.5) 40%,
    rgba(124,58,237,.4) 70%, transparent);
  z-index: 2;
}

/* stage */
.cf-stage {
  position: relative;
  width: 100%;
  height: 70vh;
  z-index: 1;
}

/* center anchor */
.cf-center {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
}

/* ── BOOK CONTAINER — perspective lives here ── */
.cf-book {
  position: absolute;
  /* book dimensions */
  --w: 240px;
  --h: 360px;
  --d: 40px; /* thickness / spine width */
  width: var(--w);
  height: var(--h);
  top:  calc(var(--h) / -2);
  left: calc(var(--w) / -2);
  /* perspective on container so children share 3D space */
  perspective: 800px;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4,0,.2,1),
              opacity  .5s ease,
              filter   .45s ease;
  opacity: 0;
  pointer-events: none;
}

/* ── THE BOOK (inner rotating element) ── */
.cf-book-3d {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-30deg);
  transition: transform .6s ease;
  animation: bookInit .8s ease 0s 1 both;
}
@keyframes bookInit {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(-30deg); }
}

/* Hover: open to face-on */
.cf-book.active .cf-book-3d:hover {
  transform: rotateY(0deg);
}

/* ── FRONT COVER ── */
.cf-book-3d > img {
  /* position: absolute; */
  width: var(--w);
  height: var(--h);
  object-fit: cover;
  display: block;
  border-radius: 1px 3px 3px 1px;
  box-shadow: 5px 5px 30px rgba(0,0,0,.6);
  /* light gradient overlay */
  pointer-events: none;
}
/* shine on front */
.cf-book-3d > img + .cf-shine {
  position: absolute; inset: 0;
  background: linear-gradient(118deg,
    rgba(255,255,255,.13) 0%,
    rgba(255,255,255,.03) 30%,
    transparent 55%);
  z-index: 1; pointer-events: none;
  border-radius: 1px 3px 3px 1px;
}

/* ── PAGES (::before) ── */
.cf-book-3d::before {
  content: '';
  position: absolute;
  background: linear-gradient(to right,
    #e8e4f0, #f4f0ff, #e0d8f0, #f0ecff, #ddd8ee);
  /* slightly smaller than cover */
  width: var(--d);
  height: calc(var(--h) - 6px);
  top: 3px;
  /* position flush with right edge of cover, then rotate 90° */
  transform:
    translateX(calc(var(--w) - var(--d) / 2 - 3px))
    rotateY(90deg)
    translateX(calc(var(--d) / 2));
  border-radius: 0 2px 2px 0;
  /* subtle page lines */
  background-image:
    linear-gradient(to right, #e8e4f0, #f4f0ff, #e0d8f0, #f0ecff, #ddd8ee),
    repeating-linear-gradient(to bottom,
      transparent 0px, transparent 4px,
      rgba(0,0,0,.04) 4px, rgba(0,0,0,.04) 5px);
}

/* ── BACK COVER (::after) ── */
.cf-book-3d::after {
  content: '';
  position: absolute;
  width: var(--w);
  height: var(--h);
  background: #01020a;
  border-radius: 1px 3px 3px 1px;
  transform: translateZ(calc(var(--d) * -1));
  box-shadow: -10px 0 50px 10px rgba(0,0,0,.7);
}

/* POSITIONS */
.cf-book.active {
  transform: translateX(0);
  opacity: 1; pointer-events: all; z-index: 10; filter: none;
}
.cf-book.prev-1 {
  transform: translateX(-260px) rotateY(20deg) scale(.75);
  opacity: 1; pointer-events: all; z-index: 8; filter: brightness(.45);
}
.cf-book.next-1 {
  transform: translateX(260px) rotateY(-20deg) scale(.75);
  opacity: 1; pointer-events: all; z-index: 8; filter: brightness(.45);
}
.cf-book.prev-2 {
  transform: translateX(-420px) rotateY(30deg) scale(.55);
  opacity: .6; pointer-events: all; z-index: 6; filter: brightness(.22);
}
.cf-book.next-2 {
  transform: translateX(420px) rotateY(-30deg) scale(.55);
  opacity: .6; pointer-events: all; z-index: 6; filter: brightness(.22);
}
.cf-book.cf-hidden {
  opacity: 0; pointer-events: none;
  transform: translateZ(-600px) scale(0);
}
.cf-book.prev-1:hover, .cf-book.prev-2:hover,
.cf-book.next-1:hover, .cf-book.next-2:hover { filter: brightness(.65); }

/* preventa glow on active */
.cf-book.active.is-preventa .cf-book-3d > img {
  box-shadow: 5px 5px 30px rgba(0,0,0,.6), 0 0 40px rgba(0,200,180,.35);
}

/* preventa glow */
.cf-book.active.is-preventa .cf-book-visual {
  box-shadow: -12px 20px 60px rgba(0,0,0,.8), 0 0 40px rgba(0,200,180,.3);
}

/* click hint */
.cf-hint {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.88);
  color: var(--cyan);
  font-family: var(--sans);
  font-size: .58rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  padding: .38rem 1rem;
  border: 1px solid var(--cyan);
  white-space: nowrap;
  opacity: 0; transition: opacity .25s;
  pointer-events: none; z-index: 4;
}
/* .cf-book.active:hover .cf-hint { opacity: 1; } */
/* arrows + dots */
.cf-controls {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  z-index: 2;
}
.cf-arrows { display: flex; gap: .75rem; }
.cf-arrow {
  width: 46px; height: 46px;
  background: rgba(10,8,20,.85);
  border: 1px solid rgba(124,58,237,.35);
  color: var(--lavender);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
  backdrop-filter: blur(6px);
}
.cf-arrow:hover { background: rgba(124,58,237,.2); border-color: var(--purple-l); color: #fff; }
.cf-dots { display: flex; gap: .45rem; }
.cf-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dim); border: none; cursor: pointer; transition: all .3s;
}
.cf-dot.on { background: var(--purple-l); width: 18px; border-radius: 3px; }

/* ══════════════════════════════════════════
   RIGHT — INFO PANEL (single card, no scroll)
══════════════════════════════════════════ */
.cf-right-col {
  border-left: 1px solid var(--border);
  position: relative;
  /* matches sticky left column height */
  height: 90vh;
  display: flex;
  align-items: stretch;
  overflow: visible;
}

/* Single card — all cards stacked, only active visible */
.book-info-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 4rem 4rem 6rem 4.25rem;
  gap: 1rem;
  /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
  transform: translateY(16px);
  overflow-y: auto;
}
.book-info-card.active-card {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* vertical accent */
.book-info-card::before {
  content: '';
  position: absolute;
  left: -1px; top: 20%; height: 60%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--cyan) 40%, var(--purple-l) 60%, transparent);
  opacity: 0;
  transition: opacity .4s;
}
.book-info-card.active-card::before { opacity: 1; }

/* watermark number */
.bic-num {
  position: absolute;
  bottom: 2rem; right: 3rem;
  font-family: var(--serif);
  font-size: 8rem; font-weight: 900;
  color: rgba(124,58,237,.05);
  line-height: 1;
  pointer-events: none;
}

.bic-badge {
  display: none;
  font-size: .6rem; font-weight: 800;
  letter-spacing: .2em; text-transform: uppercase;
  padding: .28rem .85rem; border-radius: 2px;
  align-self: flex-start;
}
.book-info-card.is-preventa .bic-badge { display: inline-block; background: var(--cyan); color: #0a0a0f; }
.book-info-card.is-free     .bic-badge { display: inline-block; background: rgba(196,181,253,.12); color: var(--lavender); border: 1px solid rgba(196,181,253,.3); }

.bic-genre {
  font-size: .72rem; color: var(--cyan);
  letter-spacing: .15em; text-transform: uppercase; font-weight: 600;
}
.bic-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 900; line-height: 1.08; color: var(--text);
}
.bic-divider {
  width: 48px; height: 2px;
  background: linear-gradient(to right, var(--purple-l), var(--cyan));
  border: none; flex-shrink: 0;
}
.bic-desc {
  font-size: .97rem; color: var(--muted); line-height: 1.8; max-width: 500px;
}
.bic-links {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: .75rem;
  flex-wrap: nowrap;
  margin-top: .6rem;
  padding-bottom: 1rem;
}

.review-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
  width: 100%;
}

.review-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  width: 100%;
}

.review-prefix {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
  white-space: nowrap;
}

/* staggered reveal when card becomes active */
.book-info-card > * {
  opacity: 0; transform: translateX(16px);
  transition: opacity .45s ease, transform .45s ease;
}
.book-info-card.active-card > * { opacity: 1; transform: none; }
.book-info-card.active-card > *:nth-child(1) { transition-delay: .05s; }
.book-info-card.active-card > *:nth-child(2) { transition-delay: .1s;  }
.book-info-card.active-card > *:nth-child(3) { transition-delay: .16s; }
.book-info-card.active-card > *:nth-child(4) { transition-delay: .22s; }
.book-info-card.active-card > *:nth-child(5) { transition-delay: .28s; }
.book-info-card.active-card > *:nth-child(6) { transition-delay: .34s; }

/* ── LINK BUTTONS ── */
.mlink {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .62rem 1.4rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; border: 1px solid var(--border); color: var(--muted);
  transition: all .2s;
}
.mlink.review-chip {
  justify-content: center;
  padding: .6rem .88rem;
  font-size: .68rem;
  letter-spacing: .04em;
  white-space: nowrap;
  background: rgba(196,181,253,.06);
  flex: 1 1 140px;
  min-width: 140px;
}
.review-icon {
  font-size: .92rem;
  line-height: 1;
  flex-shrink: 0;
}
.review-icon-claude { color: #f6efe7; }
.review-icon-deepseek { color: #aab5ff; }
.review-icon-chatgpt { color: #7ff7d8; }
.mlink:hover { color: var(--lavender); border-color: rgba(196,181,253,.35); background: rgba(196,181,253,.04); }
.mlink.primary { background: var(--purple); color: #fff; border-color: var(--purple); }
.mlink.primary:hover { background: var(--purple-l); border-color: var(--purple-l); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124,58,237,.35); }
.mlink.cta-cyan { background: var(--cyan); color: #0a0a0f; border-color: var(--cyan); font-weight: 800; }
.mlink.cta-cyan:hover { background: #00e0c8; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,200,180,.3); color: #0a0a0f; }
.mlink.cta-free { background: rgba(196,181,253,.1); color: var(--lavender); border-color: rgba(196,181,253,.4); }
.mlink.cta-free:hover { background: rgba(196,181,253,.2); transform: translateY(-2px); }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .books-split { grid-template-columns: 1fr; min-height: auto; }
  .cf-left-col { position: relative; height: 70vw; min-height: 380px; max-height: 560px; }
  .cf-stage { height: 100%; }
  .cf-right-col {
    border-left: none; border-top: 1px solid var(--border);
    height: auto;
    min-height: 520px;
  }
  .book-info-card { padding: 2.5rem 2rem 3rem; }
  .book-info-card::before { display: none; }
  .bic-num { display: none; }
}
@media (max-width: 580px) {
  .cf-book { --w: 160px; --h: 240px; --d: 30px; }
  .cf-book.prev-1 { transform: translateX(-170px) rotateY(20deg) scale(.75); }
  .cf-book.next-1 { transform: translateX(170px)  rotateY(-20deg) scale(.75); }
  .cf-book.prev-2 { transform: translateX(-270px) rotateY(30deg) scale(.55); }
  .cf-book.next-2 { transform: translateX(270px)  rotateY(-30deg) scale(.55); }
  .cf-right-col { min-height: 560px; }
  .book-info-card { padding: 2rem 1.5rem; gap: 1rem; }
  .bic-title { font-size: 1.6rem; }
  .review-row {
    flex-wrap: wrap;
  }
  .mlink.review-chip {
    width: 100%;
    justify-content: flex-start;
  }
}
