* {
    margin: 0;
    padding: 0;
}

:root {
    --wall-opacity: 0.75;
    --bottom-tint-opacity: 0.22;
}

html {
    overflow-y: hidden;
    overflow-x: hidden;
    height: 100%;
}

.page-shell {
    width: 1600px;
    min-height: 1000px;
    transform-origin: top left;
    transform: scale(var(--page-scale, 1));
}

.title{
    font-weight: bold;
    font-size: 1.2em;
}

body {
    margin: 0;
    padding: 24px;
    font-family: "Zen Kurenaido", sans-serif;
    background-image:
        linear-gradient(0deg, rgba(126, 86, 31, var(--bottom-tint-opacity)) 0%, rgba(126, 86, 31, 0) 48%),
        linear-gradient(rgba(255, 255, 255, var(--wall-opacity)), rgba(255, 255, 255, var(--wall-opacity))),
        url('wall.png'),
        linear-gradient(0deg, #7e561f 0%, #c9b08a 28%, #f7f4ec 62%, #efe8d8 100%);
    background-size: cover, cover, cover, cover;
    background-position: center, center, center, center;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
    overflow-y: hidden;
    overflow-x: hidden;
}

.info-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(16, 16, 16, 0.72);
    z-index: 2000;
    padding: 24px;
}

.info-overlay.is-open {
    display: flex;
}

.info-card {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 24px;
    background: linear-gradient(180deg, #fffdf7 0%, #f0e7d4 100%);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
    padding: 36px 32px 32px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.info-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    color: #222;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.info-card-title {
    margin: 0 56px 24px 0;
    font-size: 2.1rem;
}

.info-card-body .author {
    font-size: 1.35rem;
    line-height: 1.65;
    margin-bottom: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.5fr);
    gap: 24px;
    align-items: start;
}

.info-meta .author {
    margin-bottom: 10px;
}

.meta-label {
    color: #8a4d1a;
    font-weight: 700;
}

.book-note {
    font-size: 1.03rem;
    line-height: 1.9;
    color: #3a3122;
    white-space: normal;
}

