/*
 * Site public — Mahoulolo SEBIO
 * Grille « bento », thèmes clair et sombre, accent orange cuivré #D97745.
 * Les couleurs passent toutes par des variables : le thème sombre ne fait
 * que redéfinir ces variables. Aucun framework : ce fichier est servi tel quel.
 */

:root {
    color-scheme: light;
    --bg: #F5F3EF;
    --surface: #FFFFFF;
    --surface-2: #EDE9E2;
    --sunken: #F5F3EF;
    --text: #111111;
    --text-soft: #3F3F46;
    --muted: #6B7280;
    --line: rgba(17, 17, 17, .08);
    --line-strong: rgba(17, 17, 17, .15);
    --inverse: #111111;
    --inverse-text: #FFFFFF;
    --inverse-muted: rgba(255, 255, 255, .68);
    --inverse-line: rgba(255, 255, 255, .1);
    --accent: #D97745;
    --accent-strong: #B85F31;
    --accent-text: #B85F31;   /* texte cuivré lisible sur le fond courant */
    --accent-soft: #FBEDE4;
    --accent-on-inverse: #F0B08C;
    --success-bg: #ECFDF3;
    --success-text: #166534;
    --danger-bg: #FEF2F2;
    --danger-text: #991B1B;
    --glow: rgba(217, 119, 69, .14);
    --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 8px 24px -12px rgba(17, 17, 17, .14);
    --shadow-hover: 0 2px 4px rgba(17, 17, 17, .05), 0 30px 50px -24px rgba(17, 17, 17, .3);
    --nav-bg: rgba(255, 255, 255, .72);

    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

    /* Échelle typographique commune : toutes les tailles du site en découlent. */
    --fs-display: clamp(2.4rem, 5vw, 3.9rem);   /* titre principal d'une page */
    --fs-h2: clamp(2rem, 4.2vw, 3rem);          /* titre de section */
    --fs-h3-lg: clamp(1.4rem, 2.4vw, 1.65rem);  /* titre de bloc large, appel à l'action */
    --fs-h3: 1.3rem;                            /* titre de bloc */
    --fs-h4: 1.1rem;                            /* sous-titre, élément de liste */
    --fs-lead: 1.05rem;                         /* texte d'introduction, article */
    --fs-text: .95rem;                          /* texte courant dans un bloc */
    --fs-small: .85rem;                         /* méta, légende, aide */
    --fs-label: .76rem;                         /* étiquette en capitales */
    --fs-xs: .78rem;                            /* badge, tag */
    --tracking-label: .1em;

    --radius-sm: 14px;
    --radius: 18px;
    --radius-lg: 26px;
    --icon-box: 46px;
    --gap: 16px;
    --container: 1200px;
    --ease: cubic-bezier(.22, .61, .36, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0B0B0C;
    --surface: #151517;
    --surface-2: #1F1F22;
    --sunken: #1F1F22;
    --text: #F5F3EF;
    --text-soft: #D4D4D8;
    --muted: #A1A1AA;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    /* Les blocs « inversés » deviennent clairs en mode sombre. */
    --inverse: #F5F3EF;
    --inverse-text: #111111;
    --inverse-muted: rgba(17, 17, 17, .62);
    --inverse-line: rgba(17, 17, 17, .1);
    --accent-text: #EDA27A;
    --accent-soft: rgba(217, 119, 69, .16);
    --accent-on-inverse: #B85F31;
    --success-bg: rgba(34, 197, 94, .12);
    --success-text: #86EFAC;
    --danger-bg: rgba(239, 68, 68, .12);
    --danger-text: #FCA5A5;
    --glow: rgba(217, 119, 69, .2);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .4), 0 30px 50px -24px rgba(0, 0, 0, .8);
    --nav-bg: rgba(21, 21, 23, .72);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
    margin: 0; font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
    color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    transition: background-color .4s var(--ease), color .4s var(--ease);
}
body::before {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(700px 500px at 8% -5%, var(--glow), transparent 60%),
        radial-gradient(600px 500px at 100% 30%, var(--glow), transparent 60%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #FFFFFF; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--inverse); color: var(--inverse-text); padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -.025em; margin: 0; }
p { margin: 0; }

/* ---------- Barre de progression du défilement ---------- */

.scroll-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); background: linear-gradient(90deg, var(--accent-strong), var(--accent)); pointer-events: none; }

/* ---------- Navigation flottante ---------- */

/*
 * La barre reste toujours visible. En haut de page elle est translucide ;
 * dès que l'on défile, elle se resserre et prend la couleur de la marque
 * (noir en thème clair, blanc cassé en thème sombre), sur mobile comme sur ordinateur.
 */
