@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Inter:wght@400;500;600&display=swap');

/* ============================================================
   1. Variables & base
   ============================================================ */
:root {
    --bg: #0d0a14;
    --bg-soft: #14101f;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --text: #ece9f4;
    --text-soft: #a89fc0;
    --accent: #a855f7;
    --accent-2: #fb923c;
    --accent-soft: rgba(168, 85, 247, 0.16);
    --gradient: linear-gradient(120deg, #a855f7, #fb923c);
    --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --radius: 18px;
    --nav-h: 76px;
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16.5px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent), var(--accent-2));
    border-radius: 99px;
}

img { max-width: 100%; height: auto; display: block; }

/* Pictos : petites images générées (style diorama) qui remplacent les emojis dans le texte */
.picto {
    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    vertical-align: -0.32em;
    object-fit: contain;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }

:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 200;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 500;
    transition: top 0.3s var(--ease-spring);
}

.skip-link:focus { top: 12px; }

/* Masquage visuel accessible (annonces lecteur d'écran) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   2. Décor global : bruit, halos, particules
   ============================================================ */
.noise {
    position: fixed;
    inset: -50%;
    z-index: 40; /* au-dessus du contenu (5), sous les navs (45/50) */
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: noise-shift 0.6s steps(4) infinite;
}

@keyframes noise-shift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2%, 1%); }
    50% { transform: translate(1%, -2%); }
    75% { transform: translate(-1%, 2%); }
    100% { transform: translate(2%, -1%); }
}

.bg-glow {
    position: fixed;
    z-index: 0;
    width: 55vw;
    height: 55vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.16;
    pointer-events: none;
}

.bg-glow--1 {
    top: -20vw;
    right: -15vw;
    background: #7c3aed;
    animation: glow-drift 18s ease-in-out infinite alternate;
}

.bg-glow--2 {
    bottom: -25vw;
    left: -15vw;
    background: #c2410c;
    animation: glow-drift 22s ease-in-out infinite alternate-reverse;
}

@keyframes glow-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(6vw, 4vw) scale(1.15); }
}

.particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

main, .nav, .footer { position: relative; z-index: 5; }

/* ============================================================
   3. Preloader
   ============================================================ */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--bg);
    transition: opacity 0.6s ease, visibility 0.6s;
    /* Filet de sécurité sans JS : disparaît tout seul après 4s */
    animation: preloader-failsafe 0.6s ease 4s forwards;
}

@keyframes preloader-failsafe {
    to { opacity: 0; visibility: hidden; }
}

.preloader.is-done { opacity: 0; visibility: hidden; }

.preloader-name {
    display: flex;
    gap: 2px;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.preloader-letter {
    opacity: 0;
    transform: translateY(24px);
    animation: preloader-in 0.5s var(--ease-spring) forwards;
    animation-delay: calc(var(--pi, 0) * 60ms);
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.preloader-letter.is-space { width: 0.5em; }

@keyframes preloader-in {
    to { opacity: 1; transform: translateY(0); }
}

.preloader-bar {
    width: min(240px, 60vw);
    height: 3px;
    border-radius: 99px;
    background: var(--surface-strong);
    overflow: hidden;
}

.preloader-bar span {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: var(--gradient);
    transform-origin: left;
    transform: scaleX(0);
    animation: preloader-bar 1s ease forwards 0.2s;
}

@keyframes preloader-bar { to { transform: scaleX(1); } }

/* ============================================================
   4. Curseur personnalisé
   ============================================================ */
.cursor-dot, .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-2);
    opacity: 0; /* invisible tant que la souris n'a pas bougé */
    transition: transform 0.15s, opacity 0.3s;
}

.cursor-ring {
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(168, 85, 247, 0.75);
    opacity: 0;
    transition: width 0.25s var(--ease-spring), height 0.25s var(--ease-spring),
                border-color 0.25s, background 0.25s, opacity 0.3s;
}

body.cursor-hovering .cursor-ring {
    width: 64px;
    height: 64px;
    background: rgba(168, 85, 247, 0.12);
    border-color: var(--accent-2);
}

