/* ============================================================
   3D Interactive Graduation Book — v7
   ============================================================ */

.gb-active .ybx-closed-book {
    display: none !important;
}

.gb-active .ybx-opening-actions {
    display: none !important;
}

.gb-active .ybx-stage-copy {
    z-index: 2;
}

.ybx-home-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    color: #fffaf0;
    background: rgba(17, 16, 13, 0.62);
    border: 1px solid rgba(255, 250, 240, 0.14);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(18px);
    font-size: 0.86rem;
    font-weight: 800;
    transition: transform 220ms ease, background 220ms ease, color 220ms ease;
}

.ybx-home-button:hover {
    transform: translateY(-2px);
    background: rgba(212, 175, 90, 0.18);
    color: #d4af5a;
}

/* --- Particle Canvas --- */
#gbParticleCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* --- 3D Wrapper: absolute fill, centered content --- */
.gb-3d-wrapper {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 250px;
    perspective: 1200px;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.gb-3d-wrapper.is-hidden {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

/* =============================================
   BOOK  320 × 430,  depth ±25  (50px total)
   ============================================= */
.gb-book {
    width: 320px;
    height: 430px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(6deg) rotateY(-20deg);
    transition: transform 0.1s ease-out;
    cursor: pointer;
}

/* =============================================
   FRONT COVER
   ============================================= */
.gb-front {
    width: 320px;
    height: 430px;
    position: absolute;
    top: 0;
    left: 0;
    transform: translateZ(25px);
    border-radius: 3px 14px 14px 3px;
    background:
        repeating-linear-gradient(55deg, transparent, transparent 2px, rgba(0, 0, 0, 0.018) 2px, rgba(0, 0, 0, 0.018) 4px),
        repeating-linear-gradient(-35deg, transparent, transparent 3px, rgba(255, 255, 255, 0.01) 3px, rgba(255, 255, 255, 0.01) 6px),
        linear-gradient(155deg, #6b2020 0%, #7a2828 18%, #5c1818 48%, #4a1212 78%, #3d0f0f 100%);
    border: 1px solid rgba(80, 25, 25, 0.7);
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 200, 120, 0.05),
        0 4px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transform-origin: left center;
    box-sizing: border-box;
}

/* 2px thickness layers */
.gb-front::before {
    content: '';
    position: absolute;
    inset: -1px;
    transform: translateZ(-1px);
    background: #3d0f0f;
    border-radius: inherit;
    border: inherit;
}

.gb-front::after {
    content: '';
    position: absolute;
    inset: -1px;
    transform: translateZ(-2px);
    background: #4a1414;
    border-radius: inherit;
    border: inherit;
}

.gb-book.is-opening {
    animation: gb-book-shift 1.4s cubic-bezier(.23, 1, .32, 1) forwards;
}

@keyframes gb-book-shift {
    0% {
        transform: rotateX(4deg) rotateY(0deg) translateX(0);
    }
    100% {
        transform: rotateX(10deg) rotateY(0deg) translateX(80px);
    }
}

.gb-book.is-opening .gb-front {
    animation: gb-cover-open 1.4s cubic-bezier(.23, 1, .32, 1) forwards;
}

@keyframes gb-cover-open {
    0% {
        transform: translateZ(25px) rotateY(0deg);
    }

    100% {
        transform: translateZ(25px) rotateY(-160deg);
    }
}

.gb-book.is-opening .gb-intro-text {
    opacity: 1 !important;
}

/* Gold frame */
.gb-cover-frame {
    position: absolute;
    inset: 16px;
    border: 1.2px solid rgba(212, 175, 90, 0.3);
    border-radius: 2px 10px 10px 2px;
    pointer-events: none;
}

.gb-cover-frame::before,
.gb-cover-frame::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1.2px solid rgba(212, 175, 90, 0.4);
}

.gb-cover-frame::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.gb-cover-frame::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

.gb-cover-frame span::before,
.gb-cover-frame span::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1.2px solid rgba(212, 175, 90, 0.4);
}

.gb-cover-frame span::before {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 8px 0 0;
}

.gb-cover-frame span::after {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
}

.gb-cover-content {
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 28px;
}

.gb-emblem {
    width: 55px;
    height: 75px;
    margin: 0 auto 14px;
    opacity: 0.8;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.gb-cover-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 700;
    color: #d4af5a;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin: 0 0 2px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.gb-cover-year {
    font-family: 'Playfair Display', serif;
    font-size: 44px;
    font-weight: 900;
    color: #d4af5a;
    margin: 4px 0 6px;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 24px rgba(212, 175, 90, 0.12);
}

.gb-cover-batch {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: rgba(212, 175, 90, 0.5);
    letter-spacing: 7px;
    text-transform: uppercase;
    margin: 0 0 16px;
}

.gb-cover-line {
    width: 65px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4af5a, transparent);
    margin: 0 auto 14px;
}