.site-header { position: fixed; top: 16px; left: 0; right: 0; z-index: 50; pointer-events: none; transition: top .45s var(--ease); }
.site-header.is-scrolled { top: 10px; }
.nav-shell {
    pointer-events: auto; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    max-width: var(--container); margin: 0 auto; padding: 8px 8px 8px 16px; width: calc(100% - 40px);
    background: var(--nav-bg); border: 1px solid var(--line);
    backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-radius: 999px; box-shadow: var(--shadow);
    transition: box-shadow .4s, background-color .45s var(--ease), border-color .45s, padding .45s var(--ease), max-width .5s var(--ease);
}
.site-header.is-scrolled .nav-shell {
    max-width: calc(var(--container) - 80px); padding: 6px 6px 6px 12px;
    background: color-mix(in srgb, var(--inverse) 94%, transparent); border-color: transparent;
    color: var(--inverse-text); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55);
}
.site-header.is-scrolled .brand-mark { background: var(--accent); color: #FFFFFF; }
.site-header.is-scrolled .lang-switch { background: var(--inverse-line); }
.site-header.is-scrolled .lang-switch a { color: var(--inverse-muted); }
.site-header.is-scrolled .lang-switch a.is-current { color: #FFFFFF; }
.site-header.is-scrolled .lang-switch::before { background: var(--accent); }
.site-header.is-scrolled .theme-toggle { background: var(--inverse-line); color: var(--inverse-text); }
.site-header.is-scrolled .nav-toggle { background: var(--accent); color: #FFFFFF; }
/* Fine barre de progression intégrée sous la navigation */
.nav-progress { position: absolute; left: 22px; right: 22px; bottom: 0; height: 2px; border-radius: 2px; overflow: hidden; opacity: 0; transition: opacity .4s; pointer-events: none; }
.nav-progress::after { content: ''; position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); background: var(--accent); }
.site-header.is-scrolled .nav-progress { opacity: 1; }
/* Indicateur glissant sous le lien de la section visible */
.nav-indicator { position: absolute; top: 50%; left: 0; height: 38px; width: 0; border-radius: 999px; background: var(--surface-2); transform: translateY(-50%); opacity: 0; pointer-events: none; transition: transform .5s var(--spring), width .5s var(--spring), opacity .3s, background-color .4s; }
.site-header.is-scrolled .nav-indicator { background: var(--accent); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--inverse); color: var(--inverse-text); font-size: .85rem; font-weight: 700; transition: transform .4s var(--spring), background-color .3s, color .3s; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); background: var(--accent); color: #FFFFFF; }

.nav { position: relative; display: flex; align-items: center; gap: 2px; }
.nav a:not(.btn) { position: relative; z-index: 1; padding: 9px 13px; border-radius: 999px; font-size: .92rem; font-weight: 500; color: var(--text-soft); transition: background-color .2s, color .3s; }
.nav a:not(.btn):hover { color: var(--text); }
.nav a.is-active { color: var(--text); }
.nav:not(.has-indicator) a.is-active { background: var(--surface-2); }
@media (min-width: 981px) {
    .site-header.is-scrolled .nav a:not(.btn) { color: var(--inverse-muted); }
    .site-header.is-scrolled .nav a:not(.btn):hover { color: var(--inverse-text); }
    .site-header.is-scrolled .nav a.is-active { color: #FFFFFF; }
    .site-header.is-scrolled .nav:not(.has-indicator) a.is-active { background: var(--accent); }
    .site-header.is-scrolled .nav .btn-primary { background: var(--accent); color: #FFFFFF; box-shadow: none; }
}
.nav-tools { display: flex; align-items: center; gap: 6px; }

/* Sélecteur de langue avec indicateur glissant */
.lang-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: var(--surface-2); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.lang-switch a { position: relative; z-index: 1; padding: 6px 10px; border-radius: 999px; text-align: center; color: var(--muted); transition: color .3s; }
.lang-switch a.is-current { color: var(--inverse-text); }
.lang-switch::before { content: ''; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--inverse); transition: transform .45s var(--spring); }
.lang-switch[data-current="1"]::before { transform: translateX(100%); }

/* Bouton de thème : soleil / lune */
.theme-toggle { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); cursor: pointer; overflow: hidden; transition: background-color .3s, transform .3s var(--spring); }
.theme-toggle:hover { transform: rotate(-12deg); }
.theme-toggle:active { transform: scale(.9); }
.theme-toggle i { position: absolute; transition: transform .55s var(--spring), opacity .3s; }
.theme-toggle .fa-sun { transform: translateY(0) rotate(0); }
.theme-toggle .fa-moon { transform: translateY(150%) rotate(-90deg); opacity: 0; }
[data-theme="dark"] .theme-toggle .fa-sun { transform: translateY(-150%) rotate(90deg); opacity: 0; }
[data-theme="dark"] .theme-toggle .fa-moon { transform: translateY(0) rotate(0); opacity: 1; }

/* Bouton menu : trois traits qui s'animent */
.nav-toggle { display: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--inverse); color: var(--inverse-text); cursor: pointer; transition: transform .35s var(--spring), background-color .3s; }
.nav-toggle:active { transform: scale(.9); }
.burger { position: relative; display: block; width: 16px; height: 12px; }
.burger span { position: absolute; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: width .35s var(--spring), transform .35s var(--spring); }
.burger span:nth-child(1) { top: 0; width: 16px; }
.burger span:nth-child(2) { top: 5px; width: 11px; }
.burger span:nth-child(3) { top: 10px; width: 7px; }
.nav-toggle:hover .burger span { width: 16px; }

/* Menu mobile : panneau latéral droit */
.mobile-menu { display: none; }

@media (max-width: 980px) {
    .nav-toggle { display: grid; place-items: center; }
    .nav { display: none; }
    .brand-name { display: none; }

    .mobile-menu { display: block; position: fixed; inset: 0; z-index: 80; pointer-events: none; }
    .mobile-menu.is-open { pointer-events: auto; }
    .mobile-menu-backdrop {
        position: absolute; inset: 0; background: rgba(10, 10, 11, .45);
        backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
        opacity: 0; transition: opacity .45s var(--ease);
    }
    .mobile-menu.is-open .mobile-menu-backdrop { opacity: 1; }
    .mobile-menu-panel {
        position: absolute; top: 0; right: 0; bottom: 0; width: min(88vw, 420px);
        display: flex; flex-direction: column; gap: 28px; overflow-y: auto;
        padding: calc(22px + env(safe-area-inset-top, 0px)) 24px calc(26px + env(safe-area-inset-bottom, 0px));
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
        background:
            radial-gradient(320px 260px at 100% 0%, rgba(217, 119, 69, .38), transparent 70%),
            radial-gradient(260px 220px at 0% 100%, rgba(217, 119, 69, .16), transparent 70%),
            var(--inverse);
        color: var(--inverse-text); box-shadow: -30px 0 60px -20px rgba(0, 0, 0, .5);
        transform: translateX(105%); transition: transform .6s cubic-bezier(.16, 1, .3, 1);
    }
    .mobile-menu.is-open .mobile-menu-panel { transform: none; }
    .mobile-menu-head { display: flex; align-items: center; justify-content: space-between; }
    .mobile-menu-head .tile-label { color: var(--inverse-muted); }
    .mobile-menu-close {
        display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
        background: var(--accent); color: #FFFFFF; font-size: 1.1rem; cursor: pointer;
        transform: rotate(-90deg) scale(.6); opacity: 0; transition: transform .5s var(--spring) .15s, opacity .3s .15s;
    }
    .mobile-menu.is-open .mobile-menu-close { transform: none; opacity: 1; }
    .mobile-menu-close:active { transform: scale(.9); }

    .mobile-menu-links { display: flex; flex-direction: column; }
    .mobile-menu-links a {
        position: relative; display: flex; align-items: center; gap: 16px; padding: 15px 4px;
        border-bottom: 1px solid var(--inverse-line);
        font-family: var(--font-display); font-size: clamp(1.6rem, 7vw, 2rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.1;
        opacity: 0; transform: translateX(48px);
        transition: opacity .45s var(--ease), transform .6s cubic-bezier(.16, 1, .3, 1), color .25s;
    }
    .mobile-menu.is-open .mobile-menu-links a, .mobile-menu.is-open .mobile-menu-foot { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 60ms + 160ms); }
    .mobile-menu-links small { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: 0; color: var(--accent-on-inverse); }
    .mobile-menu-links span { flex: 1; }
    .mobile-menu-links i { font-size: .9rem; color: var(--inverse-muted); transform: translateX(-8px); opacity: 0; transition: transform .35s var(--spring), opacity .25s, color .25s; }
    .mobile-menu-links a:hover, .mobile-menu-links a:active, .mobile-menu-links a.is-active { color: var(--accent-on-inverse); }
    .mobile-menu-links a:hover i, .mobile-menu-links a:active i, .mobile-menu-links a.is-active i { transform: none; opacity: 1; color: var(--accent-on-inverse); }

    .mobile-menu-foot {
        margin-top: auto; display: flex; flex-direction: column; gap: 16px;
        opacity: 0; transform: translateX(48px); transition: opacity .45s var(--ease), transform .6s cubic-bezier(.16, 1, .3, 1);
    }
    .mobile-menu-foot .btn { width: 100%; padding: 16px 22px; }
    .mobile-menu-mail { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--inverse-muted); word-break: break-all; }
    .mobile-menu-foot .socials a { background: var(--inverse-line); color: var(--inverse-text); }

    html.menu-open { overflow: hidden; }
}

