.profile-scroll-wrapper {
    height: 300vh;
    position: relative;
}

/* Sticky Flip Section */
.sticky-section {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(to right, #f5f7fa, #c3cfe2);
    display: flex;
    perspective: 1200px;
    z-index: 10;
}

.flip-block {
    flex: 1;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.5s ease;
}

.face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    overflow-y: auto;
}

.left-face-front {
    /* background-image: url('../Images/banner/banner1.png');
    background-size: cover;
    background-position-y: 100px;
    background-position-x: -20px;
    background-repeat: no-repeat; */
    background-color: #F4C700;
    transform: rotateX(0deg);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
}

.left-face-front img#avatar {
    width: 400px;
    height: 400px;
    object-fit: cover;
    object-position: center;
    position: absolute;
    bottom: 0;
    left: 55%;
    transform: translateX(-50%);
    z-index: 2;
}

.left-face-front img#banner {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom;
    position: absolute;
    bottom: 0;
    left: 75%;
    transform: translateX(-76%);
    z-index: 1;
}

.left-face-back {
    background-image: url('../Images/banner/profile-content-banner.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: rotateX(-180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.right-face-front {
    background-image: url('../Images/banner/profile-content-banner.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: rotateX(0deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.right-face-back {
    background-color: #F4C700;
    transform: rotateX(180deg);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
}

.right-face-back img#avatar {
    width: 350px;
    height: 400px;
    object-fit: cover;
    object-position: center;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.right-face-back img#banner {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom;
    position: absolute;
    bottom: 0;
    left: 75%;
    transform: translateX(-76%);
    z-index: 1;
}

.left-block.flipped {
    transform: rotateX(180deg);
}

.right-block.flipped {
    transform: rotateX(-180deg);
}

/* Scroll buffer for testing */
.scroll-buffer {
    height: 250vh;
    background: #f8f9fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #555;
}

/* Hidden trigger element at the end of main container */
.hidden-trigger {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: transparent;
    pointer-events: none;
}

.profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: 100%;
    padding: 2rem;
    text-align: center;
    overflow: hidden;
}

.profile-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
}

.profile-connect {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.profile-connect img {
    height: 24px;
    width: 24px;
    transition: transform 0.2s ease;
}

.profile-connect img:hover {
    transform: scale(1.1);
}

.profile-title {
    font-family: 'OpenSauceOne', Arial, sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
    margin-bottom: 0.8rem;
    text-align: center;
    color: black;
    letter-spacing: -0.02em;
}

.profile-designation {
    font-family: 'OpenSauceOne', Arial, sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2.5vw, 1.8rem);
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
}

.profile-description {
    font-family: 'OpenSauceOne', Arial, sans-serif;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    text-align: justify;
    max-width: 85%;
    margin: 0 auto;
    text-justify: inter-word;
    hyphens: auto;
    word-spacing: 0.1em;
    text-indent: 0;
}

/* Desktop and larger screens */
@media (min-width: 1200px) {
    .face {
        padding: 3rem;
    }

    .profile-content {
        padding: 3rem 2.5rem;
    }

    .profile-heading {
        margin-bottom: 2.5rem;
    }

    .profile-title {
        font-size: 3.2rem;
        margin-bottom: 1rem;
    }

    .profile-designation {
        font-size: 1.6rem;
        margin-bottom: 0.8rem;
    }

    .profile-description {
        font-size: 1.2rem;
        line-height: 1.6;
        /* max-width: 80%; */
    }

    .profile-connect {
        gap: 25px;
    }

    .profile-connect img {
        height: 28px;
        width: 28px;
    }

    .left-face-front img#avatar {
        width: 60%;
        height: 60%;
    }

    .right-face-back img#avatar {
        width: 50%;
        height: 60%;
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1199px) {
    .face {
        padding: 2.5rem;
    }

    .profile-content {
        padding: 2rem 1.5rem;
    }

    .profile-heading {
        margin-bottom: 2rem;
    }

    .profile-description {
        max-width: 85%;
        font-size: 1.1rem;
        line-height: 1.5;
    }

    .left-face-front img#avatar {
        width: 350px;
        height: 350px;
    }

    .right-face-back img#avatar {
        width: 300px;
        height: 350px;
    }
}

/* Tablet portrait and mobile landscape */
@media (max-width: 768px) {
    .sticky-section {
        flex-direction: column-reverse;
        height: auto;
        min-height: 100vh;
        position: relative;
        perspective: none;
    }

    .flip-block {
        height: 50vh;
        min-height: 400px;
        transform-style: flat;
        transition: none;
    }

    .face {
        position: relative;
        backface-visibility: visible;
        padding: 1.5rem;
        height: 100%;
    }

    /* Show both profiles on mobile */
    .left-face-front,
    .right-face-back {
        display: none;
    }

    .left-face-back,
    .right-face-front {
        transform: none;
        position: relative;
    }

    .profile-content {
        padding: 1.5rem 1rem;
    }

    .profile-heading {
        margin-bottom: 1.5rem;
    }

    .profile-description {
        font-size: 0.95rem;
        max-width: 95%;
        text-align: left;
        line-height: 1.4;
    }

    .profile-connect {
        gap: 12px;
    }

    .profile-connect img {
        height: 22px;
        width: 22px;
    }

    /* Disable flip animations on mobile */
    .left-block.flipped,
    .right-block.flipped {
        transform: none;
    }

    /* Adjust scroll wrapper height for mobile */
    .profile-scroll-wrapper {
        height: auto;
        min-height: 100vh;
    }

    /* Fixed positioning for mobile images (if any are shown) */
    .left-face-front img#avatar,
    .right-face-back img#avatar {
        width: 200px;
        height: 250px;
        position: relative;
        transform: none;
        left: auto;
        bottom: auto;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .face {
        padding: 1rem;
    }

    .flip-block {
        min-height: 350px;
    }

    .profile-content {
        padding: 1rem 0.8rem;
    }

    .profile-heading {
        margin-bottom: 1.2rem;
    }

    .profile-title {
        font-size: 1.6rem;
    }

    .profile-designation {
        font-size: 1rem;
    }

    .profile-description {
        font-size: 0.85rem;
        line-height: 1.3;
        text-align: left;
        max-width: 100%;
    }

    .profile-connect img {
        height: 20px;
        width: 20px;
    }
}

/* Extra small mobile devices */
@media (max-width: 320px) {
    .face {
        padding: 0.8rem;
    }

    .profile-content {
        padding: 0.8rem 0.5rem;
    }

    .profile-title {
        font-size: 1.4rem;
    }

    .profile-designation {
        font-size: 0.9rem;
    }

    .profile-description {
        font-size: 0.8rem;
        line-height: 1.2;
    }
}