body.cursor-hovering .cursor-dot { transform: translate(-50%, -50%) scale(0.4); }

@media (hover: none), (pointer: coarse) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* ============================================================
   5. Barre de progression + navigation
   ============================================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: 100%;
    height: 3px;
    background: var(--gradient);
    transform-origin: left;
    transform: scaleX(0);
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    padding: 0 clamp(20px, 5vw, 56px);
    background: rgba(13, 10, 20, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: transform 0.4s var(--ease-spring), border-color 0.3s, background 0.3s;
}

.nav.is-scrolled {
    background: rgba(13, 10, 20, 0.85);
    border-bottom-color: var(--border);
}

.nav.is-hidden { transform: translateY(-100%); }

/* La nav masquée réapparaît dès qu'un de ses liens reçoit le focus clavier */
.nav.is-hidden:focus-within { transform: none; }

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.nav-logo-mark {
    display: inline-block;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.4s var(--ease-spring);
}

.nav-logo:hover .nav-logo-mark { transform: rotate(-12deg) scale(1.15); }

.nav-logo-dot { color: var(--accent-2); }

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.5vw, 32px);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a {
    position: relative;
    padding: 6px 2px;
    color: var(--text-soft);
    transition: color 0.25s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    border-radius: 99px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s var(--ease-spring);
}

.nav-links a:hover, .nav-links a.is-active { color: var(--text); }

.nav-links a:hover::after, .nav-links a.is-active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-links .nav-cta {
    padding: 9px 20px;
    border: 1px solid var(--accent);
    border-radius: 99px;
    color: var(--text);
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}

.nav-links .nav-cta::after { display: none; }

.nav-links .nav-cta:hover {
    background: var(--accent-soft);
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.nav-burger span {
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.3s, opacity 0.3s;
}

.nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8vh;
    padding-top: var(--nav-h);
    background: rgba(13, 10, 20, 0.96);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.nav-mobile.is-open { opacity: 1; visibility: visible; }

.nav-mobile a {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 7vw, 2.4rem);
    font-weight: 700;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s, transform 0.4s var(--ease-spring), color 0.3s;
}

.nav-mobile.is-open a { opacity: 1; transform: translateY(0); }

.nav-mobile a:hover { color: var(--accent-2); }

.nav-mobile.is-open a:nth-child(1) { transition-delay: 0.05s; }
.nav-mobile.is-open a:nth-child(2) { transition-delay: 0.1s; }
.nav-mobile.is-open a:nth-child(3) { transition-delay: 0.15s; }
.nav-mobile.is-open a:nth-child(4) { transition-delay: 0.2s; }
.nav-mobile.is-open a:nth-child(5) { transition-delay: 0.25s; }

@media (max-width: 800px) {
    .nav-links { display: none; }
    .nav-burger { display: flex; }
}

/* ============================================================
   6. Hero
   ============================================================ */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-h) + 4vh) clamp(20px, 8vw, 120px) 10vh;
}

.hero-inner { max-width: 900px; }

.hero-hello {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    color: var(--accent-2);
    margin-bottom: 8px;
}

.hero-name {
    font-size: clamp(3rem, 11vw, 7.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    word-spacing: 0.1em;
    margin-bottom: 20px;
}

.hero-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.6em) rotate(6deg);
    animation: hero-letter-in 0.7s var(--ease-spring) forwards;
    animation-delay: calc(1s + var(--i) * 55ms);
    transition: color 0.2s;
    cursor: default;
}

.hero-letter:hover {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation-name: hero-letter-in, hero-letter-bounce;
    animation-duration: 0.7s, 0.5s;
    animation-delay: calc(1s + var(--i) * 55ms), 0s;
}

.hero-word { display: inline-block; white-space: nowrap; }

@keyframes hero-letter-in {
    to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes hero-letter-bounce {
    30% { transform: translateY(-0.12em) scale(1.06); }
    100% { transform: translateY(0) scale(1); }
}

.hero-role {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 3vw, 1.7rem);
    font-weight: 500;
    min-height: 1.6em;
    margin-bottom: 22px;
}

