/* ============================================================
   PORTFOLIO V2 — Jean-Charles Fremont
   DA : coque technique froide (Piste B) + trait dessiné (Piste A)
   ============================================================ */

:root {
    color-scheme: light dark; /* les contrôles natifs suivent le thème */

    /* Couleur du texte sur les sections toujours sombres (contact, footer).
       Constante : ne suit PAS le thème, sinon texte sombre sur fond sombre. */
    --on-dark:      #EEF1F4;

    /* --- Couleur ----------------------------------------------------- */
    --bg:           #EEF1F4;   /* gris bleuté froid */
    --bg-deep:      #E7EBEF;   /* fond des creux */
    --surface:      #F7F8FA;   /* cartes / surfaces */
    --ink:          #13171A;   /* texte principal */
    --ink-soft:     #3A4248;   /* texte secondaire */
    --muted:        #5B6673;   /* labels, captions — contraste AA sur fond clair */
    --line:         #D2D8DE;   /* filets, bordures */

    /* Accent — bleu électrique (repris de la landing page) */
    --accent:       #003CFF;
    --accent-ink:   #0A0EE3;
    --accent-bright:#4D7CFF;  /* variante lisible sur fond sombre (contact, footer) */

    /* --- Typo -------------------------------------------------------- */
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
    --font-mono:    'Space Mono', ui-monospace, monospace;

    /* --- Grille ------------------------------------------------------ */
    --maxw: 1320px;
    --pad:  clamp(1.25rem, 4vw, 3rem);

    /* --- Motion ------------------------------------------------------ */
    --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ============================================================
   DARK MODE — suit la préférence système
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #13171A;   /* fond principal */
        --bg-deep:      #0D1013;   /* fonds creux, hero */
        --surface:      #1C2229;   /* cartes, surfaces */
        --ink:          #EEF1F4;   /* texte principal */
        --ink-soft:     #B0BCC8;   /* texte secondaire */
        --muted:        #8794A1;   /* labels, captions — contraste AA sur bg ET surface */
        --line:         #252D37;   /* filets, bordures */

        /* Accent dark : jaune signal — complémentaire du bleu électrique du mode
           clair, lu comme une inversion jour/nuit assumée. Contraste 11 à 14:1
           selon le fond, là où le bleu tombait à 4,3:1 sur les cartes. */
        --accent:       #FFD24D;
        --accent-ink:   #FFC01F;   /* survol / état actif, plus dense */
        --accent-bright:#FFD24D;
    }
    /* NB : les surcharges de composants pour le dark mode sont regroupées
       en fin de fichier (sinon les règles suivantes les écrasent). */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* Les <picture> servent uniquement à choisir la source (thème / mouvement) :
   ils ne doivent pas peser sur la mise en page, seul l'<img> compte. */
picture { display: contents; }

/* Focus clavier visible partout, sans polluer la navigation souris */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}
.contact :focus-visible,
.site-footer :focus-visible {
    outline-color: var(--accent-bright);
}

.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; top: -999px; left: 1rem;
    background: var(--ink); color: var(--bg);
    font-family: var(--font-mono); font-size: .82rem;
    padding: .6rem 1.2rem; border-radius: 0 0 4px 4px;
    z-index: 9999; text-decoration: none;
    transition: top .15s;
}
.skip-link:focus { top: 0; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: fixed; inset: 0 0 auto 0;
    z-index: 100;
    padding: 1.4rem 0;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border-bottom: 1px solid transparent;
    transition: border-color .3s var(--ease), padding .3s var(--ease);
}
.site-header.scrolled {
    padding: .9rem 0;
    border-bottom-color: var(--line);
}

.nav {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: flex; align-items: center; justify-content: space-between;
}

