        section {
            position: relative;
            /* allow absolute positioning of controls */
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100vh;
            overflow: hidden;
            font-family: 'Goldleaf', sans-serif;
            background: linear-gradient(90deg, #ffd700, #ffcc00, #ffb700);
            background-clip: text;
            /* -webkit-text-fill-color: transparent; */
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        }

        /* .section a {
            text-decoration: none;
            color: #ffffff;
            transition: background-color 1s;
        } */

        .book {
            position: relative;
            width: 45%;
            height: 85%;
            perspective: 2000px;
            transition: transform 1s ease;
            transform-origin: right center;
            /* transform: translateX(-3%); */
            /* Nudge inward so shadow & perspective are visible */
        }

        /* When opened, bring to center */
        .book.centered {
            transform: translateX(50%);
        }

        /* Shadow along right edge */
        .book::after {
            content: "";
            position: absolute;
            right: -10px;
            top: 0;
            width: 40px;
            height: 100%;
            /* background: linear-gradient(to left, rgba(0, 0, 0, 0.25), transparent 70%); */
            opacity: 1;
            transition: opacity 1s ease;
            pointer-events: none;
        }

        /* When opened, shadow softens */
        .book.centered::after {
            opacity: 0.4;
        }

        /* Page setup */
        .page {
            position: absolute;
            width: 100%;
            height: 100%;
            transform-origin: left center;
            transform-style: preserve-3d;
            transition: transform 1s ease, z-index 1s ease;
        }

        .page img {
            width: min(400px, 30%);
            max-height: 60vh;
            height: auto;
            object-fit: contain;
            cursor: zoom-in;
            transition: transform 0.3s ease;
        }

        .page img.expanded {
            width: 100%;
            cursor: zoom-out;
        }


        .page-front,
        .page-back {
            position: absolute;
            width: 100%;
            height: 100%;
            justify-content: center;
            backface-visibility: hidden;
            overflow: hidden;
            border-radius: 1.5%;
            box-shadow: 15px 15px 15px rgba(0, 0, 0, 0.3);
            border: 1px solid rgb(43, 2, 2)
        }

        .book-cover,
        .book-back {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            position: absolute;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            overflow: hidden;
            border-radius: 1.5%;
            box-shadow: 15px 15px 15px rgba(0, 0, 0, 0.3);
            border: 1px solid rgb(43, 2, 2)
        }

        .intro {
            color: #ffcc00;
        }

        .book-cover {
            background: #aaa195;
            background-image: url(/backgrounds/leather_book_texture.jpg);
            background-size: 110%;
            z-index: 2;
        }

        .book-cover p {
            max-width: 60%;
        }

        .book-cover img {
            border-radius: 10px;
        }

        .book-back {
            background: #aaa195;
            background-image: url(/backgrounds/leather_book_texture.jpg);
            background-size: 110%;
            transform: rotateY(180deg);
        }

        .page-front {
            background: #aaa195;
            background-image: url(/backgrounds/parchment_paper_texture.jpg);
            background-size: 110%;
            z-index: 2;
        }

        .page-back {
            background: #aaa195;
            background-image: url(/backgrounds/parchment_paper_texture.jpg);
            background-size: 110%;
            transform: rotateY(180deg);
        }

        .page-content {
            padding: 30px;
            box-sizing: border-box;
        }

        .page-content p {
            max-width: min(70%, 38rem);
            margin: 20px auto;
            padding-left: 10px;
            font-size: clamp(0.75rem, 1.1vw, 0.95rem);
            line-height: clamp(1.4, 1.6vw, 1.65);
        }

        .page-content img {
            padding: 10px;
            border-radius: 10%;
        }

        .page-content h3 {
            text-align: center;
            justify-content: center;
        }

        .final-image-row {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 30px;
            margin-top: 30px;
        }

        .final-image {
            max-width: 40%;
            height: auto;
            cursor: zoom-in;
            border-radius: 6px;
        }

        /* .final-image.thumbnail {
            width: auto;
        } */

        .back-cover-emblem {
            position: absolute;
            bottom: 50%;
            left: 50%;
            transform: translate(-50%, 50%);
            width: 100px;
            /* adjust to taste */
            max-width: 15%;
            opacity: 0.85;
            pointer-events: none;
            /* prevents zoom / click interference */
            filter:
                brightness(0.85) contrast(1.2) drop-shadow(1px 1px 1px rgba(255, 255, 255, 0.2)) drop-shadow(-2px -2px 3px rgba(0, 0, 0, 0.7));
        }

        /* Flip animation */
        .page.flipped {
            transform: rotateY(-180deg);
            z-index: 0;
        }

        /* The controls now sit below the book */
        .controls {
            position: absolute;
            top: calc(95%);
            /* positions just below the bottom of the book */
            left: 48.75%;
            /* transform: translateX(40%); */
            display: flex;
            gap: 20px;
            transition: transform 1s ease;
            z-index: 10;
        }

        /* When the book opens, buttons shift left to center between pages */
        .book.centered~.controls {
            transform: translateX(-30%);
        }

        /* Button styling */
        button {
            padding: 8px 16px;
            font-size: 16px;
            border: none;
            border-radius: 6px;
            background: #333;
            color: white;
            cursor: pointer;
            transition: background 0.3s;
        }

        button:hover {
            background: #555;
        }

        /*ensure fullsize photos on thumbnail click*/
        .image-overlay img.fullsize {
            position: static !important;

            display: block !important;

            max-width: 100vw !important;
            max-height: 100vh !important;
            width: auto !important;
            height: auto !important;

            margin: auto !important;

            align-self: center !important;
        }