:root{
    --book-w: clamp(120px, 13vw, 200px);
    --book-h: calc(var(--book-w) * 1.5); /* keep 2:3 aspect ratio */
    --plate-w: clamp(80px, 8vw, 250px);
    --gap-row: 1.5rem;
}

body {
    background-color: #ffe4e1; /* Light pink background */
    background-repeat: no-repeat;
    background-attachment: fixed;
    margin: 0; /* remove large left margin so layout can center */
    background-position: left top; /* Adjusted to move the background to the left and top */
}

.book-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--book-w);
    height: var(--book-h);
    border: 1px solid transparent;
    border-radius: 5px;
    overflow: hidden;
    box-sizing: border-box;
    align-self: flex-end; /* Align book bottom with plate bottom */
    animation: breathing 3s ease-in-out infinite; /* Added breathing effect */
}

@keyframes breathing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05); /* Scales up slightly */
    }
}

.book-title {
    font-weight: bold;
    font-size: clamp(0.9rem, 1.6vw, 1.2rem);
    margin: 0.5rem 0;
}

#book-list {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    gap: calc(var(--gap-row) + 0.5rem);
    padding: 3rem 1rem 4rem 1rem; /* spacing around the list */
    box-sizing: border-box;
}

/* Apply Typekit font to elements marked as English */
:lang(en) {
    font-family: "proxima-nova", "Helvetica Neue", Arial, sans-serif;
}

/* Cover page background */
body.cover {
    background-image: url("mokume2.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    /* keep existing tint if desired */
    background-color: #ffe4e1;
}

#book-list > .book-item:nth-child(1),
#book-list > .book-item:nth-child(2) {
    grid-row: 1;
}

#book-list > .book-item:nth-child(3),
#book-list > .book-item:nth-child(4) {
    grid-row: 2;
}

#book-list > .book-item:nth-child(5),
#book-list > .book-item:nth-child(6),
#book-list > .book-item:nth-child(7) {
    grid-row: 3;
}

#book-list > div {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.plate {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: flex-end; /* Ensure plate bottom alignment */
    width: 250px;
    height: 250px;
    background-image: url("saradai.png");
    background-size: cover;
    background-position: center;
    border-radius: 50%; /* Ensure circular shape */
    border: 2px solid #d2b48c;
    animation: rotate-plate 15s linear infinite;
}

.small-plate {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: flex-end;
    width: 200px;
    height: 200px;
    background-image: url("sarashou.png");
    background-size: cover;
    background-position: center;
    border-radius: 50%; /* Ensure circular shape */
    border: 2px solid #d2b48c;
    animation: rotate-plate 15s linear infinite;
}

@keyframes rotate-plate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.book-item div {
    margin: 0.2rem 0;
    word-wrap: break-word;
}

.book-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.plate img, .small-plate img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.book-item:hover {
    position: relative;
}

.book-item:hover::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center alignment */
    width: 200px; /* Match book width */
    height: 300px; /* Match book height */
    background-color: rgba(255, 255, 255, 0.7); /* 70% white overlay */
    border-radius: 5px; /* Match book-item border radius */
}

header h1 {
    display: flex;
    justify-content: center;
    color: aliceblue;
    font-size: clamp(1.6rem, 3.2vw, 2.5rem);
    font-weight: bold;
    align-items: center;
    height: 14vh; /* Reduced vertical height */
    min-height: 60px; /* Ensure it's not too small on short viewports */
    margin: 0; /* Remove default margin */
    text-shadow: 3px 3px 5px rgba(24, 24, 24, 0.5); /* Add text shadow for better visibility */    
}