.hero-role-prefix { color: var(--accent); }

#typed {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typed-caret {
    color: var(--accent-2);
    animation: caret-blink 0.9s step-end infinite;
}

@keyframes caret-blink { 50% { opacity: 0; } }

.hero-pitch {
    max-width: 560px;
    color: var(--text-soft);
    font-size: clamp(1rem, 2vw, 1.15rem);
    margin-bottom: 36px;
}

.hero-pitch strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }

.hero-scroll {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
}

.hero-scroll-mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-soft);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.hero-scroll-mouse span {
    width: 3px;
    height: 8px;
    border-radius: 99px;
    background: var(--accent-2);
    animation: scroll-wheel 1.6s ease-in-out infinite;
}

@keyframes scroll-wheel {
    0% { transform: translateY(0); opacity: 1; }
    70% { transform: translateY(12px); opacity: 0; }
    71% { transform: translateY(0); opacity: 0; }
    100% { opacity: 1; }
}

.hero-scroll-label {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* ============================================================
   7. Boutons
   ============================================================ */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 99px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1rem;
    overflow: hidden;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
    will-change: transform;
}

.btn span { position: relative; z-index: 1; display: inline-block; }

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.35);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, #fb923c, #a855f7);
    opacity: 0;
    transition: opacity 0.4s;
}

.btn-primary:hover { box-shadow: 0 12px 44px rgba(251, 146, 60, 0.45); }
.btn-primary:hover::before { opacity: 1; }

.btn-ghost {
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.btn-big { font-size: clamp(1rem, 2.6vw, 1.25rem); padding: 18px 38px; }

/* ============================================================
   8. Marquee technos
   ============================================================ */
.marquee {
    position: relative;
    padding: 18px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    transform: rotate(-1.2deg) scale(1.02);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track,
.marquee.is-paused .marquee-track { animation-play-state: paused; }

.marquee-group { display: flex; align-items: center; }

.marquee-item {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-soft);
    padding: 0 18px;
    white-space: nowrap;
    transition: color 0.3s;
}

.marquee-item:hover { color: var(--accent-2); }

.marquee-sep { color: var(--accent); font-size: 0.8rem; }

@keyframes marquee {
    to { transform: translateX(-50%); }
}

/* ============================================================
   9. Sections génériques
   ============================================================ */
.section {
    max-width: 1080px;
    margin: 0 auto;
    padding: clamp(80px, 14vh, 140px) clamp(20px, 5vw, 40px) 0;
}

.section--wide { max-width: 1240px; }

.section-head { margin-bottom: clamp(36px, 6vh, 60px); }

.section-kicker {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin-bottom: 10px;
}

.section-title {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-sub { color: var(--text-soft); margin-top: 12px; max-width: 520px; }

/* ============================================================
   10. À propos
   ============================================================ */
.about {
    display: grid;
    grid-template-columns: minmax(260px, 380px) 1fr;
    gap: clamp(32px, 6vw, 72px);
    align-items: start;
}

.about-photo { position: relative; }

.about-photo-frame {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.about-photo-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(200deg, rgba(168, 85, 247, 0.25), transparent 40%, rgba(251, 146, 60, 0.18));
    mix-blend-mode: overlay;
}

.about-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-spring);
}

.about-photo-frame:hover img { transform: scale(1.05); }

.about-badge {
    position: absolute;
    padding: 8px 16px 8px 12px;
    border-radius: 99px;
    background: rgba(20, 16, 31, 0.9);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

.about-badge .picto { width: 1.7em; height: 1.7em; vertical-align: -0.5em; margin-right: 4px; }

.about-badge--1 { top: 6%; right: -8%; animation-delay: 0s; }
.about-badge--2 { bottom: 22%; left: -10%; animation-delay: 0.8s; }
.about-badge--3 { bottom: -4%; right: 4%; animation-delay: 1.6s; }

.floaty { animation: floaty 5s ease-in-out infinite; }

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.about-text p { color: var(--text-soft); margin-bottom: 18px; }

.about-langs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.chip {
    display: inline-block;
    padding: 7px 15px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.85rem;
    color: var(--text-soft);
    transition: border-color 0.3s, color 0.3s, transform 0.3s;
}

.chip strong { color: var(--text); }

.chip:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-top: clamp(48px, 8vh, 80px);
}

