    @import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    body {
        font-family: 'Outfit', sans-serif;
        background: #0a0a0f;
        color: #fff;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow-x: hidden;
        position: relative;
    }

    body::before {
        content: '';
        position: fixed;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background:
            radial-gradient(circle at 30% 40%, rgba(80, 50, 160, 0.15), transparent 40%),
            radial-gradient(circle at 70% 60%, rgba(40, 120, 180, 0.15), transparent 40%);
        z-index: -1;
        animation: rotateBg 40s linear infinite;
        pointer-events: none;
    }

    @keyframes rotateBg {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    .header {
        text-align: center;
        margin-bottom: 2rem;
        animation: fadeInDown 1s ease;
    }

    .header h1 {
        font-size: 3rem;
        font-weight: 600;
        letter-spacing: 3px;
        text-transform: uppercase;
        background: linear-gradient(135deg, #ffffff, #a5b4fc, #818cf8);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        text-shadow: 0 10px 30px rgba(129, 140, 248, 0.2);
    }

    .header p {
        color: #8a8a9a;
        margin-top: 5px;
        letter-spacing: 1px;
        font-weight: 300;
    }

    .content-wrapper {
        display: block;
        padding: 20px;
        width: 100%;
    }

    /* --- 3D Book Container --- */
    .book-wrapper {
        display: none;
        position: relative;
        width: 450px;
        height: 636px;
        perspective: 2500px;
        transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
        animation: floating 6s ease-in-out infinite;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
    }

    .book-wrapper.expanded {
        transform: scale(1.1) translateY(-20px);
        z-index: 100;
    }

    .book-wrapper.expanded .overlay {
        opacity: 1;
        pointer-events: all;
    }

    @keyframes floating {

        0%,
        100% {
            transform: translateY(0);
        }

        50% {
            transform: translateY(-10px);
        }
    }

    .book {
        position: absolute;
        width: 100%;
        height: 100%;
        transform-style: preserve-3d;
        box-shadow:
            0 40px 80px rgba(0, 0, 0, 0.7),
            inset 0 0 0 1px rgba(255, 255, 255, 0.15);
        border-radius: 10px;
        display: flex;
        flex-direction: column;
    }

    .book::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 10px;
        transform: translateY(-50%);
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgb(0 0 0 / 6%) 45%, rgb(0 0 0 / 0%) 50%, rgb(0 0 0 / 0%) 55%, rgba(0, 0, 0, 0) 100%);
        z-index: 50;
        pointer-events: none;
    }

    .half-page {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        overflow: hidden;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        border-radius: 10px;
    }

    .top-half {
        /* Full radius */
        border-radius: 10px;
    }

    .bottom-half {
        /* Full radius */
        border-radius: 10px;
        display: none;
    }

    .flip-page {
        display: none !important;
    }

    .flip-page.animating {
        display: block;
    }

    .flip-face {
        position: absolute;
        width: 100%;
        height: 100%;
        backface-visibility: hidden;
        background-size: 100% 200%;
        background-repeat: no-repeat;
    }

    .flip-front {
        border-radius: 0 0 10px 10px;
        background-position: center bottom;
        box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.3);
    }

    .flip-back {
        border-radius: 10px 10px 0 0;
        background-position: center top;
        transform: rotateX(180deg);
        box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.3);
    }

    /* --- Navigation Controls --- */
    .controls {
        position: absolute;
        top: 50%;
        left: -80px;
        right: -80px;
        transform: translateY(-50%);
        display: flex;
        justify-content: space-between;
        z-index: 60;
        pointer-events: none;
    }

    .nav-btn {
        display: none;
        /* Hidden on desktop */
        pointer-events: auto;
        width: 55px;
        height: 55px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.15);
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(12px);
        color: #fff;
        font-size: 1.2rem;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    }

    .nav-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.4);
        transform: scale(1.15);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 255, 255, 0.15);
    }

    .nav-btn:active {
        transform: scale(0.95);
    }

    .expand-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 70;
        opacity: 0;
        transition: all 0.3s ease;
    }

    .book-wrapper:hover .expand-btn {
        opacity: 1;
    }

    .expand-btn:hover {
        background: #fff;
        color: #000;
    }

    /* --- Thumbnails Strip --- */
    .thumbnails-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .thumbnails-container::-webkit-scrollbar {
        display: none;
    }

    .thumbnail {
        width: 100%;
        height: auto;
        border-radius: 12px;
        overflow: hidden;
        cursor: pointer;
        position: relative;
        transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
        border: 2px solid transparent;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .thumbnail img {
        width: 100%;
        height: auto;
        object-fit: contain;
        transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.6s ease, opacity 0.6s ease;
        filter: grayscale(70%) brightness(0.9);
        opacity: 0.8;
    }

    .thumbnail:hover {
        transform: translateY(-6px);
        box-shadow: 0 10px 25px rgba(255, 255, 255, 0.15);
    }

    .thumbnail:hover img {
        filter: grayscale(0%) brightness(1.1);
        opacity: 1;
        transform: scale(1.08);
    }

    .thumbnail.active {
        border-color: #ffffff;
        transform: translateY(-8px) scale(1.03);
        box-shadow: 0 0 0 1px #ffffff, 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 255, 255, 0.4);
        z-index: 10;
    }

    .thumbnail.active img {
        filter: grayscale(0%) brightness(1.15);
        opacity: 1;
        transform: scale(1.05);
    }

    /* Dim overlay for expanded view */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(10px);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.5s ease;
    }

    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Global Slider Rules */
    body.slider-open {
        overflow: hidden;
    }

    @keyframes openPageModal {
        from {
            opacity: 0;
            transform: scale(0.95);
        }

        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    body.slider-open .book-wrapper {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        width: 100vw;
        height: calc(100vh - 90px);
        max-height: none;
        animation: openPageModal 0.3s ease-out forwards;
    }

    body.slider-open .book {
        box-shadow: none;
        background: transparent;
        border-radius: 0;
    }

    body.slider-open .book::before {
        display: none;
    }

    body.slider-open .half-page {
        height: 100%;
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        border-radius: 0;
    }

    body.slider-open .flip-page {
        display: none !important;
    }

    body.slider-open .overlay {
        opacity: 1;
        pointer-events: all;
        z-index: 90;
        background: rgba(0, 0, 0, 0.95);
    }

    body.slider-open .thumbnails-container {
        display: flex;
        flex-direction: row;
        position: fixed;
        bottom: 0;
        left: 500px;
        width: 36vw;
        height: 90px;
        z-index: 120;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        padding: 10px 0;
        /* Changed horizontal padding to 0, using pseudo-elements instead */
        margin: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        border: none;
        border-radius: 0;
        align-items: center;
        justify-content: flex-start;
        animation: none;
    }

    body.slider-open .thumbnails-container::before,
    body.slider-open .thumbnails-container::after {
        content: '';
        flex: 0 0 50vw;
        height: 1px;
    }

    body.slider-open .thumbnail {
        width: 48px;
        height: 68px;
        flex: 0 0 48px;
        margin: 0 10px 0 0;
        max-width: 48px;
        scroll-snap-align: center;
    }

    .controls {
        left: 10px;
        right: 10px;
        z-index: 110;
    }

    .nav-btn {
        display: none;
    }

    body.slider-open .expand-btn {
        opacity: 1;
        top: 20px;
        right: 20px;
        z-index: 120;
        background: rgba(0, 0, 0, 0.5);
    }

    /* Source Images (Hidden) */
    #htmlImageSource {
        display: none;
    }

    /* Responsive adjustments */
    @media (max-width: 1024px) {
        body.slider-open .thumbnails-container {
            left: 0;
            width: 100vw;
        }
    }

    @media (max-width: 768px) {
        body.slider-open .thumbnails-container {
            height: 75px;
        }

        body.slider-open .thumbnail {
            width: 40px;
            height: 56px;
            flex: 0 0 40px;
        }

        body.slider-open .book-wrapper {
            height: calc(100vh - 75px);
        }
    }