#legal {
    text-align: center;
    width: 30vw;
    font-family: 'Inter', sans-serif;
    color: white;
    display: grid;
    grid-auto-flow: row;
    gap: 20px;
}

body.no-scroll {
    overflow: hidden; /* Prevents scrolling when subpage is open */
}
.bookshelf {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Space between books */
    justify-content: center;
    max-width: 1000px;
}

.book {
    width: 160px; /* Width of the book */
    height: 200px; /* Height of the book */
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
    cursor: pointer;
}

.cover {
    width: 100%;
    height: 100%;
    position: absolute;
    background-color: #000000; /* Brown color for the book cover */
    transform-origin: left center; /* Open from the left */
    transition: transform 0.5s ease-in-out;
    /*box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);*/
    z-index: 2; /* Ensure the cover is on top when closed */
    box-shadow: inset 0 0 2px 1px white; /* 2px is the border thickness */
}

/* Thickness effect for the cover (visible even when closed) */
.cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 100%;
    width: 15px; /* Increased thickness of the cover */
    height: 100%;
    background-color: #654321; /* Darker brown for the spine */
    transform-origin: left center;
    transform: translateX(-15px) rotateY(-90deg); /* Adjust positioning */
}

.title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Uni Sans Heavy Regular', serif;
}

.pages {
    width: 98%;
    height: 98%;
    position: absolute;
    background-color: #f5f5f5; /* Light color for pages */
    top: 1%;
    left: 1%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    transform-origin: left center;
    transition: transform 0.5s ease-in-out;
    z-index: 1; /* Ensure pages are behind the cover when closed */
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Thickness effect for the pages (visible even when closed) */
.pages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 100%;
    width: 12px; /* Increased thickness of the pages */
    height: 100%;
    background-color: #e0e0e0; /* Light gray for the page edges */
    transform-origin: left center;
    transform: translateX(-12px) rotateY(-90deg); /* Adjust positioning */
}

.content {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    text-align: center;
}

.book:hover .cover {
    transform: rotateY(-20deg); /* Open the cover */
}

.book:hover .pages {
    transform: rotateY(0deg); /* Slight rotation for pages */
}

.subpage {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.subpage-content {
    background-color: black;
    border: 1px solid #252424;
    width: 50vw;
    height: 50vh;
    overflow-y: auto;
    padding: 100px;
    position: relative;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    font-family: 'Inter', serif;
    color: white;
    text-align: left;
    margin: 40px;

}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    color: white;
    background-color: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 10px;
}

.close-btn:hover {
    /*background-color: #c0392b;*/
}