.wordmark { display: flex; align-items: center; gap: .6rem; }
.wordmark-sig {
    height: 36px; width: auto;
    display: block;
}
/* Le footer est toujours sombre : signature inversée en blanc */
.footer-sig { filter: invert(1); }
.wordmark-full {
    font-family: var(--font-mono);
    font-size: .72rem; color: var(--muted);
    letter-spacing: .01em;
}

.nav-links { display: flex; gap: 2.2rem; list-style: none; }
.nav-links a {
    font-family: var(--font-mono);
    font-size: .82rem;
    color: var(--ink-soft);
    position: relative;
    padding: .2rem 0;
    transition: color .2s var(--ease);
}
.nav-links a::after {
    content: ''; position: absolute; left: 0; bottom: -2px;
    width: 100%; height: 1.5px; background: var(--accent);
    transform: scaleX(0); transform-origin: left;
    transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex; flex-direction: column; justify-content: center;
    /* Air propre au hero (n'affecte pas la grille projets) */
    max-width: 1200px;
    margin: 0 auto;
    padding: 10rem clamp(2rem, 7vw, 6.5rem) 7rem;
    overflow: hidden;
}

/* --- arrière-plan : trame + trait --- */
.hero-canvas {
    position: absolute; inset: 0;
    z-index: 0; pointer-events: none;
}
.grid-dots {
    position: absolute; inset: -10%;
    background-image: radial-gradient(var(--ink) 1.1px, transparent 1.2px);
    background-size: 30px 30px;
    opacity: .05;
    animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { opacity: .04; background-size: 30px 30px; }
    50%      { opacity: .07; background-size: 31px 31px; }
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.hero-gif {
    position: absolute;
    right: clamp(-2rem, 1vw, 3rem); top: 50%;
    transform: translateY(-50%);
    width: clamp(260px, 33vw, 460px);
    height: auto;
    object-fit: contain;
    opacity: 1;   /* fond détouré directement dans le fichier (APNG transparent) */
    animation: gifIn 1s var(--ease) .2s both;
}
/* n'anime QUE l'opacité, pour ne pas écraser le transform de positionnement */
@keyframes gifIn { from { opacity: 0; } to { opacity: 1; } }

/* --- contenu --- */
.hero-inner { position: relative; z-index: 1; max-width: 54ch; }

.hero-label {
    font-family: var(--font-mono);
    font-size: .82rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: .08em;
    margin-bottom: 2rem;
    display: flex; align-items: center;
}
.hero-status { color: var(--accent); }
.blink { color: var(--accent); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.1rem, 4.2vw, 3.5rem);
    line-height: 1.06;
    letter-spacing: -.03em;
    color: var(--ink);
    margin-bottom: 1.4rem;
}
.hero-title .line { display: block; }
.hero-title .accent { position: relative; color: var(--accent); white-space: nowrap; }

/* soulignement dessiné sous "dessin" */
.hero-title .ul {
    position: absolute; left: 0; right: 0; bottom: -.12em;
    width: 100%; height: .32em;
    overflow: visible;
}
.hero-title .ul path {
    stroke: var(--accent); stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 240; stroke-dashoffset: 240;
    animation: draw 1s var(--ease) 2.6s forwards;
}