.stat {
    padding: 28px 22px;
    text-align: center;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: transform 0.35s var(--ease-spring), border-color 0.3s, background 0.3s;
}

.stat:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label { color: var(--text-soft); font-size: 0.9rem; }

@media (max-width: 800px) {
    .about { grid-template-columns: 1fr; }
    .about-photo { max-width: 320px; margin: 0 auto; }
    .about-badge--1 { right: -4%; }
    .about-badge--2 { left: -4%; }
}

/* ============================================================
   11. Compétences
   ============================================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

.skill-card {
    position: relative;
    padding: 30px 26px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.3s, background 0.3s;
}

.skill-card:hover { border-color: rgba(168, 85, 247, 0.5); }

.skill-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -40%;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.18), transparent 70%);
    transition: transform 0.5s var(--ease-spring);
}

.skill-card:hover::before { transform: scale(1.6); }

.skill-icon { margin-bottom: 14px; }
.skill-icon .picto { width: 3rem; height: 3rem; vertical-align: middle; }

.skill-title {
    font-size: 1.2rem;
    margin-bottom: 14px;
}

.skill-list { list-style: none; }

.skill-list li {
    position: relative;
    padding: 4px 0 4px 20px;
    color: var(--text-soft);
    font-size: 0.95rem;
    transition: color 0.25s, transform 0.25s;
}

.skill-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-2);
}

.skill-list li:hover { color: var(--text); transform: translateX(5px); }

/* ============================================================
   12. Timeline parcours
   ============================================================ */
.timeline { position: relative; padding: 20px 0 40px; }

.timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.timeline-line span {
    display: block;
    width: 100%;
    height: 0;
    background: var(--gradient);
    transition: height 0.2s linear;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 44px 44px;
}

.timeline-item.is-left { left: 0; text-align: right; }
.timeline-item.is-right { left: 50%; }

.timeline-dot {
    position: absolute;
    top: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 5px rgba(168, 85, 247, 0.15), 0 0 18px rgba(168, 85, 247, 0.6);
    transition: transform 0.3s var(--ease-spring), background 0.3s;
}

.timeline-item.is-left .timeline-dot { right: -7px; }
.timeline-item.is-right .timeline-dot { left: -7px; }

.timeline-item:hover .timeline-dot {
    transform: scale(1.4);
    background: var(--accent-2);
}

.timeline-card {
    display: inline-block;
    text-align: left;
    padding: 24px 26px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: transform 0.35s var(--ease-spring), border-color 0.3s, box-shadow 0.35s;
}

.timeline-card:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.timeline-period {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin-bottom: 8px;
}

.timeline-role { font-size: 1.15rem; margin-bottom: 4px; }

.timeline-company {
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.timeline-desc { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 14px; }

.timeline-tech { display: flex; flex-wrap: wrap; gap: 8px; }

.timeline-item.is-left .timeline-tech { justify-content: flex-start; }

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    background: var(--accent-soft);
    color: #c4b5fd;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

@media (max-width: 800px) {
    .timeline-line { left: 8px; }
    .timeline-item, .timeline-item.is-right {
        width: 100%;
        left: 0;
        text-align: left;
        padding: 0 0 36px 36px;
    }
    .timeline-item.is-left { text-align: left; }
    .timeline-item.is-left .timeline-dot, .timeline-item.is-right .timeline-dot { left: 1px; right: auto; }
}

/* ============================================================
   13. Projets : filtres + grille
   ============================================================ */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 36px;
}

.filter-btn {
    padding: 10px 22px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-soft);
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.3s, border-color 0.3s, background 0.3s, transform 0.3s;
}

.filter-btn:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }

.filter-btn.is-active {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.4s, opacity 0.3s, scale 0.3s;
    will-change: transform;
}

.project-card:hover {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Filtrage : fondu de sortie, retrait de la grille, cascade d'entrée */
.project-card.is-leaving {
    opacity: 0;
    scale: 0.92;
    pointer-events: none;
}

.project-card.is-hidden { display: none; }

.project-card.is-entering {
    animation: card-in 0.5s var(--ease-spring) backwards;
    animation-delay: var(--enter-delay, 0ms);
}

@keyframes card-in {
    from {
        opacity: 0;
        scale: 0.92;
        translate: 0 14px;
    }
}

.project-cover {
    position: relative;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 45%),
        linear-gradient(135deg, var(--g1), var(--g2));
}

.project-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s var(--ease-spring);
}

.project-card:hover .project-cover-img { transform: scale(1.06); }

/* Les illustrations (dioramas) sont cadrées au centre, contrairement aux captures */
.project-cover-img.is-illustration { object-position: center; }

/* Voile pour garder badges et emoji lisibles sur les captures */
.project-cover.has-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(13, 10, 20, 0.6));
}

.project-icon {
    width: 4.6rem;
    height: 4.6rem;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
    transition: transform 0.45s var(--ease-spring);
}

.project-cover.has-image .project-icon {
    position: absolute;
    left: 12px;
    bottom: 8px;
    z-index: 1;
    width: 2.6rem;
    height: 2.6rem;
}

.project-card:hover .project-icon { transform: scale(1.25) rotate(-8deg); }

.project-year {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 1;
    padding: 4px 12px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

.project-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 22px 24px;
}

.project-title { font-size: 1.25rem; margin-bottom: 6px; }

.project-tagline {
    color: var(--text-soft);
    font-size: 0.93rem;
    flex: 1;
    margin-bottom: 16px;
}

.project-tech { display: flex; flex-wrap: wrap; gap: 8px; }

.project-arrow {
    position: absolute;
    right: 20px;
    bottom: 18px;
    font-size: 1.3rem;
    color: var(--accent-2);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s, transform 0.35s var(--ease-spring);
}

.project-card:hover .project-arrow { opacity: 1; transform: translateX(0); }

.project-card.is-featured .project-cover { height: 180px; }

@media (min-width: 900px) {
    .project-card.is-featured { grid-column: span 2; }
}

/* ============================================================
   14. Contact
   ============================================================ */
.contact { padding-bottom: clamp(80px, 14vh, 140px); }

.contact-inner {
    text-align: center;
    padding: clamp(48px, 8vw, 90px) clamp(24px, 5vw, 80px);
    border-radius: 32px;
    border: 1px solid var(--border);
    background:
        radial-gradient(ellipse at 50% -20%, rgba(168, 85, 247, 0.22), transparent 60%),
        var(--surface);
    overflow: hidden;
    position: relative;
}

