/* Variables CSS pour un thème sombre/clair élégant */
:root {
    --primary-color: #4A4E69; /* Bleu Indigo profond pour les accents */
    --secondary-color: #9A8C98; /* Gris-rose doux pour le contraste */
    --text-dark: #22223B; /* Noir profond pour le texte principal */
    --text-light: #F2E9E4; /* Blanc cassé pour le texte sur fonds sombres */
    --background-light: #F2E9E4; /* Fond clair principal */
    --background-dark: #22223B; /* Fond sombre pour certaines sections */
    --card-bg: #FFFFFF; /* Fond des cartes projets/compétences */
    --border-radius-lg: 12px;
    --border-radius-sm: 8px;
    --transition-speed: 0.4s ease-out; /* Transitions plus douces */
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Thème sombre */
[data-theme="dark"] {
    --primary-color: #9A8C98;
    --secondary-color: #C9B8B5;
    --text-dark: #E8E0D8;
    --background-light: #151525;
    --background-dark: #0e0e1c;
    --card-bg: #1e1f35;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] header {
    background-color: rgba(14, 14, 28, 0.95);
}

/* Sections avec fonds codés en dur */
[data-theme="dark"] .stats-section {
    background: linear-gradient(180deg, var(--card-bg) 0%, var(--background-light) 100%);
}

[data-theme="dark"] .stat-card {
    background: var(--card-bg);
    border-color: rgba(154, 140, 152, 0.15);
}

[data-theme="dark"] .stat-current {
    background:
        radial-gradient(circle at top right, rgba(154, 140, 152, 0.15), transparent 34%),
        var(--card-bg);
    border-color: rgba(154, 140, 152, 0.3);
}

[data-theme="dark"] .stat-detail {
    color: rgba(232, 224, 216, 0.85);
}

[data-theme="dark"] .stat-card:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(154, 140, 152, 0.08)),
        var(--card-bg);
}

/* Cartes compétences / projets / expériences */
[data-theme="dark"] .skill-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .education-card {
    border-color: rgba(154, 140, 152, 0.15);
}

[data-theme="dark"] .skill-card h3 {
    border-bottom-color: rgba(154, 140, 152, 0.2);
}

[data-theme="dark"] .skill-tag,
[data-theme="dark"] .project-tag {
    background: rgba(154, 140, 152, 0.1);
    border-color: rgba(154, 140, 152, 0.22);
    color: var(--text-dark);
}

[data-theme="dark"] .skill-tag:hover {
    background: rgba(154, 140, 152, 0.2);
    border-color: var(--primary-color);
}

[data-theme="dark"] .project-card:hover,
[data-theme="dark"] .experience-card:hover {
    background-color: var(--card-bg);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(154, 140, 152, 0.25);
}

/* Textes secondaires */
[data-theme="dark"] .experience-card .duration {
    color: rgba(232, 224, 216, 0.78);
}

/* Bouton primary hover */
[data-theme="dark"] .btn-primary:hover {
    background-color: var(--secondary-color);
}

[data-theme="dark"] .info-item {
    border-bottom-color: rgba(154, 140, 152, 0.12);
}

[data-theme="dark"] .info-item:hover {
    background: rgba(154, 140, 152, 0.06);
}

[data-theme="dark"] .info-icon {
    background: rgba(154, 140, 152, 0.15);
}

[data-theme="dark"] .info-value {
    color: var(--text-dark);
}

[data-theme="dark"] .filter-btn {
    background-color: rgba(154, 140, 152, 0.1);
    border-color: rgba(154, 140, 152, 0.25);
    color: var(--text-dark);
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.is-active {
    background-color: var(--secondary-color);
    color: var(--text-light);
    border-color: transparent;
}

/* Général */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--background-light);
    scroll-behavior: smooth;
}

html {
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.section {
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden; /* Pour les animations internes si besoin */
}

.section h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3em;
    margin-bottom: 60px;
    color: var(--text-dark);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Header & Navigation */
header {
    background-color: rgba(34, 34, 59, 0.92);
    backdrop-filter: blur(6px);
    color: var(--text-light);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    z-index: 1000;
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 40px;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 400;
    font-size: 1.1em;
    transition: color var(--transition-speed), transform var(--transition-speed);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary-color);
    transition: width var(--transition-speed);
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 28px;
    padding: 6px 10px;
    border: 1px solid rgba(242, 233, 228, 0.25);
    border-radius: 999px;
    color: rgba(242, 233, 228, 0.72);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.86em;
    font-weight: 700;
}

.lang-option {
    border: none;
    background: transparent;
    color: rgba(242, 233, 228, 0.68);
    cursor: pointer;
    font: inherit;
    padding: 2px 3px;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.lang-option:hover,
.lang-option.is-active {
    color: var(--text-light);
    transform: translateY(-1px);
}

/* Bouton dark/light mode */
#theme-toggle {
    background: none;
    border: 1px solid rgba(242, 233, 228, 0.3);
    color: rgba(242, 233, 228, 0.8);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    margin-left: 10px;
    flex-shrink: 0;
}