/* ---------- Boutons ---------- */

.btn {
    position: relative; overflow: hidden; isolation: isolate;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 13px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
    font-weight: 600; font-size: .95rem; line-height: 1; white-space: nowrap;
    transition: transform .35s var(--spring), background-color .25s, color .25s, border-color .25s, box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn i { transition: transform .35s var(--spring); }
.btn:hover .fa-arrow-right { transform: translateX(4px); }
.btn:hover .fa-arrow-down { transform: translateY(3px); }
.btn:hover .fa-arrow-up-right-from-square { transform: translate(2px, -2px); }
.btn-primary { background: var(--inverse); color: var(--inverse-text); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); }
.btn-primary:hover { background: var(--accent); color: #FFFFFF; box-shadow: 0 14px 30px -12px rgba(217, 119, 69, .7); }
.btn-accent { background: var(--accent); color: #FFFFFF; }
.btn-accent:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.btn-sm { padding: 10px 17px; font-size: .88rem; }
/* Onde au clic */
.ripple { position: absolute; z-index: -1; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .25; animation: ripple .65s var(--ease) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ---------- Grille bento ---------- */

.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.tile {
    --mx: 50%; --my: 50%;
    position: relative; overflow: hidden; isolation: isolate;
    padding: 26px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
    transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s, background-color .4s, color .4s;
}
.tile::after {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
    background: radial-gradient(380px circle at var(--mx) var(--my), var(--glow), transparent 45%);
    transition: opacity .35s;
}
a.tile, .tile-hover { cursor: pointer; }
.tile:hover { box-shadow: var(--shadow-hover); }
.tile:hover::after { opacity: 1; }
.tile-dark { background: var(--inverse); color: var(--inverse-text); border-color: transparent; }
.tile-dark::after { background: radial-gradient(380px circle at var(--mx) var(--my), rgba(217, 119, 69, .3), transparent 45%); }
.tile-copper { background: var(--accent); color: #FFFFFF; border-color: transparent; }
.tile-copper::after { background: radial-gradient(380px circle at var(--mx) var(--my), rgba(255, 255, 255, .22), transparent 45%); }
.tile-flat { padding: 0; }

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.row-2 { grid-row: span 2; }

.tile-label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }
.tile-label i { color: var(--accent); }
.tile-dark .tile-label { color: var(--inverse-muted); }
.tile-dark .tile-label i { color: var(--accent-on-inverse); }
.tile-copper .tile-label { color: rgba(255, 255, 255, .78); }
.tile-copper .tile-label i { color: #FFFFFF; }
.tile-corner { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--sunken); color: var(--text); transition: transform .45s var(--spring), background-color .2s, color .2s; }
.tile:hover .tile-corner { transform: rotate(-45deg) scale(1.08); background: var(--accent); color: #FFFFFF; }
.tile-dark .tile-corner { background: var(--inverse-line); color: var(--inverse-text); }
.tile-copper .tile-corner { background: rgba(255, 255, 255, .2); color: #FFFFFF; }

@media (max-width: 1000px) {
    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-3, .span-4 { grid-column: span 2; }
}
@media (max-width: 600px) {
    .bento { grid-template-columns: minmax(0, 1fr); }
    .span-2, .span-3, .span-4 { grid-column: span 1; }
    .row-2 { grid-row: span 1; }
    .tile { padding: 22px; }
}

/* ---------- Accueil ---------- */

.hero { padding: 116px 0 0; }
.intro { display: flex; flex-direction: column; justify-content: space-between; gap: 26px; min-height: 440px; }
.intro-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.availability { display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 10px; border-radius: 999px; background: var(--success-bg); color: var(--success-text); font-size: .84rem; font-weight: 500; }
.availability .dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; animation: pulse 2s infinite; }
.availability.is-busy { background: var(--surface-2); color: var(--muted); }
.availability.is-busy .dot { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.intro-name { font-size: var(--fs-small); color: var(--muted); }
.intro-name strong { color: var(--text); font-weight: 600; }
.intro h1 { margin-top: 14px; font-size: var(--fs-display); letter-spacing: -.04em; line-height: 1.02; }
.intro h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.intro h1 .line > span { display: inline-block; transform: translateY(105%); animation: rise .9s var(--ease) forwards; }
.intro h1 .line:nth-child(2) > span { animation-delay: .12s; }
.intro h1 .accent { background: linear-gradient(100deg, var(--accent-strong), var(--accent) 50%, var(--accent-strong)); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise .9s var(--ease) .12s forwards, shine 6s ease-in-out 1.2s infinite; }
@keyframes rise { to { transform: none; } }
@keyframes shine { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.intro .lead { color: var(--text-soft); font-size: var(--fs-lead); max-width: 60ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line); font-size: var(--fs-small); font-weight: 500; transition: background-color .2s, color .2s, transform .35s var(--spring), border-color .2s; }
.chip:hover { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; transform: translateY(-2px); }
.chip i { color: var(--accent); font-size: .8em; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Portrait circulaire avec anneau cuivré en orbite */
.photo-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px 18px 110px; min-height: 440px;
    background:
        radial-gradient(260px 220px at 50% 34%, rgba(217, 119, 69, .32), transparent 70%),
        radial-gradient(var(--line-strong) 1px, transparent 1px) 0 0 / 16px 16px,
        var(--surface);
}
.portrait { position: relative; width: min(100%, 230px); aspect-ratio: 1; margin-top: 6px; }
.portrait img { position: relative; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; clip-path: circle(49% at 50% 50%); box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .55); transition: transform 1s var(--spring); }
.photo-tile:hover .portrait img { transform: scale(1.04); }
.portrait::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--accent); opacity: .9; }
.portrait-orbit { position: absolute; inset: -20px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); animation: orbit 24s linear infinite; }
.portrait-orbit::after { content: ''; position: absolute; top: 50%; right: -6px; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(217, 119, 69, .22); }
@keyframes orbit { to { transform: rotate(360deg); } }
.portrait-id { text-align: center; margin-top: 12px; }
.portrait-id strong { display: block; font-family: var(--font-display); font-size: var(--fs-h4); font-weight: 600; letter-spacing: -.01em; }
.portrait-id span { font-size: var(--fs-small); color: var(--muted); }
.photo-badge {
    position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: var(--fs-xs); color: var(--muted);
}
.photo-badge i { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #FFFFFF; }
.photo-badge strong { display: block; color: var(--text); font-size: var(--fs-small); line-height: 1.3; }

.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 200px; }
.stat-value { font-family: var(--font-display); font-size: clamp(3rem, 6vw, 4.2rem); font-weight: 600; letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .38em; letter-spacing: -.01em; margin-left: 4px; opacity: .75; }
.stat p { font-size: var(--fs-text); opacity: .85; }
.stat h3 { font-size: var(--fs-h3-lg); line-height: 1.2; }
.stat h3 + p { margin-top: 8px; }
.stat.is-compact { min-height: 0; }
/* Grande icône en filigrane : habille les blocs de couleur sans les surcharger */
.watermark { position: absolute; right: -14px; bottom: -26px; z-index: -1; font-size: 9.5rem; line-height: 1; opacity: .1; transform: rotate(-12deg); transition: transform .9s var(--spring), opacity .4s; pointer-events: none; }
.tile:hover .watermark { transform: rotate(-4deg) scale(1.06); opacity: .16; }
/* Pastilles (noms de projets, services...) dans un bloc de couleur */
.mini-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-pill { padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .6s var(--spring), background-color .2s; transition-delay: calc(var(--i, 0) * 70ms + 250ms); }
.is-visible .mini-pill { opacity: 1; transform: none; }
.tile-dark .mini-pill { background: var(--inverse-line); }
.mini-pill:hover { background: rgba(255, 255, 255, .3); }
/* Frise des années d'expérience */
.years { display: flex; align-items: flex-end; gap: 6px; height: 74px; }
.years span { position: relative; flex: 1; height: var(--h); border-radius: 7px 7px 3px 3px; background: var(--inverse-line); transform-origin: bottom; transform: scaleY(0); transition: transform .8s var(--spring); transition-delay: calc(var(--i, 0) * 90ms + 200ms); }
.years span.is-now { background: var(--accent); }
.is-visible .years span { transform: none; }
.years span small { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); font-size: .68rem; font-weight: 600; color: var(--inverse-muted); white-space: nowrap; }

