/* --- GLOBAL & SETUP --- */
:root {
    /* --primary-blue-dark: #3364a8; */
    --primary-blue-dark: #2663a6;
    --primary-blue-light: #aac1dc;
    --accent-blue: #42a5f5;
    --text-light: #ffffff;
    --text-dark: #333333;
    --background-body: #ababab;
    --background-content: #ffffff;
    --background-block: #f8f9fa;
    --border-color: #e0e0e0;
    --header-height: 150px;
    --header-scrolled-height: 45px;
    --sticky-nav-width: 60px;
    --color-formation-1: #6d6d6d;
    --color-formation-2: #427bf6;
    --color-formation-3: #285de2;
    --color-formation-4: #1c43a4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-scrolled-height) + 64px);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-body);
    background-image: url('../images/page_bg.webp');
    background-position: top left;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.6;
    /* padding-top: var(--header-height); */
}

/* Page plus large que haute (paysage) - affichage sur toute la largeur */
@media (orientation: landscape) {
    body {
        background-size: 100% auto;
    }
}

/* Page plus haute que large (portrait) - affichage sur toute la hauteur */
@media (orientation: portrait) {
    body {
        background-size: auto 100%;
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 0;
}

/* --- HEADER --- */
.main-header {
    background-color: transparent;
    color: var(--text-dark);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    transition: all 0.4s ease-in-out;
    width: 100%;
}

.contact-info {
    display: grid;
    grid-template-columns: 0.9fr 1fr 1.2fr;
    gap: 1rem;
    width: 100%;
    min-height: 140px;
    max-height: 140px;
    overflow: visible;
}

.empty-column {
    display: flex;
    align-items: center;
}

.scrolled-name {
    display: flex;
    flex-direction: column;
    line-height: 1;
    opacity: 0;
    padding: 50px 0 0 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
}



.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 10px 2rem 0;
    position: relative;
    height: var(--header-height);
    transition: all 0.4s ease-in-out;
    background-color: var(--background-block);
}

.header-bg-container {
    position: absolute;
    bottom: -65px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    max-width: 800px;
    height: 65px;
    max-height: 65px;
    background-image: url('../images/bg.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% auto;
    z-index: 0;
    transition: all 0.4s ease-in-out;
    pointer-events: none;
}

@media (max-width: 768px) {
    .header-bg-container {
        bottom: calc(-65px + (150px - clamp(100px, 20vw, 150px)));
    }
}

@media (max-width: 480px) {
    .header-bg-container {
        bottom: calc(-65px + (150px - clamp(60px, 15vw, 80px)));
    }
}


.main-header.scrolled .header-bg-container {
    height: 65px;
    max-height: 65px;
    bottom: -65px;
    width: 800px;
    max-width: 800px;
    background-size: 100% auto;
}

.header-content>* {
    position: relative;
    z-index: 2;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid var(--accent-blue);
    background-color: #ccc;
    flex-shrink: 0;
    transition: width 0.4s ease-in-out, height 0.4s ease-in-out;
    background-size: cover;
    background-position: center;
}

.profile-image {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 1001;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 8px solid var(--primary-blue-dark);
    /* background-color: var(--primary-blue-light); */
    /* padding: 4px; */
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.profile-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.contact-info {
    display: grid;
    grid-template-columns: 0.9fr 1fr 1.2fr;
    gap: 1rem;
    width: 100%;
    min-height: 140px;
    max-height: 140px;
    overflow: visible;
}

.name {
    text-align: left;
    line-height: 1;
}

.first-name,
.scrolled-first-name {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--primary-blue-dark);
}

.last-name,
.scrolled-last-name {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-blue-dark);
}

.title {
    font-size: 2rem;
    font-weight: 0;
    color: var(--text-dark);
    text-align: right;
    align-self: center;
    transition: all 0.4s ease-in-out;
}

.contacts {
    list-style: none;
    padding: 0;
}

.contacts li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    /* Prevent line breaks within contact items */
}

.contacts i {
    width: 20px;
    text-align: center;
    color: var(--primary-blue-light);
}

