:root {
    --bg: #F3F5FB;
    --paper: #FFFFFF;
    --ink: #0E1630;
    --navy: #232F4B;
    --royal: #1F3FE0;
    --royal-deep: #142BA8;
    --royal-soft: #DDE4FC;
    --mute: #5A6480;
    --line: #CBD3EA;
    --on-royal: #FFFFFF;
    --f-display: "Unbounded", "Arial Black", system-ui, sans-serif;
    --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --f-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    --blob-a: 62% 38% 55% 45% / 48% 58% 42% 52%;
    --blob-b: 38% 62% 44% 56% / 58% 42% 58% 42%;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 17px;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}
a { color: inherit; text-decoration: none; }
/* Accessibilité : navigation au clavier */
a:focus-visible,
button:focus-visible {
    outline: 3px solid #8FA3FF;
    outline-offset: 4px;
    border-radius: 4px;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Styles de texte (surlignage pro) */
.highlight { background: linear-gradient(180deg, transparent 55%, var(--royal-soft) 55%); font-weight: 500; padding: 0 4px;}
.highlight-soft { background: linear-gradient(180deg, transparent 55%, rgba(221, 228, 252, 0.5) 55%); font-style: normal; }

/* Navigation Desktop */
.navbar { position: sticky; top: 0; z-index: 50; background: rgba(243, 245, 251, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 15px 20px; }
.navbar-in { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; position: relative; }
.logo { font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; color: var(--royal); }
.logo i { font-weight: 300; }
.nav-links { display: flex; gap: 20px; transition: all 0.3s ease; }
.nav-links a { font-family: var(--f-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--mute); transition: color 0.2s; }
.nav-links a:hover { color: var(--royal); }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--royal); cursor: pointer; padding: 5px; }

