.shelf-scene {
    perspective: 1200px;
    margin-top: 36px;
}

.bookcase {
    position: relative;
    max-width: 760px;
    height: 320px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 36px 48px 46px;
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(255, 220, 170, 0.05), transparent 28%),
        linear-gradient(90deg, #3b2418 0%, #4a2d1c 12%, #3a2216 100%);
    box-shadow:
        inset 0 0 0 14px #6b4630,
        inset 0 0 40px rgba(0, 0, 0, 0.35),
        0 28px 50px rgba(0, 0, 0, 0.35);
}

.bookcase__board {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 22px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(#c08a58, #7a5134 55%, #4e3120);
    box-shadow: 0 10px 0 #2a1810;
}

.book {
    position: relative;
    z-index: 2;
    width: 62px;
    height: 214px;
    margin-left: 36px;
    margin-bottom: -6px;
    padding: 14px 8px;
    border: 0;
    border-radius: 2px 7px 7px 2px;
    cursor: pointer;
    color: #f6e7c3;
    background:
        linear-gradient(90deg, #2a0c14 0 8px, transparent 8px),
        linear-gradient(180deg, #8d243c 0%, #641628 42%, #4a1020 100%);
    box-shadow:
        8px 10px 0 rgba(0, 0, 0, 0.28),
        inset -8px 0 0 rgba(0, 0, 0, 0.22),
        inset 0 0 0 1px rgba(246, 231, 195, 0.28);
    transform-origin: 50% 100%;
    transition: transform 0.35s ease;
}

.book:hover,
.book:focus-visible {
    transform: translateY(-16px) rotate(-2deg);
}

.book:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
}

.book.is-pulled {
    animation: pull-book 0.72s ease forwards;
    pointer-events: none;
}

.book__spine {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 10px;
}

.book__spine-title {
    writing-mode: vertical-rl;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.book__spine-author {
    writing-mode: vertical-rl;
    font-size: 11px;
    letter-spacing: 0.12em;
    opacity: 0.8;
}

.reader {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 8, 12, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.reader[hidden] {
    display: none;
}

.reader__spread {
    width: min(1040px, calc(100vw - 48px));
    min-height: min(560px, 78vh);
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f6f1e6;
    color: #2b2218;
    border-radius: 3px 16px 16px 3px;
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(90, 60, 30, 0.15);
    overflow: hidden;
    animation: open-book 0.5s ease;
}

.reader__page {
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.reader__page--left {
    background:
        linear-gradient(90deg, rgba(80, 40, 20, 0.08), transparent 18%),
        #f3ecdf;
    border-right: 1px solid rgba(70, 46, 24, 0.12);
}

.reader__kicker {
    margin: 0 0 18px;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8a6238;
}

.reader__title {
    margin: 0;
    font-size: clamp(40px, 6vw, 64px);
    letter-spacing: -0.04em;
    line-height: 1;
    color: #2b2218;
}

.reader__by {
    margin: 18px 0 0;
    color: #6d5844;
}

.reader__page--right {
    align-items: center;
    text-align: center;
    gap: 16px;
}

.reader__body {
    margin: 28px 0 0;
    font-size: 15px;
    line-height: 1.8;
    color: #3d3228;
    word-break: keep-all;
}

.reader__count {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.16em;
    color: #8a6238;
}

.reader__read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    padding: 16px 40px;
    border-radius: 999px;
    background: #2b2218;
    color: #f6f1e6;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.reader__read:hover {
    background: #433628;
}

.reader__read:focus-visible {
    outline: 2px solid #8a6238;
    outline-offset: 3px;
}

.reader__close {
    margin-top: 8px;
    border: 1px solid rgba(70, 46, 24, 0.25);
    background: transparent;
    color: #2b2218;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    cursor: pointer;
}

.reader__close:hover {
    background: rgba(70, 46, 24, 0.06);
}

.reader__close:focus-visible {
    outline: 2px solid #8a6238;
    outline-offset: 2px;
}

@keyframes pull-book {
    0% { transform: translateY(0) rotate(0); }
    45% { transform: translateY(-92px) rotate(-7deg) scale(1.08); }
    100% { transform: translateY(-130px) scale(1.12); opacity: 0; }
}

@keyframes open-book {
    from { transform: perspective(900px) rotateY(-28deg) scale(0.92); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (max-width: 760px) {
    .bookcase {
        height: 280px;
        padding-left: 24px;
    }

    .reader__spread {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .reader__page {
        padding: 28px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .book,
    .book.is-pulled,
    .reader__spread {
        animation: none;
        transition: none;
    }
}