.gb-cover-uni {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: rgba(212, 175, 90, 0.4);
    letter-spacing: 2px;
    margin: 0;
}

/* =============================================
   BACK COVER
   ============================================= */
.gb-back {
    width: 320px;
    height: 430px;
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg) translateZ(25px);
    border-radius: 14px 3px 3px 14px;
    background:
        repeating-linear-gradient(55deg, transparent, transparent 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px),
        linear-gradient(155deg, #4a1212 0%, #3d0f0f 60%, #2e0a0a 100%);
    border: 1px solid rgba(80, 25, 25, 0.6);
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.3);
    backface-visibility: hidden;
    box-sizing: border-box;
}

/* =============================================
   SPINE
   ============================================= */
.gb-spine {
    width: 50px;
    height: 430px;
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(90deg) translateX(-25px);
    transform-origin: left center;
    background: linear-gradient(0deg, #3d0f0f 0%, #4a1414 15%, #3d0f0f 35%, #4a1414 55%, #3d0f0f 75%, #4a1414 100%);
    border-top: 1px solid rgba(80, 25, 25, 0.4);
    border-bottom: 1px solid rgba(80, 25, 25, 0.4);
    border-radius: 8px 0 0 8px;
    box-shadow: inset 3px 0 6px rgba(0, 0, 0, 0.3), inset -3px 0 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.gb-spine-label {
    writing-mode: vertical-rl;
    font-family: 'Inter', sans-serif;
    font-size: 7px;
    color: rgba(212, 175, 90, 0.3);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* =============================================
   REAL 3D PAGES — generated by JS
   Each is an actual div with translateZ
   ============================================= */
.gb-real-page {
    position: absolute;
    top: 4px;
    left: 3px;
    width: 314px;
    height: 422px;
    border-radius: 2px 14px 14px 2px;
    backface-visibility: hidden;
    box-sizing: border-box;
    border-right: 1px solid rgba(180, 170, 150, 0.5);
    border-top: 1px solid rgba(200, 190, 170, 0.3);
    border-bottom: 1px solid rgba(200, 190, 170, 0.3);
    box-shadow: 1.5px 1.5px 4px rgba(0, 0, 0, 0.25);
}

/* =============================================
   OPEN BOOK BUTTON
   ============================================= */
.gb-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    margin-top: 50px;
    border: 1.5px solid rgba(212, 175, 90, 0.25);
    border-radius: 50px;
    background: rgba(40, 12, 12, 0.55);
    color: #d4af5a;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s ease;
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 4;
}

.gb-open-btn:hover {
    background: rgba(212, 175, 90, 0.1);
    border-color: rgba(212, 175, 90, 0.55);
    color: #e8c86a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 90, 0.1);
}

.gb-open-btn:active {
    transform: translateY(0);
}

.gb-open-btn.is-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.gb-open-btn i {
    font-size: 15px;
}

/* =============================================
   RESPONSIVE (Tablets & Mobile)
   ============================================= */

/* Tablets (Portrait & Landscape) */
@media (max-width: 1024px) {
    .gb-3d-wrapper {
        padding-top: 15vh;
    }
}

/* Small Tablets / Large Phones */
@media (max-width: 768px) {
    .gb-book {
        width: 280px;
        height: 380px;
    }

    .gb-front,
    .gb-back {
        width: 280px;
        height: 380px;
    }

    .gb-spine {
        height: 380px;
    }

    .gb-real-page {
        width: 274px;
        height: 372px;
    }

    .gb-cover-year {
        font-size: 38px;
    }

    .gb-cover-title {
        font-size: 13px;
        letter-spacing: 4px;
    }

    .gb-emblem {
        width: 48px;
        height: 65px;
    }

    .gb-3d-wrapper {
        padding-top: 10vh;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .ybx-home-button span {
        display: none;
    }

    .ybx-home-button {
        width: 44px;
        padding: 0;
        justify-content: center;
    }

    .gb-book {
        width: 220px;
        height: 300px;
    }

    .gb-front,
    .gb-back {
        width: 220px;
        height: 300px;
    }

    .gb-spine {
        height: 300px;
    }

    .gb-real-page {
        width: 214px;
        height: 292px;
    }

    .gb-cover-year {
        font-size: 30px;
    }

    .gb-cover-title {
        font-size: 11px;
        letter-spacing: 3px;
    }

    .gb-emblem {
        width: 35px;
        height: 50px;
    }

    .gb-open-btn {
        padding: 11px 22px;
        font-size: 12px;
        letter-spacing: 2px;
        margin-top: 35px;
    }

    .gb-3d-wrapper {
        padding-top: 5vh;
    }
}

/* Landscape Mode (Short Height Devices) */
@media (max-height: 600px) {
    .gb-3d-wrapper {
        padding-top: 2vh;
    }
    
    .gb-open-btn {
        margin-top: 20px;
    }
}