.social-links {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    font-size: 1.8rem;
}

.social-links a {
    color: var(--text-dark);
    margin-right: 1rem;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--primary-blue-light);
}

/* --- NAVIGATION --- */
.main-nav {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.4s ease-in-out;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    padding: 0;
}

.main-nav a {
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
}

.main-nav a:hover {
    color: var(--primary-blue-dark);
    background-color: rgba(0, 0, 0, 0.05);
}

/* --- HEADER SCROLLED STATE --- */
.main-header.scrolled {
    height: var(--header-scrolled-height);
    background-image: none;
    filter: none;
}

.main-header.scrolled .empty-column .scrolled-name {
    opacity: 1;
    visibility: visible;
}

.main-header.scrolled .name {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.main-header.scrolled .title {
    font-size: 1.2rem;
}

.main-header.scrolled .profile-image {
    opacity: 0;
    transform: translateY(-100px);
    pointer-events: none;
}

.main-header.scrolled .header-content {
    padding: 0 2rem;
    height: var(--header-scrolled-height);
}

.main-header.scrolled .profile-picture {
    width: 50px;
    height: 50px;
}

.main-header.scrolled .contact-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.main-header.scrolled .contact-info h2 {
    font-size: 1rem;
    margin: 0;
}

.main-header.scrolled .contacts,
.main-header.scrolled .social-links,
.main-header.scrolled .main-nav {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- MAIN LAYOUT --- */
.main-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    width: 100%;
}

/* --- SECTIONS & CONTENT --- */
.content-column {
    background-color: var(--background-content);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    width: 100%;
}

.about-paragraph {
    text-align: center;
    font-size: 1.1rem;
    margin: 214px 0 3rem 0;
    /* Top margin accounts for fixed header height */
}

section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    color: var(--primary-blue-dark);
}

.skills-grid-container {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: flex-start;
    gap: 2rem;
}

.product-skills-column {
    margin-left: -2rem;
}

.skill-pills {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
}

.skill-pills li {
    background-color: var(--primary-blue-dark);
    color: var(--text-light);
    padding: 0.5rem 1.2rem 0.5rem 2rem;
    font-size: 0.9rem;
    border-radius: 0 16px 16px 0;
    transition: transform 0.3s ease;
}

.skill-pills li:hover {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Classe réutilisable pour l'effet de reflet */
.shiny,
.skill-box,
.skill-pills li,
.company-badge,
.position-content,
.formation-text,
.projet-content,
.projet-tech {
    position: relative;
    overflow: hidden;
}

.shiny:hover::before,
.skill-box:hover::before,
.skill-pills li:hover::before,
.company-badge:hover::before,
.position-content:hover::before,
.formation-text:hover::before,
.projet-content:hover::before,
.projet-tech:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shine 0.6s ease-in-out;
    z-index: 1;
}

.languages {
    margin-top: 2rem;
    padding-left: 2rem;
}

.languages span {
    display: block;
    margin-bottom: 0.75rem;
}

.languages i {
    margin-right: 0.5rem;
    color: var(--primary-blue-light);
}

.secondary-skills-column {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
}

.skill-box {
    background-color: var(--background-block);
    padding: 1.5rem;
    flex-shrink: 0;
    clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
    background-image: radial-gradient(circle at 500% 500%, var(--background-body), transparent);
    transition: transform 0.3s ease;
}

.skill-box:hover {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.skill-box h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-blue-dark);
}

.soft-skills-list {
    list-style: none;
    padding: 0;
}

.tech-skills-list {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0.0rem;
    align-items: center;
}

.tech-skills-list dt {
    font-weight: 700;
}

/* --- EXPERIENCE SECTION --- */
.experience-section {
    margin-top: 3rem;
}

.experience-container {
    display: block;
}

.experience-timeline {
    position: relative;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 160px;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--primary-blue-light);
    z-index: 10;
}

.skills-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--background-block);
    color: var(--text-dark);
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    text-align: left;
    font-weight: 500;
    margin-right: 2rem;
    position: relative;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
}

