@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

*{
    margin: 0;
    padding: 0;
    text-decoration: none;
    box-sizing: border-box;
    border: none;
    outline: none;
}
:root {
    --bg-color: #17110e; /* Dark chocolate mahogany wood */
    --main-color: #c2593f; /* Warm collegiate retro terracotta / rust */
    --accent-color: #d99f59; /* Glowing amber-gold */
    --text-color: #2b231f; /* Deep sepia-ink charcoal */
    --second-text-color: #5e524b; /* Soft sepia charcoal */
    --white-color: #fffdfa; /* Warm paper white */
    --cover-color: linear-gradient(135deg, #8c1c24, #470c10); /* Premium Contrasting Crimson/Burgundy Red Leather */
    --pages-color: linear-gradient(90deg, #FAF6EE, #E6DEC9); /* Aged vintage ivory parchment paper */
    --border: 0.125rem solid #c2593f;
    --box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45); /* Deeper physical depth shadow */
    --page-bg: #faf6ee;
}

body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; 
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    font-family: "Kalam", sans-serif;
}

.wrapper{
    position: relative;
    width: 72rem;
    height: 48rem;
    padding: 2rem;
    perspective: 250rem;
    animation: show-animate 2s forwards;
}

@keyframes show-animate {
    0%,
    30% {
        opacity: 0;
        transform: rotate(-20deg);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg);
    }
}

.cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--cover-color);
    box-shadow: var(--box-shadow);
    border-top-left-radius: 0.6rem;
    border-bottom-left-radius: 0.6rem;
    transform-origin: right;
}
/* Beautiful gold foil border inlay inside covers */
.cover::after {
    content: '';
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.8rem;
    border: 1.5px solid rgba(251, 191, 36, 0.45); /* Elegant thin gold line */
    border-radius: 0.4rem;
    pointer-events: none;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.25);
}
.cover.cover-left{
    z-index: -1;
    border-right: 4px solid rgba(0, 0, 0, 0.4);
    box-shadow: inset 8px 0 24px rgba(0, 0, 0, 0.6), var(--box-shadow);
}
/* 3D Brass metal corner caps on Left Cover (Top/Bottom Left) */
.cover.cover-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, #fbbf24 0%, #b45309 45%, #92400e 55%, transparent 60%) no-repeat top left,
        linear-gradient(45deg, #fbbf24 0%, #b45309 45%, #92400e 55%, transparent 60%) no-repeat bottom left;
    background-size: 28px 28px;
    z-index: 10;
    pointer-events: none;
    border-top-left-radius: 0.6rem;
    border-bottom-left-radius: 0.6rem;
}
.cover.cover-right{
    z-index: 100;
    border-left: 4px solid rgba(0, 0, 0, 0.4);
    box-shadow: inset -8px 0 24px rgba(0, 0, 0, 0.6), var(--box-shadow);
    transition: transform 1s cubic-bezier(.645, .045, .355, 1);
}
/* 3D Brass metal corner caps on Right Cover (Top/Bottom Right) */
.cover.cover-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(-135deg, #fbbf24 0%, #b45309 45%, #92400e 55%, transparent 60%) no-repeat top right,
        linear-gradient(-45deg, #fbbf24 0%, #b45309 45%, #92400e 55%, transparent 60%) no-repeat bottom right;
    background-size: 28px 28px;
    z-index: 10;
    pointer-events: none;
    border-top-right-radius: 0.6rem;
    border-bottom-right-radius: 0.6rem;
}
.cover.cover-right.turn {
    transform: rotateY(180deg);
    border-left: none;
    border-right: 4px solid rgba(0, 0, 0, 0.4);
    box-shadow: inset 8px 0 24px rgba(0, 0, 0, 0.6), var(--box-shadow);
}

.book {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    perspective: 250rem;
}

.book .book-page {
    position: absolute;
    width: 50%;
    height: 100%;
    background: var(--pages-color);
    box-shadow: 0 0 .6rem rgba(0,0,0,0.1);
    display: flex;
    padding: 2rem;
    overflow: visible;
}
.book-page.page-left{
    box-shadow: -.6rem .6rem .6rem rgba(0,0,0,0.1);
}

.profile-page{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Container for the overlapping photos - see Base Polaroid Frame Style below */

/* Masking Tape effect */
.tape {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    width: 110px;
    height: 35px;
    background-color: rgba(238, 232, 170, 0.8);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    z-index: 15;
    backdrop-filter: blur(2px);
}

/* Base Polaroid Frame Style */
.photo-stack {
    position: relative;
    width: 250px;
    height: 300px; 
    margin-bottom: 3rem;
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    z-index: 1;
}

/* Base image styles for polaroid photos */
.photo-stack img {
    position: absolute;
    width: 175px;
    height: auto;
    border-radius: 6px;
    box-shadow: 4px 8px 20px rgba(0,0,0,0.45);
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease, z-index 0s;
}

/* Back Photo (Tilted Left) */
.photo-stack .photo-back {
    transform: rotate(-12deg) translate(-35px, 15px);
    z-index: 1;
}

/* Front Photo (Tilted Right) */
.photo-stack .photo-front {
    transform: rotate(8deg) translate(35px, -5px);
    z-index: 2;
}

/* Hover - Pulls the hovered photo forward and straightens it */
.photo-stack img:hover {
    transform: rotate(0deg) scale(1.15) translateY(-10px);
    z-index: 10;
    box-shadow: 8px 12px 25px rgba(0, 0, 0, 0.6);
}

.profile-page h1 {
    font-size: 2.7rem;
    line-height: 1.25;
    overflow: hidden;
}
.profile-page h2{
    color: var(--main-color);
    font-size: 1.5rem;
}
.profile-page .social-media {
    margin: .6rem .8rem;
}
.profile-page .social-media a{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: var(--border);
    border-radius: 50%;
    font-size: 1.3rem;
    color: var(--main-color);
    margin: 0 .2rem;
    transition: .5s;
}
.profile-page .social-media a:hover{
    background-color: var(--main-color);
    color: var(--white-color);
}
.profile-page p {
    text-align: justify;
    font-size: 1.1rem;
}
.profile-page .btn-box{
    margin-top: 1.2rem;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 9.5rem;
    height: 3rem;
    background: var(--main-color);
    border: var(--border) ;
    border-radius: .3rem;
    font-size: 1rem;
    color: var(--white-color);
    font-weight: 500;
    margin: 0 1rem;
    transition: .5s;
    overflow: hidden;
}
.btn-box .btn:nth-child(2){
    background: transparent;
    color: var(--main-color);
}
.btn-box .btn:nth-child(1):hover{
    background: transparent;
    color: var(--main-color);
}
.btn-box .btn:nth-child(2):hover{
    background: var(--main-color);
    color: var(--white-color);
}

/* right page */
.book-page.page-right{
    position: absolute;
    right: 0;
    transform-style: preserve-3d;
    transform-origin: left;
    transition: transform 1s cubic-bezier(.645, .045, .355, 1);
}
.book-page.page-right.turn{
    transform: rotateY(-180deg);
}

.book-page .page-front,
.book-page .page-back{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pages-color);
    padding: 0;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.book-page .page-front{
    transform: rotateY(0deg) translateZ(1px);
}
.book-page .page-back{
    transform: rotateY(180deg) translateZ(1px);
}

/* Page Scroll Content Wrapper (resolves page number overlap bug!) */
.page-content {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Lock content completely to prevent scrollbars for physical scrapbook look */
    padding: 1.5rem 2rem 3.5rem; /* Spacious padding including bottom margin for page number */
    box-sizing: border-box;
}
.page-content::-webkit-scrollbar {
    width: 4px;
}
.page-content::-webkit-scrollbar-thumb {
    background: rgba(194, 89, 63, 0.35);
    border-radius: 4px;
}

/* Translucent Bottom Fade Mask */
.book-page .page-front::after,
.book-page .page-back::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3.8rem;
    background: linear-gradient(to top, var(--page-bg, #fff) 45%, rgba(255, 255, 255, 0) 100%);
    z-index: 9;
    pointer-events: none;
    border-radius: 0 0 8px 8px;
}

.title {
    text-align: center;
    margin-bottom: 0.5rem;
}
/* Line draw karne ka blueprint */
@keyframes drawLine {
    0% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

/* Dots ko pop karne ka blueprint */
@keyframes popDot {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); opacity: 1; } /* Thoda bada hoke bounce back karega */
    100% { transform: scale(1); opacity: 1; }
}
.workeduc-box {
    position: relative;
    margin-top: 0.5rem;
}
.workeduc-box::after {
    content: none;
}
/* Duplicate ::before removed - correct version is below at .workeduc-content::before */
/* code fix kra hai ye krke ki maine turn krne ke baad animation krna hai */
.book-page:not(.turn) .workeduc-box::after {
    animation: drawLine 4s linear forwards; 
}

/* 2. Biology to Binary Dot */
.book-page:not(.turn) .workeduc-content:nth-child(1)::before {
    animation: popDot 0.4s ease forwards;
    animation-delay: 0s; 
}

/* 3. Day One Dot */
.book-page:not(.turn) .workeduc-content:nth-child(2)::before {
    animation: popDot 0.4s ease forwards;
    animation-delay: 1.6s; 
}

/* 4. The Unplanned Squad Dot */
.book-page:not(.turn) .workeduc-content:nth-child(3)::before {
    animation: popDot 0.4s ease forwards;
    animation-delay: 3.5s; 
}

.workeduc-box .workeduc-content {
    position: relative;
    padding-left: 1.6rem;
    padding-bottom: 0.8rem;
}
.workeduc-box .workeduc-content::before{
    content: '';
    position: absolute;
    top: 0.35rem;
    left: -0.72rem;
    width: 1rem;
    height: 1rem;
    background: linear-gradient(135deg, #df7a54, var(--main-color));
    clip-path: polygon(0 0, 100% 50%, 0 100%, 25% 50%);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}


.workeduc-content h2{
    font-size: 1.4rem;
    margin: .3rem 0;
}
.workeduc-content p{
    font-size: clamp(0.75rem, 1.2vw, 1.05rem);
    text-align: justify;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}
.workeduc-content .year i {
    margin-right: .4rem;
    font-size: 1.2rem;
}
.number-page{
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
    z-index: 20;
}
/* page 2 img  */
.page2-video{
    width: 100%;
    max-width: 400px;         
    height: auto;       
    aspect-ratio: 16 / 9;
    overflow: hidden;    
    border-radius: 12px; 
    border: 2px solid #ccc;
    display: block;
    margin: 0 auto;
}

.page2-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;   
  object-position: center; 
}


/* Global Edge Navigation Buttons styling */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: var(--border);
    border-radius: 50%;
    font-size: 2.2rem;
    color: var(--main-color);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 200; /* Ensure nav buttons sit securely above 3D planes */
}
.nav-btn:hover {
    background: var(--main-color);
    color: var(--white-color);
    box-shadow: 0 6px 20px rgba(194, 89, 63, 0.45);
    transform: translateY(-50%) scale(1.15);
}
.nav-btn.prev-btn {
    left: -5rem; /* Sit perfectly outside the left edge of the flipbook */
}
.nav-btn.next-btn {
    right: -5rem; /* Sit perfectly outside the right edge of the flipbook */
}




/* ---- FIXED VIDEO GRID (9:16 RATIO) ---- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Column */
    grid-template-rows: repeat(2, 1fr);    /* 2 Row - Isse 4 boxes perfectly set honge */
    gap: 0.5rem;
    height: auto;
    margin-top: 1rem;
}

