:root {
    --bg-color: #0b0f19;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --primary: #1a9cb8;
    /* Le bleu cyan du logo AYO */
    --secondary: #4eb5cf;
    /* Un cyan plus clair pour des dégradés éclatants */
    --card-bg: #1e293b;
    --nav-bg: rgba(11, 15, 25, 0.8);
    --dot-pattern: rgba(255, 255, 255, 0.04);
    --scrollbar-thumb: rgba(255, 255, 255, 0.15);
}

body.light-mode {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #475569;
    --primary: #0284c7;
    /* Un cyan légèrement plus foncé pour rester lisible sur fond blanc */
    --secondary: #06b6d4;
    --card-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --dot-pattern: rgba(0, 0, 0, 0.05);
    --scrollbar-thumb: rgba(0, 0, 0, 0.2);
}

/* --- Overrides spécifiques au Mode Clair --- */
body.light-mode .project-card,
body.light-mode .carte-visite-container {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.light-mode .timeline-content,
body.light-mode .logo,
body.light-mode .skill-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.8));
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .skill-card .skill-icon {
    background: rgba(2, 132, 199, 0.1);
    border-color: rgba(2, 132, 199, 0.2);
    box-shadow: 0 0 15px rgba(2, 132, 199, 0.1);
}

body.light-mode .skill-progress-circular {
    background: rgba(241, 245, 249, 0.8);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
}

body.light-mode .filter-btn {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .filter-btn:hover,
body.light-mode .filter-btn.active {
    color: #fff;
}

body.light-mode .timeline-dot {
    background: #fff;
}

body.light-mode .project-image {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .project-category {
    background: rgba(255, 255, 255, 0.9);
}

body.light-mode .tech-tag {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .project-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .circle-bg {
    stroke: rgba(0, 0, 0, 0.1);
}

body.light-mode .lightbox {
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .lightbox-close {
    color: #333;
}

body.light-mode header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .gallery-content {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    /* Empêche l'en-tête de cacher les titres au clic */
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: radial-gradient(var(--dot-pattern) 1px, transparent 1px);
    background-size: 30px 30px;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.badge {
    font-family: 'Poppins', sans-serif;
}

/* --- Personnalisation de la Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Effet de lueur en arrière-plan */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.05), transparent 60%);
    z-index: -1;
}

header {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.8rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(11, 15, 25, 0.9));
    backdrop-filter: blur(15px);
    border: 2px solid rgba(26, 156, 184, 0.4);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(26, 156, 184, 0.2), inset 0 0 10px rgba(26, 156, 184, 0.1);
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(26, 156, 184, 0.4), inset 0 0 15px rgba(26, 156, 184, 0.2);
    border-color: var(--secondary);
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    margin-top: 2px;
}

.logo-main {
    display: flex;
    align-items: center;
    line-height: 1;
}

.logo-ay {
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--text-color);
}

.logo-o {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--primary);
    margin-left: -2px;
}

