.book-library {
  max-width: var(--max);
  margin: 0 auto;
  padding: 110px 24px;
  border-top: 1px solid var(--line);
}

.book-heading { margin-bottom: 18px; }

.library-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid #2d5137;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(23,163,74,.14), rgba(17,21,18,.75));
}

.library-summary strong {
  color: var(--lime);
  font: 800 2.5rem/1 Manrope, sans-serif;
}

.library-summary span {
  color: #b9c0ba;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.book-intro {
  max-width: 720px;
  margin: 0 0 42px;
  color: var(--muted);
  font-size: 1.05rem;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.book-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #111512;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.book-card:hover {
  transform: translateY(-7px);
  border-color: rgba(99,219,126,.55);
  box-shadow: 0 22px 50px rgba(0,0,0,.45), 0 0 30px rgba(23,163,74,.12);
}

.book-cover-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #070907;
}

.book-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3,5,4,.28), transparent 34%);
  pointer-events: none;
}

.book-cover {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), filter .3s ease;
}

.book-card:hover .book-cover {
  transform: scale(1.035);
  filter: brightness(1.06) saturate(1.06);
}

.book-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  background: rgba(8,11,9,.86);
  color: #dbe1dc;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.book-card.is-bonus {
  border-color: rgba(226,157,40,.42);
  background: linear-gradient(155deg, rgba(55,35,12,.4), #111512 46%);
}

.book-card.is-bonus .book-badge {
  border-color: rgba(255,183,61,.42);
  background: rgba(126,73,5,.9);
  color: #fff0cf;
}

.book-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.book-meta {
  margin: 0 0 7px;
  color: var(--lime);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.book-copy h3 {
  font-size: 1.18rem;
  line-height: 1.2;
}

.book-subtitle {
  min-height: 42px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.book-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.book-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.book-read { background: var(--green); color: #fff; }
.book-read:hover { background: #22b957; transform: translateY(-1px); }
.book-download { border: 1px solid #364039; color: #d9dfda; }
.book-download:hover { border-color: var(--green); color: var(--lime); }

@media (max-width: 1050px) {
  .books-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .book-library { padding: 78px 16px; }
  .book-heading { align-items: start; }
  .library-summary { margin-top: 24px; width: fit-content; }
}

@media (max-width: 480px) {
  .book-copy { padding: 13px; }
  .book-copy h3 { font-size: 1rem; }
  .book-subtitle { min-height: 54px; font-size: .75rem; }
  .book-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .book-card,
  .book-cover,
  .book-actions a { transition: none; }
  .book-card:hover,
  .book-card:hover .book-cover { transform: none; }
}