.hero-sub {
    font-size: clamp(1rem, 1.4vw, 1.14rem);
    color: var(--ink-soft);
    max-width: 46ch;
    margin-bottom: 2.4rem;
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
    font-family: var(--font-mono);
    font-size: .85rem;
    padding: .85rem 1.5rem;
    border: 1.5px solid var(--ink);
    border-radius: 2px;
    transition: all .25s var(--ease);
    display: inline-flex; align-items: center; gap: .5rem;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

.scroll-hint {
    position: absolute; bottom: 2rem; left: var(--pad);
    z-index: 1;
    font-family: var(--font-mono); font-size: .72rem;
    color: var(--muted); text-transform: uppercase; letter-spacing: .1em;
    display: flex; align-items: center; gap: .6rem;
}
.scroll-arrow { animation: bob 1.8s ease-in-out infinite; display: inline-block; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* entrée du contenu */
.hero-label, .hero-title .line, .hero-sub, .hero-cta {
    opacity: 0; transform: translateY(14px);
    animation: rise .9s var(--ease) forwards;
}
.hero-title .line:nth-child(1) { animation-delay: .15s; }
.hero-title .line:nth-child(2) { animation-delay: .28s; }
.hero-sub  { animation-delay: .5s; }
.hero-cta  { animation-delay: .62s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ============================================================
   SECTIONS — entêtes communes
   ============================================================ */
.section-head { max-width: 60ch; }
.section-kicker {
    font-family: var(--font-mono);
    font-size: .82rem; color: var(--accent);
    letter-spacing: .04em; margin-bottom: 1.2rem;
}
.section-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.6rem, 3.4vw, 2.7rem);
    line-height: 1.06; letter-spacing: -.02em;
    color: var(--ink);
}

/* reveal */
.section-head, .work-card {
    opacity: 0; transform: translateY(18px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.section-head.in, .work-card.in { opacity: 1; transform: none; }

/* ============================================================
   TRAVAUX
   ============================================================ */
.travaux {
    max-width: var(--maxw); margin: 0 auto;
    padding: 7rem var(--pad);
    border-top: 1px solid var(--line);
}

/* --- filtres --- */
.filters {
    display: flex; flex-wrap: wrap; gap: .6rem;
    margin: 2.6rem 0 3rem;
}
.filter {
    font-family: var(--font-mono);
    font-size: .82rem; color: var(--ink-soft);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .5rem 1.1rem;
    cursor: pointer;
    transition: all .2s var(--ease);
}
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter.is-active {
    background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.filter-count { opacity: .55; margin-left: .15rem; }

/* --- grille --- */
.works-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1.5rem, 3vw, 2.6rem);
}
.work-card {
    display: flex; flex-direction: column;
    color: var(--ink);
}
.work-card.is-hidden { display: none; }

/* visuel + hover graphique */
.work-visual {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    background: var(--bg-deep);
    border: 1px solid var(--line);
}
.work-visual img, .work-visual video {
    width: 100%; height: 100%; object-fit: cover;
    transform: scale(1.01);
    transition: transform .6s var(--ease);
}
.work-card:hover .work-visual img,
.work-card:focus-visible .work-visual img,
.work-card:hover .work-visual video,
.work-card:focus-visible .work-visual video {
    transform: scale(1.05);
}

/* masque accent : bandeau qui glisse depuis le bas */
.work-mask {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: var(--accent);
    display: flex; align-items: center;
    padding: .95rem 1.2rem;
    transform: translateY(101%);
    transition: transform .42s var(--ease);
}
.work-card:hover .work-mask,
.work-card:focus-visible .work-mask { transform: translateY(0); }
.work-cta {
    font-family: var(--font-mono);
    font-size: .9rem; font-weight: 700;
    color: var(--bg);
    display: inline-flex; align-items: center; gap: .5rem;
}
.work-cta .arrow { transition: transform .3s var(--ease); }
.work-card:hover .work-cta .arrow { transform: translateX(4px); }

/* badge catégorie */
.work-cat {
    position: absolute; top: .8rem; left: .8rem;
    font-family: var(--font-mono);
    font-size: .68rem; letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(6px);
    padding: .25rem .6rem; border-radius: 999px;
    border: 1px solid var(--line);
}

/* corps */
.work-body { padding-top: 1.1rem; }
.work-topline {
    display: flex; align-items: center; gap: .7rem;
    font-family: var(--font-mono); font-size: .74rem;
    color: var(--muted); margin-bottom: .5rem;
}
.work-num { color: var(--accent); }
.work-title {
    font-family: var(--font-display);
    font-weight: 600; font-size: 1.5rem;
    letter-spacing: -.02em; line-height: 1.1;
    margin-bottom: .5rem;
}
.work-excerpt {
    color: var(--ink-soft); font-size: .95rem;
    max-width: 46ch; margin-bottom: 1rem;
}
.work-tags {
    display: flex; flex-wrap: wrap; gap: .4rem; list-style: none;
}
.work-tags li {
    font-family: var(--font-mono); font-size: .72rem;
    color: var(--ink-soft);
    border: 1px solid var(--line); border-radius: 3px;
    padding: .2rem .55rem;
}

@media (max-width: 720px) {
    .works-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   BARRE DE RETOUR (centrée en bas)
   ============================================================ */
.case-navbar, .to-top {
    position: fixed; left: 50%; bottom: clamp(1rem, 3vw, 1.5rem);
    z-index: 200;
    transform: translateX(-50%) translateY(14px);
    opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.case-navbar.is-visible, .to-top.is-visible {
    opacity: 1; transform: translateX(-50%); pointer-events: auto;
}

/* barre claire (pages projet) */
.case-navbar {
    display: flex; align-items: center; gap: 1.25rem;
    max-width: min(560px, 92vw);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; padding: .55rem .55rem .55rem 1.25rem;
    box-shadow: 0 14px 34px -16px rgba(0,0,0,.4);
}
.case-navbar-info { display: flex; flex-direction: column; min-width: 0; }
.case-navbar-title {
    font-family: var(--font-display); font-weight: 600;
    font-size: .98rem; letter-spacing: -.01em; line-height: 1.15;
    color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.case-navbar-sub {
    font-size: .8rem; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* bouton foncé partagé */
.case-navbar-back, .to-top {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
    border-radius: 8px; padding: .7rem 1.15rem;
    font-family: var(--font-mono); font-size: .76rem;
    text-transform: uppercase; letter-spacing: .1em;
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
    transition: background .2s var(--ease), border-color .2s var(--ease), opacity .3s var(--ease), transform .3s var(--ease);
}
.to-top { box-shadow: 0 10px 26px -14px rgba(0,0,0,.5); }
.case-navbar-back:hover, .to-top:hover { background: var(--accent); border-color: var(--accent); }
.cn-arrow { line-height: 1; transition: transform .25s var(--ease); }
.case-navbar-back:hover .cn-arrow { transform: translateX(-3px); }
.to-top:hover .cn-arrow { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
    .case-navbar, .to-top { transition: opacity .2s; }
    .case-navbar.is-visible, .to-top.is-visible { transform: translateX(-50%); }
}

/* generic reveal hook */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ============================================================
   SIGNAL — ce que j'apporte
   ============================================================ */
.signal {
    max-width: var(--maxw); margin: 0 auto;
    padding: 7rem var(--pad);
    border-top: 1px solid var(--line);
}
.signal-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.5rem, 3vw, 2.4rem);
    margin-top: 3.5rem;
}
.signal-card {
    display: flex; flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
    padding: 2rem 1.8rem 2.2rem;
    transition: transform .3s var(--ease);
}
.signal-card:hover { transform: translateY(-3px); }
/* GIF en bas de la carte, sous les textes, pleine largeur (bleed) */
.signal-ico {
    margin-top: auto;
    margin-left: -1.8rem; margin-right: -1.8rem; margin-bottom: -2.2rem;
    padding-top: 2rem;
    height: 340px;
}
.signal-ico svg { width: 100%; height: 100%; }
.signal-gif { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; display: block; }
.signal-ico [stroke], .signal-ico svg * { }
.signal-ico .s-draw, .signal-ico .s-link, .signal-ico .s-cursor {
    stroke: var(--ink); stroke-width: 3; fill: none;
    stroke-linecap: round; stroke-linejoin: round;
}
.signal-ico .s-iris { stroke: var(--accent); stroke-width: 3; fill: none; }
.signal-ico .s-pup  { fill: var(--accent); }
.signal-ico .s-node { fill: var(--accent); }
.signal-ico .s-cursor { stroke: var(--accent); }

/* anim quand la carte entre */
.signal-card .s-draw { stroke-dasharray: 240; stroke-dashoffset: 240; }
.signal-card.in .s-draw { animation: draw 1.3s var(--ease) .2s forwards; }
.signal-card .s-link { stroke-dasharray: 90; stroke-dashoffset: 90; }
.signal-card.in .s-link { animation: draw 1s var(--ease) forwards; }
.signal-card .s-iris { opacity: 0; }
.signal-card.in .s-iris { animation: nodeIn .5s var(--ease) 1s forwards; }
.signal-card .s-cursor { animation: blink 1.1s steps(2) infinite; }

.signal-label {
    font-family: var(--font-mono); font-size: .78rem;
    color: var(--accent); letter-spacing: .04em; margin-bottom: .7rem;
}
.signal-title {
    font-family: var(--font-display); font-weight: 600;
    font-size: 1.4rem; letter-spacing: -.02em; margin-bottom: .7rem;
}
.signal-text { color: var(--ink-soft); font-size: .95rem; }

@media (max-width: 640px) {
    .signal-grid { grid-template-columns: 1fr; max-width: 30rem; }
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
    background: #08090C;
    color: var(--on-dark);
}
.contact-inner {
    max-width: var(--maxw); margin: 0 auto;
    padding: 7rem var(--pad);
}
.contact .section-kicker { color: var(--accent-bright); }
.contact-head {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(2.6rem, 8vw, 6rem); line-height: .95;
    letter-spacing: -.03em; margin: 1rem 0 1.6rem;
}
.contact-lead {
    color: color-mix(in srgb, var(--on-dark) 78%, transparent);
    max-width: 46ch; font-size: 1.05rem; margin-bottom: 3.5rem;
}
.contact-cols {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 2.5rem; max-width: 44rem;
    border-top: 1px solid color-mix(in srgb, var(--on-dark) 22%, transparent);
    padding-top: 2.5rem;
}
.contact-k {
    font-family: var(--font-mono); font-size: .76rem;
    text-transform: uppercase; letter-spacing: .08em;
    color: color-mix(in srgb, var(--on-dark) 62%, transparent);
    margin-bottom: 1.1rem;
}
.contact-list { list-style: none; }
.contact-list li { font-size: 1.05rem; padding: .25rem 0; }
.contact-link {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .55rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--on-dark) 18%, transparent);
    font-size: 1rem; transition: color .2s var(--ease), padding .25s var(--ease);
}
.contact-link span { color: var(--accent-bright); }
.contact-link:hover { color: var(--accent-bright); padding-left: .4rem; }

@media (max-width: 640px) {
    .contact-cols { grid-template-columns: 1fr; gap: 2rem; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: #08090C; color: var(--on-dark); }
.footer-inner {
    max-width: var(--maxw); margin: 0 auto;
    padding: 2.2rem var(--pad);
    border-top: 1px solid color-mix(in srgb, var(--on-dark) 16%, transparent);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
}
.footer-sig { height: 40px; width: auto; display: block; }
.footer-social { display: flex; gap: 1.5rem; list-style: none; }
.footer-social a {
    font-family: var(--font-mono); font-size: .82rem;
    color: color-mix(in srgb, var(--on-dark) 70%, transparent);
    transition: color .2s var(--ease);
}
.footer-social a:hover { color: var(--accent-bright); }
.footer-meta {
    font-family: var(--font-mono); font-size: .76rem;
    color: color-mix(in srgb, var(--on-dark) 58%, transparent);
}

/* ============================================================
   PAGE DÉMARCHE
   ============================================================ */
.page-head {
    max-width: var(--maxw); margin: 0 auto;
    padding: 11rem var(--pad) 4rem;
}
.page-title {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(2.6rem, 7vw, 5rem); line-height: .98;
    letter-spacing: -.03em; margin: 1rem 0 1.8rem;
}
.page-title .accent { color: var(--accent); }
.page-lead {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    color: var(--ink-soft); max-width: 62ch;
}
.page-lead strong { color: var(--ink); }

/* --- 3 temps --- */
.process-section, .parcours-section, .skills-section {
    max-width: var(--maxw); margin: 0 auto;
    padding: 6rem var(--pad);
    border-top: 1px solid var(--line);
}
.process {
    list-style: none;
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.5rem, 3vw, 2.4rem);
    margin-top: 3.5rem;
    counter-reset: step;
}
.process-step {
    position: relative;
    padding-top: 2rem;
    border-top: 2px solid var(--ink);
}
.process-step::before {
    content: ''; position: absolute; top: -2px; left: 0;
    width: 20%; height: 2px; background: var(--accent);
}
.process-step:nth-child(2)::before { width: 55%; }
.process-step:nth-child(3)::before { width: 100%; }
.process-num {
    font-family: var(--font-mono); font-size: .82rem;
    color: var(--muted);
}
.process-title {
    font-family: var(--font-display); font-weight: 600;
    font-size: 1.7rem; letter-spacing: -.02em;
    margin: .4rem 0 .3rem;
}
.process-sub { font-weight: 500; color: var(--ink); margin-bottom: .7rem; }
.process-text { color: var(--ink-soft); font-size: .95rem; }

/* --- parcours / timeline --- */
.parcours { margin-top: 3.5rem; max-width: 760px; }
.parcours-item {
    position: relative;
    padding: 0 0 3.5rem 2.2rem;
    border-left: 1px solid var(--line);
}
.parcours-item:last-child { padding-bottom: 0; }
.parcours-item::before {
    content: ''; position: absolute; left: -6px; top: .35rem;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--bg);
}
.parcours-label {
    font-family: var(--font-mono); font-size: .78rem;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted);
}
.parcours-title {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem); letter-spacing: -.02em;
    margin: .5rem 0 .8rem;
}
.parcours-text { color: var(--ink-soft); margin-bottom: 1.1rem; max-width: 56ch; }
.parcours-take {
    font-size: .95rem; color: var(--ink);
    border-left: 2px solid var(--accent);
    padding-left: 1rem; max-width: 54ch;
}
.parcours-take span {
    display: block; font-family: var(--font-mono);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--accent); margin-bottom: .25rem;
}