.logo-start {
    font-size: 0.32rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-top: 2px;
    margin-right: -3px;
    /* Compense le letter-spacing pour le centrage */
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.social-nav-link {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-nav-link:hover {
    color: #1877F2 !important;
    /* Couleur officielle de Facebook au survol */
    transform: scale(1.1);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
}

.theme-toggle:hover {
    color: var(--primary);
    transform: rotate(20deg);
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 100px 5rem 0;
    margin-top: 0;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    text-align: left;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    letter-spacing: 0.5px;
    background: rgba(26, 156, 184, 0.1);
    border: 1px solid rgba(26, 156, 184, 0.3);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(3rem, 5.5vw, 5.5rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
}

.subtitle {
    min-height: 2rem;
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 1.2rem;
    background-color: var(--primary);
    animation: blink 0.8s infinite;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-arrow {
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.btn:hover .btn-arrow {
    transform: translateX(5px);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(26, 156, 184, 0.1);
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.glowing-orb {
    position: absolute;
    width: 380px;
    height: 380px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    animation: float 6s ease-in-out infinite;
    z-index: 0;
}

.profile-img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: float 6s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.projects-section {
    padding: 6rem 2rem;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: auto;
}

.projects-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    margin-bottom: 2.5rem;
}

/* --- Filtres Projets --- */
.project-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(26, 156, 184, 0.3);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: start;
}

.project-card {
    /* Prépare les cartes pour l'animation JS */
    will-change: transform, opacity;
}

.project-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 0px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-top-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(26, 156, 184, 0.15);
}

.project-card.hide {
    display: none;
}

.project-image {
    position: relative;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 0;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(11, 15, 25, 0.9) 0%, transparent 60%);
    opacity: 0.8;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-image img {
    width: 100%;
    height: 180px;
    /* Fixe une hauteur uniforme pour toutes les images */
    object-fit: cover;
    /* Recadre l'image pour qu'elle remplisse l'espace sans se déformer */
    object-position: top;
    /* Si l'image est très longue, on garde toujours le haut visible */
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image::after {
    opacity: 0.3;
}

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

/* --- Overlay "Voir la galerie" --- */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.4s ease;
    color: #fff;
    pointer-events: none;
    /* Laisse le clic passer en dessous */
    z-index: 2;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay i,
.project-overlay span {
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-overlay i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.project-overlay span {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition-delay: 0.05s;
}

.project-card:hover .project-overlay i,
.project-card:hover .project-overlay span {
    transform: translateY(0);
}

/* Conteneur pour aligner le titre et la catégorie sur la même ligne */
.project-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.project-category {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(5px);
    color: var(--primary);
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(26, 156, 184, 0.3);
    white-space: nowrap;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    gap: 0.5rem;
}

.project-tech {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tech-tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--tech-color, var(--text-color));
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.6rem;
    font-weight: 600;
    border: 1px solid var(--tech-color, rgba(255, 255, 255, 0.1));
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: var(--tech-color, var(--primary));
    border-color: var(--tech-color, var(--primary));
    color: #fff !important;
    box-shadow: 0 4px 10px var(--tech-color, transparent);
    transform: translateY(-2px);
}

.project-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0;
    color: var(--text-color);
}

.project-card p {
    color: var(--text-muted);
    font-size: 11px;
}

/* --- Progression Circulaire --- */
.project-progress-circular {
    position: relative;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-progress-circular svg {
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.progress-text {
    position: absolute;
    font-size: 0.40rem;
    font-weight: 700;
    color: var(--text-color);
}

/* --- Section Parcours (Timeline) --- */
.parcours-section {
    padding: 6rem 2rem;
    padding: 4rem 2rem;
    max-width: 1000px;
    margin: auto;
}

.parcours-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    margin-bottom: 2.5rem;
}

.timeline {
    position: relative;
    padding-left: 0;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: linear-gradient(180deg, transparent, var(--primary), var(--secondary), transparent);
    opacity: 0.5;
}

.timeline-item {
    position: relative;
    margin-bottom: 3.5rem;
    will-change: transform, opacity;
    width: 50%;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 3rem;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 3rem;
}

.timeline-dot {
    position: absolute;
    top: 30px;
    width: 30px;
    height: 30px;
    background: var(--bg-color);
    border: 2px solid var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(26, 156, 184, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-dot {
    left: auto;
    right: -15px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -15px;
}

.timeline-dot::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--secondary);
    transition: all 0.4s ease;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    border-color: var(--secondary);
    box-shadow: 0 0 25px var(--secondary);
    background: rgba(26, 156, 184, 0.2);
}

.timeline-item:hover .timeline-dot::after {
    transform: scale(1.5);
    background: #fff;
    box-shadow: 0 0 15px #fff;
}

.timeline-content {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    opacity: 0.6;
    transition: all 0.4s ease;
}

.timeline-content:hover {
    transform: translateX(15px);
    border-color: rgba(26, 156, 184, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(26, 156, 184, 0.15);
}

.timeline-item:nth-child(odd) .timeline-content {
    text-align: right;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    left: auto;
    right: 0;
}

.timeline-item:nth-child(odd) .timeline-content:hover {
    transform: translateX(-15px);
}

.timeline-content:hover::before {
    opacity: 1;
    width: 100%;
    z-index: -1;
    background: linear-gradient(90deg, rgba(26, 156, 184, 0.15), transparent);
}

.timeline-item:nth-child(odd) .timeline-content:hover::before {
    background: linear-gradient(-90deg, rgba(26, 156, 184, 0.15), transparent);
}

.timeline-content h3 {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.timeline-content h4 {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.timeline-item:nth-child(odd) h4 {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.institution-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: 15px;
    border-radius: 100%;
    background: #ffffff;
    padding: 5px;
    border: 2px solid rgba(26, 156, 184, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timeline-item:nth-child(odd) .institution-logo {
    margin-right: 0;
    margin-left: 15px;
}

.timeline-item:hover .institution-logo {
    transform: scale(1.15) rotate(-5deg) translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(26, 156, 184, 0.4);
}

.timeline-content p {
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.5;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.timeline-content .date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1.2rem;
    background: linear-gradient(90deg, rgba(26, 156, 184, 0.15), transparent);
    border-left: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 0 50px 50px 0;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-item:nth-child(odd) .date {
    border-left: none;
    border-right: 2px solid var(--primary);
    border-radius: 50px 0 0 50px;
    flex-direction: row-reverse;
}

.timeline-content .date::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(26, 156, 184, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(26, 156, 184, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(26, 156, 184, 0);
    }
}

/* --- Section Compétences --- */
.competences-section {
    padding: 6rem 2rem;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: auto;
}

.competences-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    margin-bottom: 2.5rem;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem 2rem;
    border-radius: 0px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    will-change: transform, opacity;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    opacity: 0;
    transition: all 0.4s ease;
}

.skill-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(26, 156, 184, 0.15);
    border-color: rgba(26, 156, 184, 0.3);
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-card .skill-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(26, 156, 184, 0.1);
    border: 1px solid rgba(26, 156, 184, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 0 20px rgba(26, 156, 184, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.skill-card:hover .skill-icon {
    transform: scale(1.1) rotate(5deg);
    background: rgba(26, 156, 184, 0.2);
    box-shadow: 0 0 30px rgba(26, 156, 184, 0.4);
    border-color: var(--primary);
}

.skill-card h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.skill-progress-circular {
    position: relative;
    width: 65px;
    height: 65px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 25, 0.4);
    border-radius: 50%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.skill-progress-circular svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 4px rgba(26, 156, 184, 0.4));
    transition: filter 0.4s ease;
}

.skill-card:hover .skill-progress-circular svg {
    filter: drop-shadow(0 0 8px var(--primary));
}

.skill-progress-circular .progress-text {
    font-size: 0.85rem;
    font-weight: 700;
}

/* S'active quand la carte apparaît à l'écran grâce au Javascript */
.skill-card.visible .circle,
.project-card.visible .circle {
    stroke-dashoffset: var(--target-offset);
}

/* --- Wrapper CV & Carte de Visite --- */
.documents-wrapper {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: auto;
    padding: 6rem 2rem;
    padding: 4rem 2rem;
    gap: 4rem;
    align-items: center;
    justify-content: center;
}

/* --- Section CV --- */
.cv-section {
    flex: 1;
    min-width: 280px;
}

.cv-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 2.5rem;
}

.cv-section h2 {
    font-size: 2.5rem;
    margin-bottom: 0;
}

.cv-download-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 156, 184, 0.3);
}

.cv-download-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(26, 156, 184, 0.5);
}

.cv-iframe {
    width: 100%;
    height: 33n 0px;
    border: none;
    border-radius: 0px;
    background-color: rgba(30, 41, 59, 0.4);
    margin-bottom: 0rem;
}

/* --- Section Carte de Visite --- */
.carte-visite-section {
    text-align: center;
    flex: 1;
    min-width: 280px;
}

.carte-visite-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    margin-bottom: 2.5rem;
}

.carte-visite-container {
    display: inline-block;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.carte-visite-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 20px rgba(26, 156, 184, 0.2);
}

.carte-visite-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    cursor: pointer;
}

/* --- Boutons Flottants de Contact --- */
.floating-contact {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
    /* Permet de toujours rester au-dessus de tout le reste */
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.float-btn.whatsapp {
    background-color: #25D366;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.float-btn.email {
    background-color: #ea4335;
    box-shadow: 0 4px 15px rgba(234, 67, 53, 0.4);
}

.float-btn.phone {
    background-color: var(--primary);
    box-shadow: 0 4px 15px rgba(26, 156, 184, 0.4);
}

.float-btn:hover {
    transform: translateY(-5px) scale(1.1);
}

.float-btn.whatsapp:hover {
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

.float-btn.email:hover {
    box-shadow: 0 8px 25px rgba(234, 67, 53, 0.6);
}

.float-btn.phone:hover {
    box-shadow: 0 8px 25px rgba(26, 156, 184, 0.6);
}

/* --- Lightbox Photo de profil --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--primary);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    padding: 20px;
    transition: color 0.3s ease;
    z-index: 2001;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--primary);
}

/* --- Modal Galerie Intermédiaire --- */
.gallery-modal {
    z-index: 1990;
    /* Juste en dessous du plein écran (2000) */
}

.gallery-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    border-radius: 16px;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-modal.active .gallery-content {
    transform: scale(1);
}

.gallery-title {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
    font-family: 'Poppins', sans-serif;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.gallery-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, 0.1);
}

.gallery-thumb:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* --- Animations JavaScript --- */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(26, 156, 184, 0.12) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: -2;
}

.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Adaptation pour les téléphones portables */
@media (max-width: 900px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(11, 15, 25, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        transform: translateY(-150%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        /* Ajoute une ombre au menu déroulé */
    }

    body.light-mode .nav-links {
        background: rgba(255, 255, 255, 0.95);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        display: block;
        padding: 0.5rem 2rem;
        font-size: 1.1rem;
    }

    .logo {
        width: 42px;
        height: 42px;
    }

    .logo-ay,
    .logo-o {
        font-size: 0.9rem;
    }

    .logo-start {
        font-size: 0.25rem;
    }

    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding: 100px 2rem 2rem;
        gap: 2rem;
    }

    .hero-content {
        text-align: center;
    }

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

    .glowing-orb {
        width: 280px;
        height: 280px;
    }

    .profile-img {
        width: 260px;
        height: 260px;
    }

    .timeline {
        padding-left: 2rem;
    }

    .timeline::before {
        left: 0;
        transform: none;
    }

    .timeline-item {
        width: 100%;
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: -15px;
        right: auto;
    }

    .timeline-item:nth-child(odd) .timeline-content {
        text-align: left;
    }

    .timeline-item:nth-child(odd) h4 {
        justify-content: flex-start;
        flex-direction: row;
    }

    .timeline-item:nth-child(odd) .institution-logo {
        margin-right: 15px;
        margin-left: 0;
    }

    .timeline-item:nth-child(odd) .date {
        border-left: 2px solid var(--primary);
        border-right: none;
        border-radius: 0 50px 50px 0;
        flex-direction: row;
    }

    .timeline-item:nth-child(odd) .timeline-content::before {
        left: 0;
        right: auto;
    }

    .timeline-item:nth-child(odd) .timeline-content:hover {
        transform: translateX(15px);
    }

    .timeline-item:nth-child(odd) .timeline-content:hover::before {
        background: linear-gradient(90deg, rgba(26, 156, 184, 0.15), transparent);
    }

    .cv-iframe {
        height: 400px;
    }
}

/* Adaptation pour les TRES petits téléphones (iPhone SE, etc.) */
@media (max-width: 600px) {
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    nav {
        padding: 0 1rem;
    }

    .hero {
        padding: 90px 1rem 2rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .glowing-orb {
        width: 200px;
        height: 200px;
    }

    .profile-img {
        width: 180px;
        height: 180px;
    }

    .projects-section,
    .parcours-section,
    .competences-section,
    .documents-wrapper {
        padding: 4rem 1rem;
        padding: 2.5rem 1rem;
    }

    .project-grid,
    .skill-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        padding: 1rem;
    }

    .project-image {
        margin: -1rem -1rem 1rem -1rem;
    }

    .timeline {
        padding-left: 2rem;
    }

    .timeline-dot {
        left: -15px;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .timeline-content h3 {
        font-size: 1.2rem;
    }

    .timeline-content h4 {
        font-size: 0.95rem;
    }

    .timeline-content .date {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
    }

    /* Ajuster la hauteur de l'iframe du CV sur mobile pour qu'il soit visible */
    .cv-iframe {
        height: 350px;
    }

    .floating-contact {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }

    .float-btn {
        width: 45px;
        height: 45px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}

/* --- Pied de page (Footer) --- */
.footer {
    background: rgba(11, 15, 25, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
    position: relative;
    z-index: 10;
}

body.light-mode .footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 320px;
}

.footer-links h3,
.footer-social h3 {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-links h3::after,
.footer-social h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary);
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.footer-links ul li a::before {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    color: var(--primary);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.footer-links ul li a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.footer-links ul li a:hover::before {
    transform: translateX(3px);
}

.social-icons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .social-icons a {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.social-icons a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-5px) rotate(8deg);
    box-shadow: 0 8px 20px rgba(26, 156, 184, 0.4);
    border-color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

body.light-mode .footer-bottom {
    border-top-color: rgba(0, 0, 0, 0.1);
}

/* Adaptation Mobile pour le Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand p {
        margin: 1.5rem auto 0;
    }

    .footer-links h3::after,
    .footer-social h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-icons {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand .logo {
        margin: 0 auto;
    }
}

/* --- Animation Sphère 3D (TagCloud) --- */
.tech-sphere-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto 5rem;
    width: 100%;
    overflow: visible;
}

.tech-sphere {
    position: relative;
}

.tagcloud {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
}

/* On évite d'utiliser transform, car la librairie l'utilise pour la 3D ! */
.tagcloud--item {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.tagcloud--item:hover {
    border-color: var(--primary);
    color: #fff;
    background: rgba(30, 41, 59, 1);
    box-shadow: 0 0 20px rgba(26, 156, 184, 0.5);
    z-index: 100 !important;
    /* Pour passer par-dessus les autres au survol */
}

.tagcloud--item i,
.tagcloud--item span {
    font-size: 1.5rem;
}

body.light-mode .tagcloud--item {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

body.light-mode .tagcloud--item:hover {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 20px rgba(2, 132, 199, 0.3);
}