:root,
[data-theme="dark"] {
    --bg:        #0a0b12;
    --bg-2:      #0e0f19;
    --surface:   #13141f;
    --surface-2: #191a28;
    --border:    #2a2b45;
    --text:      #ececf6;
    --text-2:    #c9cade;   
    --muted:     #a3a4bf;   
    --accent:    #a5b4fc;   
    --accent-2:  #818cf8;
    --violet:    #a855f7;
    --btn:       #6366f1;
    --btn-text:  #ffffff;
    --halo:      rgba(129, 140, 248, 0.35);
    --grad:      linear-gradient(135deg, #c7d2fe 0%, #818cf8 55%, #a855f7 100%);
    --m1: #c7d2fe; --m2: #818cf8; --m3: #a855f7;
    color-scheme: dark;
}

[data-theme="light"] {
    --bg:        #f6f6fb;
    --bg-2:      #eeeff7;
    --surface:   #ffffff;
    --surface-2: #f3f3fa;
    --border:    #dcdcea;
    --text:      #17182a;
    --text-2:    #33354d;
    --muted:     #5b5d78;   
    --accent:    #4f46e5;
    --accent-2:  #6366f1;
    --violet:    #7c3aed;
    --btn:       #4f46e5;
    --btn-text:  #ffffff;
    --halo:      rgba(99, 102, 241, 0.18);
    --grad:      linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    --m1: #818cf8; --m2: #6366f1; --m3: #7c3aed;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background 0.25s, color 0.25s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hl { color: var(--accent); font-weight: 500; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 1.5rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.recette {
    background: repeating-linear-gradient(-45deg, #f59e0b22 0 12px, transparent 12px 24px), var(--surface);
    border-bottom: 1px solid #f59e0b66;
    color: var(--text);
    text-align: center;
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
}

.nav {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 1rem; height: 60px; }
.nav-brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 500; letter-spacing: 0.04em; }
.nav-brand:hover { text-decoration: none; }
.nav-brand .monogramme { width: 30px; height: 30px; }
.nav-links { display: flex; gap: 0.2rem; margin-left: auto; list-style: none; }
.nav-links a { color: var(--muted); font-size: 0.85rem; padding: 0.35rem 0.7rem; border-radius: 999px; transition: color 0.15s, background 0.15s; }
.nav-links a:hover, .nav-links a.on { color: var(--text); background: var(--surface-2); text-decoration: none; }
.theme-btn {
    flex: none; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    cursor: pointer; font-size: 1rem; line-height: 1;
}
.theme-btn:hover { border-color: var(--accent-2); }

.monogramme { display: block; overflow: visible; }
.monogramme * { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.monogramme .mg-ring { stroke-width: 1.8; opacity: 0.75; }
.monogramme .mg-arc  { stroke-width: 2.2; opacity: 0.85; stroke-dasharray: 70 225; stroke-dashoffset: -160; }
.monogramme .mg-m, .monogramme .mg-t { stroke-width: 5.4; }
@keyframes mg-trace-m { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
@keyframes mg-trace-t { from { stroke-dashoffset: 16; } to { stroke-dashoffset: 0; } }
@keyframes mg-tour  { from { transform: rotate(-120deg); opacity: 0; } to { transform: rotate(0); opacity: 0.85; } }
.monogramme.anime .mg-m { stroke-dasharray: 200; animation: mg-trace-m 1.3s ease-out both; }
.monogramme.anime .mg-t { stroke-dasharray: 16; animation: mg-trace-t 0.4s 1.1s ease-out both; }
.monogramme.anime .mg-arc { transform-origin: 60px 60px; animation: mg-tour 1.4s ease-out both; }

.monogramme stop:nth-child(1) { stop-color: var(--m1); }
.monogramme stop:nth-child(2) { stop-color: var(--m2); }
.monogramme stop:nth-child(3) { stop-color: var(--m3); }

.hero { padding: 4.5rem 0 3.5rem; position: relative; overflow: hidden; }
.hero::before {
    content: ''; position: absolute; inset: -40% -10% auto auto; width: 620px; height: 620px;
    background: radial-gradient(circle, var(--halo), transparent 65%); pointer-events: none;
}
.hero .wrap { display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; align-items: center; position: relative; }
.portrait { position: relative; width: 168px; height: 168px; }
.portrait img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; position: relative; z-index: 1; border: 4px solid var(--bg); }
.portrait::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; background: var(--grad); }
.identite { display: flex; align-items: center; gap: 1.1rem; }
.identite .logo { width: 74px; height: 74px; flex: none; filter: drop-shadow(0 0 16px var(--halo)); }
.hero h1 { font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 300; letter-spacing: 0.02em; line-height: 1.15; }
.hero h1 strong { font-weight: 600; }
.hero .titre {
    font-size: 1.15rem; font-weight: 500; margin-top: 0.35rem;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero .devise { color: var(--muted); font-style: italic; margin-top: 1rem; font-size: 0.95rem; max-width: 560px; }
.contacts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.4rem; list-style: none; }
.contacts > li > a, .contacts > li > span, .chip {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.85rem; color: var(--text-2);
    border: 1px solid var(--border); background: var(--surface);
    border-radius: 999px; padding: 0.35rem 0.85rem;
}
.contacts > li > a:hover { border-color: var(--accent-2); color: var(--text); text-decoration: none; }
.contacts svg { width: 15px; height: 15px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--btn); color: var(--btn-text); border: 0; border-radius: 999px;
    padding: 0.6rem 1.25rem; font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer;
    box-shadow: 0 6px 20px var(--halo); transition: transform 0.15s, filter 0.15s;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); text-decoration: none; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero .actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-ghost:hover { border-color: var(--accent-2); }

