.home-library {
  background: #0b121b;
  color: #f4f0e8;
  padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 7vw, 7rem);
}

.home-library-heading {
  margin: 0 auto clamp(4rem, 7vw, 6.5rem);
  max-width: 840px;
  text-align: center;
}

.home-library-heading h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.8rem, 5.5vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .98;
  margin: .5rem 0 1.25rem;
}

.home-library-heading > p:last-child {
  color: #aeb8c5;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  margin: 0;
}

#home-library-categories {
  margin: auto;
  max-width: 1320px;
}

.library-category {
  border-top: 1px solid #2a3644;
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(4.5rem, 8vw, 7rem);
}

.library-category:last-child {
  padding-bottom: 0;
}

.library-category-header {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.library-category-header h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.5rem, 4.5vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: 1;
  margin: 0 0 .8rem;
}

.library-category-header p:last-child {
  color: #aeb8c5;
  margin: 0;
  max-width: 610px;
}

.library-category-header > a {
  border-bottom: 1px solid #d5b366;
  color: #f4f0e8;
  flex: 0 0 auto;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
  padding-bottom: .25rem;
  text-decoration: none;
  text-transform: uppercase;
}

.library-books {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.library-book {
  background: #121c27;
  border: 1px solid #293543;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.library-book-cover {
  align-items: center;
  background: linear-gradient(145deg, #071b31, #18344f);
  display: flex;
  height: clamp(310px, 32vw, 450px);
  justify-content: center;
  overflow: hidden;
  padding: clamp(1.3rem, 3vw, 2.5rem);
}

.library-book-cover img {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform .3s ease;
  width: 100%;
}

.library-book:hover .library-book-cover img {
  transform: translateY(-5px) scale(1.015);
}

.library-book-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(1.25rem, 2.3vw, 2rem);
}

.library-book-kicker {
  color: #d5b366;
  font-family: "DM Mono", monospace;
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .11em;
  margin: 0 0 .75rem;
}

.library-book h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.55rem, 2.2vw, 2.05rem);
  font-weight: 500;
  line-height: 1.08;
  margin: 0 0 .8rem;
}

.library-book h3 a {
  color: #f4f0e8;
  text-decoration: none;
}

.library-book-copy > p:not(.library-book-kicker) {
  color: #aeb8c5;
  margin: 0 0 1.5rem;
}

.library-book-link {
  color: #f4f0e8;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.library-book-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1rem;
  margin-top: auto;
}

.library-amazon-link {
  background: #e9a928;
  color: #17191c;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  padding: .65rem .8rem;
  text-decoration: none;
}

.library-amazon-link:hover { background: #f3c965; }

.library-book-link span {
  display: inline-block;
  margin-left: .3rem;
  transition: transform .2s ease;
}

.library-book-link:hover span {
  transform: translateX(4px);
}

.library-error {
  text-align: center;
}

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

@media (max-width: 620px) {
  .home-library {
    padding: 4rem 1.25rem;
  }

  .library-category-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-books {
    grid-template-columns: 1fr;
  }

  .library-book-cover {
    height: 390px;
  }
}
