#writing {
  position: relative;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 5;
}

.shelf-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.writing-shelf {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.book {
  position: absolute;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 6;
}

.book img {
  max-width: 800px; /* adjust size */
}

.book:hover {
  transform: translateY(-10px) rotate(-2deg);
  z-index: 2;
}

.book-caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 15px 25px;
  border-radius: 8px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999; /* always above books */
}

.book:nth-of-type(1) { top: 20%; left: 0%; }
.book:nth-of-type(2) { top: 20%; left: 30%; }
.book:nth-of-type(3) { top: 20%; left: 60%; }