/* Global */
.bg-paper { background: var(--paper); }
.bg-light { background: var(--bg); }
.section-padding { padding-block: 5rem; }
.eyebrow { font-family: var(--f-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .16em; color: var(--royal); display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.eyebrow::before { content: ""; width: 2.2rem; height: 2px; background: var(--royal); }
h2 { font-family: var(--f-display); font-weight: 300; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; margin-bottom: 3rem; }
h2 b { font-weight: 800; color: var(--royal); }

/* Hero Desktop */
.hero-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem; align-items: center; position: relative; z-index: 5;}
.badge-stage { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: 99px; padding: 0.5rem 1.2rem; font-family: var(--f-mono); font-size: 0.8rem; margin-bottom: 1.6rem; background: var(--paper); color: var(--ink); font-weight: 500; }
.hero-text { grid-column: 1 / span 7; z-index: 2; }
.name { font-family: var(--f-display); font-size: clamp(2.5rem, 8vw, 6rem); line-height: 1; margin-bottom: 20px;}
.name .l { font-weight: 300; display: block; }
.name .b { font-weight: 800; color: var(--royal); margin-left: 2rem; display: block;}
.lede { font-size: 1.2rem; }

.floating-element { position: absolute; color: var(--royal-soft); font-size: 3rem; z-index: 0; opacity: 0.6; animation: float 6s ease-in-out infinite; }
.float-1 { top: 10%; left: 5%; animation-delay: 0s; }
.float-2 { bottom: 20%; left: 40%; animation-delay: 2s; font-size: 4rem;}
.float-3 { top: 20%; right: 10%; animation-delay: 4s; }

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.hero-photo { grid-column: 8 / span 5; position: relative; aspect-ratio: 1; }
.blob { position: absolute; inset: 0; background: var(--royal); border-radius: var(--blob-a); animation: morph 14s ease-in-out infinite alternate; }
.blob.two { inset: 5%; background: var(--royal-soft); z-index: -1; animation-duration: 18s; animation-direction: alternate-reverse; }
.portrait { position: absolute; inset: 10%; z-index: 1; border-radius: 50%; border: 4px solid var(--royal); background-size: cover; background-position: center; }
.sticker { position: absolute; z-index: 3; font-family: var(--f-mono); font-size: .7rem; background: var(--paper); border: 1.5px solid var(--ink); padding: .4rem .8rem; border-radius: 99px; }
.s1 { bottom: 10%; left: -10%; transform: rotate(-5deg); }
.s2 { top: 5%; right: 0; transform: rotate(5deg); }
.wave { width: 100%; height: 100px; margin-top: 2rem; }

@keyframes morph {
    0% { border-radius: 62% 38% 55% 45% / 48% 58% 42% 52%; }
    50% { border-radius: 42% 58% 38% 62% / 60% 40% 60% 40%; }
    100% { border-radius: 55% 45% 62% 38% / 40% 56% 44% 60%; }
}

/* Profil */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.about-copy p { font-size: 1.1rem; margin-bottom: 1.5rem; line-height: 1.8;}
.method { display: flex; flex-direction: column; gap: 1rem; }
.step { padding: 1rem 1.5rem; background: var(--bg); border-radius: 12px; border-left: 4px solid var(--royal); transition: transform 0.2s;}
.step:hover { transform: translateX(5px); }
.step i { font-family: var(--f-mono); color: var(--royal); font-size: 0.9rem; font-style: normal; margin-bottom: 5px; display: block;}
.step strong { font-family: var(--f-display); font-size: 1.1rem; margin-bottom: 5px; display: block;}
.step span { opacity: 0.8; font-size: 0.95rem;}

/* Compétences */
.tracks-sec { background: var(--ink); color: #fff; padding-block: 5rem;}
.tracks-sec h2 b, .tracks-sec .eyebrow { color: #8FA3FF; }
.tracks-sec .eyebrow::before { background: #8FA3FF; }
.tracks { margin-top: 2rem; width: 100%; overflow: hidden;}
.lane-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; border-top: 1px solid #2A3558; height: 80px;}
.lane-label span { font-family: var(--f-mono); font-weight: 700; color: #fff; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; }
.lane { position: relative; height: 100%; }

.clip { position: absolute; top: 15px; height: 50px; background: var(--royal); border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 15px; font-size: 0.9rem; font-weight: 600; white-space: nowrap; color: white; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s; }
.brand-icon { width: 22px; height: 22px; object-fit: contain; }
.clip.alt { background: #4B66E8; }
.clip.soft { background: #2B3F9C; }
.clip:hover { transform: scale(1.05) translateY(-5px); z-index: 10; }

/* Compétences complémentaires */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.skill-card {
    background: #192442;
    border: 1px solid #344269;
    border-radius: 14px;
    padding: 1.7rem;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: #8FA3FF;
}

.skill-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(143, 163, 255, 0.14);
    color: #8FA3FF;
    border-radius: 10px;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
}

.skill-card h3 {
    font-family: var(--f-display);
    font-size: 1rem;
    color: #fff;
    margin-bottom: 1rem;
}

.skill-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.skill-card li {
    color: #C5CDE2;
    font-size: 0.9rem;
    line-height: 1.5;
    padding-left: 1rem;
    position: relative;
}

.skill-card li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #8FA3FF;
}


/* Projets */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; text-align: left; cursor: pointer; transition: transform 0.2s; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.card .media { aspect-ratio: 16 / 9; height: auto; background: var(--bg); border-radius: 8px; margin-bottom: 1.5rem; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;}
.card h3 { font-family: var(--f-display); font-size: 1.1rem; margin: 1rem 0; line-height: 1.2;}
.pill { font-family: var(--f-mono); font-size: 0.7rem; background: var(--royal-soft); color: var(--royal); padding: 4px 10px; border-radius: 20px; margin-right: 5px; text-transform: uppercase; display: inline-block; margin-bottom: 5px;}
.more { font-family: var(--f-mono); font-size: 0.8rem; color: var(--royal); font-weight: bold; }

.card .media.v-youtube-thumb {
    background-image: url("Minia.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
}
.play-overlay { position: absolute; inset: 0; background: transparent; display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
.card:hover .play-overlay { background: rgba(0, 0, 0, 0.18); }
.play-overlay i { font-size: 1.8rem; color: #fff; background: rgba(0, 0, 0, 0.7); width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding-left: 5px; transition: transform 0.3s, background 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.3);}
.card:hover .play-overlay i { transform: scale(1.1); background: var(--royal); }

.v-aff { background: var(--royal) !important; color: white;}
.v-cine {
    background: var(--royal-soft) !important;
}

/* Parcours */
.parcours-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.path-title { font-family: var(--f-mono); font-size: 1rem; color: var(--royal); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--line); }
.path { position: relative; padding-left: 2rem; display: flex; flex-direction: column; gap: 2.5rem; }
.path::before { content: ""; position: absolute; left: -14px; top: 5px; bottom: 0; width: 2px; background: var(--line); }
.pt { position: relative; padding-left: 45px;}
.pt-logo { position: absolute; left: -34px; top: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); border: 2px solid var(--royal); box-shadow: 0 2px 5px rgba(0,0,0,0.1); background-size: cover; background-position: center; }
.when { font-family: var(--f-mono); font-size: 0.8rem; color: var(--royal); font-weight: 500; display: block; margin-bottom: 5px; }
.pt h4 { font-family: var(--f-display); font-size: 1.1rem; font-weight: 500; margin-bottom: 5px; }
.pt p { font-size: 0.95rem; color: var(--mute); }

/* Contact */
.contact { position: relative; background: var(--royal); color: var(--on-royal); padding-block: clamp(4rem, 10vw, 8rem) 2rem; text-align: left; }
.contact::before, .contact::after { content: ""; position: absolute; background: var(--royal-deep); z-index: 0; }
.contact::before { width: 42vw; max-width: 520px; aspect-ratio: 1; right: -10vw; top: -12%; border-radius: var(--blob-a); }
.contact::after { width: 22vw; max-width: 260px; aspect-ratio: 1; left: -6vw; bottom: 8%; border-radius: var(--blob-b); opacity: .7; }
.contact .wrap { position: relative; z-index: 1; }
.contact .eyebrow { color: #fff; justify-content: flex-start; }
.contact .eyebrow::before { background: #fff; }
.contact h2 { color: #fff; font-size: clamp(2.2rem, 6vw, 4rem); margin: 1rem 0; line-height: 1.1; }
.contact-desc { font-size: 1.15rem; line-height: 1.6; max-width: 50ch; margin-bottom: 2.5rem; opacity: 0.9; }
.contact h2 b { color: #fff; font-weight: 800; }
.mail-row { margin-bottom: 3rem; display: flex; justify-content: flex-start; }
.mail-link { font-family: var(--f-mono); font-size: clamp(1.2rem, 3vw, 2rem); color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 15px; padding-bottom: 5px; border-bottom: 2px solid transparent; transition: all 0.3s ease; }
.mail-link i { font-size: 0.8em; transform: translateX(0); transition: transform 0.3s ease; }
.mail-link:hover { border-bottom: 2px solid #fff; }
.mail-link:hover i { transform: translateX(10px); }
.btns { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: flex-start; margin-bottom: 0; }
.btn { font-family: var(--f-mono); font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; text-decoration: none; display: inline-flex; align-items: center; padding: 12px 28px; border-radius: 50px; border: 2px solid #fff; background: transparent; color: #fff; font-weight: 500; transition: all 0.2s ease; }
.btn i { margin-right: 5px; font-size: 1.1em; }
.btn:hover { background: #fff; color: var(--royal); transform: translateY(-3px); }
.btn.solid { background: #fff; color: var(--royal); }
.btn.solid:hover { background: var(--royal-soft); }
.foot { margin-top: 5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .06em; opacity: .8; border-top: none; padding-top: 0;}

/* MODALE PROJETS */
dialog { border: none; border-radius: 16px; padding: 0; max-width: 900px; width: 95%; margin: auto; background: var(--paper); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); overflow: hidden; }
dialog::backdrop { background: rgba(14, 22, 48, 0.8); backdrop-filter: blur(5px); }
.d-close { position: absolute; right: 20px; top: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 50%; width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer; z-index: 10; transition: background 0.2s; }
.d-close:hover { background: var(--bg); }

.d-layout { display: grid; grid-template-columns: 1fr 1fr; max-height: 85vh; }
.d-media-pane { background: var(--bg); display: flex; align-items: center; justify-content: center; position: relative; overflow-y: auto; padding: 20px;}
.d-text-pane { padding: 3rem 2.5rem; display: flex; flex-direction: column; gap: 1.5rem; overflow-y: auto;}
.d-text-pane h3 { font-family: var(--f-display); font-size: 1.6rem; line-height: 1.2; margin-top: 0.5rem;}
.d-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
.d-grid dt { font-family: var(--f-mono); font-size: 0.8rem; color: var(--royal); text-transform: uppercase; margin-bottom: 5px; }
.d-grid dd {
    font-size: 0.95rem;
    color: var(--mute);
    line-height: 1.5;
}
.card {
    font: inherit;
    color: inherit;
}

/* MODALE : LECTEUR YOUTUBE 16:9 */
.yt-wrap { position: relative; width: min(100%, calc(62vh * 16 / 9)); aspect-ratio: 16 / 9; background: #000; }
.yt-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
dialog.is-video { max-width: 960px; }
dialog.is-video .d-layout { grid-template-columns: 1fr; overflow-y: auto; max-height: 92vh; }
dialog.is-video .d-media-pane { background: #000; padding: 0; overflow: hidden; }
dialog.is-video .d-text-pane { padding: 2rem 2.5rem 2.5rem; overflow: visible; }
dialog.is-video .d-grid { grid-template-columns: 1fr 1fr; gap: 1.2rem 2rem; }

/* Animations Fade Up */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* =========================================
   RESPONSIVE MOBILE CORRIGÉ (ZÉRO DÉCALAGE)
   ========================================= */
@media (max-width: 850px) {
    .mobile-menu-btn { display: block; }
    
    .nav-links {
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--paper); flex-direction: column; gap: 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        display: none; 
    }
    .nav-links.active { display: flex; }
    .nav-links a { padding: 15px 20px; border-bottom: 1px solid var(--bg); font-size: 0.9rem; width: 100%; text-align: left;}

    /* Correction alignement texte et nom sur mobile */
    .hero-grid { display: flex; flex-direction: column; gap: 2rem; text-align: left; }
    .hero-text { width: 100%; }
    .name { font-size: clamp(2.8rem, 12vw, 4rem); margin-bottom: 15px; }
    .name .b { margin-left: 0 !important; display: block; }
    
    .about-grid, .grid-3, .parcours-grid { grid-template-columns: 1fr; gap: 2.5rem;}
    .section-padding { padding-block: 3.5rem; }
    h2 { font-size: clamp(1.8rem, 6vw, 2.5rem); margin-bottom: 2rem; }
    
    /* Photo et bulles recentrées sans dépassement */
    .hero-photo { margin: 1rem auto 2rem auto; width: 80%; max-width: 240px; }
    .s1 { left: -5px; bottom: 5%; font-size: 0.6rem; } 
    .s2 { right: -5px; top: 5%; font-size: 0.6rem; } 
    .floating-element { display: none; } 
    
    /* Timeline Scrollable proprement */
    .tracks { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 15px; margin-inline: -20px; padding-inline: 20px;}
    .tracks::-webkit-scrollbar { display: none; } 
    .lane-row { min-width: 600px; } 
    .lane-label { width: 60px; font-size: 0.65rem;}
    .clip { font-size: 0.75rem; padding: 0 8px; }
    
    /* Boutons et Modale */
    .contact .btns { flex-direction: column; width: 100%; }
    .contact .btn { width: 100%; justify-content: center; }
    .mail-link { font-size: 1.05rem; word-break: break-all; }

    .d-layout { grid-template-columns: 1fr; max-height: 90vh;}
    .d-media-pane { height: 260px; flex-shrink: 0;}
    .d-text-pane { padding: 1.5rem; }

    /* Vidéo : plein largeur, ratio 16:9 exact, texte dessous */
    dialog { width: 100%; max-width: 100%; border-radius: 14px; }
    dialog.is-video .d-layout { max-height: 92dvh; }
    dialog.is-video .d-media-pane { height: auto; }
    dialog.is-video .yt-wrap { width: min(100%, calc(62dvh * 16 / 9)); }
    dialog.is-video .d-text-pane { padding: 1.5rem; }
    dialog.is-video .d-grid { grid-template-columns: 1fr; }
    .d-close { right: 10px; top: 10px; width: 36px; height: 36px; }

    .skills-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}
/* Accessibilité : réduction des animations */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-up {
        opacity: 1;
        transform: none;
    }
}
}