#theme-toggle:hover {
    background: rgba(242, 233, 228, 0.12);
    border-color: rgba(242, 233, 228, 0.6);
    color: var(--text-light);
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 30px;
    height: 3px;
    background-color: var(--text-light);
    margin: 6px;
    transition: all var(--transition-speed);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(34, 34, 59, 0.85), rgba(34, 34, 59, 0.85)); /* Enlève l'image ici */
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    min-height: 700px;
    text-align: center;
    padding: 0 40px;
    position: relative;
    overflow: hidden;
}

.scroll-indicator {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.85);
    font-size: 1.5rem;
    animation: bounce 1.8s infinite;
    text-decoration: none;
    z-index: 10;
    transition: color 0.2s;
}
.scroll-indicator:hover { color: var(--accent); }

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* Canvas pour les particules */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* Assure que le contenu est par-dessus */
    background-color: transparent;
    pointer-events: none; /* Permet d'interagir avec le contenu en dessous */
}

.hero-content {
    position: relative; /* Pour que le contenu soit par-dessus le canvas */
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    align-items: center;
    gap: 70px;
    width: 100%;
    max-width: 1400px;
    text-align: left;
}

.hero-copy {
    max-width: 680px;
}

.hero-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 4.5em;
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Styles pour l'effet machine à écrire */
.typed-text-container {
    font-size: 1.6em;
    margin-bottom: 20px;
    max-width: 900px;
    font-weight: 300;
    height: 1.6em; /* Maintient la hauteur pour éviter les sauts de mise en page */
    display: inline-block; /* Pour que le curseur soit à côté du texte */
    overflow: hidden; /* Cache le texte qui n'est pas encore tapé */
    white-space: nowrap; /* Empêche le retour à la ligne */
    border-right: 2px solid var(--secondary-color); /* Curseur */
    animation: blink-cursor 0.75s step-end infinite;
}

.typed-text {
    display: inline;
}

.typing-cursor {
    opacity: 1;
    animation: blink-cursor 0.75s step-end infinite;
}

@keyframes blink-cursor {
    from, to { border-color: transparent }
    50% { border-color: var(--secondary-color); }
}

.hero-content .tagline {
    font-size: 1.2em;
    font-style: italic;
    color: rgba(242, 233, 228, 0.8);
    margin-top: -10px;
    margin-bottom: 12px;
}