.video-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
}

.video-aspect-ratio-box {
    height: 17.5rem; /* Video ko box ke andar fixed lamba rakha */
    aspect-ratio: 9 / 16; /* Exact Reel/Shorts ratio */
    position: relative;
    border: var(--border);
    border-radius: 0.4rem;
    overflow: hidden;
    background-color: #000;
    box-shadow: var(--box-shadow);
}

/* Video tag ki internal styling */
.video-aspect-ratio-box video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Video ratio me properly bharega */
}

/* Custom Floating Fullscreen Overlay Button for 9:16 vertical videos */
.video-fullscreen-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: rgba(23, 17, 14, 0.75); /* Dark chocolate translucent matching desk theme */
    border: 1px solid rgba(194, 89, 63, 0.35);
    color: #fffdfa;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.15rem;
    z-index: 20;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.video-fullscreen-btn:hover {
    background: var(--main-color);
    color: var(--white-color);
    box-shadow: 0 6px 14px rgba(194, 89, 63, 0.45);
    transform: scale(1.12);
}

.video-fullscreen-btn i {
    pointer-events: none; /* Icon clicks bubble cleanly to the button */
}

/* Premium Fullscreen Theater Mode styling (for all videos) */
video:fullscreen {
    object-fit: scale-down !important; /* Prevents video from stretching beyond its original crisp resolution */
    background-color: #000000 !important; /* Pure cinematic black background */
    box-shadow: none !important;
}

/* Safari / iOS / Webkit engine fullscreen fallbacks */
video:-webkit-full-screen {
    object-fit: scale-down !important;
    background-color: #000000 !important;
}

.video-item h3 {
    font-size: 1rem;
    margin-top: 0.5rem;
    color: var(--text-color);
    text-align: center;
}

/* ---- MOBILE VIEW ADJUSTMENT ---- */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 1rem;
        height: auto; /* Mobile par height free chhodenge taaki scroll ho sake */
    }
    
    .video-aspect-ratio-box {
        height: auto; 
        width: 100%; /* Mobile par full width lega apne hisse ki */
        aspect-ratio: 9 / 16;
    }
}

/* skills box */
.skills-box{
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}
.skills-box .skills-content{
    flex: 1 1 20rem;
}
.skills-content h2{
    font-size: 1.3rem;
    line-height: 1.25;
    margin-bottom: .6rem;
    overflow: hidden;
}
.skills-content .content{
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
}
.skills-content .content span{
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 6.5rem;
    height: 5.5rem;
    border: var(--border);
    border-radius: .3rem;
    font-weight: 600;
    transition: .3s ease;
}
.skills-content .content span:hover{
    box-shadow: var(--box-shadow);
}
.skills-content .content span i{
    color: var(--main-color);
    font-size: 2.2rem;
    margin-bottom: 0.2rem;
}