section { padding: 3.5rem 0; border-top: 1px solid var(--border); }
.label {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
    margin-bottom: 0.6rem;
}
.label::before { content: ''; width: 28px; height: 2px; border-radius: 2px; background: var(--grad); }
h2.titre-section { font-size: 1.6rem; font-weight: 400; letter-spacing: 0.01em; margin-bottom: 1.75rem; }
.prose p { color: var(--text-2); margin-bottom: 1rem; }
.prose p:last-child { margin-bottom: 0; }

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.carte {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 1.4rem 1.5rem;
}
.carte h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.7rem; }
.carte p, .carte li { color: var(--text-2); font-size: 0.93rem; }
.piliers { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0; list-style: none; }
.piliers li { font-size: 0.8rem; border-radius: 999px; padding: 0.2rem 0.7rem; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }

.frise { position: relative; list-style: none; }
.frise::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent-2), var(--violet) 60%, transparent); opacity: 0.6; }
.etape { position: relative; padding-left: 2.4rem; margin-bottom: 2.2rem; }
.etape::before {
    content: ''; position: absolute; left: 0; top: 0.45rem; width: 16px; height: 16px; border-radius: 50%;
    background: var(--bg); border: 3px solid var(--accent-2);
}
.etape .periode { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; color: var(--accent); }
.etape h3 { font-size: 1.2rem; font-weight: 600; margin-top: 0.15rem; }
.etape .poste { color: var(--text); font-size: 0.98rem; }
.etape .contexte { display: inline-block; margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 0.2rem 0.6rem; background: var(--surface); }
.etape .bloc { margin-top: 0.9rem; }
.etape .contrat { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; vertical-align: middle; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0.05rem 0.4rem; margin-left: 0.3rem; }
.etape .note { margin-top: 0.7rem; font-style: italic; color: var(--text-2); }
.etape .puces { margin-top: 0.9rem; }
.etape .resultats {
    margin-top: 0.9rem; padding: 0.75rem 1rem; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--violet);
}
.etape .resultats strong { color: var(--accent); font-weight: 600; margin-right: 0.35rem; }
.accroche p { font-size: 1.08rem; color: var(--text); line-height: 1.75; }