.skills-list::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid var(--background-block);
    border-top: 22px solid transparent;
    border-bottom: 22px solid transparent;
}

@media (max-width: 768px) {
    .position-item .skills-list {
        position: relative;
        /* Reset positioning */
        margin-bottom: 1rem;
        margin-right: 0;
        /* Override desktop margin */
        display: flex;
        flex-direction: row;
        /* Ensure horizontal layout for li items */
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        /* Center skills */
        padding-left: 1.5rem;
        /* Increased padding */
        padding-right: 1.5rem;
        /* Increased padding */
        /* box-sizing: border-box; is global, so padding is included correctly */
        order: 2;
        /* Display after position-content */
    }
}

/* Company Item (Entreprise) */
.company-item {
    margin-bottom: 0.5rem;
    position: relative;
}


.company-logo {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: calc(140px - 2rem);
}


.logo-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--background-block);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 6px solid var(--primary-blue-light);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
    position: relative;
    z-index: 20;
}

.logo-letter {
    color: white;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
}

.logo-image {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 50%;
}

.company-badge {
    background-color: var(--primary-blue-dark);
    color: white;
    padding: 0.5rem 3rem;
    border-radius: 0 25px 25px 0;
    font-weight: 600;
    margin-left: -30px;
    z-index: 1;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
    transition: transform 0.3s ease;
}

.company-badge:hover {
    transform: translateX(20px);
    transition: transform 0.3s ease;
}

/* Position Item (Poste) */
.position-item {
    margin-bottom: 2.5rem;
    position: relative;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 2rem;
    align-items: center;
    transition: transform 0.3s ease;
}

.position-item:hover {
    /* transform: translateY(-5px); */
    /* transform: translateX(-5px); */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.50));
    transform: scale(1.02);
    transition: transform 0.3s ease;
    z-index: 10;
}

.position-item:hover .position-header::before {
    visibility: hidden;
}

.position-item:hover .skills-list {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

.position-content {
    background-color: var(--background-block);
    padding: 0.5rem 2rem 0.5rem 4rem;
    border-radius: 15px 0 0 15px;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); */
    margin-right: -2rem;
    margin-left: -2rem;
    /* Décalage à droite pour s'aligner avec la nouvelle position de la ligne */
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
    position: relative;
    z-index: 5;
    background-image: radial-gradient(circle at 500% 500%, var(--background-body), transparent);
}

.position-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 20;
    /* Au-dessus de la ligne verticale (z-index: 10) */
}

.position-header::before {
    content: '';
    position: absolute;
    left: calc(-3rem - 3px);
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: var(--primary-blue-light);
    border-radius: 50%;
    border: 3px solid var(--background-content);
    z-index: 25;
    /* Au-dessus du position-header (z-index: 20) */
}

.position-header h3 {
    font-size: 1.4rem;
    color: var(--primary-blue-dark);
    margin-bottom: 0;
    font-weight: 600;
}

.position-header .period {
    font-size: 1rem;
    color: #888;
    font-style: italic;
    font-weight: 400;
    white-space: nowrap;
    /* Empêche le retour à la ligne de la date */
}

.position-details {
    list-style: none;
    padding: 0;
    margin: 0;
}

.position-details li {
    /* margin-bottom: 0.75rem; */
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.4;
}

.position-details .emoji {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* --- FORMATION SECTION --- */
.formation-section {
    margin-top: 3rem;
}

.formation-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0;
    width: 100%;
}

.formation-image {
    width: 100%;
    height: auto;
    max-width: 100%;
}


.formation-text-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 1rem;
}

.formation-text {
    background-color: var(--background-block);
    padding: 0.2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-blue-dark);
    background-image: radial-gradient(circle at 500% 500%, var(--background-body), transparent);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
}

.formation-text:hover {
    transform: translateY(-10px);
}


.formation-text h3 {
    color: var(--primary-blue-dark);
    font-size: 1rem;
    /* margin-bottom: 0.5rem; */
    /* font-weight: 500; */
}

