* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(100% 60% at 50% 0%, #26231c 0%, #14130f 70%),
    #14130f;
  color: #efece2;
}

#shelf {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 40px;
}

.shelf-head { text-align: center; margin-bottom: 44px; }
.shelf-head h1 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 500;
  letter-spacing: 0.5px;
}
.shelf-head p { margin: 0; color: #a89f8c; font-size: 15px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 38px 28px;
  perspective: 1600px;
}

.book-card {
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
  align-items: center;
  outline: none;
}

.cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 3px 8px 8px 3px;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.3, 0.9, 0.4, 1);
  box-shadow:
    -4px 0 0 rgba(255,255,255,0.06) inset,
    0 3px 6px rgba(0,0,0,0.4),
    0 16px 34px -10px rgba(0,0,0,0.7);
}
.book-card:hover .cover-wrap,
.book-card:focus-visible .cover-wrap {
  transform: rotateY(-9deg) translateY(-8px) scale(1.02);
  box-shadow:
    -4px 0 0 rgba(255,255,255,0.08) inset,
    0 6px 12px rgba(0,0,0,0.45),
    22px 30px 50px -14px rgba(0,0,0,0.8);
}

.cover-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.cover-wrap .placeholder {
  position: absolute; inset: 0;
  border-radius: inherit;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 16px;
  background: linear-gradient(150deg, #5a4a33, #2e2619);
  font-family: Georgia, serif;
  font-size: 17px;
  color: #e8dfc9;
}
/* pages peeking out on the right edge */
.cover-wrap::after {
  content: "";
  position: absolute;
  top: 2%; bottom: 2%; right: -4px; width: 4px;
  background: repeating-linear-gradient(to bottom, #d9d2be 0 2px, #b9b19c 2px 4px);
  border-radius: 0 2px 2px 0;
  transform: translateZ(-1px);
}

.progress-strip {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 5px;
  background: rgba(0,0,0,0.5);
  border-radius: 0 0 8px 3px;
  overflow: hidden;
}
.progress-strip i {
  display: block; height: 100%;
  background: #c6920b;
}
.resume-badge {
  position: absolute; top: 10px; right: -4px;
  background: #c6920b;
  color: #241a0d;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.4px;
  padding: 4px 9px 4px 10px;
  border-radius: 3px 0 0 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.book-meta { margin-top: 14px; text-align: center; max-width: 100%; }
.book-meta .t {
  font-family: Georgia, serif;
  font-size: 15.5px;
  line-height: 1.3;
  display: block;
}
.book-meta .a {
  font-size: 12.5px;
  color: #a89f8c;
  margin-top: 3px;
  display: block;
}

.shelf-foot {
  margin-top: 56px;
  text-align: center;
  color: #6f6857;
  font-size: 12.5px;
}

#loadError {
  text-align: center;
  color: #cf9d6a;
  padding: 40px 20px;
  line-height: 1.7;
}

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 18px; }
  #shelf { padding-top: 34px; }
}