.hero-objective {
    max-width: 760px;
    margin: 0 0 30px;
    font-size: 1.05em;
    color: rgba(242, 233, 228, 0.9);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-actions .btn-primary,
.hero-actions .btn-secondary {
    margin: 0;
}

.btn-hero-secondary {
    color: var(--text-light);
    border-color: rgba(242, 233, 228, 0.48);
}

.btn-hero-secondary:hover {
    border-color: var(--primary-color);
}

.hero-orbit {
    position: relative;
    width: min(430px, 42vw);
    aspect-ratio: 1;
    justify-self: end;
    margin-right: -10px;
    display: grid;
    place-items: center;
}

.profile-core {
    position: relative;
    z-index: 4;
    width: 240px;
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(145deg, #ffffff, rgba(154, 140, 152, 0.7));
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32), 0 0 0 8px rgba(242, 233, 228, 0.08);
}

.profile-core::after {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1px solid rgba(242, 233, 228, 0.18);
}

.profile-core img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.orbit {
    position: absolute;
    inset: 50%;
    border: 1px solid rgba(242, 233, 228, 0.22);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 18px rgba(154, 140, 152, 0.08);
}

.orbit-one {
    width: 260px;
    height: 260px;
    animation: orbit-spin 12s linear infinite;
    border-color: rgba(154, 140, 152, 0.5);
    box-shadow: inset 0 0 18px rgba(154, 140, 152, 0.08), 0 0 12px rgba(154, 140, 152, 0.25);
}

.orbit-two {
    width: 340px;
    height: 340px;
    animation: orbit-spin-reverse 28s linear infinite;
}

.orbit-three {
    width: 420px;
    height: 420px;
    animation: orbit-spin 45s linear infinite;
}

.orbit-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(34, 34, 59, 0.82);
    color: var(--text-light);
    border: 1px solid rgba(242, 233, 228, 0.28);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
    font-size: 1.1em;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.orbit-item:hover {
    transform: scale(1.4) !important;
    box-shadow: 0 0 16px rgba(154, 140, 152, 0.6), 0 10px 26px rgba(0, 0, 0, 0.28);
    z-index: 10;
}

.orbit-item.python { transform: rotate(18deg) translateX(130px) rotate(-18deg); color: #f2d66b; }
.orbit-item.database { transform: rotate(198deg) translateX(130px) rotate(-198deg); color: #9dd6ff; }
.orbit-item.pytorch { transform: rotate(68deg) translateX(170px) rotate(-68deg); color: #ee4c2c; }
.orbit-item.pandas { transform: rotate(248deg) translateX(170px) rotate(-248deg); color: #f0a267; }
.orbit-item.docker { transform: rotate(130deg) translateX(210px) rotate(-130deg); color: #90caf9; }
.orbit-item.brain { transform: rotate(310deg) translateX(210px) rotate(-310deg); color: #e3b5ff; }

@keyframes orbit-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbit-spin-reverse {
    to { transform: translate(-50%, -50%) rotate(-360deg); }
}

@keyframes profile-pulse {
    0%, 100% { box-shadow: 0 22px 60px rgba(0,0,0,0.32), 0 0 0 8px rgba(242,233,228,0.08), 0 0 0 0 rgba(154,140,152,0); }
    50% { box-shadow: 0 22px 60px rgba(0,0,0,0.32), 0 0 0 8px rgba(242,233,228,0.08), 0 0 28px 8px rgba(154,140,152,0.35); }
}

/* Glow sur la photo */
.profile-core {
    animation: profile-pulse 3.5s ease-in-out infinite;
}

/* Pause des orbites au survol */
.hero-orbit:hover .orbit-one,
.hero-orbit:hover .orbit-two,
.hero-orbit:hover .orbit-three {
    animation-play-state: paused;
}

/* Tooltip au survol des icônes */
.orbit-item::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(34, 34, 59, 0.92);
    color: var(--text-light);
    font-size: 0.65em;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border: 1px solid rgba(242,233,228,0.2);
}

.orbit-item:hover::after {
    opacity: 1;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 15px 35px;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    transition: all var(--transition-speed);
    margin: 10px;
    position: relative; /* Pour l'effet de bouton */
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before, .btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2); /* Effet de brillance */
    transition: all var(--transition-speed);
    z-index: -1;
    transform: skewX(-20deg);
}

.btn-primary:hover::before, .btn-secondary:hover::before {
    left: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: 2px solid var(--primary-color);
}

/* Fallback pour darken */
.btn-primary:hover {
    background-color: #3f435e;
    animation: pulse 0.4s;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 6px 20px rgba(74, 78, 105, 0.4);
    transform: translateY(-3px);
    animation: pulse 0.4s;
}

.cv-download i {
    transition: transform 0.25s ease-out;
}

.cv-download:hover i {
    transform: translateY(3px);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.07); }
    100% { transform: scale(1); }
}

/* About Section */
.about-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    align-items: start;
    text-align: left;
}

.about-info {
    position: sticky;
    top: 100px;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(74, 78, 105, 0.08);
    transition: background 0.2s;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item:hover {
    background: rgba(74, 78, 105, 0.04);
}

.info-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(74, 78, 105, 0.08);
    color: var(--secondary-color);
    font-size: 0.9em;
    flex-shrink: 0;
}

.info-label {
    display: block;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    margin-bottom: 2px;
}

.info-value {
    display: block;
    font-size: 0.92em;
    font-weight: 500;
    color: var(--primary-color);
}

.available-value {
    display: flex;
    align-items: center;
    gap: 7px;
}

.available-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: #3cb87a;
    box-shadow: 0 0 0 0 rgba(60, 184, 122, 0.4);
    animation: live-pulse 1.8s ease-out infinite;
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: top;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-light);
    margin-bottom: 14px;
    transition: transform 0.4s cubic-bezier(.25,.8,.25,1);
}

.project-card img:hover {
    transform: scale(1.05);
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.15em;
    line-height: 1.8;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    text-align-last: left;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.about-actions .btn-primary,
.about-actions .btn-secondary {
    margin: 0;
}


/* Key stats */
.stats-section {
    padding: 70px 0;
    background:
        linear-gradient(180deg, #ffffff 0%, rgba(242, 233, 228, 0.55) 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1.25fr repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

a.stat-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.stat-card {
    position: relative;
    min-height: 230px;
    padding: 30px 22px;
    border-radius: var(--border-radius-sm);
    border: 2px solid transparent;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 233, 228, 0.55)),
        var(--card-bg);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.28s ease-out, border-color 0.28s ease-out, box-shadow 0.28s ease-out, background-color 0.28s ease-out;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(154, 140, 152, 0.18), transparent);
    transform: translateX(-110%);
}

.stat-card.is-visible::before {
    animation: stat-shine 1.2s ease-out forwards;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary-color);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(242, 233, 228, 0.78)),
        var(--card-bg);
    box-shadow: 0 16px 34px rgba(74, 78, 105, 0.18), 0 0 0 4px rgba(154, 140, 152, 0.16);
}