.formation-text p {
    color: var(--text-dark);
    font-size: 0.875rem;
    margin: 0;
    /* line-height: 1.4; */
}

/* Proportions : 3/9em, 2/9em, 3/9em, 1/9em */
.formation-text-large {
    flex: 3;
    min-height: 3em;
}

.formation-text-medium {
    flex: 2;
    min-height: 2em;
}

.formation-text-small {
    flex: 1;
    min-height: 1em;
}

/* Couleurs spécifiques pour chaque formation */
.formation-text:nth-child(1) {
    border-left-color: var(--color-formation-1);
}

.formation-text:nth-child(1) h3 {
    color: var(--color-formation-1);
}

.formation-text:nth-child(2) {
    border-left-color: var(--color-formation-2);
}

.formation-text:nth-child(2) h3 {
    color: var(--color-formation-2);
}

.formation-text:nth-child(3) {
    border-left-color: var(--color-formation-3);
}

.formation-text:nth-child(3) h3 {
    color: var(--color-formation-3);
}

.formation-text:nth-child(4) {
    border-left-color: var(--color-formation-4);
}

.formation-text:nth-child(4) h3 {
    color: var(--color-formation-4);
}

.formation-container {
    display: block;
}

.formation-timeline {
    position: relative;
    padding-left: 2rem;
}

.formation-item {
    margin-bottom: 2.5rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.formation-logo {
    position: relative;
    display: flex;
    align-items: center;
}

.formation-content {
    background-color: var(--background-block);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
    flex: 1;
}

/* --- PROJETS SECTION --- */
.projets-section {
    margin-top: 3rem;
}

.projets-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.projet-content {
    background-color: var(--background-block);
    padding: 1.5rem 1rem 1.5rem 2rem;
    border-radius: 0 15px 0 0;
    margin-left: -2rem;
    margin-right: 0rem;
    /* margin-bottom: 2rem; */
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
    position: relative;
    z-index: 5;
    background-image: radial-gradient(circle at 500% 500%, var(--background-body), transparent);
    /* width: 100%; */
    transition: transform 0.3s ease;
}

.projet-content:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.50));
    transition: transform 0.3s ease;
}