@media (max-width: 760px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

header h1 {
    margin: 48px 0 20px;
    margin-left: 620px;
    font-size: 3rem;
    color: #7e561f;
}

main {
    overflow: visible;
}

.book-illustrations {
    display: flex;
    flex-wrap: nowrap;
    margin: 440px 0 24px;
    padding-left: 90px;
    width: max-content;
    max-width: none;
    position: relative;
}

.book-illustrations::before {
    content: "";
    position: absolute;
    left: -220px;
    right: -220px;
    bottom: 0px;
    height: 100px;
    border-radius: 10px;
    background-image: url('wood.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    box-shadow: inset 0 -6px 8px rgba(0,0,0,0.12);
    z-index: 0;
}

.book-illustrations::after {
    content: "";
    position: absolute;
    left: -170px;
    right: -180px;
    bottom: -30px;
    height: 42px;
    border-radius: 20px;
    background-image: url('wood2.jpeg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    box-shadow: 0 16px 28px rgba(72, 42, 16, 0.28);
    z-index: 0;
}

.book-illustration {
    position: relative;
    flex: 0 0 auto;
    width: 420px;
    height: 285px;
    z-index: 1;
    transition: transform 200ms ease-out;
}

/* Precise click target aligned to the visible top face of each book */
.book-hitbox {
    position: absolute;
    left: 90px;
    top: 38px;
    width: 240px;
    height: 170px;
    transform: skewX(20deg) rotate(110deg);
    transform-origin: center;
    z-index: 6;
    cursor: pointer;
    background: transparent;
}

.book-illustration::after {
    content: "";
    position: absolute;
    left: 150px;
    top: 168px;
    width: 120px;
    height: 180px;
    background: radial-gradient(ellipse at center, rgba(111, 69, 32, 0.32) 0%, rgba(111, 69, 32, 0.18) 30%, rgba(111, 69, 32, 0.08) 54%, rgba(111, 69, 32, 0) 78%);
    filter: blur(8px);
    transform: skewX(20deg) rotate(90deg);
    transform-origin: center;
    z-index: 0;
    pointer-events: none;
}

.book-illustration:hover {
    transform: translateY(-30px);
}

.book-illustration:hover::after {
    width: 108px;
    height: 160px;
    filter: blur(5px);
}

.book-illustration:first-child {
    left: -150px;
}

.book--white {
    left: -330px;
}

.book-illustration:nth-child(3) {
    left: -510px;
}
.book-illustration:nth-child(4) {
    left: -690px;
}

.book-illustration:nth-child(5) {
    left: -870px;
}

.book-illustration:nth-child(6) {
    left: -1050px;
}

.book-illustration:nth-child(7) {
    left: -1230px;
}

.book-illustration:nth-child(4) .book-top {
    background: #f9ebd1;
}
.book-illustration:nth-child(4) .book-back {
    background: #d0bfa0;
}
.book-illustration:nth-child(4) .book-side {
    background: #fffef0;
}
.book-illustration:nth-child(4) .book-pages {
    background: #d0bfa0;
}

.book-illustration:nth-child(5) .book-top {
    background: linear-gradient(90deg, #6aa9d4 0%, #ffffff 100%);
}

.book-illustration:nth-child(5) .book-back {
    background: #6aa9d4;
}

.book-illustration:nth-child(5) .book-pages {
    background: #6aa9d4;
}

.book-illustration:nth-child(6) .book-top {
    background: linear-gradient(180deg, #8fa5ae 0%, #fd534a 100%);
}

.book-illustration:nth-child(6) .book-back {
    background: #8fa5ae;
}

.book-illustration:nth-child(6) .book-pages {
    background: #8fa5ae;
}


.book-back {
    position: absolute;
    z-index: 0;
    left: 112px;
    top: 21px;
    width: 243px;
    height: 150px;
    background: #d6b83e;
    transform: skewX(20deg) rotate(110deg);
    transform-origin: center;
    border-radius: 6px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

/* Tooltip (speech bubble) that appears above each book on hover */
.book-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 100px);
    transform: translateX(-50%) translateY(10px);
    background: #ffffff;
    color: #111;
    padding: 23px 28px;
    border-radius: 14px;
    font-size: 20px;
    line-height: 1.8;
    min-width: 260px;
    max-width: 360px;
    min-height: 210px;
    text-align: center;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 999;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.14);
}

.tooltip-title {
    display: block;
    font-weight: 700;
}

.tooltip-sub {
    display: block;
    margin-top: 30px;
}

.book-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -13px;
    border-width: 11px 11px 0 11px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.09));
}

.book-illustration:hover .book-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: none;
}
.book-illustration {
    cursor: pointer;
}
.book--white .book-side {
    background: #fffef0;
}

.book--white .book-pages {
    background: #eae7e0;
    box-shadow: 0 0 0 3px #44c444;
}

.book--white .book-top {
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22), 0 0 0 3px #44c444;
}

.book--white .book-back {
    background: #a8b9a4;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.10);
}

.book--white .book-tooltip::after {
    border-color: #ffffff transparent transparent transparent;
}

.book-illustration:first-child .book-top {
    background: linear-gradient(0deg, #ffffff 0%, #000000 100%);
}

.book-illustration:first-child .book-back {
    background: #3a3a3a;
}

.book-illustration:first-child .book-side {
    background: #eef6ff;
}

.book-illustration:first-child .book-pages {
    background: #000000;
}

.book-top {
    position: absolute;
    z-index: 2;
    left: 78px;
    top: 45px;
    width: 243px;
    height: 150px;
    background: #ffdc42 0%;
    transform: skewX(20deg) rotate(110deg);
    transform-origin: center;
    border-radius: 6px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.book-side {
    position: absolute;
    z-index: 1;
    left: 222px;
    top: -156px;
    width: 13px;
    height: 315px;
    background: #fffef0;
    transform: skewX(-42deg)skewY(-52deg)rotate(147deg);
    border-radius: 3px;
}

.book-pages {
    position: absolute;
    z-index: 2;
    left: 277px;
    top: 21px;
    width: 36px;
    height: 228px;
    background: #d6b83e;
    transform: skewY(-30deg);
    border-radius: 0 4px 4px 4px;
    cursor: pointer;
}

.book-top,
.book-back,
.book-pages {
    overflow: hidden;
    isolation: isolate;
}

.book-top::before,
.book-back::before,
.book-pages::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: url('noise.png');
    background-size: 140px 140px;
    background-repeat: repeat;
    opacity: 0.12;
    pointer-events: none;
    mix-blend-mode: multiply;
}