.stat-icon {
    position: relative;
    width: 58px;
    height: 58px;
    display: block;
    margin: 0 auto 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75), transparent 34%),
        rgba(74, 78, 105, 0.12);
    color: var(--primary-color);
    font-size: 2em;
    line-height: 1;
    box-shadow: inset 0 -8px 16px rgba(34, 34, 59, 0.08);
    transition: transform 0.28s ease-out, color 0.28s ease-out, background-color 0.28s ease-out, box-shadow 0.28s ease-out;
}

.stat-icon::before {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    line-height: 1;
    transform: translate(-50%, -50%);
}

.stat-card:hover .stat-icon {
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.22), transparent 34%),
        var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 12px 24px rgba(74, 78, 105, 0.24);
    transform: translateY(-4px) scale(1.08);
}

.stat-number {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 2.6em;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 8px;
    transition: color 0.28s ease-out, transform 0.28s ease-out;
}

.stat-card:hover .stat-number {
    color: var(--secondary-color);
    transform: scale(1.07);
}

.stat-label {
    display: block;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.35;
}

.stat-detail {
    display: block;
    margin-top: 10px;
    color: rgba(34, 34, 59, 0.72);
    font-size: 0.9em;
    line-height: 1.45;
    max-width: 250px;
}

.stat-current {
    border: 2px solid rgba(74, 78, 105, 0.28);
    background:
        radial-gradient(circle at top right, rgba(154, 140, 152, 0.2), transparent 34%),
        linear-gradient(145deg, #ffffff, rgba(242, 233, 228, 0.72));
}

.stat-current.is-visible {
    animation: stat-current-lift 0.9s ease-out both;
}

.stat-status {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background-color: rgba(74, 78, 105, 0.1);
    color: var(--primary-color);
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: background-color 0.28s ease-out, color 0.28s ease-out;
}

.stat-current:hover .stat-status {
    background-color: var(--primary-color);
    color: var(--text-light);
}


.stat-status span[aria-hidden="true"] {
    width: 8px;
    height: 8px;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
    background-color: #3cb87a;
    box-shadow: 0 0 0 0 rgba(60, 184, 122, 0.45);
    animation: live-pulse 1.8s ease-out infinite;
}

@keyframes stat-shine {
    to { transform: translateX(110%); }
}

@keyframes stat-current-lift {
    0% {
        transform: translateY(12px);
        box-shadow: var(--shadow-light);
    }
    100% {
        transform: translateY(0);
        box-shadow: var(--shadow-hover);
    }
}

/* Timeline for Formations */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 80px auto 0;
    padding: 20px 0;
    border-left: 2px solid rgba(74, 78, 105, 0.18);
}

.timeline::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    z-index: 1;
    transition: height 1.4s ease-out;
}

.reveal-section.is-visible .timeline::before {
    height: 100%;
}

.timeline::after {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 0;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-item {
    padding: 20px 30px;
    position: relative;
    background-color: var(--card-bg);
    margin-bottom: 25px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-speed);
    text-align: left;
    margin-left: 20px; /* Pour laisser de la place au cercle */
}

.timeline-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.timeline-item::before { /* Cercle sur la ligne du temps */
    content: '';
    position: absolute;
    left: -32px; /* Positionne le cercle sur la ligne */
    top: 25px;
    width: 15px;
    height: 15px;
    background-color: var(--primary-color);
    border-radius: 50%;
    z-index: 2;
    border: 3px solid var(--background-light); /* Bague autour du cercle */
    box-shadow: 0 0 0 rgba(154, 140, 152, 0);
    transition: background-color 0.4s ease-out, box-shadow 0.4s ease-out;
}

.timeline-item.is-visible::before,
.timeline-item:hover::before {
    background-color: var(--secondary-color);
    box-shadow: 0 0 0 8px rgba(154, 140, 152, 0.18);
}

.timeline-item.is-current::before {
    background-color: #3cb87a;
    box-shadow: 0 0 0 0 rgba(60, 184, 122, 0.4);
    animation: live-pulse 1.8s ease-out infinite;
}

.timeline-item.is-current.is-visible::before,
.timeline-item.is-current:hover::before {
    background-color: var(--primary-color);
    box-shadow: 0 0 0 8px rgba(74, 78, 105, 0.18);
}

