body, html {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: #ffffff;
}

.main-page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
}

.welcome-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 3vmin;
    padding-right: calc(35% + 5vmin);
    background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
    box-shadow: inset 1px 0 0 #e5e5ea;
    order: -1;
    position: relative;
    overflow: hidden;
}

.bubbles-section {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 1vW;
    padding: 3vW;
    background: #1a1a1a;
    overflow: hidden;
}

.welcome-section h1 {
    font-size: 7vmin;
    font-weight: 700;
    margin: 6vmin 0 0.8vmin 5vmin;
    color: #000000;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 2;
}

.welcome-section p {
    font-size: 3vmin;
    color: #86868b;
    margin: 0 0 3vmin 5vmin;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

.header-top {
    width: 100%;
}

.cv-panel {
    width: 20vw;
    height: 20/sqert(2)vw;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

.cv-jpeg {
    height: 100%;
    width: 100%;
    border: 0.1vmin solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5vmin;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    background: white;
    box-sizing: border-box;
    object-fit: cover; 
}

.cv-button {
    width: 100%;
    margin: 1.25vmin 0 0 0;
    display: inline-flex;
    justify-content: center;
    background: #007AFF;
    color: white;
    text-decoration: none;
    border-radius: 0.75vmin;
    font-weight: 500;
    font-size: 2.5vmin;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 122, 255, 0.2);
    position: relative;
    z-index: 2;
}

.bubble {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 1vmin;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 5vmin;
    color: white;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
    overflow: hidden;
}

.bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: all 0.4s ease;
    z-index: -1;
    opacity: 0;
}

.bubble:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0;
}

.bubble:hover::after {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

#bubble-about::before { 
    background-image: url('Images/About-me.jpeg');
    background-size: cover;
    background-position: center;
}
#bubble-education::before { 
    background-image: url('Images/Education-experience.jpeg');
    background-size: cover;
    background-position: center;
}
#bubble-skills::before { 
    background-image: url('Images/Technical-skills.jpeg');
    background-size: cover;
    background-position: center;
}
#bubble-goals::before { 
    background-image: url('Images/Career-interests.jpeg');
    background-size: cover;
    background-position: center;
}
#bubble-contact::before { 
    background-image: url('Images/Contact-informations.jpg');
    background-size: cover;
    background-position: center;
}
#bubble-passions::before { 
    background-image: url('Images/My-passions.jpg');
    background-size: cover;
    background-position: center;
}


.bubble:hover::before {
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

.bubble::after {
    content: attr(data-label);
    margin-top: 2vmin;
    font-size: 30%;
    text-align: center;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.3s ease-in 0.2s;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 1000;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.personalized-section {
    background: white;
    padding: 3vmin;
    border-radius: 1.25vmin;
    max-width: min(500px, 80vw);
    max-height: 85vh;
    overflow-y: auto;
    text-align: left;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.personalized-section h2 {
    font-size:5vmin;
    font-weight: 700;
    margin: 0 0 1vmin 0;
    color: #000000;
}

.personalized-section p {
    font-size: 2.5vmin;
    color: #555555;
    line-height: 1.6;
    margin: 0.75vmin 0;
}

.personalized-section ul {
    font-size: 2.25vmin;
    color: #555555;
    line-height: 1.8;
    margin: 0.75vmin 0;
    padding-left: 1.25vmin;
}

.overlay.active .personalized-section {
    transform: scale(1) translateY(0);
}


.cv-button:hover {
    background: #0051D5;
    box-shadow: 0 8px 12px rgba(0, 122, 255, 0.3);
    transform: translateY(-2px);
}

.close-btn {
    position: absolute;
    top: 1.25vmin;
    right: 1.25vmin;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 1.75vmin;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.6);
    width: 2.75vmin;
    height: 2.75vmin;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.8);
}

.image-cascade {
    position: absolute;
    right: 4.5vmin;
    top: 0;
    width: 50%;
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 0;
    scroll-behavior: auto !important;
}
.image-cascade:hover {
    overflow-y: auto;
}

.image-cascade::-webkit-scrollbar {
    display: none;
}

.image-list {
    display: flex;
    flex-direction: column;
    gap: 3vmin;
}


.image-container {
    position: relative;
}

.image-cascade img {
    width: 90%;
    margin: 0 auto;
    display: block;
    height: auto;
    border-radius: 1.5vmin;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, filter 0.5s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.image-cascade img:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
    z-index: 100;
}

.image-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    margin-bottom: 2vmin;
    padding: 1vmin;
    border-radius: 0.8vmin;
    font-size: 1.5vmin;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.image-container:hover .image-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-0.5vmin);
    z-index: 200;
}

/* Mobile Responsive Styles */
@media only screen and (max-aspect-ratio: 0.6) {
    .main-page {
        flex-direction: column;
    }

    .welcome-section {
        flex:3;
    }

    .welcome-section p {
        margin: 0vmin 0 3vmin 5vmin;
        font-size: 3.5vmin;
        display: inline-block;
        vertical-align: baseline;
    }

    .cv-panel {
        width: 65vw;
        margin-left: 25%;
        height: auto;
    }
    
    .cv-jpeg {
        max-height: 15vh;
        object-fit: cover;
        object-position: top;
    }

    .image-cascade {
        width: 45%;
        right: 2vmin;
    }

    .bubble {
        font-size: 5vmin;
    }

    .cv-button {
        font-size: 3.5vmin;
    }

    .personalized-section {
        margin: 4vmin;
        padding: 5vmin;
    }

    .personalized-section p {
        font-size:  2.5vmin;
    }

    .personalized-section h2 {
        font-size: 5vmin;
    }

    .close-btn {
        width: 6vmin;
        height: 6vmin;
        font-size: 4vmin;
    }

    /* Horizontal image cascade for mobile */
    .image-cascade {
        position:relative;
        margin-left:2vw;
        margin-top: 1.5vh;
        margin-bottom: 2vh;
        width: 93vw;
        height: 100%;
        right: auto;
        overflow-x: auto;
        overflow-y: hidden !important;
        touch-action: pan-x;
    }
    
    .image-cascade:hover {
        overflow-y: hidden !important;
    }
    .image-container {
        position: center;
        margin-top:1.5vh;
        height: 23vh;
    }

    .image-list {
        margin-top: 3%;
        flex-direction: row;
        gap: 6vw;
    }

    .image-cascade img {
        height: 80%;
        width: auto;
        object-position: center;
    }
    .image-tooltip {        
        bottom: auto;
        top: 90%;
        left: 50%;
        transform: translateX(-50%) translateY(0.5vmin);
    }
    .bubbles-section {
        padding-bottom: 10vh;
    }
    .bubble::after {
        font-size: 60%;
    }
    #bubble-about::before { 
    background-image: url('Images/About-me.jpeg');
    background-size: cover;
    background-position: center;
    }
    #bubble-education::before { 
        background-image: url('Images/Education-experience.jpeg');
        background-size: cover;
        background-position: center;
    }
    #bubble-skills::before { 
        background-image: url('Images/Technical-skills.jpeg');
        background-size: cover;
        background-position: center;
    }
    #bubble-goals::before { 
        background-image: url('Images/Career-interests.jpeg');
        background-size: cover;
        background-position: center;
    }
    #bubble-contact::before { 
        background-image: url('Images/Contact-informations.jpg');
        background-size: cover;
        background-position: center;
    }
    #bubble-passions::before { 
        background-image: url('Images/My-passions.jpg');
        background-size: cover;
        background-position: center;
    }
}