/* --- compétences --- */
.skills { margin-top: 3rem; }
.skills-row {
    display: grid; grid-template-columns: 220px 1fr;
    gap: 1.5rem; align-items: start;
    padding: 1.8rem 0;
    border-top: 1px solid var(--line);
}
.skills-row:last-child { border-bottom: 1px solid var(--line); }
.skills-cat {
    font-family: var(--font-display); font-weight: 600;
    font-size: 1.15rem; letter-spacing: -.01em;
}
.skills-pills { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.skills-pills li {
    font-family: var(--font-mono); font-size: .82rem;
    color: var(--ink-soft);
    border: 1px solid var(--line); border-radius: 3px;
    padding: .35rem .75rem;
    transition: border-color .2s var(--ease), color .2s var(--ease);
}
.skills-pills li:hover { border-color: var(--ink); color: var(--ink); }

@media (max-width: 640px) {
    .process { grid-template-columns: 1fr; }
    .skills-row { grid-template-columns: 1fr; gap: .8rem; }
}

/* ============================================================
   CAS D'ÉTUDE
   ============================================================ */
.case { max-width: 1080px; margin: 0 auto; padding: 0 var(--pad); }
.case-back {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--font-mono); font-size: .82rem;
    color: var(--muted); margin: 9rem 0 2.5rem;
    transition: color .2s var(--ease), gap .2s var(--ease);
}
.case-back:hover { color: var(--accent); gap: .8rem; }