.timeline-item h4 {
    font-size: 1.4em;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.timeline-item .date {
    font-size: 0.9em;
    color: var(--secondary-color);
    font-weight: 300;
}

/* Skills Section */
.bg-gradient {
    background: linear-gradient(135deg, var(--background-dark), #3a3f5c); /* Dégradé sombre */
    color: var(--text-light);
}
.bg-gradient h2 {
    color: var(--text-light); /* Titre clair sur fond sombre */
}
.bg-gradient h2::after {
    background-color: var(--secondary-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: left;
    align-items: stretch;
}

.skill-card {
    background-color: var(--card-bg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-light);
    border: 2px solid transparent;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color var(--transition-speed);
    color: var(--text-dark); /* Texte sombre sur carte claire */
    position: relative; /* Pour l'effet de lueur */
    overflow: hidden;
}

.skill-card:hover {
    box-shadow: var(--shadow-hover), 0 0 0 4px var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-12px) scale(1.03);
}

.skill-card i {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: block;
    text-align: center;
    transition: transform 0.3s ease-out, color 0.3s ease-out;
    position: relative; /* Pour être au-dessus de la lueur */
    z-index: 1;
}

.skill-card:hover i {
    transform: scale(1.15); /* Plus d'agrandissement */
    color: var(--secondary-color); /* Changement de couleur au survol */
}

.skill-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1em;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    position: relative;
    z-index: 1;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    align-content: flex-start;
    position: relative;
    z-index: 1;
    flex: 1;
}

.skill-tag {
    background: rgba(74, 78, 105, 0.08);
    border: 1px solid rgba(74, 78, 105, 0.18);
    color: var(--text-dark);
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 0.83em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed);
}

.skill-tag:hover {
    background: rgba(74, 78, 105, 0.16);
    border-color: var(--primary-color);
}

.skill-tag i {
    font-size: 0.9em;
    color: var(--primary-color);
}

/* Projects Section */
.project-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: -28px 0 46px;
}

.filter-btn {
    border: 1px solid rgba(74, 78, 105, 0.22);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.72);
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 700;
    padding: 9px 16px;
    transition: background-color var(--transition-speed), color var(--transition-speed), transform var(--transition-speed), box-shadow var(--transition-speed);
}

.filter-btn:hover,
.filter-btn.is-active {
    background-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 10px 22px rgba(74, 78, 105, 0.18);
    transform: translateY(-2px);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.project-card {
    background-color: var(--card-bg);
    padding: 35px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-light);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 2px solid transparent;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color var(--transition-speed), background-color var(--transition-speed), opacity 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card[data-proof] {
    padding-bottom: 78px;
}

.project-card::after {
    content: attr(data-proof);
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 18px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    background-color: rgba(34, 34, 59, 0.94);
    color: var(--text-light);
    font-size: 0.86em;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.28s ease-out, transform 0.28s ease-out;
    pointer-events: none;
}

.project-card:hover {
    background-color: #fff;
    box-shadow: 0 16px 38px rgba(74, 78, 105, 0.22), 0 0 0 4px rgba(154, 140, 152, 0.24);
    transform: translateY(-12px) scale(1.03);
    border-color: var(--secondary-color);
}

.project-card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.project-card.is-filtered-out {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
    pointer-events: none;
}

.project-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.15em;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card h3 i {
    display: block;
    margin: 0 auto 12px auto;
    font-size: 3em; /* même taille que .skill-card i */
    color: var(--primary-color);
    text-align: center;
    transition: color 0.28s ease-out, transform 0.28s ease-out;
}

.project-card:has(.project-img) h3 i {
    display: none;
}

.project-card:has(.project-img) h3 {
    text-align: left;
    margin-bottom: 10px;
}

.featured-badge {
    display: none;
}

.project-card:hover h3 i {
    color: var(--secondary-color);
    transform: translateY(-4px) scale(1.08);
}

.project-card p {
    margin-bottom: 25px;
    color: var(--text-dark);
    line-height: 1.7;
    flex-grow: 1;
}

/* Justifie les descriptions de projets pour un rendu plus uniforme */
.projects-grid .project-card p {
    text-align: justify;
    text-justify: inter-word; /* meilleure répartition des mots */
    hyphens: auto; /* césure automatique si nécessaire */
    text-align-last: left; /* dernière ligne alignée à gauche */
}

.project-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Gère le débordement sur plusieurs lignes */
}

.project-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed), transform var(--transition-speed);
    font-size: 1.05em;
}

.project-link i {
    margin-right: 8px;
    font-size: 1.1em;
}

.project-link:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

.coming-soon {
    color: var(--secondary-color);
    font-style: italic;
    font-size: 0.9em;
    padding: 8px 12px;
    border: 1px dashed var(--secondary-color);
    border-radius: var(--border-radius-sm);
    opacity: 0.8;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 0;
}

.project-tag {
    background: rgba(74, 78, 105, 0.07);
    border: 1px solid rgba(74, 78, 105, 0.14);
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.76em;
    font-weight: 500;
    color: var(--primary-color);
}

.featured-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--secondary-color);
    color: #fff;
    font-size: 0.68em;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.project-card.is-featured {
    border-color: rgba(154, 140, 152, 0.45);
}

.project-card.research-card {
    border: 2px solid var(--secondary-color);
}

/* Experience Section */
.bg-light {
    background-color: var(--background-light); /* Définissez cette variable dans :root */
}

.experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.experience-card {
    background-color: var(--card-bg);
    padding: 35px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-light);
    text-align: left;
    border: 2px solid transparent;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color var(--transition-speed), background-color var(--transition-speed);
    position: relative; /* Pour l'effet de lueur */
    overflow: hidden;
}

