/* books.css */

.books-hero {
  text-align: center;
  padding: 6rem 2rem 3rem;
}
.books-hero .eyebrow {
  justify-content: center;
}
/* ── Project cards ── */
.project-card {
  width: calc(100% - 2rem);
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 4rem 3rem;
  position: relative;
  border: 1px solid rgba(201,168,76,.32);
  background: linear-gradient(135deg, rgba(255,255,255,.02), transparent);
  transition: border-color .4s;
}
.project-card:hover { border-color: var(--border-hover); }
.project-card.featured {
  background: linear-gradient(135deg, rgba(30,45,26,.08), rgba(22,17,42,.1));
}

.project-badge {
  position: absolute; top: -1px; left: 2.5rem;
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ink);
  background: var(--gold);
  padding: .3rem 1rem;
  text-transform: uppercase;
}
.project-badge.wip {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border-hover);
  top: 0;
}

/* ── Featured layout ── */
.project-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 5rem;
  align-items: start;
}

/* ── 3-D Book ── */
.book-3d-wrap {
  perspective: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
}
.book-3d {
  position: relative;
  width: 200px; height: 300px;
  transform-style: preserve-3d;
  transform: rotateY(-22deg);
  animation: bookRock 8s ease-in-out infinite;
  cursor: pointer;
  transition: transform .6s cubic-bezier(.34,1.56,.64,1);
}
.book-3d:hover { transform: rotateY(-10deg) translateY(-8px); }

@keyframes bookRock {
  0%,100% { transform: rotateY(-22deg) translateY(0); }
  50%      { transform: rotateY(-18deg) translateY(-10px); }
}

.book-face {
  position: absolute;
  backface-visibility: hidden;
}
.book-face.front {
  width: 200px; height: 300px;
  left: 0; top: 0;
  transform: translateZ(14px);
  border-radius: 2px 6px 6px 2px;
  overflow: hidden;
  border: 1px solid rgba(201,168,76,.45);
}
.book-face.spine {
  width: 28px; height: 300px;
  left: -14px; top: 0;
  transform: rotateY(-90deg) translateZ(14px);
  background: linear-gradient(180deg, #0f1a0f, #1a1428, #0f1a0f);
  border-radius: 3px 0 0 3px;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl;
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--gold);
  text-transform: uppercase;
  overflow: hidden;
}

.book-cover-art {
  width: 100%; height: 100%;
  /* background: linear-gradient(160deg, #1a1428 0%, #0d1a10 50%, #1e1228 100%); */
  background: url("images/HFITF-front-cover.png");
  background-size: cover;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .8rem; position: relative;
  box-shadow: inset -4px 0 12px rgba(0,0,0,.5);
}
.book-cover-art.second-book-cover {
  background-image: linear-gradient(160deg, #1a1428, #0d1a10 52%, #1e1228);
}
.cover-texture {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(201,168,76,.015) 2px,
    rgba(201,168,76,.015) 4px
  );
}
.cover-motif {
  font-size: 2.5rem;
  color: var(--gold);
  opacity: .5;
  text-shadow: 0 0 20px rgba(201,168,76,.4);
}
.cover-titles { text-align: center; padding: 0 1.2rem; }
.cover-author {
  display: block;
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--gold);
  margin-top: .6rem;
  text-transform: uppercase;
}

.book-shadow {
  width: 160px; height: 20px;
  background: radial-gradient(ellipse, rgba(0,0,0,.6) 0%, transparent 70%);
  border-radius: 50%;
  margin-top: -.5rem;
}

/* ── Project info ── */
.project-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--parchment);
  margin-bottom: 1rem;
  line-height: 1.15;
}
.project-title em { font-style: italic; color: var(--gold-lt); }
.project-subtitle {
  color: var(--gold-lt);
  font-size: 1.05rem;
  font-weight: 600;
  margin: -.5rem 0 1.25rem;
}

.project-meta {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 1.5rem;
}
.genre-pill {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--gold);
  border: 1px solid var(--border-hover);
  padding: .25rem .75rem;
  text-transform: uppercase;
}

