

:root {
    --primary-color: #00c6ff;
    --secondary-color: #0072ff;
    --accent-color: #ffffff;
    --bg-dark: #0f2027;
    --bg-dark2: #203a43;
    --font-family: 'Inter', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--accent-color);
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-dark2));
    overflow-x: hidden;
    line-height: 1.6;
    padding-top: 70px;
}

@media (max-width: 768px) {
    body {
        padding-top: 50px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 50px;
    }
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    z-index: 10000;
    background: rgba(10,25,33,0.8);
    backdrop-filter: blur(10px);
    transition: background 0.3s ease;
}

@media (max-width: 480px) {
    header {
        height: 45px;
    }
}


.lang-switcher {
    display: flex;
    gap: 0.5rem;
    font-size: 1.4rem;
    cursor: pointer;
}
.lang-switcher .flag {
    user-select: none;
    transition: transform 0.2s;
}
.lang-switcher .flag.active {
    transform: scale(1.2);
}


.lang-fr .en, .lang-en .fr { display: none; }
.lang-fr .fr, .lang-en .en { display: inline; }

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 70px;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--accent-color);
    transition: transform 0.3s;
    pointer-events: auto;
}

.menu-toggle.open {
    transform: rotate(90deg);
}

.nav-links {
    display: flex;
    gap: 1rem; 
}

.nav-links li {
    list-style: none;
}