.case-head { margin-bottom: 2.5rem; }
.case-meta {
    font-family: var(--font-mono); font-size: .82rem;
    color: var(--muted); margin-bottom: 1.1rem;
    display: flex; flex-wrap: wrap; gap: .5rem 1rem;
}
.case-meta .cat { color: var(--accent); }
.case-title {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.02;
    letter-spacing: -.03em; max-width: 34ch;
}
.case-sub {
    font-family: var(--font-display); font-weight: 400;
    font-size: clamp(1.05rem, 2vw, 1.4rem); color: var(--muted);
    letter-spacing: -.01em; margin-top: .8rem;
}

.case-hero {
    margin: 0 0 4rem;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-deep);
    aspect-ratio: 3 / 2;               /* format horizontal uniforme pour tous les héros */
}
.case-hero img, .case-hero video { width: 100%; height: 100%; object-fit: cover; display: block; }

.case-intro {
    font-family: var(--font-display); font-weight: 400;
    font-size: clamp(1.3rem, 2.6vw, 2rem); line-height: 1.25;
    letter-spacing: -.01em; max-width: 760px;
    margin: 0 0 5rem;
    color: var(--ink);
}

/* étapes */
.case-steps { margin-bottom: 5rem; }
.case-step {
    display: grid; grid-template-columns: 1fr 2.2fr;
    gap: clamp(1rem, 4vw, 3rem);
    padding: 2.4rem 0; border-top: 1px solid var(--line);
}
.case-step:last-child { border-bottom: 1px solid var(--line); }
.case-step-side { display: flex; flex-direction: column; gap: .3rem; }
.case-step-num {
    font-family: var(--font-display); font-weight: 600;
    font-size: 2rem; color: var(--accent); line-height: 1;
}
.case-step-label {
    font-family: var(--font-mono); font-size: .8rem;
    text-transform: uppercase; letter-spacing: .06em; color: var(--ink);
}
.case-step-body { color: var(--ink-soft); }
.case-step-body p + p,
.case-step-body p + ul { margin-top: .8rem; }
.case-step-body ul { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.case-step-body li { padding-left: 1.1rem; position: relative; }
.case-step-body li::before {
    content: '—'; position: absolute; left: 0; color: var(--accent);
}
.case-step-body strong { color: var(--ink); }

/* vidéo */
.case-video {
    position: relative; aspect-ratio: 16/9;
    margin: 0 0 4rem; border-radius: 6px; overflow: hidden;
    border: 1px solid var(--line);
}
.case-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* galerie horizontale */
.gallery-wrap { position: relative; margin-bottom: 6rem; }
.gallery {
    display: flex; gap: 1rem; overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
    scrollbar-width: thin;
}
.gallery::-webkit-scrollbar { height: 6px; }
.gallery::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.gallery-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    height: clamp(300px, 56vh, 540px);
    min-width: clamp(180px, 28vw, 340px);
    border-radius: 6px;
    background: var(--bg-deep);
    /* overflow: hidden retiré — il bloquait l'expansion flex après chargement */
}
.gallery-item img, .gallery-item video {
    height: 100%; width: auto; display: block;
    border-radius: 6px; /* reporté sur l'image pour garder les coins arrondis */
}
.gallery-btn {
    font-family: var(--font-mono); font-size: 1.35rem;
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--accent); background: var(--accent);
    color: #fff; cursor: pointer;
    transition: all .2s var(--ease);
}
.gallery-btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.gallery-controls {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    padding: 0 .75rem;
}
.gallery-controls .gallery-btn { pointer-events: auto; }


