/* "One Flame" book section + One Flame Communications footer line. Tokens come from app.css. */
.book-card {
  max-width: 600px; margin: 0 auto;
  display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 22px; align-items: center;
  padding: 22px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px) saturate(1.15); -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
}
.book-cover {
  --rx: 0deg; --ry: 0deg; --rz: -1.2deg; --sx: 130%;
  position: relative; display: block; line-height: 0; overflow: hidden;
  border-radius: 3px 6px 6px 3px;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) rotate(var(--rz));
  box-shadow: 0 18px 30px -16px rgba(20, 30, 20, 0.55), 0 0 0 1px rgba(176, 138, 60, 0.35);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
  will-change: transform;
}
.book-cover img { width: 100%; height: auto; display: block; }
/* spine shading on the left edge */
.book-cover::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 8%; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.12) 55%, transparent);
}
/* light sheen; its position follows the pointer (desktop) or sweeps once on reveal */
.book-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 236, 196, 0.34) 50%, transparent 65%) no-repeat;
  background-size: 260% 100%; background-position: var(--sx) 0;
  mix-blend-mode: screen;
}
.book-card.is-tilting .book-cover { transition: transform 0.12s linear, box-shadow 0.3s ease; --rz: 0deg; box-shadow: 0 26px 36px -18px rgba(20, 30, 20, 0.6), 0 0 0 1px rgba(176, 138, 60, 0.5); }
.book-card.is-tilting .book-cover::after { transition: none; }
.book-cover:active { transform: perspective(900px) scale(0.98) rotate(var(--rz)); }

/* reveal: the cover settles in, one sheen sweep, then the text follows */
@keyframes book-settle { from { transform: perspective(900px) rotateY(-24deg) rotate(-4deg) translateY(10px); opacity: 0.4; } to { transform: perspective(900px) rotateY(0deg) rotate(-1.2deg); opacity: 1; } }
@keyframes book-sheen { from { background-position: 130% 0; } to { background-position: -40% 0; } }
@keyframes book-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html.js .book-card.reveal.in .book-cover { animation: book-settle 1s cubic-bezier(0.22, 1, 0.36, 1) both; }
html.js .book-card.reveal.in .book-cover::after { animation: book-sheen 1.6s ease 0.55s both; }
html.js .book-card.reveal.in .book-body > * { animation: book-rise 0.6s ease both; }
html.js .book-card.reveal.in .book-body > :nth-child(2) { animation-delay: 0.08s; }
html.js .book-card.reveal.in .book-body > :nth-child(3) { animation-delay: 0.16s; }
html.js .book-card.reveal.in .book-body > :nth-child(4) { animation-delay: 0.24s; }
html.js .book-card.reveal.in .book-body > :nth-child(5) { animation-delay: 0.32s; }
html.js .book-card.reveal.in .book-body > :nth-child(6) { animation-delay: 0.4s; }
/* once the pointer takes over, drop the one-shot animations so the custom properties drive it */
.book-card.is-tilting .book-cover, .book-card.is-tilting .book-cover::after,
.book-card.settled .book-cover, .book-card.settled .book-cover::after, .book-card.settled .book-body > * { animation: none !important; }
.book-buy svg { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.book-buy:hover svg { transform: translate(2px, -2px); }
.book-kicker {
  margin: 0; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-text);
}
.book-title { margin: 6px 0 0; font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 6vw, 2.1rem); line-height: 1.05; color: var(--ink); }
.book-title cite { font-style: normal; }
.book-sub { margin: 4px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.05rem; line-height: 1.35; color: var(--ink-soft); }
.book-desc { margin: 12px 0 0; font-size: 0.93rem; line-height: 1.6; color: var(--ink-soft); max-width: 46ch; }
.book-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 16px; }
.book-buy { padding: 10px 20px; min-height: 46px; }
.book-buy svg { width: 16px; height: 16px; }
.book-review {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 0.88rem; color: var(--gold-text); text-underline-offset: 3px; text-decoration-color: var(--gold-faint);
}
.book-review:hover { color: var(--green-bright); }
.book-meta { margin: 6px 0 0; font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted); }
.book-review:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 520px) {
  .book-card { grid-template-columns: 1fr; text-align: center; padding: 24px 20px; gap: 18px; }
  .book-cover { width: 136px; margin: 0 auto; }
  .book-desc { margin-left: auto; margin-right: auto; }
  .book-actions { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .book-cover, .book-cover::after, .book-body > *, .book-buy svg { animation: none !important; transition: none !important; }
  .book-cover { transform: rotate(-1.2deg) !important; }
}