.experience-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: opacity 0.45s ease-out, transform 0.8s ease-out;
}

.experience-card.is-visible::before {
    opacity: 1;
    transform: scaleY(1);
}

.experience-card:hover {
    background-color: #fff;
    box-shadow: 0 16px 38px rgba(74, 78, 105, 0.22), 0 0 0 4px rgba(154, 140, 152, 0.24);
    transform: translateY(-12px) scale(1.03);
    border-color: var(--secondary-color);
}

.current-experience {
    border: 2px solid rgba(74, 78, 105, 0.35);
    background:
        radial-gradient(circle at top right, rgba(154, 140, 152, 0.18), transparent 32%),
        var(--card-bg);
}

.current-experience:hover {
    border-color: var(--primary-color);
    box-shadow: 0 18px 42px rgba(74, 78, 105, 0.24), 0 0 0 5px rgba(74, 78, 105, 0.14);
}

.current-experience:hover .current-badge {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.current-experience::after {
    content: '';
    position: absolute;
    inset: -40%;
    background: conic-gradient(from 180deg, transparent, rgba(154, 140, 152, 0.18), transparent 30%);
    opacity: 0;
    transform: rotate(0deg);
    pointer-events: none;
}

.current-experience.is-visible::after {
    animation: current-sweep 4.5s ease-out 0.4s 1;
}

.current-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: rgba(74, 78, 105, 0.1);
    color: var(--primary-color);
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: background-color 0.28s ease-out, color 0.28s ease-out;
}

.current-badge span[aria-hidden="true"] {
    width: 9px;
    height: 9px;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
    background-color: #3cb87a;
    box-shadow: 0 0 0 0 rgba(60, 184, 122, 0.45);
    animation: live-pulse 1.8s ease-out infinite;
}

.current-experience h3,
.current-experience .company,
.current-experience .duration,
.current-experience li,
.current-experience .project-actions {
    position: relative;
    z-index: 1;
}

@keyframes live-pulse {
    70% { box-shadow: 0 0 0 10px rgba(154, 140, 152, 0); }
    100% { box-shadow: 0 0 0 0 rgba(154, 140, 152, 0); }
}

@keyframes current-sweep {
    0% {
        opacity: 0;
        transform: rotate(0deg);
    }
    18% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(120deg);
    }
}

.experience-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.experience-card .company {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.experience-card .duration {
    font-size: 0.95em;
    color: #777;
    margin-bottom: 20px;
    font-style: italic;
}

.experience-card ul {
    list-style: none;
    padding-left: 0;
    text-align: justify;
}

.experience-card ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px;
    line-height: 1.6;
    text-align: justify;
}