@media (max-width: 680px) {
    .case-step { grid-template-columns: 1fr; gap: .8rem; }
    .case-step-side { flex-direction: row; align-items: baseline; gap: .8rem; }
}

/* ---- Projet suivant (fin de cas d'étude) ---- */
.case-next { margin: 0 0 6rem; border-top: 1px solid var(--line); }
.case-next-link {
    display: flex; flex-direction: column; gap: .35rem;
    padding: 2.4rem 0;
    align-items: flex-end; text-align: right;
    transition: color .2s var(--ease);
}
.case-next-k {
    font-family: var(--font-mono); font-size: .78rem;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted);
}
.case-next-title {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: -.02em;
    color: var(--ink); line-height: 1.05;
}
.case-next-title .cn-arrow { display: inline-block; color: var(--accent); }
.case-next-domain { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
.case-next-link:hover .case-next-title { color: var(--accent); }
.case-next-link:hover .cn-arrow { transform: translateX(6px); }

/* ---- Rap Book (bespoke) ---- */
.rb-section { margin-bottom: 5rem; }
.rb-label {
    font-family: var(--font-mono); font-size: .82rem;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--accent); margin-bottom: 1.5rem;
}
.rb-intro { color: var(--ink-soft); max-width: 60ch; font-size: 1.05rem; margin-bottom: 1.8rem; }
.rb-label { font-weight: 400; }
.rb-divider { border: 0; border-top: 1px solid var(--line); margin: 4rem 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
    .wordmark-full { display: none; }
    .nav-links { gap: 1.4rem; }
    .nav-links a { font-size: .76rem; }
    .hero-gif { opacity: .5; right: -3rem; width: 300px; }
    .hero { padding-top: 7rem; }
}
@media (max-width: 540px) {
    /* animation placée en haut, au-dessus du bloc texte — plus d'air en dessous */
    .hero { justify-content: flex-start; padding-top: 22.5rem; padding-bottom: 6rem; }
    .hero-gif {
        top: 4.5rem; left: 50%; right: auto; bottom: auto;
        transform: translateX(-50%);
        width: clamp(170px, 48vw, 220px); opacity: 1;
    }
    .scroll-hint { display: none; }
    /* les boutons ferment le bloc et créent la coupure avec la suite */
    .hero-cta {
        flex-direction: column; align-items: stretch;
        margin-top: 2.4rem; padding-top: 2rem;
        border-top: 1px solid var(--line);
    }
    .btn { justify-content: center; }
}