/* portfolio */
.portfolio-box{
    margin-top: 2rem;
}
.portfolio-box .img-box{
    display: flex;
    width: 100%;
    height: 15rem;
    border-radius: .5rem;
    border: var(--border);
    overflow: hidden;
}
.portfolio-box .img-box img{
    width: 100%;
    object-fit: cover;
    transition: .5s ease;
}
.portfolio-box .img-box:hover img{
    transform: scale(1.1);
}
.portfolio-box .info-box{
    margin: 1rem 0 1.5rem;
}
.portfolio-box .info-box .info-title{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.portfolio-box .info-box .info-title h2{
    font-size: 1.3rem;
}
.portfolio-box .info-box .info-title a{
    display: flex;
    align-items: center;
    color: var(--main-color);
}
.portfolio-box .info-box .info-title a i{
    margin-left: .3rem;
}
.portfolio-box .info-box p:nth-of-type(1){
    font-weight: 600;
}
.portfolio-box .info-box p{
    text-align: justify;
    word-break: break-word;
    overflow-wrap: break-word;
}
.portfolio-box .btn-box{
    display: flex;
    justify-content: center;
}
.portfolio-box .btn-box .btn{
    margin: 0 0.5rem;
}

/* Contact Me! */
.contact-box{
    margin-top: 2rem;
    text-align: center;
}
.contact-box .field{
    width: 100%;
    background-color: transparent;
    border: var(--border);
    border-radius: .3rem;
    padding: .8rem;
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-family: inherit;
}
.contact-box .field::placeholder{
    color: var(--text-color);
}
.contact-box textarea{
    resize: none;
    height: 15rem;
    max-width: 100%;
}
.contact-box .btn{
    cursor: pointer;
    font-family: inherit;
}
.contact-box .btn:hover{
    background-color: transparent;
    color: var(--main-color);
}

.back-profile{
    position: absolute;
    bottom: 1.2rem;
    right: 2rem;
    width: 2rem;
    height: 2rem;
    background-color: transparent;
    border: var(--border);
    border-radius: .3rem;
    font-size: 1.1rem;
    color: var(--main-color);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: .5s;
}
.back-profile:hover{
    background: var(--main-color);
    color: var(--white-color);
}
.back-profile p{
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scale(.5);
    font-size: 1rem;
    opacity: 0;
    transition: .5s;
    color: var(--main-color);
}
.back-profile:hover p{
    opacity: 1;
    transform: translateX(-50%) scale(1);
    top: -1.8rem;
}

.mobile-nav-btn {
    display: none;
}

/* ==========================================================
   ADVANCED MOBILE & TABLET RESPONSIVENESS (max-width: 1024px)
   Dynamic CSS scale engine: keeps the full double-page 3D book
   intact, legs visible, and animations pristine on all viewports.
   ========================================================== */
@media (max-width: 1024px) {
    body {
        overflow: hidden;
        position: relative;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .wrapper {
        position: absolute;
        top: 50%;
        left: 50%;
        /* Scale dynamically to perfectly fit whichever viewport dimension is smaller and center absolutely */
        transform: translate(-50%, -50%) scale(min(calc(92vw / 1152), calc(92vh / 768)));
        transform-origin: center;
        margin: 0;
        padding: 0;
        perspective: 250rem;
        box-sizing: border-box;
    }

    .cover {
        display: block !important;
    }

    .book-page.page-left,
    .book-page.page-right {
        display: flex !important;
    }

    /* Edge button adjustments inside scaled mobile screens */
    .nav-btn {
        width: 3.2rem;
        height: 3.2rem;
        font-size: 2rem;
        z-index: 250;
    }
    .nav-btn.prev-btn {
        left: 0.5rem;
        background: rgba(255, 255, 255, 0.98);
    }
    .nav-btn.next-btn {
        right: 0.5rem;
        background: rgba(255, 255, 255, 0.98);
    }
}

/* ==========================================================
   PREMIUM 3D MOBILE BOOKLET & TEXTURE STYLING (max-width: 768px)
   ========================================================== */
@media (max-width: 768px) {
    body {
        overflow: hidden;
        /* Rich warm ambient dark mahogany desk vignette */
        background: radial-gradient(circle at 50% 50%, #201714 0%, #0f0b09 100%) !important;
    }

    .wrapper {
        position: absolute;
        top: 0;
        left: 0;
        transform: none !important;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-width: 100%;
        max-height: 100%;
        padding: 1rem 0.8rem calc(4.5rem + 1rem); /* Space for bottom navigation */
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
    }

    .cover {
        display: none !important; /* Hide outer desktop covers */
    }

    .book {
        width: 92%;
        max-width: 395px; /* Perfect handheld booklet width */
        height: 80vh;
        height: 80dvh;
        max-height: 640px;
        min-height: 480px;
        perspective: 150rem;
        position: relative;
        margin: 0 auto;
        border-radius: 8px 16px 16px 8px;
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
    }

    /* Visual Moleskine Spine on left edge */
    .book::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 16px;
        height: 100%;
        background: linear-gradient(to right, 
            rgba(194, 89, 63, 0.35) 0%, 
            rgba(15, 22, 28, 0.75) 25%, 
            rgba(194, 89, 63, 0.2) 50%, 
            rgba(15, 22, 28, 0.85) 75%, 
            rgba(255, 255, 255, 0.08) 100%);
        border-right: 1px solid rgba(194, 89, 63, 0.12);
        box-shadow: 1px 0 6px rgba(0,0,0,0.3);
        z-index: 100;
        border-top-left-radius: 8px;
        border-bottom-left-radius: 8px;
    }

    /* Layered Stacked Page Edges to simulate real paper depth */
    .book::after {
        content: '';
        position: absolute;
        top: 5px;
        right: -6px;
        width: 6px;
        height: calc(100% - 10px);
        background: repeating-linear-gradient(to bottom,
            #fff 0px, #fff 2px,
            #d3d8dc 2px, #d3d8dc 4px);
        border-radius: 0 4px 4px 0;
        box-shadow: 1px 1px 6px rgba(0,0,0,0.25);
        z-index: 5;
    }

    /* Reset page containers to stack as single-column booklet pages */
    .book .book-page {
        width: 100% !important;
        height: 100% !important;
        left: 0 !important;
        right: 0 !important;
        position: absolute !important;
        background: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        transform: none !important;
        overflow: visible !important;
        display: block !important;
    }

    /* Stylize booklet sheets (Profile, Front, Back) */
    .book-page.page-left,
    .book-page .page-front,
    .book-page .page-back {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: #fdfdfd !important; /* Premium paper color */
        border-radius: 8px 16px 16px 8px !important;
        box-shadow: inset 14px 0 25px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.18) !important;
        transform-origin: left center !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
        transform-style: preserve-3d !important;
        border: 1px solid rgba(0,0,0,0.05) !important;
    }

    .book-page.page-left {
        padding: 1.2rem 1rem 3.2rem 1.8rem !important; /* Smaller margins for mobile scroll view! */
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .book-page .page-front,
    .book-page .page-back {
        padding: 0 !important;
        overflow: hidden !important;
    }

    /* Mobile scrollbar and padding behavior inside page-content wrapper */
    .page-content {
        padding: 1.2rem 1rem 3.2rem 1.8rem !important; /* Slightly smaller padding for text room! */
        overflow-y: auto !important; /* Enable scrolling on mobile! */
        overflow-x: hidden !important;
        height: 100% !important;
        display: block !important;
        -webkit-overflow-scrolling: touch !important;
        --page-bg: #fdfdfd;
    }

    /* Force back pages flat facing the reader */
    .book-page .page-back {
        transform: rotateY(0deg) translateZ(0px) !important;
    }

    /* Custom 3D Transitions */
    .mobile-sheet-active {
        transform: rotateY(0deg) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        z-index: 1000 !important; /* Force active page to stack on top */
        transition: transform 0.85s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease !important;
    }

    .turned-mobile {
        transform: rotateY(-180deg) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: transform 0.85s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.7s ease !important;
    }

    .mobile-sheet-next {
        transform: rotateY(0deg) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: none !important;
    }

    /* Hide future/inactive pages fully to prevent z-index blocking clicks and scrolls */
    .book-page.page-left:not(.mobile-sheet-active):not(.turned-mobile):not(.mobile-sheet-next),
    .book-page.page-right:not(.mobile-sheet-active):not(.turned-mobile):not(.mobile-sheet-next),
    .book-page .page-front:not(.mobile-sheet-active):not(.turned-mobile):not(.mobile-sheet-next),
    .book-page .page-back:not(.mobile-sheet-active):not(.turned-mobile):not(.mobile-sheet-next) {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Custom scrollbars inside sheets */
    .book-page.page-left::-webkit-scrollbar,
    .page-content::-webkit-scrollbar {
        width: 3px;
    }
    .book-page.page-left::-webkit-scrollbar-thumb,
    .page-content::-webkit-scrollbar-thumb {
        background: rgba(194, 89, 63, 0.25);
        border-radius: 4px;
    }

    /* ----------------------------------------------------
       CONTENT CARD GRIDS AND SCALING
       ---------------------------------------------------- */
    .profile-page {
        padding: 0.2rem 0;
    }
    .photo-stack {
        width: 140px !important;
        height: 180px !important;
        margin-bottom: 1.4rem !important;
        margin-top: 0.2rem !important;
    }
    .photo-stack img {
        width: 100px !important;
        height: 135px !important;
        object-fit: cover;
    }
    .tape {
        width: 70px !important;
        height: 22px !important;
        top: -8px !important;
    }
    .profile-page h1 {
        font-size: 1.95rem !important;
        margin-top: 0.2rem;
    }
    .profile-page h2 {
        font-size: 1.05rem !important;
        margin-bottom: 0.2rem;
    }
    .profile-page .social-media {
        margin: 0.3rem 0 !important;
    }
    .profile-page .social-media a {
        width: 2rem !important;
        height: 2rem !important;
        font-size: 1.05rem !important;
        margin: 0 0.2rem !important;
    }
    .profile-page p {
        font-size: 0.88rem !important;
        line-height: 1.4 !important;
        color: var(--second-text-color);
        text-align: justify;
    }

    .title {
        font-size: 1.45rem !important;
        margin-bottom: 0.6rem !important;
        color: #111;
        border-bottom: 2px dashed rgba(194, 89, 63, 0.15);
        padding-bottom: 0.3rem;
    }

    .workeduc-box {
        margin-top: 0.6rem;
    }
    .workeduc-content h2 {
        font-size: 1.08rem !important;
        font-weight: 700;
        margin: 0.15rem 0;
    }
    .workeduc-content p {
        font-size: 0.85rem !important;
        line-height: 1.35 !important;
    }
    .workeduc-content .year {
        font-size: 0.78rem !important;
        color: var(--main-color);
    }
    
    /* Services: Stack neatly in a beautiful mobile grid */
    .services-box {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.6rem !important;
        margin-top: 0.6rem !important;
    }
    .services-box .services-content {
        padding: 0.5rem 0.3rem !important;
        border-radius: 6px !important;
        background: rgba(194, 89, 63, 0.02) !important;
        border: 1px solid rgba(194, 89, 63, 0.1) !important;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 140px;
    }
    .services-content i {
        font-size: 1.6rem !important;
        margin-bottom: 0.1rem;
    }
    .services-content h2 {
        font-size: 0.88rem !important;
        margin: 0.1rem 0 !important;
        font-weight: 700;
        line-height: 1.2;
    }
    .services-content p {
        font-size: 0.72rem !important;
        line-height: 1.25 !important;
        margin-bottom: 0.3rem !important;
        color: var(--second-text-color);
    }
    .services-content .btn {
        width: 100% !important;
        height: 1.6rem !important;
        font-size: 0.72rem !important;
        border-radius: 4px !important;
        margin: 0 !important;
    }

    /* Skills: Highly optimized visual grid */
    .skills-box {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.6rem !important;
        margin-top: 0.6rem !important;
    }
    .skills-content h2 {
        font-size: 1.05rem !important;
        margin-bottom: 0.2rem !important;
    }
    .skills-content .content {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important; /* 3 Columns are more readable on narrow screens! */
        gap: 0.4rem !important;
    }
    .skills-content .content span {
        width: 100% !important;
        height: 3.6rem !important;
        font-size: 0.7rem !important;
        padding: 0.15rem !important;
        border-radius: 4px !important;
        background: #fff;
        border: 1px solid rgba(194, 89, 63, 0.1) !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .skills-content .content span i {
        font-size: 1.35rem !important;
        margin-bottom: 0.1rem !important;
    }

    /* Portfolio */
    .portfolio-box {
        margin-top: 0.4rem !important;
    }
    .portfolio-box .img-box {
        height: 8rem !important;
    }
    .portfolio-box .info-box {
        margin: 0.5rem 0 0.6rem !important;
    }
    .portfolio-box .info-box .info-title h2 {
        font-size: 1.05rem !important;
    }
    .portfolio-box .info-box p {
        font-size: 0.78rem !important;
        line-height: 1.35 !important;
    }
    .portfolio-box .btn-box .btn {
        width: 6rem !important;
        height: 2rem !important;
        font-size: 0.78rem !important;
    }

    /* Contact box */
    .contact-box {
        margin-top: 0.5rem !important;
    }
    .contact-box .field {
        padding: 0.4rem !important;
        font-size: 0.82rem !important;
        margin-bottom: 0.6rem !important;
    }
    .contact-box textarea {
        height: 6rem !important;
    }
    .contact-box .btn {
        width: 8rem !important;
        height: 2.2rem !important;
        font-size: 0.82rem !important;
    }

    .back-profile {
        bottom: 0.6rem !important;
        right: 0.6rem !important;
        width: 1.6rem !important;
        height: 1.6rem !important;
        font-size: 0.88rem !important;
        border-radius: 4px !important;
    }
    .back-profile p {
        display: none !important;
    }

    .number-page {
        bottom: 0.4rem !important;
        font-size: 0.78rem !important;
    }

    /* ----------------------------------------------------
       RESPONSIVE VIDEO GRID & POLAROID FRAMES
       ---------------------------------------------------- */
    /* Stacking grids vertically on mobile for large, gorgeous rendering! */
    .video-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
        margin-top: 0.8rem !important;
    }
    .video-aspect-ratio-box {
        height: 18rem !important; /* Large beautiful streaming video container! */
    }
    
    .polaroid-stack-mini {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.2rem !important;
        margin: 1rem 0 !important;
    }
    .polaroid-stack-mini .scrapbook-frame {
        width: 90% !important;
        max-width: 160px !important;
    }

    /* Stacking E-Cell (Page 24) and Captured Chaos (Page 22) photo grids vertically on mobile */
    .frames-grid-three {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    .frames-grid-three div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
        align-items: center !important;
    }
    .frames-grid-three .scrapbook-frame {
        width: 90% !important;
        max-width: 220px !important;
        margin: 0 auto !important;
    }

    /* Generic selector to stack all side-by-side flex layouts vertically on mobile */
    .page-content div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.2rem !important;
    }
    .page-content div[style*="display: flex"] .scrapbook-frame {
        width: 90% !important;
        max-width: 180px !important;
        margin: 0.4rem auto !important;
    }
    .page-content .scrapbook-frame {
        margin: 0.5rem auto !important;
    }

    .scrapbook-frame {
        max-width: 200px !important;
        padding: 0.5rem 0.5rem 1.8rem !important;
    }
    .scrapbook-frame .caption,
    .polaroid-stack-mini .scrapbook-frame .caption,
    .scrapbook-frame.large-frame .caption,
    .scrapbook-frame.video-frame-vertical .caption,
    .page-college-journey .scrapbook-frame.large-frame .caption,
    .page-beyond-group .scrapbook-frame.trio-frame .caption,
    .page-beyond-group .scrapbook-frame.small-photo-frame .caption,
    .page-vintage-memories .scrapbook-frame.large-frame .caption,
    .page-cricket-gang-2 .scrapbook-frame.trio-frame .caption,
    .page-first-year-frames-1 .caption,
    .page-first-year-frames-2 .caption,
    .page-wrap-up .scrapbook-frame.large-frame .caption,
    .page-contact-social .scrapbook-frame.social-profile-frame .caption,
    .page-society-life .caption,
    .page-ece2-friends .caption,
    .page-hindi-grammar .caption {
        font-size: 0.85rem !important;
        bottom: 0.15rem !important;
    }

    /* ----------------------------------------------------
       GLASSMORPHIC CONTROL PANEL & SWIPE HINTS
       ---------------------------------------------------- */
    .nav-btn {
        position: fixed !important;
        top: auto !important;
        bottom: 1.2rem !important;
        transform: none !important;
        width: 3.2rem !important;
        height: 3.2rem !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        border: 1.5px solid rgba(194, 89, 63, 0.3) !important;
        color: var(--main-color) !important;
        box-shadow: 0 8px 32px rgba(194, 89, 63, 0.15) !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 1000 !important;
        transition: all 0.3s ease !important;
    }
    .nav-btn:active {
        transform: scale(0.9) !important;
        background: var(--main-color) !important;
        color: #fff !important;
    }
    .nav-btn.prev-btn {
        left: 2rem !important;
    }
    .nav-btn.next-btn {
        right: 2rem !important;
    }

    .wrapper::after {
        content: 'Swipe left/right or tap buttons to turn pages';
        position: fixed;
        bottom: 4.8rem;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.7rem;
        color: rgba(255, 255, 255, 0.45);
        font-weight: 300;
        letter-spacing: 0.5px;
        z-index: 999;
        text-transform: uppercase;
        pointer-events: none;
        width: 90%;
        text-align: center;
    }
}
/* ---- PREMIUM SCRAPBOOK POLAROID FRAMES ---- */
.scrapbook-frame {
    position: relative;
    background: #fff;
    padding: 0.8rem 0.8rem 2.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 90%;
    max-width: 270px;
    margin: 1.5rem auto;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    cursor: pointer;
    z-index: 2;
}
.scrapbook-frame:hover {
    transform: scale(1.05) rotate(-1deg) translateY(-5px) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
    z-index: 15;
}
.scrapbook-frame.tilt-left {
    transform: rotate(-3deg);
}
.scrapbook-frame.tilt-right {
    transform: rotate(3deg);
}
.scrapbook-frame.tilt-left:hover,
.scrapbook-frame.tilt-right:hover {
    transform: scale(1.06) rotate(0deg) translateY(-5px);
}

.scrapbook-frame .tape-mini {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    width: 80px;
    height: 24px;
    background-color: rgba(244, 240, 180, 0.75) !important;
    background: repeating-linear-gradient(45deg,
        rgba(238, 232, 170, 0.7) 0px,
        rgba(238, 232, 170, 0.7) 10px,
        rgba(244, 238, 178, 0.75) 10px,
        rgba(244, 238, 178, 0.75) 20px
    );
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 5;
    backdrop-filter: blur(1px);
}

.scrapbook-frame .placeholder-content {
    background: #f8fafc;
    border: 1px dashed rgba(194, 89, 63, 0.35);
    border-radius: 6px;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--second-text-color);
    padding: 0.8rem;
    text-align: center;
    transition: background-color 0.3s ease;
}
.scrapbook-frame:hover .placeholder-content {
    background-color: rgba(194, 89, 63, 0.02);
}
.scrapbook-frame .placeholder-content i {
    font-size: 2.4rem;
    color: var(--main-color);
    margin-bottom: 0.4rem;
    transition: transform 0.3s ease;
}
.scrapbook-frame:hover .placeholder-content i {
    transform: scale(1.15) rotate(5deg);
}
.scrapbook-frame .placeholder-content p {
    font-size: 0.82rem !important;
    line-height: 1.25 !important;
    font-weight: 500;
    color: #4b5563;
}

.scrapbook-frame .caption {
    position: absolute;
    bottom: 0.4rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Caveat", cursive;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--main-color);
    width: 90%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

/* Stacking two mini polaroids on a single page */
.polaroid-stack-mini {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin: 1.2rem 0;
    width: 100%;
}
.polaroid-stack-mini .scrapbook-frame {
    max-width: 180px;
    padding: 0.6rem 0.6rem 1.8rem;
    margin: 0;
}
.polaroid-stack-mini .scrapbook-frame .placeholder-content {
    height: 110px;
}
.polaroid-stack-mini .scrapbook-frame .placeholder-content i {
    font-size: 1.8rem;
}
.polaroid-stack-mini .scrapbook-frame .caption {
    font-size: 1.05rem;
    bottom: 0.3rem;
}

/* Large frame for horizontal campus videos and latest project screenshot */
.scrapbook-frame.large-frame {
    max-width: 400px;
    padding: 0.8rem 0.8rem 2.8rem;
    margin: 1rem auto;
}
.scrapbook-frame.large-frame .caption {
    font-size: 1.5rem;
    bottom: 0.5rem;
}

/* Vertical video frame for grid layouts */
.scrapbook-frame.video-frame-vertical {
    padding: 0.5rem 0.5rem 1.4rem;
    margin: 0 auto;
    max-width: 170px;
}
.scrapbook-frame.video-frame-vertical .video-aspect-ratio-box {
    height: 13.8rem;
    width: 100%;
}
.scrapbook-frame.video-frame-vertical .caption {
    font-size: 1.05rem;
    bottom: 0.3rem;
}

/* ---- IMMERSIVE 3D MAHOGANY DESK ENVIRONMENT ---- */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Rich Mahogany Wood planks & ambient warm lamp lighting */
    background: 
        /* 1. Warm amber light cone from vintage lamp (top-left) */
        radial-gradient(circle at 12% 12%, rgba(253, 186, 116, 0.16) 0%, rgba(253, 186, 116, 0.05) 35%, rgba(20, 16, 14, 0) 70%),
        /* 2. Soft glow in bottom right corner */
        radial-gradient(circle at 88% 88%, rgba(194, 89, 63, 0.05) 0%, rgba(20, 16, 14, 0) 45%),
        /* 3. Deep vertical mahogany panel dividing grooves */
        linear-gradient(90deg, 
            rgba(0, 0, 0, 0.45) 0px, rgba(255, 255, 255, 0.015) 2px, transparent 4px,
            transparent 196px, rgba(0, 0, 0, 0.45) 200px
        ),
        /* 4. Fine vertical wood grains */
        repeating-linear-gradient(90deg, 
            rgba(0, 0, 0, 0.01) 0px, rgba(0, 0, 0, 0.01) 2px, 
            transparent 2px, transparent 8px
        ),
        /* 5. Horizontal organic wood fibers and panel growths */
        repeating-linear-gradient(0deg, 
            rgba(255, 255, 255, 0.005) 0px, rgba(255, 255, 255, 0.005) 1px, 
            transparent 1px, transparent 4px
        ),
        /* 6. Base mahogany red-brown wood tint */
        #18110e !important;
    background-size: 100% 100%, 100% 100%, 200px 100%, 14px 100%, 100% 6px;
    position: relative;
    overflow: hidden;
}

/* Desk Items Wrapper */
.desk-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass to the book and arrows */
    z-index: 1;
    overflow: hidden;
}

/* Base style for scattered polaroid photos */
.desk-item {
    position: absolute;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(4px 8px 12px rgba(0, 0, 0, 0.4));
}

/* Highly detailed scattered polaroid styles */
.desk-decorations .desk-polaroid {
    background: #fffefb; /* Aged polaroid card paper */
    padding: 0.6rem 0.6rem 2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    border: 1px solid rgba(0,0,0,0.06);
    width: 140px;
    height: 180px;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto; /* Allow interactive hover */
    cursor: pointer;
}

.desk-decorations .desk-polaroid .tape-mini {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    width: 65px;
    height: 18px;
    background-color: rgba(238, 232, 170, 0.5) !important;
    background: repeating-linear-gradient(45deg,
        rgba(238, 232, 170, 0.4) 0px,
        rgba(238, 232, 170, 0.4) 8px,
        rgba(244, 238, 178, 0.5) 8px,
        rgba(244, 238, 178, 0.5) 16px
    );
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 5;
    backdrop-filter: blur(1px);
}

.desk-decorations .desk-polaroid .photo-img {
    width: 100%;
    height: 110px;
    background: #e7e2d6; /* Soft empty sepia polaroid frame */
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: var(--main-color);
    transition: background-color 0.3s ease;
}
.desk-decorations .desk-polaroid:hover .photo-img {
    background-color: rgba(194, 89, 63, 0.05);
}

.desk-decorations .desk-polaroid .photo-img i {
    font-size: 2.6rem;
    opacity: 0.75;
    transition: transform 0.4s ease;
}
.desk-decorations .desk-polaroid:hover .photo-img i {
    transform: scale(1.2) rotate(8deg);
}

.desk-decorations .desk-polaroid .caption {
    font-family: "Caveat", cursive;
    font-size: 1.18rem;
    font-weight: 700;
    color: #4a3e3d;
    margin-top: 0.6rem;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

/* Polaroid Hover & Elevation Effects */
.desk-decorations .desk-polaroid:hover {
    transform: scale(1.1) rotate(0deg) translateY(-8px) !important;
    box-shadow: 0 18px 36px rgba(0,0,0,0.55);
    z-index: 50;
}

/* Scattered Placements around the double-page book */
.pos-top-left {
    top: 5rem;
    left: 4.5rem;
    transform: rotate(-12deg);
}
.pos-bottom-left {
    bottom: 5.5rem;
    left: 5rem;
    transform: rotate(8deg);
}
.pos-top-right {
    top: 5rem;
    right: 4.5rem;
    transform: rotate(10deg);
}
.pos-bottom-right {
    bottom: 5.5rem;
    right: 5rem;
    transform: rotate(-8deg);
}

/* Responsive visibility rules: Hide decorations on smaller viewports */
@media (max-width: 1200px) {
    .desk-decorations {
        display: none !important;
    }
}

/* Specific overrides for Page 1 ("The Accidental Engineer") to fit all three sections without scroll or overlap */
.page-accidental-engineer {
    padding: 1.6rem 2rem 2.4rem !important; /* Spacious layout padding */
}

.page-accidental-engineer .title {
    font-size: 1.95rem !important; /* Elegant header title size */
    margin-bottom: 0.4rem !important;
}

.page-accidental-engineer .workeduc-box {
    margin-top: 0.3rem !important;
}

.page-accidental-engineer .workeduc-box::after {
    height: 11.8rem !important; /* Stops exactly at the third dot! */
}

.page-accidental-engineer .workeduc-box .workeduc-content {
    padding-left: 1.35rem !important;
    padding-bottom: 0.65rem !important; /* Perfect breathing room, no wasted space */
}

.page-accidental-engineer .workeduc-box .workeduc-content::before {
    left: -0.55rem !important; /* Reposition dots relative to line */
    width: 1rem !important;
    height: 1rem !important;
}

.page-accidental-engineer .workeduc-content h2 {
    font-size: 1.38rem !important; /* Large, bold H2 section headers */
    margin: 0.25rem 0 !important;
}

.page-accidental-engineer .workeduc-content p {
    font-size: clamp(0.82rem, 1.2vw, 1.02rem) !important; /* Beautiful large standard readable font */
    line-height: 1.35 !important;
    text-align: justify !important;
}

/* Specific overrides for Page 2 ("THE COLLEGE JOURNEY") to fit video and description without scroll or overlap */
.page-college-journey {
    padding: 1.2rem 2rem 2.2rem !important; /* Slightly tighter vertical padding */
}

.page-college-journey .title {
    font-size: 1.85rem !important;
    margin-bottom: 0.3rem !important;
}

.page-college-journey .workeduc-box {
    margin-top: 0.2rem !important;
}

.page-college-journey .workeduc-box::after {
    display: none !important; /* Hide the vertical timeline line for clean description presentation */
}

.page-college-journey .workeduc-content::before {
    display: none !important; /* Hide the timeline dots for clean description presentation */
}

.page-college-journey .workeduc-box .workeduc-content {
    padding-left: 0 !important; /* Remove timeline padding */
    padding-bottom: 0.4rem !important;
}

.page-college-journey .scrapbook-frame.large-frame {
    margin: 0.2rem auto 0.6rem !important;
    padding: 0.5rem 0.5rem 2rem !important;
}

.page-college-journey .scrapbook-frame.large-frame .caption {
    font-size: 1.15rem !important;
    bottom: 0.3rem !important;
}

.page-college-journey p {
    font-size: clamp(0.72rem, 1.1vw, 0.9rem) !important;
    line-height: 1.32 !important;
    text-align: justify !important;
}

/* Specific overrides for Page 19 ("Beyond the Group") to fit Khushi & Vaishnavi with photos on a single page */
.page-beyond-group {
    padding: 1.4rem 2rem 2.2rem !important; /* Elegant spacious padding */
}

.page-beyond-group .title {
    font-size: 1.9rem !important; /* Large beautiful header title */
    margin-bottom: 0.35rem !important;
}

.page-beyond-group .workeduc-box {
    margin-top: 0.3rem !important;
}

.page-beyond-group .workeduc-box::after {
    display: none !important; /* Hide timeline line for clean photo layout */
}

.page-beyond-group .workeduc-content::before {
    display: none !important; /* Hide timeline dots */
}

.page-beyond-group .workeduc-box .workeduc-content {
    padding-left: 0 !important; /* Remove timeline padding */
    padding-bottom: 0.65rem !important; /* More breathing room, no wasted space */
}

.page-beyond-group .scrapbook-frame.trio-frame {
    margin: 0.2rem auto 0.6rem !important;
    padding: 0.5rem 0.5rem 1.8rem !important;
    max-width: 250px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.page-beyond-group .scrapbook-frame.trio-frame .placeholder-content {
    height: 90px !important;
}

.page-beyond-group .scrapbook-frame.trio-frame .caption {
    font-size: 1.15rem !important;
    bottom: 0.3rem !important;
}

.page-beyond-group .scrapbook-frame.small-photo-frame {
    margin: 0 !important;
    max-width: 85px !important;
    padding: 0.3rem 0.3rem 1.1rem !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12) !important;
}

.page-beyond-group .scrapbook-frame.small-photo-frame .placeholder-content {
    height: 52px !important;
    width: 77px !important;
}

.page-beyond-group .scrapbook-frame.small-photo-frame .caption {
    font-size: 0.75rem !important;
    bottom: 0.15rem !important;
}

.page-beyond-group h2 {
    font-size: 1.3rem !important; /* Large, bold H2 headers */
    margin: 0.25rem 0 !important;
    font-weight: 700 !important;
}

.page-beyond-group p {
    font-size: clamp(0.82rem, 1.2vw, 1.02rem) !important; /* Match Page 1 larger font size */
    line-height: 1.35 !important;
    text-align: justify !important;
}

/* Specific overrides for Page 24 ("Vintage Memories") to fit centered layout beautifully */
.page-vintage-memories {
    padding: 1.5rem 2rem !important;
}

.page-vintage-memories .title {
    font-size: 1.85rem !important;
    margin-bottom: 0.5rem !important;
}

.page-vintage-memories .scrapbook-frame.large-frame {
    margin: 0.8rem auto 1.2rem !important;
    padding: 0.6rem 0.6rem 2.2rem !important;
    max-width: 240px !important;
}

.page-vintage-memories .scrapbook-frame.large-frame .placeholder-content {
    height: 120px !important;
}

.page-vintage-memories .scrapbook-frame.large-frame .caption {
    font-size: 1.15rem !important;
    bottom: 0.35rem !important;
}

/* Specific overrides for Page 20 ("The Cricket Gang - Part 1") to look beautifully full and scroll-free */
.page-cricket-gang-1 {
    padding: 1.6rem 2rem 2.4rem !important; /* Spacious layout padding */
}

.page-cricket-gang-1 .title {
    font-size: 1.95rem !important;
    margin-bottom: 0.4rem !important;
}

.page-cricket-gang-1 .workeduc-box {
    margin-top: 0.3rem !important;
}

.page-cricket-gang-1 .workeduc-box::after {
    height: 12.2rem !important; /* Stops exactly at the third dot! */
}

.page-cricket-gang-1 .workeduc-box .workeduc-content {
    padding-left: 1.35rem !important;
    padding-bottom: 0.65rem !important; /* Spacious spacing */
}

.page-cricket-gang-1 .workeduc-box .workeduc-content::before {
    left: -0.55rem !important;
    width: 1rem !important;
    height: 1rem !important;
}

.page-cricket-gang-1 h2 {
    font-size: 1.35rem !important; /* Consistent large bold headers */
    margin: 0.25rem 0 !important;
}

.page-cricket-gang-1 p {
    font-size: clamp(0.82rem, 1.2vw, 1.02rem) !important; /* High-readability standard font-size */
    line-height: 1.35 !important;
    text-align: justify !important;
}

/* Specific overrides for Page 21 ("The Cricket Gang - Part 2") to look beautifully full and scroll-free */
.page-cricket-gang-2 {
    padding: 1.6rem 2rem 2.4rem !important; /* Spacious layout padding */
}

.page-cricket-gang-2 .title {
    font-size: 1.95rem !important;
    margin-bottom: 0.4rem !important;
}

.page-cricket-gang-2 .workeduc-box {
    margin-top: 0.3rem !important;
}

.page-cricket-gang-2 .workeduc-box::after {
    height: 6.8rem !important; /* Stops exactly at the second dot, does not cross video frames! */
}

.page-cricket-gang-2 .workeduc-box .workeduc-content {
    padding-left: 1.35rem !important;
    padding-bottom: 0.65rem !important; /* Spacious spacing */
}

.page-cricket-gang-2 .workeduc-box .workeduc-content::before {
    left: -0.55rem !important;
    width: 1rem !important;
    height: 1rem !important;
}

.page-cricket-gang-2 h2 {
    font-size: 1.35rem !important;
    margin: 0.25rem 0 !important;
}

.page-cricket-gang-2 p {
    font-size: clamp(0.82rem, 1.2vw, 1.02rem) !important;
    line-height: 1.35 !important;
    text-align: justify !important;
}

.page-cricket-gang-2 .scrapbook-frame.trio-frame {
    margin: 0.4rem auto 0.6rem !important;
    padding: 0.5rem 0.5rem 1.8rem !important;
    max-width: 240px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.page-cricket-gang-2 .scrapbook-frame.trio-frame .placeholder-content {
    height: 80px !important;
}

.page-cricket-gang-2 .scrapbook-frame.trio-frame .caption {
    font-size: 1.15rem !important;
    bottom: 0.3rem !important;
}

/* ==========================================
   PAGES 22 & 23: FIRST YEAR FRAMES (PHOTO GRID)
   ========================================== */
.page-first-year-frames-1,
.page-first-year-frames-2,
.page-hindi-grammar {
    padding: 1.6rem 2rem 2.2rem !important;
}

.page-first-year-frames-1 .section-desc,
.page-first-year-frames-2 .section-desc,
.page-hindi-grammar .section-desc {
    font-size: 0.95rem !important;
    font-style: italic !important;
    color: var(--second-text-color) !important;
    margin-bottom: 0.8rem !important;
    text-align: center !important;
    line-height: 1.3 !important;
}

.page-first-year-frames-1 .frames-grid-two,
.page-first-year-frames-2 .frames-grid-two {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 0.4rem !important;
}

.page-first-year-frames-1 .scrapbook-frame,
.page-first-year-frames-2 .scrapbook-frame,
.page-hindi-grammar .scrapbook-frame {
    width: 100% !important;
    max-width: 225px !important;
    padding: 0.5rem 0.5rem 1.6rem !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
}

.page-first-year-frames-1 .placeholder-content,
.page-first-year-frames-2 .placeholder-content {
    height: 95px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

.page-first-year-frames-1 .placeholder-content i,
.page-first-year-frames-2 .placeholder-content i {
    font-size: 2.3rem !important;
    color: var(--main-color) !important;
    margin-bottom: 0.2rem !important;
    opacity: 0.7 !important;
}

.page-first-year-frames-1 .placeholder-content p,
.page-first-year-frames-2 .placeholder-content p {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    margin: 0 !important;
}

.page-first-year-frames-1 .caption,
.page-first-year-frames-2 .caption {
    font-size: 1.05rem !important;
    bottom: 0.25rem !important;
}

/* ==========================================
   PAGES 24 & 25: FIRST YEAR END NOTE (MEMOIR STYLE)
   ========================================== */
.page-end-note-1,
.page-end-note-2,
.page-ece2-friends {
    padding: 2rem 2.2rem 2.4rem !important;
}

.page-end-note-1 .note-box,
.page-end-note-2 .note-box {
    margin-top: 0.6rem !important;
}

.page-end-note-1 p,
.page-end-note-2 p,
.page-ece2-friends p {
    font-size: clamp(0.82rem, 1.2vw, 1.02rem) !important;
    line-height: 1.45 !important;
    text-align: justify !important;
    color: var(--second-text-color) !important;
    margin-bottom: 0.8rem !important;
}

.page-end-note-2 .quote-box,
.page-ece2-friends .quote-box {
    font-family: 'Caveat', cursive !important;
    font-size: 1.68rem !important;
    font-weight: 700 !important;
    color: var(--main-color) !important;
    line-height: 1.35 !important;
    text-align: center !important;
    padding: 0.8rem 1.2rem !important;
    background: rgba(194, 89, 63, 0.05) !important;
    border-left: 4px solid var(--main-color) !important;
    border-radius: 4px !important;
    margin: 0.9rem auto 1rem !important;
    max-width: 95% !important;
    box-shadow: inset 0 0 10px rgba(194, 89, 63, 0.02) !important;
}

/* ==========================================
   PAGE 26: CHAPTER 1 COMPLETE (WRAP-UP CARD)
   ========================================== */
.page-wrap-up {
    padding: 2rem !important;
    text-align: center !important;
}

.page-wrap-up .scrapbook-frame.large-frame {
    max-width: 235px !important;
    margin: 1.2rem auto 1rem !important;
    padding: 0.5rem 0.5rem 1.8rem !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15) !important;
}

.page-wrap-up .scrapbook-frame.large-frame .caption {
    font-size: 1.15rem !important;
    bottom: 0.3rem !important;
}

.page-wrap-up .conclude-quote {
    font-family: 'Caveat', cursive !important;
    font-size: 1.62rem !important;
    font-weight: 700 !important;
    color: var(--main-color) !important;
    line-height: 1.32 !important;
    text-align: center !important;
    margin: 1rem auto 0.6rem !important;
    padding: 0 1rem !important;
}

/* ==========================================
   PAGE 27: LET'S CONNECT! (SOCIAL CONNECT CARDS)
   ========================================== */
.page-contact-social {
    padding: 1.5rem 2rem 2.2rem !important;
    text-align: center !important;
}

.page-contact-social .scrapbook-frame.social-profile-frame {
    max-width: 200px !important;
    margin: 0.4rem auto 0.8rem !important;
    padding: 0.4rem 0.4rem 1.4rem !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

.page-contact-social .scrapbook-frame.social-profile-frame .placeholder-content {
    height: 80px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

.page-contact-social .scrapbook-frame.social-profile-frame .caption {
    font-size: 0.95rem !important;
    bottom: 0.2rem !important;
}

.page-contact-social .social-cards-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    margin-top: 0.8rem !important;
    width: 100% !important;
    align-items: center !important;
}

.page-contact-social .social-card {
    display: flex !important;
    align-items: center !important;
    gap: 0.8rem !important;
    background: #fdfbf7 !important;
    border: 1px solid rgba(194, 89, 63, 0.15) !important;
    border-radius: 8px !important;
    padding: 0.6rem 1rem !important;
    width: 90% !important;
    max-width: 320px !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03) !important;
}

.page-contact-social .social-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(194, 89, 63, 0.12) !important;
    background: rgba(194, 89, 63, 0.02) !important;
    border-color: var(--main-color) !important;
}

.page-contact-social .social-card i {
    font-size: 1.8rem !important;
    color: var(--main-color) !important;
}

.page-contact-social .social-card .card-info {
    flex-grow: 1 !important;
}

.page-contact-social .social-card .card-info h3 {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #1f2937 !important;
    text-align: left !important;
}

.page-contact-social .social-card .card-info p {
    font-size: 0.8rem !important;
    margin: 0 !important;
    color: var(--second-text-color) !important;
    font-weight: 500 !important;
    text-align: left !important;
}

/* ==========================================
   PAGE 26: E-CELL SOCIETY LAYOUT
   ========================================== */
.page-ecell {
    padding: 1.8rem 2.2rem 2.4rem !important;
}

.page-ecell .note-box p {
    font-size: clamp(0.82rem, 1.2vw, 1.02rem) !important;
    line-height: 1.42 !important;
    text-align: justify !important;
    color: var(--second-text-color) !important;
    margin-bottom: 0.8rem !important;
}

.page-ecell .scrapbook-frame .placeholder-content p {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    margin: 0 !important;
}

/* ==========================================
   PAGE 27: CAMPUS COLORS (SOCIETY LIFE GALLERY)
   ========================================== */
.page-society-life {
    padding: 1.6rem 2rem 2.2rem !important;
}

.page-society-life .section-desc {
    font-size: 0.95rem !important;
    font-style: italic !important;
    color: var(--second-text-color) !important;
    margin-bottom: 0.8rem !important;
    text-align: center !important;
    line-height: 1.3 !important;
}

.page-society-life .frames-grid-two {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 0.4rem !important;
}

.page-society-life .scrapbook-frame {
    width: 100% !important;
    max-width: 225px !important;
    padding: 0.5rem 0.5rem 1.6rem !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
}

.page-society-life .placeholder-content {
    height: 95px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

.page-society-life .placeholder-content i {
    font-size: 2.3rem !important;
    color: var(--main-color) !important;
    margin-bottom: 0.2rem !important;
    opacity: 0.7 !important;
}

.page-society-life .placeholder-content p {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    margin: 0 !important;
}

.page-society-life .caption {
    font-size: 1.05rem !important;
    bottom: 0.25rem !important;
}

/* Premium Image Fullview Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 3px solid #fff;
    object-fit: contain !important; /* Strictly show original quality without stretching */
    background: #000;
}
.lightbox-caption {
    font-family: 'Caveat', cursive;
    font-size: 2.2rem;
    color: #fff;
    margin-top: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-align: center;
}
.close-lightbox {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: #fff;
    font-size: 3.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.close-lightbox:hover {
    color: var(--main-color);
}

/* Fullscreen Zoom Button inside Image Frame */
.image-fullscreen-btn {
    position: absolute;
    bottom: 0.4rem;
    right: 0.4rem;
    background: rgba(0, 0, 0, 0.65);
    border: none;
    border-radius: 4px;
    color: #fff;
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}
.image-fullscreen-btn:hover {
    background: var(--main-color);
    transform: scale(1.1);
}
.image-fullscreen-btn i {
    font-size: 1.1rem;
}

/* Ensure images inside scrapbook frames fit without awkward cropping */
.scrapbook-frame img {
    object-fit: contain !important;
    background-color: #eae6db !important; /* Seamless borders aesthetic matching warm paper */
    border-radius: 2px;
}

/* Explicit stretch and cover style for designated scrap frames */
.scrapbook-frame img.cover-fit {
    object-fit: cover !important;
}

/* Tactile Touch Active Animations */
.image-fullscreen-btn:active,
.video-fullscreen-btn:active {
    transform: scale(0.9) !important;
    background: var(--main-color) !important;
}

/* Ultra-Short Viewport Handling (Anti-Vertical Clipping) */
@media (max-width: 768px) and (max-height: 620px) {
    .book {
        height: 75vh !important;
        height: 75dvh !important;
        min-height: 420px !important;
    }
    .wrapper {
        padding: 0.5rem 0.5rem calc(3.5rem + 0.5rem) !important;
    }
    .nav-btn {
        bottom: 0.6rem !important;
        width: 2.6rem !important;
        height: 2.6rem !important;
    }
    .wrapper::after {
        bottom: 3.6rem !important;
        font-size: 0.65rem !important;
    }
}