.contact-title {
    font-size: clamp(2rem, 6vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 14px 0 18px;
}

.contact-title-accent {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-text {
    color: var(--text-soft);
    max-width: 460px;
    margin: 0 auto 36px;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

/* ============================================================
   15. Footer
   ============================================================ */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 20px 40px;
    background: rgba(0, 0, 0, 0.25);
}

.footer-inner { max-width: 1080px; margin: 0 auto; text-align: center; }

.footer-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.footer-sub { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 22px; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 26px;
    margin-bottom: 26px;
    font-weight: 500;
}

.footer-links a {
    color: var(--text-soft);
    transition: color 0.25s;
}

.footer-links a:hover { color: var(--accent-2); }

.footer-note { color: var(--text-soft); font-size: 0.85rem; opacity: 0.8; }

.footer-heart {
    display: inline-block;
    color: #f43f5e;
    animation: heartbeat 1.4s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    12% { transform: scale(1.3); }
    24% { transform: scale(1); }
}

.footer-hint { cursor: help; border-bottom: 1px dashed var(--text-soft); }

/* Glitch effect au survol du titre du footer */
.glitch { position: relative; display: inline-block; }

.glitch:hover::before, .glitch:hover::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
}

.glitch:hover::before {
    color: var(--accent);
    animation: glitch-shift 0.3s steps(2) infinite;
    clip-path: inset(0 0 55% 0);
}

.glitch:hover::after {
    color: var(--accent-2);
    animation: glitch-shift 0.3s steps(2) infinite reverse;
    clip-path: inset(55% 0 0 0);
}

@keyframes glitch-shift {
    0% { transform: translate(-3px, 0); }
    50% { transform: translate(3px, -1px); }
    100% { transform: translate(-2px, 1px); }
}

/* ============================================================
   16. Page projet
   ============================================================ */
.project-page { padding-top: var(--nav-h); }

.project-hero {
    position: relative;
    text-align: center;
    padding: clamp(60px, 10vh, 110px) clamp(20px, 5vw, 40px) clamp(48px, 8vh, 80px);
    background:
        radial-gradient(ellipse at 50% -30%, color-mix(in srgb, var(--g1) 45%, transparent), transparent 65%),
        radial-gradient(ellipse at 80% 120%, color-mix(in srgb, var(--g2) 25%, transparent), transparent 60%);
}

.project-back {
    position: absolute;
    top: 26px;
    left: clamp(20px, 5vw, 56px);
    font-family: var(--font-display);
    font-size: 0.92rem;
    color: var(--text-soft);
    transition: color 0.25s, transform 0.3s;
}

.project-back:hover { color: var(--accent-2); transform: translateX(-4px); }

.project-hero-icon {
    display: inline-block;
    width: clamp(5rem, 11vw, 7.5rem);
    height: clamp(5rem, 11vw, 7.5rem);
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.45));
}

.project-hero-title {
    font-size: clamp(2.2rem, 7vw, 4.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.project-hero-title .hero-letter { margin-right: 0.22em; }

.project-hero-tagline {
    font-size: clamp(1.05rem, 2.6vw, 1.35rem);
    color: var(--text-soft);
    max-width: 640px;
    margin: 0 auto 24px;
}

.project-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* Capture d'écran ou illustration du projet, dans un cadre sobre */
.project-shot {
    max-width: 960px;
    margin: clamp(36px, 6vh, 56px) auto 0;
    padding: 0 clamp(20px, 5vw, 40px);
}

.project-shot-inner {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s;
}

.project-shot-inner:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 55px 120px rgba(0, 0, 0, 0.6);
}

.project-shot-inner img { width: 100%; display: block; }

.project-content {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(40px, 7vh, 70px) clamp(20px, 5vw, 40px) 0;
}

.project-story p {
    color: var(--text-soft);
    font-size: 1.08rem;
    margin-bottom: 24px;
}

.project-story p:first-child {
    font-size: 1.2rem;
    color: var(--text);
}

.project-story p::first-letter { color: var(--accent-2); }

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 40px;
}

.project-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    max-width: 920px;
    margin: clamp(60px, 10vh, 100px) auto 0;
    padding: 0 clamp(20px, 5vw, 40px) clamp(80px, 12vh, 120px);
}

.project-nav-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px 26px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: transform 0.35s var(--ease-spring), border-color 0.3s, background 0.3s;
}

.project-nav-card--next { text-align: right; }

.project-nav-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.project-nav-dir {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.project-nav-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }

@media (max-width: 640px) {
    .project-nav { grid-template-columns: 1fr; }
    .project-nav-card--next { text-align: left; }
}

/* ============================================================
   16b. Blog : liste des articles + socle commun des articles
   (chaque article ajoute ensuite son propre thème dans son template)
   ============================================================ */
.blog-head-section { min-height: 60vh; padding-top: calc(var(--nav-h) + clamp(40px, 8vh, 80px)); }

.blog-list {
    display: grid;
    gap: 18px;
    max-width: 860px;
}