.clock { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 2.8rem); font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.clock .sep { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.place { font-weight: 600; }
.place small { display: block; font-weight: 400; color: var(--muted); }

/* Fenêtre de code animée */
.code-tile { display: flex; flex-direction: column; padding: 0; background: #0F0F11; color: #E4E4E7; border-color: transparent; }
[data-theme="dark"] .code-tile { background: #0A0A0B; border-color: var(--line); }
.code-bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.code-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.code-bar i:first-child { background: #F87171; }
.code-bar i:nth-child(2) { background: #FBBF24; }
.code-bar i:nth-child(3) { background: #34D399; }
.code-bar span { margin-left: 10px; font-family: var(--font-mono); font-size: .76rem; color: #A1A1AA; }
.code { flex: 1; margin: 0; padding: 18px 20px 22px; font-family: var(--font-mono); font-size: .84rem; line-height: 1.75; white-space: pre-wrap; min-height: 210px; }
.code .k { color: #F0B08C; } .code .f { color: #93C5FD; } .code .s { color: #86EFAC; } .code .c { color: #71717A; } .code .v { color: #FDE68A; }
.code .cursor { display: inline-block; width: 8px; height: 1.1em; vertical-align: -.2em; background: var(--accent); animation: blink 1s steps(1) infinite; }

/* Bandeau de technologies défilant */
.stack-band { display: flex; align-items: center; gap: 20px; padding: 18px 22px; }
.stack-band .tile-label { flex-shrink: 0; }
.marquee { position: relative; flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 10px; width: max-content; animation: marquee 40s linear infinite; }
.tile:hover .marquee-track { animation-play-state: paused; }
.tech-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); font-size: .88rem; font-weight: 500; white-space: nowrap; }
.tech-pill i { color: var(--accent); width: 16px; text-align: center; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (max-width: 600px) { .stack-band { flex-direction: column; align-items: flex-start; } .marquee { width: 100%; } }

.links-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--sunken); color: var(--text); font-size: 1.02rem; transition: transform .4s var(--spring), background-color .2s, color .2s; }
.socials a:hover { transform: translateY(-3px) rotate(-6deg); background: var(--accent); color: #FFFFFF; }
.tile-dark .socials a { background: var(--inverse-line); color: var(--inverse-text); }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 9vw, 110px) 0 0; }
main > .section:last-child { padding-bottom: clamp(64px, 9vw, 110px); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent-text); }
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.section-head h2 { margin-top: 14px; font-size: var(--fs-h2); letter-spacing: -.035em; max-width: 20ch; }
.section-head p { max-width: 44ch; color: var(--muted); }
.section-head .btn { flex-shrink: 0; }

/* Services */
.service-tile { display: flex; flex-direction: column; gap: 14px; min-height: 230px; }
.service-icon { display: grid; place-items: center; flex-shrink: 0; width: var(--icon-box); height: var(--icon-box); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); font-size: 1.1rem; transition: transform .5s var(--spring), background-color .3s, color .3s; }
.service-tile:hover .service-icon { transform: rotate(-8deg) scale(1.08); background: var(--accent); color: #FFFFFF; }
.tile-dark .service-icon { background: rgba(217, 119, 69, .2); color: var(--accent-on-inverse); }
.service-tile h3 { font-size: var(--fs-h3); }
.service-tile p { color: var(--text-soft); font-size: var(--fs-text); }
.tile-dark.service-tile p { color: var(--inverse-muted); }
.service-tile .more { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-small); color: var(--accent-text); }
.tile-dark.service-tile .more { color: var(--accent-on-inverse); }
.service-tile .more i { transition: transform .35s var(--spring); }
.service-tile:hover .more i { transform: translateX(5px); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-text); }
.check-list li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; display: grid; place-items: center; flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-text); font-size: .68rem; }