.experience-card ul li::before {
    content: '\2022';
    color: var(--secondary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    position: absolute;
    left: 0;
}

/* Contact Section */
.contact-section {
    background: linear-gradient(135deg, var(--background-dark), #3a3f5c);
    color: var(--text-light);
}

.contact-section h2 {
    color: var(--text-light);
}

.contact-section h2::after {
    background-color: var(--secondary-color);
}

.contact-intro {
    font-size: 1.2em;
    margin-bottom: 50px;
    color: rgba(242, 233, 228, 0.82);
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 860px;
    margin: 0 auto 60px;
}

.contact-card {
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(242, 233, 228, 0.16);
    border-radius: var(--border-radius-lg);
    padding: 34px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: background-color var(--transition-speed), transform var(--transition-speed), border-color var(--transition-speed);
}

.contact-card:hover {
    background-color: rgba(255, 255, 255, 0.13);
    border-color: var(--secondary-color);
    transform: translateY(-6px);
}

.contact-card i {
    font-size: 1.9em;
    color: var(--secondary-color);
    margin-bottom: 6px;
}

.contact-card-label {
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-color);
    font-weight: 700;
}

.contact-card a,
.contact-card .contact-card-value {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1em;
    transition: color var(--transition-speed);
}

.contact-card a:hover {
    color: var(--secondary-color);
}

.copy-hint {
    font-size: 0.75em;
    opacity: 0;
    margin-left: 5px;
    transition: opacity 0.2s;
    vertical-align: middle;
}
.contact-card:hover .copy-hint {
    opacity: 0.7;
}

.social-links {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.social-links a {
    color: rgba(242, 233, 228, 0.7);
    font-size: 3em;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.social-links a:hover {
    color: var(--secondary-color);
    transform: translateY(-5px);
}

/* Footer */
footer {
    background-color: var(--background-dark);
    color: var(--text-light);
    padding: 60px 0 0;
    box-shadow: 0 -3px 15px rgba(0,0,0,0.2);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(242, 233, 228, 0.1);
}

.footer-logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 2em;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.footer-tagline {
    font-size: 0.9em;
    opacity: 0.7;
    margin-bottom: 8px;
}

.footer-location {
    font-size: 0.85em;
    opacity: 0.5;
}

.footer-location i {
    margin-right: 6px;
    color: var(--secondary-color);
}

.footer-nav h4,
.footer-social h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8em;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.footer-nav ul,
.footer-social ul {
    list-style: none;
}

.footer-nav ul li,
.footer-social ul li {
    margin-bottom: 10px;
}

.footer-nav ul li a,
.footer-social ul li a {
    color: rgba(242, 233, 228, 0.6);
    text-decoration: none;
    font-size: 0.9em;
    transition: color var(--transition-speed);
}

.footer-nav ul li a:hover,
.footer-social ul li a:hover {
    color: var(--text-light);
}

.footer-social ul li a i {
    width: 18px;
    margin-right: 8px;
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding: 18px 0;
    font-size: 0.82em;
    opacity: 0.45;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Scroll to Top Button */
#scrollToTopBtn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 50%; /* Bouton rond */
    font-size: 1.5em;
    box-shadow: var(--shadow-light);
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

#scrollToTopBtn:hover {
    background-color: #3f435e; /* Version darken de primary-color */
    transform: translateY(-3px);
}

#scrollToTopBtn:active {
    transform: scale(0.92);
    box-shadow: 0 0 0 4px var(--primary-color);
}

/* Responsive Design */
@media (min-width: 1600px) {
    .container {
        max-width: 1500px;
    }
}

@media (min-width: 1400px) {
    .section h2 {
        font-size: 3.4em;
    }

    .hero-content h1 {
        font-size: 5.2em;
    }

    .typed-text-container {
        font-size: 1.9em;
    }

    .skills-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .experience-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-orbit {
        width: min(500px, 38vw);
    }

    .stats-grid {
        grid-template-columns: 1.25fr repeat(3, 1fr);
        gap: 30px;
    }
}

@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .about-info {
        position: static;
    }
    .section {
        padding: 80px 0;
    }
    .section h2 {
        font-size: 2.5em;
    }
    .timeline {
        margin-top: 60px;
        border-left: none; /* Enlève la ligne verticale sur mobile */
        padding-left: 0;
    }
    .timeline::before,
    .timeline::after {
        display: none;
    }
    .timeline-item {
        margin-left: 0;
        text-align: center;
    }
    .timeline-item::before {
        display: none; /* Cache le cercle sur mobile */
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-grid, .experience-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-cards {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-current {
        grid-column: 1 / -1;
    }

    .hero-content h1 {
        font-size: 3.5em;
    }
    .hero-content p {
        font-size: 1.4em;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 48px;
        text-align: center;
        padding: 90px 0 70px;
    }

    .hero-copy {
        max-width: 760px;
        margin: 0 auto;
    }

    .hero-objective {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-orbit {
        width: min(390px, 78vw);
    }
}

@media (max-width: 768px) {
    .hero-section {
        height: auto;
        min-height: 100vh;
    }
    .hero-content h1 {
        font-size: 2.8em;
    }
    .typed-text-container, .hero-content p {
        font-size: 1.1em;
    }

    .typed-text-container {
        max-width: 100%;
        white-space: normal;
        height: auto;
        min-height: 1.6em;
    }

    .hero-orbit {
        width: min(310px, 86vw);
        justify-self: center;
        margin-right: 0;
    }

    .profile-core {
        width: 145px;
    }

    .orbit-one {
        width: 205px;
        height: 205px;
    }

    .orbit-two {
        width: 260px;
        height: 260px;
    }

    .orbit-three {
        width: 310px;
        height: 310px;
    }

    .orbit-item {
        width: 38px;
        height: 38px;
        margin: -19px;
        font-size: 1.1em;
    }

    .orbit-item.python { transform: rotate(18deg) translateX(102.5px) rotate(-18deg); }
    .orbit-item.database { transform: rotate(198deg) translateX(102.5px) rotate(-198deg); }
    .orbit-item.pytorch { transform: rotate(68deg) translateX(130px) rotate(-68deg); }
    .orbit-item.pandas { transform: rotate(248deg) translateX(130px) rotate(-248deg); }
    .orbit-item.docker { transform: rotate(130deg) translateX(155px) rotate(-130deg); }
    .orbit-item.brain { transform: rotate(310deg) translateX(155px) rotate(-310deg); }

    nav {
        padding: 0 15px;
    }
    .logo {
        font-size: 1.5em;
    }

    .nav-links {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 70%; /* Plus large sur mobile */
        background-color: var(--background-dark);
        flex-direction: column;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.5s ease-in-out;
        padding-top: 100px;
        pointer-events: none;
        z-index: 999;
    }
    .nav-links li {
        margin: 25px 0;
    }
    .nav-links a {
        font-size: 1.3em;
    }
    .lang-switch {
        margin-left: auto;
        margin-right: 0;
        font-size: 0.78em;
        padding: 5px 8px;
    }
    #theme-toggle {
        margin-left: 8px;
        margin-right: 8px;
        width: 32px;
        height: 32px;
        font-size: 0.85em;
    }
    .burger {
        display: block;
        z-index: 1001;
    }
    .nav-active {
        pointer-events: auto;
        transform: translateX(0%);
    }

    .section {
        padding: 60px 0;
    }
    .section h2 {
        font-size: 2em;
        margin-bottom: 40px;
    }

    .btn-primary, .btn-secondary {
        padding: 12px 25px;
        font-size: 0.9em;
    }

    .contact-cards {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    .social-links a {
        font-size: 2.5em;
    }

    .skills-grid,
    .projects-grid,
    .experience-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-current {
        grid-column: auto;
    }

    .project-card::after {
        position: static;
        display: block;
        opacity: 1;
        transform: none;
        margin-top: 18px;
    }

    .project-card[data-proof] {
        padding-bottom: 35px;
    }

    .project-filters {
        margin-top: -18px;
    }
}

/* Burger Animation */
.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.toggle .line2 {
    opacity: 0;
}
.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Keyframe for nav links fade in */
@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0px);
    }
}

/* --- NOUVELLES ANIMATIONS AU SCROLL ET EFFETS --- */

/* Base pour les éléments qui vont apparaître */
.fade-in, .fade-in-left, .fade-in-right, .slide-up-btn, .reveal-items > *, .reveal-section {
    opacity: 0;
    transform: translateY(20px); /* Pour les slides-up par défaut */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Effets spécifiques */
.fade-in-left {
    transform: translateX(-50px);
}

.fade-in-right {
    transform: translateX(50px);
}

.slide-up-btn {
    transform: translateY(30px);
}

/* Classe pour rendre visible après l'animation JS */
.is-visible {
    opacity: 1;
    transform: translateY(0);
    transform: translateX(0);
}

/* Scroll progress bar */
#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 2000;
    transition: width 0.1s linear;
}

/* Active nav link */
.nav-links a.nav-active {
    color: var(--secondary-color);
}

.nav-links a.nav-active::after {
    width: 100%;
}

/* Skip link accessibilité */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 0.9em;
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
    text-decoration: none;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: none;
}