.nav-links li a {
    display: inline-block;
    margin: 0 0.25rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 500;
    transition: color 0.3s, border-bottom 0.3s;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Mobile: hide nav-links by default on desktop */
@media (max-width: 768px) {
    .nav-links {
        display: none !important;
    }
}


header.scrolled {
    background: rgba(10,25,33,0.95);
    /* keep original height to avoid layout jumps */
}

/* always show vertical scrollbar to prevent content shift when header height changes */
body {
    overflow-y: scroll;
}

@media (max-width: 480px) {
    header.scrolled {
        background: rgba(10,25,33,0.8) !important;
        /* match normal header height to avoid scrollbar appearing */
    }
}


body.modal-open header,
body.modal-open footer {
    filter: blur(5px);
    pointer-events: none;
}

body.modal-open main {
    filter: blur(5px);
}

@media (min-width: 481px) {
    body.modal-open {
        overflow: hidden;
    }
}

/* lock scroll during nav overlay open */
body.nav-open {
    overflow: hidden;
}

body.modal-open main .mini-page {
    filter: none;
    pointer-events: auto;
}


.nav-brand {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-switcher {
    margin-left: 0.5rem;
}


.style-info {
    display: none;
}


footer {
    background: #0a1721;
    color: #ccc;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 30px 20px;
    border-top: 1px solid var(--primary-color);
}

.footer-logo h2 a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1rem;
}

.footer-nav ul {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-nav ul li a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.2rem 0.4rem;
}

.footer-nav ul li a:hover {
    color: var(--primary-color);
}

.footer-socials a {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin: 0 0.5rem;
}

.footer-bottom {
    background: #08101b;
    padding: 8px 0;
    text-align: center;
    font-size: 0.85rem;
    color: #777;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}


.lang-switcher img.flag {
    width: 32px;
    height: auto;
    cursor: pointer;
    transition: transform 0.2s;
    image-rendering: crisp-edges;
}
.lang-switcher img.flag.active {
    transform: scale(1.2);
}


@media (max-width: 768px) {
    /* Mobile: header full width, compact */
    header {
        width: 100%;
        padding: 0;
        box-sizing: border-box;
        overflow-x: hidden;
        height: 50px;
    }

    .main-nav {
        width: 100%;
        padding: 0 0.5rem;
        margin: 0;
        box-sizing: border-box;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .logo h1 {
        font-size: 0.85rem;
        margin-left: 1rem; /* space from hamburger */
    }

    .nav-brand {
        position: static;
        transform: none;
        display: flex;
        align-items: center;
        gap: 0.15rem;
        flex-shrink: 0;
    }

    .lang-switcher {
        gap: 0.15rem;
        font-size: 0.8rem;
    }

    .lang-switcher img.flag {
        width: 32px;
        height: auto;
    }

    .menu-toggle {
        display: block;
        z-index: 10003;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    /* Mobile menu overlay - slide from right */
    .nav-links {
        position: fixed !important;
        display: flex !important;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100vw !important;
        max-width: none !important;
        height: 100vh;
        background: rgba(10, 25, 33, 0.99);
        z-index: 10002;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        visibility: hidden;
        pointer-events: none;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.5);
    }

    .nav-links.open {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .nav-links ul {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        padding: 2rem 1rem;
    }

    .nav-links li {
        list-style: none;
    }

    .nav-links li a {
        display: inline-block;
        font-size: 1.3rem;
        padding: 0.5rem 1rem;
        color: var(--accent-color);
        text-decoration: none;
        text-align: center;
        transition: color 0.3s;
    }

    .nav-links li a:hover,
    .nav-links li a.active {
        color: var(--primary-color);
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 45px;
    }

    header {
        height: 45px;
        width: 100vw !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .main-nav {
        height: 45px;
        padding: 0 !important;
        gap: 0 !important;
        min-width: 0;
        width: 100% !important;
        margin: 0 !important;
    }

    .logo h1 {
        font-size: 0.65rem;
        white-space: nowrap;
        margin: 0 !important;
        padding: 0 0.25rem !important;
        flex-shrink: 0;
        margin-left: 1rem !important; /* push away from toggle */
    }

    .nav-brand {
        position: static;
        transform: none;
        gap: 0 !important;
        flex-shrink: 0;
        min-width: 0;
        margin: 0 !important;
        padding: 0 0.15rem !important;
        display: flex;
        align-items: center;
    }

    .lang-switcher {
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .lang-switcher img.flag {
        width: 32px !important;
        height: auto;
        flex-shrink: 0;
        margin: 0 !important;
        padding: 0 !important;
    }

    .menu-toggle {
        font-size: 0.9rem;
        flex-shrink: 0;
        padding: 0 0.15rem !important;
        margin: 0 !important;
        height: 45px;
        display: flex;
        align-items: center;
    }
}

section {
    padding: 100px 0;
}

@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    section {
        padding: 2rem 0;
    }
}

header.scrolled + main section { 
    padding-top: 90px;
}

#home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0 20px;
}

.bubbles-container {
    position: absolute;
    inset: 0;
    z-index: -1; 
    overflow: hidden;
    background: var(--bg-dark);
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: -120px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    opacity: 0.6;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
    animation: rise 8s linear infinite, sway 4s ease-in-out infinite alternate, rotateBubble 20s linear infinite;
    pointer-events: none;
    filter: blur(2px);
    --drift: 40px;
}

@keyframes sway {
    0% { transform: translateX(0); }
    100% { transform: translateX(var(--drift, 40px)); }
}

@keyframes rotateBubble {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



@keyframes sway {
    0% { transform: translateX(0); }
    100% { transform: translateX(40px); }
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.home-modern-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3rem;
    max-width: 1100px;
    width: 100%;
    padding: 0 20px;
}

.home-modern-layout .text {
    flex: 1 1 550px;
    text-align: left;
}

.home-modern-layout .big-title {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.buttons-col {
    margin-top: 2rem;
}


#home:before,
#home:after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(0,198,255,0.15);
    z-index: -3;
    pointer-events: none;
}
#home:before {
    width: 240px;
    height: 240px;
    top: 8%;
    left: 4%;
}
#home:after {
    width: 180px;
    height: 180px;
    bottom: 12%;
    right: 8%;
}

.home-modern-layout .profile-container {
    flex: 0 1 350px;
    display: flex;
    justify-content: center;
}

.home-modern-layout .big-title {
    font-size: 3.5rem;
    line-height: 1.2;
}

@media (max-width: 1024px) {
    #home {
        justify-content: center;
        padding: 0 10px;
    }
    .home-modern-layout {
        flex-direction: column-reverse;
        text-align: center;
        align-items: center;
        justify-content: center;
    }
    .home-modern-layout .text {
        padding-top: 30px;
        text-align: center;
    }
    .profile-container {
        margin: 0 auto;
    }
}


.home-modern-layout .text {
    flex: 1.6;
}

.home-modern-layout .profile-container {
    flex: 0.4;
}

.big-title {
    font-size: 3.5rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

.description {
    margin: 1.5rem 0;
    font-size: 1.2rem;
    color: #ccc;
}

.buttons-col {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.4s, color 0.4s, transform 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.btn-primary:hover {
    transform: translateY(-3px);
}

.btn-secondary {
    border: 2px solid var(--primary-color);
    color: var(--accent-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: #000;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.social-icons a {
    font-size: 1.8rem;
    color: var(--accent-color);
    transition: color 0.3s, transform 0.3s;
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--primary-color);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
    transition: transform 0.5s, box-shadow 0.5s;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

#about, #MesProjets {
    background: #000;
}


.about-section {
    background: linear-gradient(135deg, var(--bg-dark2) 0%, var(--bg-dark) 100%);
    padding: 80px 0 100px;
    color: #eee;
}

.about-section .about-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 3rem;
}

.about-grid {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.about-left, .about-right {
    flex: 1 1 400px;
    background: rgba(255,255,255,0.04);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.about-left p {
    line-height: 1.7;
}

.education-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(255,255,255,0.08);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    transition: transform 0.3s;
}

.education-entry:hover {
    transform: translateY(-3px);
}

.education-entry img {
    width: 60px;
    height: auto;
}

#Competences {
    
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-dark2));
}


#about .about-title,
#Competences h2,
#MesProjets .title-MesProjets {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.about-left, .about-right {
    flex: 1;
}