/* Processus */
.step { display: flex; flex-direction: column; gap: 12px; min-height: 200px; }
.step-number { font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; letter-spacing: -.05em; line-height: 1; color: var(--accent); }
.step h3 { font-size: var(--fs-h3); }
.step p { color: var(--text-soft); font-size: var(--fs-text); }
.tile-dark.step p { color: var(--inverse-muted); }

/* À propos */
.about-text p { font-size: var(--fs-lead); color: var(--text-soft); }
.about-text p + p { margin-top: 14px; }
.about-text h3 { font-size: var(--fs-h3-lg); margin: 14px 0 16px; }
.featured { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.featured h3 { font-size: var(--fs-h3-lg); margin-top: 10px; }
.featured p { color: var(--inverse-muted); font-size: var(--fs-text); max-width: 52ch; margin-top: 10px; }
.mission { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.mission blockquote { margin: 0; font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.4; letter-spacing: -.01em; }
.list-plain { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.list-plain li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line-strong); font-size: var(--fs-text); }
.list-plain li:last-child { border-bottom: 0; padding-bottom: 0; }
.list-plain li span:last-child { color: var(--muted); }
.tile .chips { margin-top: 16px; }

/* Compétences */
.skill-tile h3 { display: flex; align-items: center; gap: 12px; font-size: var(--fs-h3); margin-bottom: 22px; }
.skill-tile h3 i { display: grid; place-items: center; flex-shrink: 0; width: var(--icon-box); height: var(--icon-box); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); font-size: 1.1rem; }
.tile-dark.skill-tile h3 i { background: rgba(217, 119, 69, .2); color: var(--accent-on-inverse); }
.skill { margin-bottom: 16px; }
.skill:last-child { margin-bottom: 0; }
.skill-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: var(--fs-text); }
.skill-top span:first-child { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; }
.skill-top span:first-child i { width: 16px; text-align: center; color: var(--muted); }
.skill-top span:last-child { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-dark .skill-top span:last-child, .tile-dark .skill-top span:first-child i { color: var(--inverse-muted); }
.skill-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.tile-dark .skill-bar { background: var(--inverse-line); }
.skill-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #F0B08C, var(--accent)); transition: width 1.6s var(--ease); }
.is-visible .skill-bar span { width: var(--level); }

/* Projets */
.project-tile { display: flex; flex-direction: column; padding: 0; transform-style: preserve-3d; will-change: transform; }
.project-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.span-2.project-tile .project-media { aspect-ratio: 16 / 8.2; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.project-tile:hover .project-media img { transform: scale(1.05); }
.project-placeholder {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px 22px 0;
    background:
        radial-gradient(260px 180px at 85% 10%, rgba(217, 119, 69, .55), transparent 70%),
        radial-gradient(220px 160px at 10% 100%, rgba(217, 119, 69, .25), transparent 70%),
        #111111;
}
.project-placeholder::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(to bottom, #000, transparent); -webkit-mask-image: linear-gradient(to bottom, #000, transparent); }
.browser { position: relative; width: 100%; height: 82%; border-radius: 12px 12px 0 0; background: #1C1C1C; border: 1px solid rgba(255, 255, 255, .1); border-bottom: 0; box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .6); transform: translateY(10px); transition: transform .6s var(--ease); overflow: hidden; }
.project-tile:hover .browser { transform: translateY(0); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.browser-bar i:first-child { background: var(--accent); }
.browser-bar span { flex: 1; margin-left: 10px; padding: 4px 10px; border-radius: 6px; background: rgba(255, 255, 255, .06); font-size: .72rem; color: rgba(255, 255, 255, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-body { display: flex; flex-direction: column; gap: 9px; padding: 18px; }
.browser-body b { font-family: var(--font-display); font-size: clamp(1.2rem, 1.9vw, 1.6rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.span-2 .browser-body b { font-size: clamp(1.4rem, 2.6vw, 2.2rem); }
.browser-body em { display: block; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .1); }
.browser-body em:first-of-type { width: 85%; background: rgba(217, 119, 69, .55); }
.browser-body em.short { width: 55%; }
.project-body { display: flex; flex-direction: column; gap: 10px; padding: 22px; flex: 1; }
.project-meta { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent-text); }
.project-body h3 { font-size: var(--fs-h3); }
.project-body h3 a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.project-body p { color: var(--text-soft); font-size: var(--fs-text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tag { padding: 4px 10px; border-radius: 8px; background: var(--sunken); font-size: var(--fs-xs); font-weight: 500; color: var(--text-soft); }
a.tag { position: relative; z-index: 2; transition: background-color .2s, color .2s; }
a.tag:hover { background: var(--accent-soft); color: var(--accent-text); }
.project-links { position: relative; z-index: 2; display: flex; gap: 16px; padding: 0 22px 20px; font-size: var(--fs-small); }
.project-links a { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; transition: color .2s; }
.project-links a:hover { color: var(--accent-text); }

/* Recommandations */
.quote-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; }
.quote-tile blockquote { margin: 0; font-size: var(--fs-lead); line-height: 1.65; color: var(--text-soft); }
.tile-dark.quote-tile blockquote { color: var(--inverse-text); }
.quote-tile blockquote::before { content: '“'; display: block; font-family: var(--font-display); font-size: 3.4rem; line-height: .6; color: var(--accent); margin-bottom: 10px; }
.author { display: flex; align-items: center; gap: 12px; }
.author .avatar { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--accent); color: #FFFFFF; font-weight: 700; font-size: .9rem; }
.author .avatar img { width: 100%; height: 100%; object-fit: cover; }
.author strong { display: block; font-size: var(--fs-text); }
.author span { font-size: var(--fs-small); color: var(--muted); }
.tile-dark .author span { color: var(--inverse-muted); }
.source { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: var(--fs-xs); font-weight: 600; color: #0A66C2; }
.tile-dark .source { color: var(--accent-on-inverse); }

/* Parcours */
.timeline { list-style: none; margin: 22px 0 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), var(--surface-2)); }
.timeline li { position: relative; padding: 0 0 24px 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); transition: transform .35s var(--spring); }
.timeline li:hover::before { transform: scale(1.3); }
.timeline .period { font-size: var(--fs-xs); font-weight: 600; color: var(--accent-text); }
.timeline h4 { margin: 4px 0 2px; font-size: var(--fs-h4); }
.timeline .org { color: var(--muted); font-size: var(--fs-small); }
.timeline p { margin-top: 7px; font-size: var(--fs-text); color: var(--text-soft); }
.tile-dark .timeline::before { background: linear-gradient(var(--accent), var(--inverse-line)); }
.tile-dark .timeline li::before { background: var(--inverse); }
.tile-dark .timeline .period { color: var(--accent-on-inverse); }
.tile-dark .timeline .org, .tile-dark .timeline p { color: var(--inverse-muted); }
.current-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--success-bg); color: var(--success-text); font-size: .7rem; font-weight: 600; vertical-align: middle; }
.cert-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cert-list li { padding: 14px; border-radius: var(--radius-sm); background: var(--sunken); transition: background-color .2s, transform .35s var(--spring); }
.cert-list li:hover { background: var(--accent-soft); transform: translateY(-2px); }
.cert-list strong { display: block; font-size: var(--fs-text); font-weight: 600; line-height: 1.35; }
.cert-list span { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 600px) { .cert-list { grid-template-columns: 1fr; } }

/* Contact */
.contact-intro { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.contact-intro h2 { font-size: var(--fs-h2); letter-spacing: -.035em; margin-top: 14px; }
.contact-intro .lead { color: var(--inverse-muted); margin-top: 14px; }
.channels { display: grid; gap: 10px; }
.channel { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--inverse-line); transition: background-color .25s, transform .4s var(--spring); }
.channel:hover { background: rgba(217, 119, 69, .2); transform: translateX(5px); }
.channel i { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #FFFFFF; }
.channel small { display: block; color: var(--inverse-muted); font-size: var(--fs-xs); }
.channel strong { font-weight: 600; word-break: break-word; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; font-size: var(--fs-small); font-weight: 600; transition: color .2s; }
.field:focus-within label { color: var(--accent-text); }
.field label .opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--sunken); transition: border-color .2s, box-shadow .3s var(--ease), background-color .2s; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(217, 119, 69, .16); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #DC2626; animation: shake .4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.field .error { margin-top: 5px; font-size: var(--fs-small); color: var(--danger-text); }
.field[hidden] { display: none; }
.field.is-entering { animation: field-in .45s var(--ease); }
@keyframes field-in { from { opacity: 0; transform: translateY(-8px); } }
.type-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--radius-sm); background: var(--sunken); }
.type-switch::before { content: ''; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 11px; background: var(--inverse); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .6); transition: transform .45s var(--spring); }
.type-switch:has(input:nth-of-type(2):checked)::before { transform: translateX(calc(100% + 4px)); }
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch label { position: relative; z-index: 1; margin: 0; padding: 10px; border-radius: 11px; text-align: center; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--muted); transition: color .3s; }
.type-switch input:checked + label { color: var(--inverse-text); }
.type-switch input:focus-visible + label { outline: 2px solid var(--accent); }
/* Notation par étoiles : les champs sont dans l'ordre 5 → 1 pour colorer les étoiles précédentes en CSS */
.star-rating { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-rating input { position: absolute; opacity: 0; pointer-events: none; }
.star-rating label { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--sunken); color: var(--line-strong); font-size: 1.25rem; cursor: pointer; transition: color .2s, background-color .2s, transform .35s var(--spring); }
.star-rating label:hover, .star-rating label:hover ~ label, .star-rating input:checked ~ label { color: #F59E0B; background: color-mix(in srgb, #F59E0B 14%, var(--surface)); }
.star-rating label:hover { transform: translateY(-3px) scale(1.08); }
.star-rating input:checked + label { transform: scale(1.06); }
.star-rating input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.stars { display: inline-flex; gap: 3px; color: #F59E0B; font-size: .85rem; }
.stars .off { color: var(--line-strong); }
.tile-dark .stars .off { color: var(--inverse-line); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-small); font-weight: 400 !important; color: var(--text-soft); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
.form-footer small { color: var(--muted); font-size: var(--fs-small); max-width: 34ch; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: var(--fs-text); animation: alert-in .6s var(--spring); }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--danger-bg); color: var(--danger-text); }
.alert svg { flex-shrink: 0; width: 22px; height: 22px; }
.alert svg circle, .alert svg path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.alert svg circle { stroke-dasharray: 64; stroke-dashoffset: 64; animation: draw .6s var(--ease) .15s forwards; }
.alert svg path { stroke-dasharray: 20; stroke-dashoffset: 20; animation: draw .4s var(--ease) .6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes alert-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Pied de page ---------- */

.site-footer { padding: 26px 0 36px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-small); color: var(--muted); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.visitor-count { display: inline-flex; align-items: center; gap: 7px; font-size: inherit; color: var(--accent-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.footer-nav a { transition: color .2s; }
.footer-nav a:hover { color: var(--text); }

.back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--inverse); color: var(--inverse-text); box-shadow: var(--shadow-hover); cursor: pointer; opacity: 0; transform: translateY(16px) scale(.8); pointer-events: none; transition: opacity .3s, transform .45s var(--spring), background-color .2s; }
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { background: var(--accent); color: #FFFFFF; }

/* ---------- Pages intérieures ---------- */

.page-head { padding: 116px 0 0; }
.page-head .tile { padding: clamp(26px, 4vw, 48px); }
.page-head h1 { margin: 14px 0 12px; font-size: var(--fs-display); letter-spacing: -.04em; line-height: 1.02; max-width: 18ch; }
.page-head .lead { max-width: 60ch; color: var(--text-soft); font-size: var(--fs-lead); }
.tile-dark.page-title .lead { color: var(--inverse-muted); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--fs-small); color: var(--muted); }
.tile-dark .breadcrumb { color: var(--inverse-muted); }
.breadcrumb a { transition: color .2s; }
.breadcrumb a:hover { color: var(--accent); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.fact { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.fact span { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }
.fact strong { font-family: var(--font-display); font-size: var(--fs-h4); font-weight: 600; word-break: break-word; }
.big-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--accent); color: #FFFFFF; font-size: 1.6rem; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters a { padding: 9px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-small); font-weight: 500; transition: background-color .25s, color .25s, border-color .25s, transform .35s var(--spring); }
.filters a:hover { border-color: var(--text); transform: translateY(-2px); }
.filters a.is-active { background: var(--inverse); border-color: var(--inverse); color: var(--inverse-text); }

/* Couverture : image entière (jamais recadrée), centrée et de hauteur limitée. */
.page-head .cover-tile { display: flex; justify-content: center; padding: 16px; }
.cover-tile img { width: auto; max-width: 100%; height: auto; max-height: 360px; border-radius: var(--radius); }
.prose { font-size: var(--fs-lead); line-height: 1.8; color: var(--text-soft); }
.prose h2 { font-size: var(--fs-h3-lg); margin: 34px 0 12px; color: var(--text); }
.prose h2:first-child { margin-top: 0; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 14px; }
.prose ul { padding-left: 1.2em; margin: 10px 0 0; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--accent); }
.prose h3 { font-size: var(--fs-h4); margin: 26px 0 8px; color: var(--text); }
.prose strong { color: var(--text); }
.prose code { padding: 2px 6px; border-radius: 6px; background: var(--sunken); font-family: var(--font-mono); font-size: .86em; color: var(--accent-text); }
.prose blockquote { margin: 18px 0; padding: 14px 18px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--sunken); font-style: italic; }
.prose * + h2, .prose * + h3 { margin-top: 30px; }
.code-block { position: relative; margin: 18px 0; padding: 18px 20px; border-radius: var(--radius-sm); background: #0F0F11; color: #E4E4E7; overflow-x: auto; font-family: var(--font-mono); font-size: .84rem; line-height: 1.7; }
.code-block code { padding: 0; background: none; color: inherit; font-size: inherit; }
.code-block[data-lang]::before { content: attr(data-lang); position: absolute; top: 8px; right: 12px; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #71717A; }
.article-body .prose { max-width: 72ch; }
.article-aside { display: grid; gap: var(--gap); align-self: start; position: sticky; top: 100px; }
@media (max-width: 1000px) { .article-aside { position: static; grid-column: span 2; } }
@media (max-width: 600px) { .article-aside { grid-column: span 1; } }

/* Blog */
.post-tile { display: flex; flex-direction: column; gap: 12px; min-height: 260px; }
.post-cover { margin: -26px -26px 6px; aspect-ratio: 16 / 8; overflow: hidden; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.post-tile:hover .post-cover img { transform: scale(1.05); }
.post-tile h3 { font-size: var(--fs-h3); line-height: 1.2; }
.span-2.post-tile h3 { font-size: var(--fs-h3-lg); }
.post-tile p { color: var(--text-soft); font-size: var(--fs-text); }
.tile-dark.post-tile p { color: var(--inverse-muted); }
.post-tile .more { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-small); color: var(--accent-text); }
.tile-dark.post-tile .more { color: var(--accent-on-inverse); }
.post-tile .more i { transition: transform .35s var(--spring); }
.post-tile:hover .more i { transform: translateX(5px); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: var(--fs-small); color: var(--muted); }
.tile-dark .post-meta { color: var(--inverse-muted); }
.post-meta span { display: inline-flex; align-items: center; gap: 7px; }
.author-chip { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.share-tile .copy-link { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 13px; background: var(--sunken); color: var(--text); cursor: pointer; transition: transform .4s var(--spring), background-color .2s, color .2s; }
.share-tile .copy-link:hover, .share-tile .copy-link.is-copied { background: var(--accent); color: #FFFFFF; transform: translateY(-3px); }
.pager-links { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }

/* Étude de cas */
.metric-tile { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 150px; }
.metric-tile strong { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.metric-tile span { font-size: var(--fs-text); opacity: .85; }
.case-section .step-number { font-size: 1.1rem; display: inline-grid; place-items: center; width: var(--icon-box); height: var(--icon-box); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); }
.tile-dark.case-section .step-number { background: rgba(217, 119, 69, .2); color: var(--accent-on-inverse); }
.case-section h2 { font-size: var(--fs-h3); margin: 14px 0 10px; }
.tile-dark.case-section .prose { color: var(--inverse-muted); }
.gallery-tile figure { margin: 0; }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; }
.gallery-tile figcaption { padding: 12px 16px; font-size: var(--fs-small); color: var(--muted); }
.pager-tile { display: flex; flex-direction: column; gap: 6px; }
.pager-tile small { color: var(--muted); }
.pager-tile strong { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; }
.pager-tile.next { text-align: right; }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.cta-row h2 { font-size: var(--fs-h3-lg); letter-spacing: -.03em; max-width: 24ch; }

/* ---------- Apparitions et transitions ---------- */

.reveal { opacity: 0; transform: translateY(26px) scale(.98); transition: opacity .7s var(--ease), transform .8s var(--ease), box-shadow .45s var(--ease), background-color .4s, color .4s; transition-delay: var(--delay, 0s); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.is-visible:hover:not(.project-tile) { transform: translateY(-4px); }
.no-js .reveal { opacity: 1; transform: none; }

/* Transitions entre les pages (navigateurs compatibles) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out .28s var(--ease) both; }
::view-transition-new(root) { animation: page-in .45s var(--ease) both; }
@keyframes page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }
.site-header { view-transition-name: site-header; }
::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; }
/* Changement de thème : révélation circulaire depuis le bouton (géré en JS) */
html.theme-transition::view-transition-old(root), html.theme-transition::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal, .intro h1 .line > span { opacity: 1; transform: none; }
    .skill-bar span { width: var(--level); }
}

/* Images et vidéos dans les articles */
.prose .prose-media { margin: 26px 0; }
/* Taille raisonnable : jamais plus haut que 70 % de l'écran ni que 520 px, centré. */
.prose .prose-media img, .prose .prose-media video { display: block; width: auto; max-width: 100%; height: auto; max-height: min(70vh, 520px); margin: 0 auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--sunken); }
.prose .prose-media video { width: 100%; object-fit: contain; background: #000; }
.prose .prose-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; }
.prose .prose-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose .prose-media figcaption { margin-top: 10px; font-size: var(--fs-small); color: var(--muted); text-align: center; }

/* Protection du contenu : pas de sélection ni de glisser, sauf dans les formulaires */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, video, svg { -webkit-user-drag: none; user-drag: none; }

.protect-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 120;
    display: flex; align-items: center; gap: 14px;
    width: max-content; max-width: calc(100vw - 32px);
    padding: 14px 14px 14px 16px; border-radius: var(--radius);
    background: var(--inverse); color: var(--inverse-text);
    border: 1px solid var(--inverse-line); box-shadow: var(--shadow-hover);
    font-size: .9rem; line-height: 1.45;
    opacity: 0; transform: translate(-50%, 18px) scale(.97); pointer-events: none;
    transition: opacity .3s, transform .45s var(--spring);
}
.protect-toast.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.protect-toast-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #FFFFFF; }
.protect-toast-body { display: grid; gap: 2px; min-width: 0; }
.protect-toast-body strong { font-family: var(--font-display); font-weight: 600; }
.protect-toast-body span { color: var(--inverse-muted); }
.protect-toast-link { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--inverse-line); color: var(--inverse-text); font-size: .82rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color .2s; }
.protect-toast-link:hover { background: var(--accent); }
.protect-toast-close { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--inverse-muted); cursor: pointer; }
.protect-toast-close:hover { color: var(--inverse-text); background: var(--inverse-line); }
@media (max-width: 560px) {
    .protect-toast { bottom: 16px; flex-wrap: wrap; }
    .protect-toast-body { flex: 1 1 calc(100% - 100px); }
    .protect-toast-link { margin-left: 52px; }
}