.projet-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.projet-header h3 {
    font-size: 1.2rem;
    color: var(--primary-blue-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.projet-tech-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.projet-body {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.projet-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 6px solid var(--primary-blue-dark);
    background-color: var(--background-block);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
    transition: transform 0.3s ease;
}

.projet-icon img {
    width: 130%;
    height: 130%;
    object-fit: contain;
    border-radius: 50%;
}

.projet-description {
    flex: 1;
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
    text-indent: 2rem;
}

.projet-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.projet-url a {
    font-size: 0.9rem;
    color: var(--primary-blue-dark);
}

.projet-tech {
    background-color: var(--primary-blue-dark);
    color: var(--text-light);
    padding: 0.25rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 12px;
    transition: transform 0.3s ease;
    display: inline-block;
    /* font-weight: 500; */
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
}

.projet-tech:hover {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.card {
    background-image: radial-gradient(circle at 500% 50%, var(--primary-blue-dark), transparent);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        /* Add some padding for smaller screens */
    }

    /* Header identique à desktop mais redimensionné proportionnellement */
    .main-header {
        position: fixed;
        height: clamp(100px, 20vw, 150px);
        background-color: transparent;
        transition: all 0.4s ease-in-out;
    }

    /* Photo de profil - même position relative, juste plus petite */
    .profile-image {
        position: absolute;
        top: clamp(15px, 4vw, 30px);
        left: clamp(15px, 4vw, 30px);
        width: clamp(80px, 20vw, 200px);
        height: clamp(80px, 20vw, 200px);
        border-width: clamp(3px, 1vw, 8px);
    }

    /* Contenu du header - même structure, juste plus petit */
    .header-content {
        display: flex;
        align-items: center;
        gap: clamp(1rem, 2.5vw, 2rem);
        max-width: 800px;
        width: calc(100% - 2rem);
        margin: 0 auto;
        padding: clamp(5px, 1.5vw, 10px) 1rem 0;
        position: relative;
        height: clamp(100px, 20vw, 150px);
        transition: all 0.4s ease-in-out;
        background-color: var(--background-block);
    }

    /* Même structure de grille pour les infos contact */
    .contact-info {
        display: grid;
        grid-template-columns: 0.9fr 1fr 1.2fr;
        gap: clamp(0.5rem, 1.5vw, 1rem);
        width: 100%;
        min-height: clamp(80px, 18vw, 140px);
        max-height: clamp(80px, 18vw, 140px);
        overflow: visible;
        align-items: start;
        padding-top: clamp(10px, 2vw, 20px);
    }

    .empty-column {
        display: flex;
        align-items: center;
    }

    .scrolled-name {
        display: flex;
        flex-direction: column;
        line-height: 1;
        opacity: 0;
        padding: clamp(30px, 4vw, 30px) 0 0 0;
        visibility: hidden;
        transition: all 0.4s ease-in-out;
    }

    .name {
        text-align: left;
        line-height: 1;
    }

    /* Texte redimensionné proportionnellement */
    .first-name,
    .scrolled-first-name {
        font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    }

    .last-name,
    .scrolled-last-name {
        font-size: clamp(1.8rem, 5vw, 2.8rem);
    }

    .title {
        font-size: clamp(1.2rem, 3.5vw, 2rem);
        font-weight: 0;
        color: var(--text-dark);
        text-align: right;
        align-self: center;
        transition: all 0.4s ease-in-out;
    }

    /* Contacts - même style, juste plus petit */
    .contacts {
        list-style: none;
        padding: 0;
    }

    .contacts li {
        display: flex;
        align-items: center;
        gap: clamp(0.5rem, 1vw, 0.75rem);
        margin-bottom: clamp(0.3rem, 0.8vw, 0.5rem);
        white-space: nowrap;
    }

    .contacts i {
        width: clamp(15px, 2.5vw, 20px);
        text-align: center;
        color: var(--primary-blue-light);
        font-size: clamp(0.8rem, 2vw, 1rem);
    }

    /* Mobile header states */
    .main-header.mobile-collapsed .profile-image {
        width: clamp(50px, 12vw, 60px);
        height: clamp(50px, 12vw, 60px);
        border-width: clamp(3px, 0.8vw, 4px);
    }

    .main-header.mobile-collapsed .first-name,
    .main-header.mobile-collapsed .scrolled-first-name {
        font-size: clamp(1rem, 3vw, 1.2rem);
    }

    .main-header.mobile-collapsed .last-name,
    .main-header.mobile-collapsed .scrolled-last-name {
        font-size: clamp(1.4rem, 4.5vw, 1.8rem);
    }

    .main-header.mobile-collapsed .title {
        font-size: clamp(0.8rem, 2.5vw, 1rem);
    }

    .main-header.mobile-collapsed .contacts {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
    }

    .main-header.mobile-collapsed .header-content {
        padding: clamp(0.3rem, 1vw, 0.5rem);
    }

    .header-bg-container {
        position: absolute;
        bottom: -65px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 2rem);
        max-width: 800px;
        height: 65px;
        max-height: 65px;
        background-image: url('../images/bg.png');
        background-repeat: no-repeat;
        background-position: center top;
        background-size: 100% auto;
        z-index: 0;
        transition: all 0.4s ease-in-out;
        pointer-events: none;
        opacity: 1;
    }

    .main-header.scrolled {
        height: clamp(35px, 8vw, 45px);
        background-image: none;
        filter: none;
    }

    .main-header.scrolled .header-bg-container {
        height: 65px;
        max-height: 65px;
        bottom: -65px;
        width: calc(100% - 2rem);
        max-width: 800px;
        background-size: 100% auto;
        opacity: 1;
    }


    .main-header.scrolled .header-content {
        padding: 0 1rem;
        height: clamp(35px, 8vw, 45px);
    }

    .main-header.scrolled .empty-column .scrolled-name {
        opacity: 1;
        visibility: visible;
        transition: all 0.4s ease-in-out;
    }

    .main-header.scrolled .name {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.4s ease-in-out;
    }

    .main-header.scrolled .contact-info {
        align-items: center;
        padding-top: 0;
    }

    .main-header.scrolled .title {
        font-size: clamp(0.8rem, 2.5vw, 1.2rem);
        transition: all 0.4s ease-in-out;
    }

    .main-header.scrolled .profile-image {
        opacity: 0;
        transform: translateY(-50px);
        pointer-events: none;
        transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    }

    .main-header.scrolled .contacts,
    .main-header.scrolled .social-links,
    .main-header.scrolled .main-nav {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .sticky-nav {
        position: relative;
        /* Make nav flow in document */
        width: 100%;
        height: auto;
        flex-direction: row;
        /* Arrange items horizontally */
        flex-wrap: wrap;
        /* Allow wrapping */
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem 0;
        background-color: var(--primary-blue-dark);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .sticky-nav .nav-item {
        flex-direction: column;
        padding: 0.5rem;
        width: auto;
        /* Adjust width */
        min-width: 80px;
        /* Minimum width for tap targets */
    }

    .sticky-nav .nav-text {
        font-size: 0.7rem;
        margin-top: 0.25rem;
    }

    .sticky-nav .nav-icon {
        font-size: 1rem;
    }

    .main-layout {
        grid-template-columns: 1fr;
        /* Stack layout on mobile */
    }

    .content-column {
        padding: 1rem;
        border-radius: 8px;
    }

    .about-paragraph {
        font-size: 1rem;
        margin: clamp(140px, 28vw, 214px) 0 2rem 0;
        /* Top margin accounts for fixed header height on mobile */
    }

    section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .skills-grid-container {
        grid-template-columns: 1fr;
        /* Stack skills columns */
        gap: 1.5rem;
    }

    .product-skills-column {
        margin-left: 0;
        /* Remove negative margin */
        align-items: center;
        /* Center skill pills */
    }


    .skill-pills li {
        border-radius: 8px;
        /* Adjust border radius for full width */
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .skill-pills li:hover {
        transform: scale(1.05);
        /* Slightly reduce hover effect */
    }

    .secondary-skills-column {
        flex-direction: column;
        /* Stack skill boxes */
        align-items: stretch;
        /* Stretch skill boxes */
        gap: 1rem;
    }

    .skill-box {
        clip-path: none;
        /* Remove complex clip-path */
        border-radius: 8px;
        /* Add border radius */
    }

    .skill-box:hover {
        transform: scale(1.03);
    }

    .tech-skills-list {
        grid-template-columns: 70px 1fr;
        /* Adjust for smaller labels */
    }

    .experience-timeline {
        grid-template-columns: 1fr;
        /* Stack company and position items */
    }

    .experience-timeline::before,
    .experience-timeline::after {
        display: none;
        /* Hide pseudo-elements used for timeline visuals */
    }

    .company-logo {
        /* display: none; Hide company logo on small screens */
        margin-left: 0 !important;
        /* Remove left margin on small screens */
    }

    .company-item {
        margin-bottom: 1rem;
        /* Add space between stacked items */
        justify-content: center;
        /* Center logo */
    }

    .company-logo {
        margin-bottom: 0.5rem;
    }

    .position-item {
        padding-left: 0;
        /* Remove padding for skills list */
        display: flex;
        /* Use flex for better control */
        flex-direction: column;
        /* Stack skills list and content */
    }

    .position-item .skills-list {
        position: relative;
        /* Reset positioning */
        margin-bottom: 1rem;
        margin-right: 0;
        /* Override desktop margin */
        display: flex;
        flex-direction: row;
        /* Ensure horizontal layout for li items */
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        /* Center skills */
        padding-left: 1.5rem;
        /* Increased padding */
        padding-right: 1.5rem;
        /* Increased padding */
        /* box-sizing: border-box; is global, so padding is included correctly */
        order: 2;
        /* Display after position-content */
    }

    .skills-list::after {
        right: auto;
        /* Reset horizontal positioning */
        left: 50%;
        /* Center horizontally */
        top: -13px;
        /* Position above the element */
        transform: translateX(-50%);
        /* Adjust horizontal centering */
        border-left: 15px solid transparent;
        /* Transparent side */
        border-right: 15px solid transparent;
        /* Transparent side */
        border-bottom: 15px solid var(--background-block);
        /* Base of the triangle, pointing up */
        border-top: none;
        /* No top border */
    }

    .position-content {
        border-left: none;
        /* Remove left border */
        padding-left: 1.5rem;
        /* Added left padding for margin */
        padding-right: 1.5rem;
        /* Added right padding for alignment */
        margin-left: 0;
        /* Override desktop negative margin */
        /* margin-right: 0; */
        /* Override desktop negative margin */
        width: 100%;
        /* Ensure it takes full width of its container */
        order: 1;
        /* Display before skills-list */
    }

    .position-header h3 {
        font-size: 1.1rem;
    }

    .position-header .period {
        font-size: 0.8rem;
        display: block;
        /* Make period appear on new line */
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .formation-container {
        flex-direction: column;
        align-items: center;
    }

    .formation-image-container {
        /* max-width: 150px; */
        /* Smaller image */
        margin-bottom: 1.5rem;
    }

    .formation-text-container {
        flex-direction: column;
        align-items: stretch;
        /* Stretch text boxes */
        gap: 1rem;
        width: 100%;
    }

    .formation-text {
        padding: 1rem;
        text-align: center;
    }

    .formation-text h3 {
        font-size: 1.1rem;
    }

    .projets-container {
        grid-template-columns: 1fr;
        /* Stack projects */
        gap: 1.5rem;
    }

    .projet-content {
        margin-left: -1rem;
        /* Adjusted margin for small screens */
        margin-right: 0;
        /* Ensure no right margin interferes */
        padding-left: 1.5rem;
        /* Adjust padding if needed due to negative margin */
        padding-right: 1rem;
        border-radius: 0 8px 8px 0;
        /* Optional: adjust border-radius for new layout */
    }

    .projet-body {
        flex-direction: column;
        /* Stack icon and description */
        align-items: center;
        text-align: center;
    }

    .projet-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .projet-icon img {
        width: 60px;
        /* Smaller project icons */
        height: 60px;
    }

    .projet-description {
        font-size: 0.9rem;
    }

    .projet-footer .projet-url a {
        font-size: 0.8rem;
        word-break: break-all;
        /* Allow long URLs to break */
    }

    .main-header.scrolled .profile-image,
    .skill-pills li,
    .skill-pills li:hover,
    .skill-box,
    .skill-box:hover,
    .company-badge,
    .company-badge:hover,
    .position-item,
    .position-item:hover,
    .position-item .skills-list,
    .position-item:hover .skills-list,
    .formation-text,
    .formation-text:hover,
    .projet-content,
    .projet-content:hover {
        transform: none !important;
    }
}

@media (max-width: 480px) {

    /* Ajustements supplémentaires pour très petits écrans */
    .profile-image {
        width: clamp(50px, 12vw, 60px);
        height: clamp(50px, 12vw, 60px);
        border-width: clamp(2px, 0.6vw, 3px);
        left: clamp(5px, 1.5vw, 10px);
    }

    .header-content {
        margin: 0 auto;
        gap: clamp(0.3rem, 1.5vw, 0.6rem);
        padding: clamp(0.3rem, 1.5vw, 0.8rem);
        height: clamp(60px, 15vw, 80px);
    }

    .header-bg-container {
        position: absolute;
        bottom: -25px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 2rem);
        max-width: 800px;
        height: 65px;
        max-height: 65px;
        background-image: url('../images/bg.png');
        background-repeat: no-repeat;
        background-position: center top;
        background-size: 100% auto;
        z-index: 0;
        transition: all 0.4s ease-in-out;
        pointer-events: none;
        opacity: 1;
    }

    .contact-info {
        /* grid-template-columns: 0.7fr 1fr 0.8fr; */
        /* gap: clamp(0.2rem, 0.8vw, 0.4rem); */

        display: grid;
        grid-template-columns: 0.9fr 1fr 1.2fr;
        gap: clamp(0.5rem, 1.5vw, 1rem);
        width: 100%;
        min-height: clamp(80px, 18vw, 140px);
        max-height: clamp(80px, 18vw, 140px);
        overflow: visible;
    }

    .first-name,
    .scrolled-first-name {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }

    .last-name,
    .scrolled-last-name {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }

    .title {
        font-size: clamp(0.8rem, 2.5vw, 1rem);
        white-space: nowrap;
    }

    .contacts {
        font-size: clamp(0.65rem, 2vw, 0.75rem);
    }

    .contacts li {
        gap: clamp(0.2rem, 0.8vw, 0.4rem);
        margin-bottom: 0;
    }

    .contacts i {
        width: clamp(10px, 2vw, 12px);
        font-size: clamp(0.65rem, 2vw, 0.75rem);
    }

    .sticky-nav .nav-item {
        min-width: 70px;
    }

    .sticky-nav .nav-text {
        font-size: 0.6rem;
    }

    section h2 {
        font-size: 1.3rem;
    }

    .skill-pills li {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }

    .skill-box h3 {
        font-size: 1rem;
    }

    .soft-skills-list li,
    .tech-skills-list dd {
        font-size: 0.9rem;
    }

    .tech-skills-list dt {
        font-size: 0.9rem;
        font-weight: bold;
    }

    .position-header h3 {
        font-size: 1rem;
    }

    .position-details li {
        font-size: 0.9rem;
    }

    .formation-text h3 {
        font-size: 1rem;
    }

    .formation-text p {
        font-size: 0.9rem;
    }

    .projet-header h3 {
        font-size: 1.1rem;
    }

    .projet-tech {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* --- STICKY NAVIGATION --- */
.sticky-nav {
    position: fixed;
    left: max(10px, calc(50% - 400px - 80px));
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    /* background-color: var(--background-block); */
    border-radius: 30px;
    padding: 15px 0;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); */
    /* border: 2px solid var(--primary-blue-dark); */
    width: var(--sticky-nav-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.sticky-nav:hover {
    width: 200px;
    padding: 15px 20px;
    left: max(10px, calc(50% - 400px - 220px));
}

.nav-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--background-block);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.50));
}

.nav-item:hover {
    background-color: var(--primary-blue-dark);
    color: var(--text-light);
    transform: scale(1.1);
}

.nav-item.active {
    background-color: var(--primary-blue-dark);
    color: var(--text-light);
    box-shadow: 0 0 10px rgba(66, 165, 245, 0.5);
}

.nav-item .nav-icon {
    font-size: 16px;
    transition: all 0.3s ease;
}

.nav-item .nav-text {
    position: absolute;
    right: 50px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.sticky-nav:hover .nav-item .nav-text {
    opacity: 1;
    visibility: visible;
}

.sticky-nav:hover .nav-item {
    width: 100%;
    border-radius: 20px;
    justify-content: flex-end;
    padding-right: 15px;
}

.nav-item-top {
    border-bottom: 2px solid var(--primary-blue-dark);
    margin-bottom: 5px;
}

.nav-item-top:hover {
    background-color: var(--primary-blue-dark);
    color: var(--text-light);
    border-bottom-color: var(--primary-blue-dark);
}

/* Responsive pour le menu sticky */
@media (max-width: 1200px) {
    .sticky-nav {
        left: 10px;
    }

    .sticky-nav:hover {
        left: 10px;
    }
}

@media (max-width: 768px) {
    .sticky-nav {
        display: none;
    }

    .projet-content {
        margin-left: -1rem;
        /* Adjusted margin for small screens */
        margin-right: 0;
        /* Ensure no right margin interferes */
        padding-left: 1.5rem;
        /* Adjust padding if needed due to negative margin */
        padding-right: 1rem;
        border-radius: 0 8px 8px 0;
        /* Optional: adjust border-radius for new layout */
    }
}