.about-left p {
    font-size: 1.2rem;
    color: #ddd;
    line-height: 1.8;
}

.education-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 10px;
}

.education-logo {
    width: 60px;
}

#Competences .competences-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.competence-group {
    text-align: center;
}

.competence-group h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.DevWeb, .DevLog, .Outils {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.competence {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.competence img {
    width: 60px;
    height: 60px;
}

@media (max-width: 1024px) {
    .home-modern-layout {
        flex-direction: column-reverse;
        text-align: center;
    }
    .home-modern-layout .profile-container {
        margin-bottom: 2rem;
    }
    .big-title { font-size: 2.8rem; }
    .subtitle { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    /* Home section mobile */
    #home {
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    .home-modern-layout {
        width: 100%;
        padding: 0 1rem;
        gap: 1.5rem;
    }

    .home-modern-layout .text {
        flex: 1 1 100%;
        text-align: center;
    }

    .big-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.3rem;
    }

    .description {
        font-size: 1rem;
    }

    .buttons-col {
        flex-direction: column;
        gap: 1rem;
        justify-content: center;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 0.6rem 1.5rem;
        font-size: 0.95rem;
    }

    .profile-image {
        width: 200px;
        height: 200px;
    }

    .social-icons {
        justify-content: center;
    }

    /* About section mobile */
    .about-section {
        padding: 3rem 1.5rem;
    }

    .about-section .about-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .about-grid {
        flex-direction: column;
        gap: 1.5rem;
    }

    .about-left, .about-right {
        flex: 1 1 100%;
        padding: 1.5rem;
    }

    .about-left p {
        font-size: 1rem;
    }

    .education-entry {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .education-entry img {
        width: 50px;
    }

    /* Competences section mobile */
    #Competences h2 {
        font-size: 1.8rem;
    }

    .competence-group h3 {
        font-size: 1.3rem;
    }

    .DevWeb, .DevLog, .Outils {
        gap: 1rem;
    }

    .competence {
        padding: 1rem;
        background-color: #2a2f39;
    }

    .competence img {
        width: 50px;
        height: 50px;
    }

    .competence p {
        font-size: 0.85rem;
    }

    /* Projects section mobile */
    #MesProjets {
        padding: 2rem 1.5rem;
        width: 100%;
    }

    .title-MesProjets {
        font-size: 2rem;
    }

    .projets-container {
        gap: 2rem;
    }

    .projet {
        width: 100%;
        max-width: 350px;
    }

    .projet img {
        height: 150px;
    }

    /* Footer mobile */
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .footer-nav ul {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    /* Home section - ultra compact */
    #home {
        padding: 1rem;
        min-height: calc(100vh - 60px);
    }

    .home-modern-layout {
        gap: 1rem;
    }

    .big-title {
        font-size: 1.6rem;
        line-height: 1.2;
    }

    .subtitle {
        font-size: 1.1rem;
        margin-top: 0.3rem;
    }

    .description {
        font-size: 0.9rem;
        margin: 1rem 0;
    }

    .buttons-col {
        gap: 0.8rem;
    }

    .btn-primary, .btn-secondary {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
    }

    .profile-image {
        width: 150px;
        height: 150px;
        border-width: 4px;
    }

    .social-icons {
        gap: 1rem;
    }

    .social-icons a {
        font-size: 1.5rem;
    }

    /* About section */
    .about-section {
        padding: 2rem 0.5rem;
    }

    .about-section .about-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    .about-left, .about-right {
        padding: 1rem;
    }

    .about-left p {
        font-size: 0.95rem;
    }

    .education-entry {
        padding: 0.6rem;
        margin-bottom: 1rem;
    }

    .education-entry img {
        width: 40px;
    }

    /* Competences */
    .competence-group h3 {
        font-size: 1.1rem;
    }

    .competence {
        padding: 0.8rem;
    }

    .competence img {
        width: 40px;
        height: 40px;
    }

    .competence p {
        font-size: 0.75rem;
    }

    /* Projects */
    .projet {
        max-width: 100%;
        width: 100%;
    }

    .projet img {
        height: 120px;
    }

    .projet-info {
        padding: 1rem 0.8rem;
    }

    .projet-info h3 {
        font-size: 1rem;
    }

    .projet-info p {
        font-size: 0.8rem;
    }
}


@keyframes rise {
    0% { transform: translateY(0) scale(1); opacity: 0.8; }
    100% { transform: translateY(-1200px) scale(2); opacity: 0; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.competence {
    background-color: #323946;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease-in-out;
}

.competence:hover {
    transform: translateY(-5px);
}

.competence img {
    width: 75px;
    height: 75px;
    object-fit: contain;
}

.competence p {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 16px;
    color: white;
}

.projets-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 80px;
    margin: 0 auto;
}

.sous-titre-projet {
    font-size: 24px;
    margin: 40px 0 20px;
    color: var(--primary-color);
}

#MesProjets .projets-container .projet img {
    padding: 20px;
    width: 100%;
    height: 200px;
    object-fit: contain;
    box-sizing: border-box;
}

.title-MesProjets {
    font-size: 30px;
}

.projet {
    width: 400px;
    background: #1E232D;
    border-radius: 8px;
    overflow: hidden;
    transition: filter 0.3s ease-in-out, opacity 0.3s ease-in-out, transform 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* no dimming by default */
    opacity: 1;
    filter: brightness(1);
}

.projet:hover {
    opacity: 1;
    filter: brightness(1);
    cursor: pointer;
    transform: scale(1.03);
}
.projet:active {
    transform: scale(0.97);
}

.projet img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.projet-info {
    background: #252A34;
    padding: 15px;
    text-align: center;
}

.projet-info h3 {
    font-size: 1.2rem;
    margin: 0;
    color: #F0F0F0;
}

.projet-info p {
    font-size: 0.9rem;
    color: #AAAAAA;
    margin-top: 5px;
    margin-bottom: 5px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.projets-container .modal-content {
    background: #1E232D;
    padding: 20px;
    border-radius: 8px;
    border: 5px solid var(--primary-color);
    color: white;
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: auto;
    max-width: 50vw;
    height: auto;
    max-height: 80vh;
    box-sizing: border-box;
}

.modal-content h2 {
    margin: 0 !important;
}

hr {
    border: none;
    height: 2px;
    background-color: var(--primary-color);
    width: 100%;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 25px;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

.close:hover {
    color: red;
}

.project-description {
    display: flex;
    height: 100%;
    flex-wrap: wrap;
}

.project-image-button {
    display: flex;
    width: 50%;
    flex-direction: column;
    justify-content: space-around;
}

.project-text-description {
    width: 50%;
    max-height: 90%;
}

.project-description .project-image {
    display: flex;
    justify-content: center;
    height: 60%;
}

.project-description .project-image img.active {
    display: block;
    width: 90%;
    height: 100%;
    border-radius:8px ;
    border: 2px solid var(--primary-color);
    animation: animation-project 0.5s ease-in-out;
}

.project-description .project-button button{
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
    animation: animation-project 0.5s ease-in-out;
}

.project-description .project-button button:hover{
    cursor: pointer;
    background-color: var(--primary-color);
}

@keyframes animation-project {
    from {
        opacity: 0;
        transform: scale(0.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.project-image img {
    display: none;
}

#MesProjets {
    width: 100%;
    min-height: 100vh;
    background-color: #000;
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.mini-page {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    background: linear-gradient(135deg, rgba(16,21,30,0.95), rgba(21,26,35,0.95));
    backdrop-filter: blur(12px);
    width: 80%;
    max-width: 900px;
    height: 80%;
    max-height: 80vh;
    justify-content: space-between;
    padding: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.mini-page.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    animation: modalZoomIn 0.35s ease-out forwards;
}

.mini-page.closing {
    animation: modalZoomOut 0.3s ease-in forwards;
}

@keyframes modalZoomIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes modalZoomOut {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

.overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}


.carre1 img {
    animation: fadeInImage 0.5s ease-out;
}
@keyframes fadeInImage {
    from {opacity:0; transform: scale(0.95);} to {opacity:1; transform: scale(1);} }

.carre2 {
    opacity: 0;
    animation: slideUp 0.35s ease-out forwards;
}
@keyframes slideUp { from {opacity:0; transform: translateY(20px);} to {opacity:1; transform: translateY(0);} }


.arrow {
    position: relative;
    overflow: hidden;
}
.arrow:after {
    content: '';
    position: absolute;
    top:0; left: -100%;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.2);
    transform: skewX(-20deg);
    transition: none;
}
.arrow:hover:after {
    left: 200%;
    transition: left 0.6s ease-out;
}


@media (max-width: 768px) {
    .mini-page { flex-direction: column; width: 90%; height: 90%; }
    .carre1, .carre2 { max-width: 100%; }
    .carre2 { margin-top: 20px; }
    /* make sure image block shows first on smaller screens */
    .carre1 { order: 1; }
    .carre2 { order: 2; }
}

@media (max-width: 480px) {
    .mini-page {
        display: block !important;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100vw;
        max-width: 100vw;
        max-height: calc(100vh - 40px);
        padding: 10px 0 12px; /* no horizontal padding */
        border-radius: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
        background: linear-gradient(135deg, rgba(16,21,30,0.95), rgba(21,26,35,0.95));
    }
    .mini-page.show {
        transform: translate(-50%, -50%);
        animation: none;
    }
    .mini-page.show {
        /* keep centering and remove original show animation */
        transform: translate(-50%, -50%);
        animation: none;
    }
    .carre1, .carre2 {
        display: block;
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
        flex: 1 1 100%;
    }
    .carre1 { order: 1; }
    .carre2 { order: 2; }
    .carre1 {
        display:flex;
        justify-content:center;
        width:100%;
    }
    .carre1 img {
        max-height: 25vh; /* fix image spacing */
        margin-bottom: 0.5rem;
        width:auto;
        max-width:100%;
    }
    .arrow { font-size: 1.4rem; padding: 0.6rem; }
    .carre2-title { font-size: 1.1rem; }
    .carre2-info ul li { font-size: 0.9rem; margin-bottom: 0.5rem; width: auto; }
    .carre2-description { font-size: 0.9rem; line-height: 1.4; margin-top: 0.6rem; word-break: break-word; }
    .carre2 {
        padding: 10px 0 0 0; /* zero side padding */
        border-left: none !important;
        padding-left: 0 !important;
        overflow-y: auto;
        max-height: calc(100vh - 25vh - 60px);
        justify-content: flex-start;
    }
}

.mini-page .modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
    z-index: 10002;
    transition: color 0.2s;
    pointer-events: auto;
}
.mini-page .modal-close:hover { color: var(--primary-color); }

.carre1, .carre2 {
    flex: 1 1 45%;
    max-width: 45%;
}


.carre2 {
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 20px;
}
.carre1 {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carre1 img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
}

.arrow {
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}
.arrow.prev { position:absolute; left:4px; top:50%; transform:translateY(-50%); }
.arrow.next { position:absolute; right:4px; top:50%; transform:translateY(-50%); }
.arrow:hover { background: rgba(0,0,0,0.7); }

.carre2 {
    color: #eee;
    padding: 0 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.carre2-title {
    margin-top: 0;
    font-size: 1.4rem;
}
.carre2-info ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}
.carre2-info ul li {
    margin-bottom: 0.6rem;
}
.carre2-description {
    line-height: 1.6;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

.overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* overlay must sit above header too */
    z-index: 10000;
    display: none;
    pointer-events: none; /* allow clicks through */
}

.overlay.show {
    display: block;
    pointer-events: none;
}

/* make sure .show overrides display */
.overlay.show {
    display: block;
}

/* mobile modal redesign (single source of truth) */
@media (max-width: 768px) {
    .mini-page {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr);
        pointer-events: auto;
        touch-action: none;
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 96vw !important;
        max-width: 96vw !important;
        height: auto !important;
        max-height: calc(100vh - 24px) !important;
        padding: 12px !important;
        border-radius: 14px !important;
        overflow: hidden !important;
        box-sizing: border-box;
        z-index: 10001;
    }

    .mini-page.show {
        transform: translate(-50%, -50%) !important;
        animation: none !important;
    }

    .mini-page .modal-close {
        top: 10px;
        right: 12px;
        font-size: 1.6rem;
        z-index: 3;
    }

    .carre1,
    .carre2 {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        margin: 0 !important;
    }

    .carre1 {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start !important;
        gap: 8px;
        padding-right: 0 !important;
        position: relative;
        z-index: 1005;
    }

    .carre1 img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
        max-height: 24vh !important;
        object-fit: contain;
        margin: 0 !important;
    }

    
    .arrow {
        font-size: 1.1rem !important;
        padding: 0.8rem 1.2rem !important;
        z-index: 10002;
        pointer-events: auto;
        cursor: pointer;
    }
    .arrow i {
        pointer-events: none;
    }

    .carre2 {
        border-left: none !important;
        padding: 8px 2px 0 !important;
        overflow-y: auto !important;
        min-height: 0;
        max-height: none !important;
        display: block !important;
        text-align: left;
    }

    .carre2-title {
        font-size: 1.25rem !important;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }

    .carre2-info ul {
        margin-bottom: 0.8rem;
    }

    .carre2-info ul li {
        font-size: 0.95rem !important;
        margin-bottom: 0.45rem;
    }

    .carre2-description {
        font-size: 0.95rem !important;
        line-height: 1.5;
        margin-top: 0.5rem;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    #home {
        padding: 80px 0px 100px; /* match about-section vertical spacing */
    }
    .mini-page {
        width: 90vw !important;
        max-width: 90vw !important;
        max-height: calc(100vh - 24px) !important;
        border-radius: 12px !important;
        padding: 10px !important;
    }
    .social-icons {
        justify-content: center;
        margin-top: 1rem;
    }
    .mini-page .modal-close {
        top: 5px !important;
        right: 5px !important;
        font-size: 1.4rem !important;
    }
    .carre1 {
        width: auto !important;
        margin: 0 auto !important;
    }
    .carre1 img {
        width: auto !important;
        max-width: 100% !important;
    }
    .carre1 {
        justify-content: center !important;
    }

    .carre1 img {
        max-height: 12vh !important;
    }


    .arrow {
        font-size: 1rem !important;
        padding: 0.35rem !important;
    }

    .carre2-title {
        font-size: 1.05rem !important;
        margin-bottom: 0.35rem !important;
    }

    .carre2 {
        padding-top: 2px !important;
    }

    .carre2-info ul {
        margin-bottom: 0.35rem !important;
    }

    .carre2-info ul li {
        margin-bottom: 0.15rem !important;
    }

    .carre2-info ul li,
    .carre2-description {
        font-size: 0.9rem !important;
    }

    .carre2-description {
        line-height: 1.45 !important;
        margin-top: 0.3rem !important;
    }
}

/* ultimate mobile navbar reset */
@media (max-width: 480px) {
    html, body {
        overflow-x: hidden !important;
        width: 100vw !important;
    }
    /* prevent any element from exceeding viewport width */
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    header {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw !important;
        min-width: 100vw !important;
        height: 45px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: rgba(10,25,33,0.8) !important;
        overflow-x: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
        z-index: 10000 !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        backdrop-filter: blur(8px) !important;
    }
    .main-nav {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        box-sizing: border-box !important;
    }

    /* flex header layout: toggle left, logo center, flags right */
    .nav-brand {
        display: none !important;
    }


    .logo {
        position: relative !important;
        margin: 0 auto !important;
        padding: 0 !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        margin-left: 1.6rem !important; /* space from menu icon */
    }

    /* flags sit right inside nav-brand */
    .lang-switcher {
        position: absolute !important;
        right: 0 !important; /* flush to right edge */
        top: 50% !important;
        transform: translateY(-50%) !important;
        display: flex !important;
        gap: 0.2rem !important;
    }

    /* menu toggle moved left side */
    .menu-toggle {
        position: absolute !important;
        left: 0.25rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 1.4rem !important; /* make it larger for visibility */
    }

    .logo h1 {
        font-size: 0.75rem !important;
        margin: 10 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .lang-switcher img.flag {
        width: 32px !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
    }

    .menu-toggle {
        display: flex !important;
        align-items: center !important;
        font-size: 1.2rem !important;
        padding: 0 !important;
        margin: 0 !important;
        height: 100% !important;
        cursor: pointer !important;
        z-index: 10003 !important;
    }

    /* fixed side drawer inherited from 768px rules */
    .nav-links {
        position: fixed !important;
        display: flex !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 100vw !important;
        max-width: none !important;
        height: 100vh;
        background: rgba(10, 25, 33, 0.99);
        z-index: 10002;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        visibility: hidden;
        pointer-events: none;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.5);
    }

    .nav-links.open {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    /* add name & flags at top of drawer */
    .nav-links.open::before {
        content: "Mathieu Patural 🇫🇷 🇬🇧";
        display: block !important;
        font-size: 1.1rem !important;
        color: var(--accent-color) !important;
        margin-bottom: 1rem !important;
        text-align: center !important;
    }

    /* final flex alignment override so all elements sit in one row */
    .main-nav {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        position: relative !important;
    }
    .main-nav .menu-toggle {
        position: static !important;
        order: 1 !important;
        margin: 0 !important;
    }
    .main-nav .logo {
        position: static !important;
        order: 2 !important;
        margin: 0 auto !important;
    }
    .main-nav .lang-switcher {
        position: static !important;
        order: 3 !important;
        margin: 0 !important;
    }
}

/* complete fresh mobile navbar rebuild (override previous mess) */
@media (max-width: 480px) {
    /* ensure everything in the navbar is visible and flexed */
    header, .main-nav, .nav-brand, .menu-toggle, .logo, .lang-switcher {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    header {
        height: 45px !important;
        background: rgba(10,25,33,0.8) !important;
        width: 100vw !important;
        top: 0 !important;
        left: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        z-index: 10000 !important;
    }

    .main-nav {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        padding: 0 0.5rem !important;
        box-sizing: border-box !important;
    }

    /* force nav-brand visible and full width */
    .nav-brand {
        display: flex !important;
        position: relative !important;
        flex: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        order: 2 !important;
    }

    /* menu toggle order left */
    .menu-toggle { order: 1 !important; }

    /* ensure toggle appears first and brand takes remaining space */
    .menu-toggle { order: 1 !important; }
    .nav-brand { order: 2 !important; flex: 1 !important; position: relative !important; display: flex !important; align-items: center !important; justify-content: center !important; }

    .menu-toggle {
        display: block !important;
        font-size: 1.6rem !important;
        color: var(--accent-color) !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
    }

    .logo h1 {
        font-size: 0.9rem !important;
        color: var(--accent-color) !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        position: static !important;
        transform: none !important;
        left: auto !important;
        line-height: 45px !important;
        margin-left: 1.6rem !important; /* avoid touching toggle */
    }

    .lang-switcher {
        position: absolute !important;
        right: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        display: flex !important;
        gap: 0.4rem !important;
        flex-shrink: 0 !important;
    }


    .lang-switcher img.flag {
        width: 32px !important;
        height: auto !important;
    }

    /* simple left drawer */
    .nav-links {
        position: fixed !important;
        top: 45px !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: none !important;
        background: rgba(10,25,33,0.95) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-top: 1rem !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
        z-index: 10002 !important;
        overflow-y: auto !important;
    }

    .nav-links.open {
        transform: translateX(0) !important;
    }

    .nav-links::before { content: "" !important; display: none !important; }
}

/* emergency mobile navbar reset: clear previous styles completely */
@media (max-width: 480px) {
    header, .main-nav, .menu-toggle, .nav-links, .logo, .lang-switcher {
        all: unset !important;
    }

    header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 45px !important;
        background: rgba(10,25,33,0.9) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 0.5rem !important;
        box-sizing: border-box !important;
        z-index: 10000 !important;
    }
    /* vertically center contents under emergency reset too */
    header > * {
        align-self: center !important;
        line-height: 45px !important;
    }

    .main-nav {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        padding: 0 0.5rem !important;
        box-sizing: border-box !important;
    }

    .menu-toggle {
        display: block !important;
        font-size: 1.8rem !important;
        color: var(--accent-color) !important;
        cursor: pointer !important;
        z-index: 10005 !important; /* float above nav-brand */
        pointer-events: auto !important;
    }

    .nav-brand {
        display: flex !important;
        /* stretch full width so flags can sit at right edge */
        flex: 1 !important;
        justify-content: center !important;
        align-items: center !important;
        order: 2 !important;
        position: relative !important;
        pointer-events: none !important;
    }
    /* allow inner elements to still be interactive */
    .nav-brand .logo,
    .nav-brand .lang-switcher {
        pointer-events: auto !important;
    }

    .logo {
        position: static !important;
        margin: 0 auto !important;
    }
    .logo h1 {
        font-size: 1.2rem !important; /* larger text */
        color: var(--accent-color) !important;
        margin: 10 auto !important;
        padding: 0 !important;
        white-space: nowrap !important;
        text-align: center !important;
    }

    .lang-switcher {
        position: static !important;
        display: flex !important;
        gap: 0.4rem !important;
        align-items: center !important;
        margin-left: auto !important;
    }
    .lang-switcher img {
        width: 32px !important;
        height: auto !important;
    }
    .nav-links {
        position: fixed !important;
        top: 45px !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: none !important;
        background: rgba(10,25,33,0.95) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-top: 1rem !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
        z-index: 10002 !important;
        overflow-y: auto !important;
    }

    .nav-links.open {
        transform: translateX(0) !important;
        display: flex !important;
    }

    /* ensure each header element stays in middle of bar */
    header .menu-toggle,
    header .logo,
    header .lang-switcher {
        align-self: center !important;
    }
}