/* Impression : le contenu n'est pas imprimable, seul un avis s'affiche */
@media print {
    body > * { display: none !important; }
    body::after { content: attr(data-print-notice); display: block; padding: 40px; font: 16px/1.6 var(--font-body); color: #111111; text-align: center; }
}

/* Pages légales */
.legal-links { display: grid; gap: 4px; }
.legal-links a { padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-soft); font-weight: 500; text-decoration: none; transition: background-color .2s, color .2s; }
.legal-links a:hover { background: var(--surface-2); color: var(--text); }
.legal-links a.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.prose.legal { font-size: 1rem; }
.prose.legal a { color: var(--accent); }
.form-footer small a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-mail { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--accent); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.legal-mail:hover { text-decoration: underline; }

/* Compétences : niveau (Expert / Confirmé / Notions) et projets réalisés */
.skill-list { list-style: none; margin: 0; padding: 0; }
.skill-list .skill { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-text); }
.skill-list .skill:first-child { border-top: 0; padding-top: 0; }
.tile-dark .skill-list .skill { border-color: var(--inverse-line); }
.skill-name { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-weight: 500; }
.skill-name i { width: 16px; text-align: center; color: var(--muted); }
.tile-dark .skill-name i { color: var(--inverse-muted); }
.skill-info { display: grid; gap: 2px; min-width: 0; }
.skill-level { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; border: 1px solid var(--line-strong); color: var(--text-soft); }
.skill-level.is-expert { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.skill-level.is-confirmed { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.tile-dark .skill-level { border-color: var(--inverse-line); color: var(--inverse-muted); }
.tile-dark .skill-level.is-confirmed { background: rgba(217, 119, 69, .2); color: var(--accent-on-inverse); }
.tile-dark .skill-level.is-expert { color: #FFFFFF; }
.skill-projects { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin-left: 25px; font-size: .76rem; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .2s; }
.skill-projects i { font-size: .65rem; transition: transform .25s var(--spring); }
.skill-projects:hover { color: var(--accent-text); }
.skill-projects:hover i { transform: translateX(3px); }
.tile-dark .skill-projects { color: var(--inverse-muted); }
.tile-dark .skill-projects:hover { color: var(--accent-on-inverse); }

/* Changement de langue sans rechargement : fondu enchaîné, en-tête fixe */
html.is-switching-lang { cursor: progress; }
html.is-switching-lang main { transition: opacity .2s; opacity: .55; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
.stat-since { display: block; margin-top: 4px; font-size: .8rem; color: var(--inverse-muted); letter-spacing: .02em; }

/* Compétences : flèches en pointillés Frontend → Backend → Outils */
.skills-flow { position: relative; column-gap: clamp(44px, 5vw, 72px); row-gap: clamp(48px, 5vw, 64px); }
.skills-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; color: var(--accent); opacity: 0; transition: opacity .6s ease .45s; }
.skills-flow.is-linked .skills-links, .skills-flow.is-linked .skills-link-label { opacity: 1; }
.skills-link-track { fill: none; stroke: var(--accent); stroke-opacity: .16; stroke-width: 6; stroke-linecap: round; }
.skills-link { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 7; animation: skills-flow-dash .8s linear infinite; }
.skills-link-dot { fill: var(--accent); filter: drop-shadow(0 0 4px rgba(217, 119, 69, .7)); }
/* L'offset décroissant fait avancer les pointillés dans le sens de la flèche (gauche → droite, haut → bas). */
@keyframes skills-flow-dash { to { stroke-dashoffset: -9; } }
.skills-link-label {
    position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 12px));
    padding: 3px 9px; border-radius: 999px; white-space: nowrap; pointer-events: none;
    background: var(--surface); border: 1px dashed var(--accent); color: var(--accent-text);
    font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    box-shadow: var(--shadow); opacity: 0; transition: opacity .6s ease .6s;
}
.skills-link-label.is-vertical { transform: translate(14px, -50%); }
@media (prefers-reduced-motion: reduce) { .skills-link { animation: none; } }
.skills-link-label.is-upright { writing-mode: vertical-rl; transform: translate(-50%, calc(-100% - 12px)); padding: 9px 3px; }

/* Textes justifiés (alignés à gauche et à droite) sur tout le site.
   La césure automatique, dans la langue de la page (lang="fr" / "en"), évite
   les grands espaces entre les mots sur les écrans étroits. Les textes
   volontairement centrés (légendes, états vides, portrait) ne sont pas touchés. */
main :is(p, blockquote, li):not(:where(.portrait-id, .empty, figcaption, .form-footer, .chips, .breadcrumb, .page-actions, .skill-list, .list-plain) *, .portrait-id, .empty) {
    text-align: justify;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    hyphenate-limit-chars: 7 3 3;
    overflow-wrap: break-word;
}