/* Focus visible */
:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
    border-radius: 3px;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 4px;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 0 0 6px rgba(154, 140, 152, 0.2);
}

/* Toast notification */
#toast {
    position: fixed;
    bottom: 90px;
    right: 30px;
    background-color: var(--background-dark);
    color: var(--text-light);
    padding: 12px 22px;
    border-radius: var(--border-radius-sm);
    font-size: 0.95em;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    z-index: 1500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    border-left: 3px solid var(--secondary-color);
}

#toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}


@media (max-width: 768px) {
    #toast {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        text-align: center;
        font-size: 0.9em;
    }

    #toast.is-visible {
        transform: translateX(-50%) translateY(0);
    }
}

/* Contact form */
.contact-form {
    max-width: 600px;
    margin: 0 auto 60px;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(242, 233, 228, 0.22);
    background-color: rgba(255, 255, 255, 0.07);
    color: var(--text-light);
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    transition: border-color var(--transition-speed), background-color var(--transition-speed);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(242, 233, 228, 0.4);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.11);
}

.form-group textarea {
    resize: vertical;
    min-height: 130px;
}

.contact-form .btn-primary {
    width: 100%;
    text-align: center;
    margin: 0;
}

/* Validation du formulaire */
.form-group .error-msg {
    display: block;
    font-size: 0.8em;
    color: #e57373;
    margin-top: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.25s ease;
}

.form-group .error-msg.is-visible {
    max-height: 30px;
    opacity: 1;
}

.form-group input.is-invalid,
.form-group textarea.is-invalid {
    border-color: #e57373 !important;
}

.form-group input.is-valid,
.form-group textarea.is-valid {
    border-color: var(--secondary-color) !important;
}

/* Navbar cachée au scroll vers le bas */
header.nav-hidden {
    transform: translateY(-100%);
}

/* Parcours section subtitles */
.parcours-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.9em;
    color: var(--primary-color);
    margin: 70px 0 35px;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}

.parcours-subtitle::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.2em;
    }

    .typed-text-container {
        font-size: 0.95em;
    }

    .tagline {
        font-size: 1em;
    }

    .section h2 {
        font-size: 1.7em;
    }

    .skills-grid,
    .projects-grid,
    .experience-grid {
        grid-template-columns: 1fr;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 0.85em;
    }

    .contact-card {
        padding: 24px 16px;
    }

    .social-links a {
        font-size: 2em;
    }

    .social-links {
        gap: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .fade-in,
    .fade-in-left,
    .fade-in-right,
    .slide-up-btn,
    .reveal-items > *,
    .reveal-section {
        opacity: 1;
        transform: none;
    }

    .timeline::before {
        height: 100%;
    }
}