.blog-card {
    position: relative;
    display: flex;
    gap: 22px;
    align-items: flex-start;
    padding: 26px 56px 26px 26px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: transform 0.35s var(--ease-spring), border-color 0.3s, box-shadow 0.35s, background 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent, var(--accent));
    border-color: color-mix(in srgb, var(--accent) 65%, transparent);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* Vignette diorama de l'article, l'emoji devient un badge dessus */
.blog-card-cover {
    position: relative;
    flex: none;
    width: 210px;
    aspect-ratio: 1200 / 630;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-soft);
}

.blog-card-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-spring);
}

.blog-card:hover .blog-card-img { transform: scale(1.06); }

.blog-card-icon {
    position: absolute;
    left: 8px;
    bottom: 6px;
    width: 2.4rem;
    height: 2.4rem;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

/* Le badge flotte moins haut que les gros pictos de la home */
.blog-card-icon.floaty { animation-name: floaty-badge; }

@keyframes floaty-badge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.blog-card-meta {
    display: flex;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-soft);
    font-family: var(--font-display);
    margin-bottom: 6px;
}

.blog-card-title { font-size: 1.25rem; margin-bottom: 6px; }

.blog-card:hover .blog-card-title { color: color-mix(in srgb, var(--accent) 70%, #fff); }

.blog-card-excerpt { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 14px; }

.blog-card-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.blog-card .project-arrow { color: var(--accent); }

@media (max-width: 560px) {
    .blog-card { flex-direction: column; gap: 14px; padding: 22px; }
    .blog-card-cover { width: 100%; }
}

/* --- Socle commun des pages article --- */
.article { padding-top: var(--nav-h); }

.article-hero {
    position: relative;
    text-align: center;
    padding: clamp(60px, 10vh, 100px) clamp(20px, 5vw, 40px) clamp(44px, 7vh, 70px);
}

.article-hero-icon {
    display: inline-block;
    width: clamp(4rem, 9vw, 6rem);
    height: clamp(4rem, 9vw, 6rem);
    object-fit: contain;
    margin-bottom: 14px;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.45));
}

.article-hero h1 {
    font-size: clamp(1.7rem, 5vw, 3.1rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.article-body {
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(36px, 6vh, 60px) clamp(20px, 5vw, 40px) 0;
}

.article-body > p { color: var(--text-soft); margin-bottom: 18px; }

.article-body a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

.article-body a:hover { color: var(--text); }

.article-body code {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.88em;
}

.article-figure { margin: 22px 0; }

.article-figure img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.article-note {
    margin-top: 36px;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px dashed var(--border);
    background: var(--surface);
    font-size: 0.92rem;
    color: var(--text-soft);
}

/* ============================================================
   17. Animations de révélation au scroll
   La propriété `translate` (et non `transform`) laisse le
   transform libre pour l'effet tilt 3D sur le même élément.
   Le JS retire la classe + le délai une fois la révélation finie
   pour rendre leurs transitions d'origine aux cartes.
   ============================================================ */
.reveal, .reveal-left {
    opacity: 0;
    translate: 0 36px;
    transition: opacity 0.8s ease, translate 0.8s var(--ease-spring);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-left { translate: -48px 0; }

.reveal.is-visible, .reveal-left.is-visible {
    opacity: 1;
    translate: 0 0;
}

/* ============================================================
   18. Effet tilt 3D + reflet
   ============================================================ */
.tilt {
    transform-style: preserve-3d;
    transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
}

.tilt-glare {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%),
        rgba(255, 255, 255, 0.14), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s;
}

.tilt:hover .tilt-glare { opacity: 1; }

/* ============================================================
   19. Mode psychédélique (code Konami)
   Les déformations sont pilotées par app.js via l'API Web
   Animations, pour se superposer aux animations CSS existantes
   sans les écraser. Ici, seulement l'ambiance de fond.
   ============================================================ */
body.psyche-mode .bg-glow { opacity: 0.5; animation-duration: 2s; }

/* ============================================================
   20. Accessibilité : réduction des animations
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal, .reveal-left { opacity: 1; translate: none; }
    .hero-letter, .preloader-letter { opacity: 1; transform: none; }
    .particles, .noise { display: none; }
}