/* ============================================================
   ACCESSIBILITÉ — mouvement réduit
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .hero-title .ul path { stroke-dashoffset: 0 !important; }
    .hero-label, .hero-title .line, .hero-sub, .hero-cta { opacity: 1 !important; transform: none !important; }
    /* on coupe la respiration mais on laisse le thème fixer l'opacité */
    .grid-dots { animation: none !important; }
}

/* ============================================================
   DARK MODE — surcharges de composants
   Placé en fin de fichier : ces règles doivent gagner la cascade
   face aux règles de composants définies plus haut.
   ============================================================ */
@media (prefers-color-scheme: dark) {

    /* Signature du header : noire à l'origine → blanche sur fond sombre.
       (Celle du footer reste inversée en permanence, le footer est toujours sombre.) */
    .wordmark-sig { filter: invert(1); }

    /* Les sections toujours sombres se détachent du fond de page */
    .contact     { background: #0A0C10; }
    .site-footer { background: #05060A; }

    /* La trame de points a besoin d'un peu plus de présence sur fond sombre */
    .grid-dots { opacity: .08; }
    @keyframes breathe {
        0%, 100% { opacity: .07; background-size: 30px 30px; }
        50%      { opacity: .11; background-size: 31px 31px; }
    }

    /* L'accent dark est clair (jaune) : tout ce qui est POSÉ dessus passe en
       encre sombre, sinon le texte disparaît. */
    .work-cta    { color: #06080F; }   /* bandeau au survol des cartes */
    .gallery-btn { color: #06080F; }   /* flèches de galerie */

    /* Ombres plus profondes pour rester lisibles sur fond sombre */
    .case-navbar { box-shadow: 0 14px 34px -16px rgba(0,0,0,.8); }
    .to-top      { box-shadow: 0 10px 26px -14px rgba(0,0,0,.85); }
}