.project-desc {
  color: var(--text);
  line-height: 1.8;
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

/* ── Progress bar ── */
.progress-block {
  margin-bottom: 2rem;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.progress-pct {
  color: var(--gold);
}
.progress-track {
  height: 3px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%; /* animated in JS */
  background: linear-gradient(90deg, rgba(201,168,76,.5), var(--gold));
  border-radius: 2px;
  position: relative;
  transition: width 1.6s cubic-bezier(.16,1,.3,1);
}
.progress-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
  animation: shimmer 2.4s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.progress-status {
  font-size: 1rem;
  color: var(--text-dim);
  margin-top: .5rem;
}

.project-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hardcover-edition {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 2rem 3rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-hover);
}
.hardcover-copy { max-width: 34rem; }
.hardcover-details { min-width: 0; }
.hardcover-kicker {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--gold);
  text-transform: uppercase;
}
.hardcover-title {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--parchment);
  margin: .35rem 0 .5rem;
}
.hardcover-intro {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.6;
}
.hardcover-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem 1.5rem;
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.55;
}
.hardcover-features li::marker { color: var(--gold); }
.hardcover-progress { margin-bottom: 1.5rem; }

/* ── Trilogy ── */
.trilogy-card { text-align: center; }
.trilogy-card .project-desc { text-align: left; }
.trilogy-inner {
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 3rem;
}
.trilogy-fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  margin: 3.5rem auto 3rem;
  height: 280px;
  width: fit-content;
}
.fan-book {
  width: 140px; height: 220px;
  border: 1px solid rgba(201,168,76,.3);
  border-radius: 2px 6px 6px 2px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), box-shadow .5s;
  box-shadow: -3px 5px 20px rgba(0,0,0,.7);
  position: relative; overflow: hidden;
}
.fan-book .fan-spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 20px;
  border-right: 1px solid rgba(201,168,76,.15);
}
.fan-book.b1 { background: linear-gradient(135deg,#1e2a18,#0d1a0d); transform: rotate(-9deg) translateX(18px); z-index: 1; }
.fan-book.b2 { background: linear-gradient(135deg,#1a1428,#221830); transform: translateY(-20px); z-index: 3; }
.fan-book.b3 { background: linear-gradient(135deg,#1a1228,#1e0d14); transform: rotate(9deg) translateX(-18px); z-index: 1; }
.fan-book.b1:hover { transform: rotate(-13deg) translateX(8px) translateY(-18px); z-index: 4; box-shadow: -4px 12px 30px rgba(0,0,0,.8); }
.fan-book.b2:hover { transform: translateY(-38px); z-index: 4; box-shadow: -4px 12px 30px rgba(0,0,0,.8); }
.fan-book.b3:hover { transform: rotate(13deg) translateX(-8px) translateY(-18px); z-index: 4; box-shadow: -4px 12px 30px rgba(0,0,0,.8); }

.fan-content { text-align: center; padding: .5rem; }
.fan-num {
  font-family: var(--sans);
  font-size: 2rem;
  color: rgba(201,168,76,.65);
  line-height: 1;
}
.fan-label {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--gold);
  text-transform: uppercase;
  margin: .4rem 0 .3rem;
}
.fan-title {
  font-family: var(--display);
  font-size: 1rem;
  color: var(--mist);
  font-style: italic;
}

/* Trilogy progress */
.trilogy-progress {
  display: flex; flex-direction: column; gap: 1.2rem;
  width: 100%; margin: 2rem 0 0;
  text-align: left;
}
.trilogy-progress .progress-block { margin-bottom: 0; }
@media (max-width: 860px) {
  .project-inner { grid-template-columns: 1fr; gap: 3rem; }
  .project-card { padding: 3rem 1.5rem; }
  .book-3d-wrap { padding-top: 0; }
  .book-3d { transform: rotateY(-15deg); }
  .hardcover-edition { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 540px) {
  .project-card { padding: 2.5rem 1.2rem; }
  .trilogy-fan { flex-direction: column; height: auto; align-items: center; }
  .fan-book { transform: none !important; width: 120px; height: 180px; }
  .hardcover-features { grid-template-columns: 1fr; }
}