.pastille-cv {
    position: fixed; z-index: 25;
    right: 1.25rem; bottom: calc(1.25rem + env(safe-area-inset-bottom));
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--btn); color: var(--btn-text);
    border-radius: 999px; padding: 0.7rem 1.15rem;
    font-size: 0.88rem; font-weight: 500;
    box-shadow: 0 8px 28px var(--halo), 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s, filter 0.15s;
}
.pastille-cv:hover { filter: brightness(1.1); transform: translateY(-2px); text-decoration: none; }
.pastille-cv svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pastille-cv .court { display: none; }
.etape h4 { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
.etape p { color: var(--text-2); font-size: 0.93rem; }
.puces { list-style: none; display: grid; gap: 0.45rem; }
.puces li { position: relative; padding-left: 1.1rem; color: var(--text-2); font-size: 0.93rem; }
.puces li::before { content: ''; position: absolute; left: 0; top: 0.62rem; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }

.formations { display: grid; gap: 1rem; }
.formation { display: grid; grid-template-columns: 110px 1fr; gap: 1.25rem; align-items: start; }
.formation .annee { font-weight: 600; color: var(--accent); font-size: 0.9rem; padding-top: 0.15rem; }
.formation h3 { font-size: 1.02rem; font-weight: 600; }
.formation .ecole { color: var(--muted); font-size: 0.88rem; }
.formation p { color: var(--text-2); font-size: 0.92rem; margin-top: 0.4rem; }

.competences { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.competences .carte h3 { display: flex; align-items: center; gap: 0.6rem; }
.competences .carte h3::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--grad); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.form .large { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; color: var(--muted); }
.form input, .form textarea {
    font: inherit; font-size: 0.95rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form textarea { resize: vertical; min-height: 150px; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--halo); }
.form .question { color: var(--text-2); }
.form .question b { color: var(--text); }
.form .envoi { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; }
.form .piege { position: absolute; left: -10000px; }
.alerte { border-radius: 12px; padding: 0.9rem 1.1rem; margin-top: 1.25rem; font-size: 0.92rem; border: 1px solid; }
.alerte.ok  { border-color: #34d39966; background: rgba(52, 211, 153, 0.09); color: var(--text); }
.alerte.err { border-color: #ef444466; background: rgba(239, 68, 68, 0.08); color: var(--text); }

footer { border-top: 1px solid var(--border); padding: 2.5rem 0 6rem; }
footer .wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; }
footer .monogramme { width: 34px; height: 34px; }
footer .grow { flex: 1; }

.haut {
    position: fixed; right: 1.25rem; bottom: calc(4.6rem + env(safe-area-inset-bottom)); z-index: 15;
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); display: grid; place-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.haut.visible { opacity: 1; pointer-events: auto; }
.haut:hover { border-color: var(--accent-2); text-decoration: none; }

@media (max-width: 760px) {
    .nav-links { display: none; }
    .nav .theme-btn { margin-left: auto; }
    .hero { padding: 2.5rem 0 2.5rem; }
    .hero .wrap { grid-template-columns: 1fr; gap: 1.5rem; text-align: left; }
    .portrait { width: 120px; height: 120px; }
    .grille-2, .competences, .form { grid-template-columns: 1fr; }
    .formation { grid-template-columns: 1fr; gap: 0.2rem; }
    section { padding: 2.5rem 0; }
    .identite .logo { width: 56px; height: 56px; }
    .pastille-cv { right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); padding: 0.65rem 1rem; }
    .pastille-cv .long { display: none; }
    .pastille-cv .court { display: inline; }
    .haut { right: 1rem; bottom: calc(4.3rem + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .monogramme * { animation: none !important; }
    * { transition: none !important; }
}

.c-img { display: inline-block; height: 1.02em; background: currentColor; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.c1 { -webkit-mask-image: url('../img/c1.svg'); mask-image: url('../img/c1.svg'); aspect-ratio: 460.94 / 39.45; }
.c2 { -webkit-mask-image: url('../img/c2.svg'); mask-image: url('../img/c2.svg'); aspect-ratio: 256.41 / 29.12; height: 0.74em; }


[data-palette="or"][data-theme="dark"] {
    --bg: #18181b; --bg-2: #1c1c20; --surface: #212125; --surface-2: #29292e; --border: #38373a;
    --text: #f2efe8; --text-2: #d3cec3; --muted: #aaa498;
    --accent: #e6c97a; --accent-2: #d4af37; --violet: #b8892b; --btn: #d8bd72; --btn-text: #17130a;
    --halo: rgba(216, 189, 114, 0.16); --grad: linear-gradient(135deg, #f6e7bd 0%, #d4af37 55%, #a8801f 100%);
    --m1: #f6e7bd; --m2: #d4af37; --m3: #a8801f;
}
[data-palette="or"][data-theme="light"] {
    --bg: #faf8f3; --bg-2: #f3efe5; --border: #e3dccb; --text: #1d1a14; --text-2: #3b352a; --muted: #6a6253;
    --accent: #8a6a16; --accent-2: #a67c1a; --violet: #7a5a10; --btn: #1d1a14; --btn-text: #f6e7bd;
    --halo: rgba(166, 124, 26, 0.16); --grad: linear-gradient(135deg, #b8892b 0%, #7a5a10 100%);
    --m1: #d4af37; --m2: #a67c1a; --m3: #7a5a10;
}

.realisations { list-style: none; display: grid; gap: 0.75rem; }
.realisations li { position: relative; padding: 1rem 1.2rem 1rem 3.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text-2); font-size: 0.93rem; }
.realisations li::before { content: ''; position: absolute; left: 1.15rem; top: 1.25rem; width: 14px; height: 14px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px var(--halo); }
.realisations .ou { display: inline-block; margin-left: 0.5rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 0.4rem; }

.hero-court { padding: 3.5rem 0 2.5rem; }
.hero-court .wrap { display: block; }
.mentions { display: grid; gap: 1rem; }
.mentions .carte p { margin-bottom: 0.6rem; line-height: 1.7; }
.mentions .carte p:last-child { margin-bottom: 0; }
.mentions .carte b { color: var(--text); font-weight: 600; }
.mentions .maj { color: var(--muted); font-size: 0.85rem; margin-top: 0.5rem; }
