/* ==========================================================================
   Gaël Toux — gtoux.fr
   Édition « Dark premium · bento · motion »
   Inspiration : Linear, Vercel, Arc, Stripe
   ========================================================================== */

/* Fallback métrique-identique à Inter (Arial ajusté) :
   évite le layout shift au moment du swap quand Inter arrive de Google Fonts. */
@font-face {
    font-family: 'Inter Fallback';
    src: local('Arial');
    size-adjust: 107.4%;
    ascent-override: 90%;
    descent-override: 22.5%;
    line-gap-override: 0%;
}

:root {
    /* Palette dark (default) */
    --bg: #0a0a0b;
    --bg-elevated: #0f0f11;
    --surface: #141418;
    --surface-hover: #1a1a20;
    --surface-strong: #1e1e25;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-glow: rgba(139, 92, 246, 0.35);

    --text: #f5f5f7;
    --text-muted: #9c9ca5;
    --text-subtle: #62626a;

    /* Accents */
    --violet: #8b5cf6;
    --violet-soft: #a78bfa;
    --violet-deep: #7c3aed;
    --cyan: #22d3ee;
    --pink: #ec4899;
    --green: #10b981;

    /* Glows */
    --glow-violet: 0 0 40px rgba(139, 92, 246, 0.35);
    --glow-violet-sm: 0 0 20px rgba(139, 92, 246, 0.25);
    --glow-cyan: 0 0 40px rgba(34, 211, 238, 0.25);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-cyan: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 100%);
    --gradient-text: linear-gradient(135deg, #f5f5f7 0%, #a78bfa 100%);

    /* Type — la fallback "Inter Fallback" évite le CLS au swap (cf. @font-face en haut du fichier) */
    --sans: 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Mesures */
    --container: 1280px;
    --gutter: clamp(20px, 4vw, 40px);
    --radius: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    /* Transitions */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t: 300ms var(--ease);
    --t-slow: 600ms var(--ease);
}

/* Mode clair — optionnel, gardé pour accessibilité */
[data-theme="light"] {
    --bg: #fafafa;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-hover: #f5f5f7;
    --surface-strong: #eaeaef;
    --border: rgba(10, 10, 11, 0.08);
    --border-strong: rgba(10, 10, 11, 0.16);
    --text: #0a0a0b;
    --text-muted: #4a4a55;
    --text-subtle: #8b8b93;
    --gradient-text: linear-gradient(135deg, #0a0a0b 0%, #7c3aed 100%);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
    color-scheme: dark;
}
[data-theme="light"] html { color-scheme: light; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--text-muted);
    background: var(--bg);
    overflow-x: hidden;
    font-feature-settings: 'kern', 'liga', 'calt', 'ss01', 'ss03';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--violet); color: var(--text); }

h1, h2, h3, h4 {
    font-family: var(--sans);
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.4em;
    line-height: 1.1;
    letter-spacing: -0.03em;
}
h1 {
    font-size: clamp(2.8rem, 7vw, 5.6rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.98;
}
h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: -0.035em;
    font-weight: 650;
}
h3 { font-size: 1.15rem; letter-spacing: -0.015em; font-weight: 600; }

p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--text); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--violet-soft); }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

code, .mono {
    font-family: var(--mono);
    font-size: 0.88em;
    font-feature-settings: 'tnum', 'zero';
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ==========================================================================
   Scroll progress bar (en haut de l'écran)
   ========================================================================== */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 100%;
    background: var(--gradient-primary);
    z-index: 200;
    box-shadow: 0 0 10px var(--violet);
    transform: scaleX(0);
    transform-origin: 0 0;
    will-change: transform;
    transition: transform 80ms linear;
}

/* ==========================================================================
   Curseur custom (subtil)
   ========================================================================== */
.cursor {
    position: fixed;
    top: 0; left: 0;
    width: 20px; height: 20px;
    border: 1px solid var(--violet-soft);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 500ms var(--ease), width 200ms var(--ease), height 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
    mix-blend-mode: difference;
    opacity: 0;
}
.cursor.is-ready { opacity: 0.6; }
.cursor.is-hover { width: 50px; height: 50px; background: var(--violet); border-color: var(--violet); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
    position: fixed;
    top: 18px; left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: calc(100% - 24px);
    max-width: 880px;
    transition: all var(--t);
}
.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 10px 22px;
    background: rgba(20, 20, 24, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .nav__inner { background: rgba(255, 255, 255, 0.72); }

.nav__brand {
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav__brand::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--violet);
    box-shadow: 0 0 10px var(--violet);
}
.nav__menu {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav__menu a {
    position: relative;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    transition: color var(--t), background var(--t);
}
.nav__menu a:hover { color: var(--text); background: var(--surface-hover); }
.nav__menu a.is-active { color: var(--text); background: var(--surface-hover); }
.nav__menu a.is-active::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 2px;
    width: 16px; height: 2px;
    margin-left: -8px;
    background: var(--violet);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--violet);
}
.nav__actions { display: flex; align-items: center; gap: 6px; }
.nav__actions .btn-icon {
    background: transparent;
    border: none;
    width: 38px; height: 38px;
    border-radius: 50%;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t), background var(--t);
}
.nav__actions .btn-icon:hover { color: var(--text); background: var(--surface-hover); }
.nav__actions .btn-icon svg { width: 16px; height: 16px; }
.nav__actions .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .nav__actions .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .nav__actions .theme-toggle .icon-moon { display: block; }
.nav__actions .nav__toggle { display: none; }

@media (max-width: 820px) {
    .nav__menu { display: none; position: absolute; top: 58px; left: 0; right: 0; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); flex-direction: column; gap: 0; }
    .nav__menu.is-open { display: flex; }
    .nav__menu a { padding: 12px 16px; width: 100%; }
    .nav__actions .nav__toggle { display: inline-flex; }
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    transition: all var(--t);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    will-change: transform;
}
.btn-primary {
    background: var(--text);
    color: var(--bg);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 10px 30px rgba(255,255,255,0.1);
}
.btn-primary:hover {
    background: var(--violet);
    color: var(--text);
    box-shadow: 0 0 0 1px var(--violet), 0 10px 30px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}
.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-ghost:hover {
    background: var(--surface-hover);
    border-color: var(--violet);
    color: var(--text);
    transform: translateY(-2px);
}
.btn svg { width: 14px; height: 14px; transition: transform var(--t); }
.btn:hover svg { transform: translateX(2px); }

/* Badge live (pulsation discrète) */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.78rem;
    font-weight: 500;
    color: #34d399;
    letter-spacing: 0.01em;
}
.live-badge::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-dot 2.2s ease-out infinite;
}
@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   HERO — mesh gradient, texte large, plein écran
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    padding: 140px 0 100px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.mesh {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.mesh__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    will-change: transform;
}
.mesh__blob--1 {
    width: 500px; height: 500px;
    top: -10%; left: -10%;
    background: radial-gradient(circle, var(--violet) 0%, transparent 70%);
    animation: floatBlob1 22s ease-in-out infinite;
}
.mesh__blob--2 {
    width: 600px; height: 600px;
    top: 30%; right: -15%;
    background: radial-gradient(circle, var(--cyan) 0%, transparent 70%);
    opacity: 0.35;
    animation: floatBlob2 28s ease-in-out infinite;
}
.mesh__blob--3 {
    width: 400px; height: 400px;
    bottom: -10%; left: 30%;
    background: radial-gradient(circle, var(--pink) 0%, transparent 70%);
    opacity: 0.3;
    animation: floatBlob3 25s ease-in-out infinite;
}
@keyframes floatBlob1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(120px, -80px) scale(1.2); }
}
@keyframes floatBlob2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-140px, 60px) scale(0.85); }
}
@keyframes floatBlob3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(80px, -120px) scale(1.15); }
}

.hero__grid-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 0%, transparent 75%);
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero__status { margin-bottom: 32px; }

.hero__title {
    font-size: clamp(3rem, 8.5vw, 7.2rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.055em;
    margin: 0 0 28px;
    max-width: 14ch;
}
.hero__title .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.hero__dot {
    display: inline-block;
    color: var(--violet);
    animation: heroDotPulse 1.4s ease-in-out infinite;
    transform-origin: 50% 85%;
    will-change: transform, color;
}
@keyframes heroDotPulse {
    0%   { transform: scale(1);    color: var(--violet);       text-shadow: 0 0 0 rgba(139,92,246,0); }
    35%  { transform: scale(1.45); color: var(--pink, #ec4899); text-shadow: 0 0 24px rgba(236,72,153,0.6); }
    70%  { transform: scale(0.92); color: var(--violet-soft);  text-shadow: 0 0 12px rgba(167,139,250,0.5); }
    100% { transform: scale(1);    color: var(--violet);       text-shadow: 0 0 0 rgba(139,92,246,0); }
}
@media (prefers-reduced-motion: reduce) {
    .hero__dot { animation: none; }
}

.hero__lede {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 58ch;
    margin: 0 0 42px;
    font-weight: 400;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 60px;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: border-color var(--t), color var(--t);
}
.meta-chip:hover { border-color: var(--border-strong); color: var(--text); }
.meta-chip svg { width: 13px; height: 13px; color: var(--violet-soft); }

/* ==========================================================================
   Bento — grille modulaire moderne
   ========================================================================== */
.bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    overflow: hidden;
    transition: border-color var(--t), transform var(--t-slow);
    will-change: transform;
    transform-style: preserve-3d;
}
.card::before {
    /* Halo de curseur */
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, 0.12), transparent 40%);
    opacity: 0;
    transition: opacity var(--t);
    pointer-events: none;
    z-index: 1;
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: var(--border-strong); }
.card > * { position: relative; z-index: 2; }

.card--hl {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-strong) 100%);
    border-color: var(--border-strong);
}
.card--tilt { transform-style: preserve-3d; }
.card--tilt .card__inner { transform: translateZ(20px); }

/* Utilitaires taille bento */
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.row-2 { grid-row: span 2; }

@media (max-width: 980px) {
    .span-3, .span-4, .span-5 { grid-column: span 6; }
    .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 640px) {
    .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
    padding: clamp(80px, 12vw, 140px) 0;
    position: relative;
}
.section__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: clamp(40px, 6vw, 60px);
}
.section__head-text { max-width: 640px; }
.section__tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--violet-soft);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 18px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.section__tag::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--violet);
    box-shadow: 0 0 8px var(--violet);
}
.section__title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0 0 16px;
    font-weight: 650;
}
.section__title em {
    font-style: normal;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.section__lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ==========================================================================
   Chiffres clés (cards bento)
   ========================================================================== */
.stat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}
.stat__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}
.stat__head::after {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--violet);
    box-shadow: 0 0 10px var(--violet);
}
.stat__value {
    font-size: clamp(3rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.stat__suffix {
    font-size: 0.35em;
    font-weight: 500;
    color: var(--violet-soft);
    font-family: var(--mono);
    letter-spacing: 0;
}
.stat__label {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ==========================================================================
   Compétences (bento tilt)
   ========================================================================== */
.skill {
    min-height: 200px;
    display: flex;
    flex-direction: column;
}
.skill__icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--violet) 0%, var(--violet-deep) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    margin-bottom: 20px;
    box-shadow: var(--glow-violet-sm);
    transition: transform var(--t);
}
.card:hover .skill__icon { transform: scale(1.08) rotate(-4deg); }
.skill__icon svg { width: 22px; height: 22px; }
.skill__num {
    position: absolute;
    top: 22px; right: 24px;
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--text-subtle);
    letter-spacing: 0.1em;
}
.skill h3 {
    font-size: 1.12rem;
    margin: 0 0 10px;
    letter-spacing: -0.015em;
}
.skill p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ==========================================================================
   Projets (bento asymétrique)
   ========================================================================== */
.project {
    min-height: 280px;
    display: flex;
    flex-direction: column;
}
.project__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}
.project__icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--surface-strong);
    border: 1px solid var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--violet-soft);
    transition: all var(--t);
}
.card:hover .project__icon {
    background: linear-gradient(135deg, var(--violet) 0%, var(--violet-deep) 100%);
    border-color: var(--violet);
    color: var(--text);
    box-shadow: var(--glow-violet-sm);
}
.project__icon svg { width: 22px; height: 22px; }
.project__badge {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    background: rgba(139, 92, 246, 0.12);
    color: var(--violet-soft);
    border: 1px solid rgba(139, 92, 246, 0.3);
    white-space: nowrap;
}
.project__category {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
}
.project h3 {
    font-size: 1.3rem;
    margin: 0 0 14px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.project__desc {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-muted);
    flex: 1;
    margin: 0 0 22px;
}
.project__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.project__tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--surface-strong);
    border: 1px solid var(--border);
    transition: border-color var(--t), color var(--t);
}
.project:hover .project__tag { border-color: var(--border-strong); color: var(--text); }

/* ==========================================================================
   Parcours — timeline moderne
   ========================================================================== */
.timeline-tabs {
    display: inline-flex;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    margin-bottom: 40px;
    gap: 2px;
}
.timeline-tabs__btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--t);
}
.timeline-tabs__btn:hover { color: var(--text); }
.timeline-tabs__btn.is-active {
    background: var(--text);
    color: var(--bg);
}

.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 10px; top: 10px; bottom: 10px;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, var(--border-strong) 10%, var(--border-strong) 90%, transparent 100%);
}
.timeline::after {
    /* barre de progression animée qui se "dessine" au scroll */
    content: '';
    position: absolute;
    left: 10px; top: 10px;
    width: 1px;
    height: var(--timeline-progress, 0%);
    background: linear-gradient(180deg, var(--violet) 0%, var(--cyan) 100%);
    box-shadow: 0 0 8px var(--violet);
    transition: height 200ms linear;
}
.timeline__item {
    position: relative;
    padding: 0 0 40px 28px;
}
.timeline__item::before {
    content: '';
    position: absolute;
    left: -19px; top: 6px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border-strong);
    transition: all var(--t);
}
.timeline__item:hover::before {
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}
.timeline__item[data-current="1"]::before {
    background: var(--violet);
    border-color: var(--violet);
    box-shadow: 0 0 12px var(--violet);
}
.timeline__year {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--violet-soft);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding: 4px 10px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: var(--radius-pill);
}
.timeline__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.timeline__category-tag {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    color: var(--text-subtle);
    background: var(--surface-strong);
    border: 1px solid var(--border);
    font-weight: 500;
}
.timeline__item[data-category="experience"] .timeline__category-tag {
    color: var(--violet-soft);
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.25);
}
.timeline__org {
    font-size: 0.88rem;
    color: var(--text-subtle);
    margin-bottom: 12px;
}
.timeline__org strong { color: var(--text-muted); font-weight: 500; }
.timeline__description {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0;
    max-width: 75ch;
}

/* ==========================================================================
   Bio (grid simple dans des cards)
   ========================================================================== */
/* À propos — grille 2 colonnes, hauteurs naturelles (pas de coupure) */
.about-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 16px;
    align-items: start;
}
.about-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (max-width: 820px) {
    .about-grid { grid-template-columns: 1fr; }
}

.bio-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}
.bio-grid > .bio-card { grid-column: span 4; }
/* 4 cartes : 2 + 2 équilibrées */
.bio-grid:has(> .bio-card:nth-child(4):last-child) > .bio-card { grid-column: span 6; }
/* 5 cartes : 3 sur la 1ère ligne, 2 alignées sur la 2ème */
.bio-grid:has(> .bio-card:nth-child(5):last-child) > .bio-card:nth-child(4),
.bio-grid:has(> .bio-card:nth-child(5):last-child) > .bio-card:nth-child(5) {
    grid-column: span 6;
}
@media (max-width: 900px) {
    .bio-grid > .bio-card,
    .bio-grid:has(> .bio-card:nth-child(4):last-child) > .bio-card,
    .bio-grid:has(> .bio-card:nth-child(5):last-child) > .bio-card:nth-child(4),
    .bio-grid:has(> .bio-card:nth-child(5):last-child) > .bio-card:nth-child(5) {
        grid-column: span 6;
    }
}
@media (max-width: 600px) {
    .bio-grid > .bio-card { grid-column: 1 / -1 !important; }
}
.bio-card h3 {
    font-size: 1.05rem;
    margin: 0 0 12px;
    letter-spacing: -0.015em;
}
.bio-card p {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { padding-bottom: 60px; }
.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 16px;
}
@media (max-width: 820px) { .contact__grid { grid-template-columns: 1fr; } }

.contact__info h3 {
    font-size: 1.15rem;
    margin-bottom: 14px;
}
.contact__info p {
    font-size: 0.94rem;
    color: var(--text-muted);
}
.contact__list {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.contact__list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text);
    transition: border-color var(--t);
}
.contact__list li:hover { border-color: var(--border-strong); }
.contact__list svg { width: 16px; height: 16px; color: var(--violet-soft); flex-shrink: 0; }
.contact__list a { color: inherit; }
.contact__vcard { margin-top: 18px; }
.contact__vcard svg { width: 14px; height: 14px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form__field { display: flex; flex-direction: column; gap: 6px; }
.form__field label {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}
.form__field input,
.form__field textarea {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    font-size: 0.94rem;
    color: var(--text);
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.form__field input:focus,
.form__field textarea:focus {
    outline: none;
    border-color: var(--violet);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}
.form__field textarea { min-height: 130px; resize: vertical; }
.form__honeypot { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.form__status {
    display: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
}
.form__status.is-success { display: block; background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.form__status.is-error { display: block; background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
@media (max-width: 520px) { .form__row { grid-template-columns: 1fr; } }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    padding: 60px 0 40px;
    border-top: 1px solid var(--border);
    position: relative;
}
.footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer__brand {
    font-weight: 600;
    color: var(--text);
    display: flex; align-items: center; gap: 8px;
}
.footer__brand::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: var(--violet);
    box-shadow: 0 0 8px var(--violet);
}
.footer__links { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.footer__links a { font-size: 0.85rem; color: var(--text-muted); }
.footer__links a:hover { color: var(--violet-soft); }

/* ==========================================================================
   Reveal animations (scroll-in)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

.reveal-stagger > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal-stagger.is-visible > * { opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.is-visible > *:nth-child(8) { transition-delay: 560ms; }

/* Cartes tilt : transform piloté par le JS — on dissocie le délai du stagger (opacité)
   du transform (qui doit rester instantané pour que le hover réagisse vite). */
[data-tilt] {
    transition-property: border-color, transform;
    transition-duration: var(--t), 90ms;
    transition-timing-function: var(--ease), ease-out;
}
.reveal-stagger > [data-tilt] {
    transform: none;
    transition-property: opacity, transform, border-color;
    transition-duration: 700ms, 90ms, var(--t);
    transition-timing-function: var(--ease), ease-out, var(--ease);
    transition-delay: 0ms, 0ms, 0ms;
}
.reveal-stagger.is-visible > [data-tilt]:nth-child(1) { transition-delay:   0ms, 0ms, 0ms; }
.reveal-stagger.is-visible > [data-tilt]:nth-child(2) { transition-delay:  80ms, 0ms, 0ms; }
.reveal-stagger.is-visible > [data-tilt]:nth-child(3) { transition-delay: 160ms, 0ms, 0ms; }
.reveal-stagger.is-visible > [data-tilt]:nth-child(4) { transition-delay: 240ms, 0ms, 0ms; }
.reveal-stagger.is-visible > [data-tilt]:nth-child(5) { transition-delay: 320ms, 0ms, 0ms; }
.reveal-stagger.is-visible > [data-tilt]:nth-child(6) { transition-delay: 400ms, 0ms, 0ms; }
.reveal-stagger.is-visible > [data-tilt]:nth-child(7) { transition-delay: 480ms, 0ms, 0ms; }
.reveal-stagger.is-visible > [data-tilt]:nth-child(8) { transition-delay: 560ms, 0ms, 0ms; }

/* Timeline : effet de survol pour cohérence avec les cartes */
.timeline__item {
    transition: transform 200ms ease-out;
    will-change: transform;
}
.timeline__item:hover { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-stagger > *, .mesh__blob { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
    html { scroll-behavior: auto; }
}

/* ==========================================================================
   Scrollbar stylée
   ========================================================================== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-strong); border: 2px solid var(--bg); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet); }

/* ==========================================================================
   Page 404
   ========================================================================== */
.error-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 80px 0;
}
.error-page__content {
    position: relative;
    z-index: 2;
    max-width: 640px;
}
.error-page__code {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--violet-soft);
    letter-spacing: 0.18em;
    border: 1px solid var(--border-strong);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 22px;
}
.error-page__title {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.045em;
    margin: 0 0 22px;
}
.error-page__title em {
    font-style: normal;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.error-page__lede {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 36px;
}
.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ==========================================================================
   Print : version sobre pour impression / export PDF navigateur
   ========================================================================== */
@media print {
    /* Forcer mode clair, fond blanc, texte noir */
    :root, [data-theme="dark"], [data-theme="light"] {
        color-scheme: light;
    }
    html, body {
        background: #fff !important;
        color: #000 !important;
    }
    body * {
        color: #000 !important;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        filter: none !important;
    }

    /* Masquer tout ce qui est décoratif ou interactif */
    .nav, .footer, .scroll-progress, .cursor,
    .mesh, .hero__grid-bg,
    .timeline-tabs,
    .form, .contact__info,
    .hero__actions,
    [data-magnetic], [data-cursor], [data-progress] {
        display: none !important;
    }

    /* Désactiver les transformations / animations */
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    /* Compacter l'espacement */
    .hero { min-height: 0 !important; padding: 0 0 16pt !important; }
    .section { padding: 12pt 0 !important; page-break-inside: avoid; }
    .section__head { margin-bottom: 8pt !important; }

    /* Typo lisible papier */
    .hero__title { font-size: 26pt !important; line-height: 1.1 !important; margin-bottom: 6pt !important; }
    .hero__title .gradient-text,
    .hero__dot,
    .error-page__title em {
        background: none !important;
        -webkit-text-fill-color: #000 !important;
        color: #000 !important;
    }
    .hero__lede { font-size: 11pt !important; margin: 0 0 8pt !important; }
    .section__title { font-size: 16pt !important; margin: 0 0 6pt !important; }
    .section__title em { font-style: italic; }
    .section__lead { font-size: 10pt !important; margin: 0 0 8pt !important; }

    /* Cartes en bordure simple */
    .card {
        border: 1px solid #ccc !important;
        padding: 8pt !important;
        page-break-inside: avoid;
    }
    .card::before { display: none !important; }

    /* Bento → flux vertical pour tenir sur la page */
    .bento, .about-grid, .bio-grid, .contact__grid {
        display: block !important;
    }
    .bento > *, .about-grid > *, .bio-grid > *, .contact__grid > * {
        margin-bottom: 8pt;
    }

    /* Affichage des URLs après les liens externes */
    a[href^="http"]::after,
    a[href^="mailto"]::after,
    a[href^="tel"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555 !important;
    }
    a[href^="#"]::after { content: ""; }

    /* Timeline : retirer la ligne verticale, alléger les puces */
    .timeline::before, .timeline::after { display: none !important; }
    .timeline__item { padding-left: 0 !important; padding-bottom: 8pt !important; }
    .timeline__item::before { display: none !important; }

    /* Stats / chiffres clés : taille plus mesurée à l'impression */
    .stat__value { font-size: 22pt !important; }
}

/* ==========================================================================
   Pages légales (mentions légales, confidentialité)
   ========================================================================== */
.legal {
    padding: 140px 0 80px;
    min-height: 80vh;
}
.legal__content {
    max-width: 760px;
}
.legal__title {
    font-size: clamp(2.2rem, 5.5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.045em;
    margin: 14px 0 36px;
}
.legal__title em {
    font-style: normal;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.legal h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 36px 0 12px;
    color: var(--text);
    letter-spacing: -0.015em;
}
.legal p,
.legal ul {
    font-size: 0.97rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0 0 14px;
}
.legal ul {
    padding-left: 22px;
}
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--violet-soft); }
.legal a:hover { color: var(--violet); }
.legal__updated {
    margin-top: 48px !important;
    font-size: 0.82rem !important;
    color: var(--text-subtle) !important;
    border-top: 1px solid var(--border);
    padding-top: 18px;
}

/* ==========================================================================
   Mode clair — ajustements pour parité visuelle avec le mode sombre
   ========================================================================== */
[data-theme="light"] {
    --border-glow: rgba(139, 92, 246, 0.25);
    --glow-violet: 0 0 30px rgba(139, 92, 246, 0.18);
    --glow-violet-sm: 0 0 16px rgba(139, 92, 246, 0.12);
}

/* Blobs du hero : nettement moins saturés pour ne pas agresser sur blanc */
[data-theme="light"] .mesh__blob { opacity: 0.22 !important; filter: blur(70px); }
[data-theme="light"] .mesh__blob--1 {
    background: radial-gradient(circle, var(--violet) 0%, transparent 70%);
}
[data-theme="light"] .mesh__blob--2 {
    background: radial-gradient(circle, var(--cyan) 0%, transparent 70%);
}
[data-theme="light"] .mesh__blob--3 {
    background: radial-gradient(circle, var(--pink) 0%, transparent 70%);
}

/* Grille de fond hero : un peu plus marquée pour rester perceptible */
[data-theme="light"] .hero__grid-bg {
    background-image:
        linear-gradient(rgba(10, 10, 11, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 10, 11, 0.06) 1px, transparent 1px);
}

/* Cartes : ombre subtile pour les détacher du fond blanc */
[data-theme="light"] .card {
    box-shadow: 0 1px 2px rgba(10, 10, 11, 0.03), 0 1px 1px rgba(10, 10, 11, 0.02);
}
[data-theme="light"] .card:hover {
    box-shadow: 0 6px 20px rgba(10, 10, 11, 0.06);
}

/* Halo violet intérieur : plus discret en light */
[data-theme="light"] .card::before {
    background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, 0.08), transparent 40%);
}

/* Nav scrollée : une ombre légère pour la séparer du contenu */
[data-theme="light"] .nav.is-scrolled {
    box-shadow: 0 1px 0 rgba(10, 10, 11, 0.04), 0 4px 18px rgba(10, 10, 11, 0.03);
}

/* Boutons fantômes : bord plus marqué pour la lisibilité */
[data-theme="light"] .btn-ghost {
    border-color: var(--border-strong);
}
[data-theme="light"] .btn-ghost:hover {
    background: rgba(10, 10, 11, 0.04);
}

/* Footer : fond légèrement teinté pour la séparation */
[data-theme="light"] .footer {
    background: rgba(10, 10, 11, 0.025);
    border-top: 1px solid var(--border);
}

/* Curseur personnalisé : plus contrasté en light */
[data-theme="light"] .cursor { border-color: var(--violet-deep); }
[data-theme="light"] .cursor.is-hover { background: var(--violet-deep); border-color: var(--violet-deep); }

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-track { background: #f0f0f3; }
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(10, 10, 11, 0.15);
    border-color: #f0f0f3;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--violet); }

/* Inputs / textareas : bordure plus présente en light */
[data-theme="light"] .form input,
[data-theme="light"] .form textarea {
    background: #fff;
    border-color: rgba(10, 10, 11, 0.12);
}
[data-theme="light"] .form input:focus,
[data-theme="light"] .form textarea:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

/* Timeline : dot et ligne plus marqués en light */
[data-theme="light"] .timeline::before {
    background: linear-gradient(180deg, transparent, rgba(10, 10, 11, 0.12), transparent);
}
[data-theme="light"] .timeline__item::before {
    background: #fff;
}

/* Meta-chips : fond très léger en light */
[data-theme="light"] .meta-chip {
    background: rgba(10, 10, 11, 0.025);
}

/* Live-badge / project tags */
[data-theme="light"] .project__tag,
[data-theme="light"] .project__category {
    background: rgba(139, 92, 246, 0.08);
}

/* Skill__num : lisibilité */
[data-theme="light"] .skill__num { color: var(--text-subtle); }

/* ==========================================================================
   Terminal interactif (easter egg accessible)
   ========================================================================== */
.term-trigger {
    position: fixed;
    bottom: 18px;
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom, 18px));
    right:  max(18px, env(safe-area-inset-right,  18px));
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(20, 20, 24, 0.78);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    cursor: pointer;
    transition: color var(--t), background var(--t), border-color var(--t), transform var(--t);
}
.term-trigger:hover {
    color: var(--text);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
.term-trigger__icon {
    color: var(--violet-soft);
    font-weight: 700;
    letter-spacing: -1px;
}
[data-theme="light"] .term-trigger {
    background: rgba(255, 255, 255, 0.85);
}

/* Modale terminal */
.term-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.term-modal.is-open { display: flex; }
.term-modal__inner {
    width: 100%;
    max-width: 720px;
    height: min(560px, 80vh);
    display: flex;
    flex-direction: column;
    background: #0c0c10;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    color: #d4d4d8;
    font-family: var(--mono);
    font-size: 0.88rem;
}
.term-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #1a1a20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #9c9ca5;
    font-size: 0.78rem;
}
.term-modal__head-dots { display: inline-flex; gap: 6px; }
.term-modal__head-dots span {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #3a3a44;
}
.term-modal__head-dots span:nth-child(1) { background: #ff5f56; }
.term-modal__head-dots span:nth-child(2) { background: #ffbd2e; }
.term-modal__head-dots span:nth-child(3) { background: #27c93f; }
.term-modal__close {
    background: transparent;
    border: none;
    color: #9c9ca5;
    font-family: var(--mono);
    font-size: 1.2rem;
    line-height: 1;
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
}
.term-modal__close:hover { background: rgba(255, 255, 255, 0.06); color: #f5f5f7; }
.term-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    line-height: 1.55;
}
.term-modal__body::-webkit-scrollbar { width: 8px; }
.term-modal__body::-webkit-scrollbar-track { background: transparent; }
.term-modal__body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
.term-line { white-space: pre-wrap; word-break: break-word; margin: 0 0 4px; }
.term-line--cmd { color: #f5f5f7; }
.term-line--err { color: #ff7474; }
.term-line--accent { color: #a78bfa; }
.term-line--muted { color: #62626a; }
.term-line--ok { color: #27c93f; }
.term-prompt-symbol { color: #8b5cf6; font-weight: 600; margin-right: 8px; }
.term-modal__input-row {
    display: flex;
    align-items: center;
    padding: 10px 16px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.term-modal__input-row input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f5f5f7;
    font-family: var(--mono);
    font-size: 0.88rem;
    caret-color: #8b5cf6;
    padding: 0;
}
.term-modal__input-row input::placeholder { color: #62626a; }

/* Desktop : terminal en mode fenêtre flottante (déplaçable + minimize + maximize) */
@media (min-width: 701px) {
    .term-modal {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        pointer-events: none;
    }
    .term-modal__inner {
        pointer-events: auto;
        position: absolute;
        top: 80px;
        left: 50%;
        margin-left: -360px;
        width: 720px;
        height: 520px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.08);
        transition: top 220ms var(--ease), left 220ms var(--ease),
                    width 220ms var(--ease), height 220ms var(--ease);
    }
    .term-modal__inner.is-dragging {
        transition: none;
        user-select: none;
        cursor: grabbing;
    }
    .term-modal__inner.is-maximized {
        top: 20px !important;
        left: 20px !important;
        margin-left: 0 !important;
        width: calc(100vw - 40px) !important;
        height: calc(100vh - 40px) !important;
    }
    .term-modal__inner.is-minimized {
        height: 44px !important;
        width: 280px !important;
        max-height: 44px !important;
    }
    .term-modal__inner.is-minimized .term-modal__body,
    .term-modal__inner.is-minimized .term-modal__input-row {
        display: none;
    }
    .term-modal__head { cursor: grab; user-select: none; }
    .term-modal__inner.is-dragging .term-modal__head { cursor: grabbing; }
    .term-modal__inner.is-maximized .term-modal__head,
    .term-modal__inner.is-minimized .term-modal__head { cursor: default; }
    .term-modal__head-dots span {
        cursor: pointer;
        transition: transform 100ms ease-out;
    }
    .term-modal__head-dots span:hover { transform: scale(1.25); }
}

/* Mobile : terminal en bottom sheet plein écran */
@media (max-width: 700px) {
    .term-trigger__label { display: none; }
    .term-trigger { padding: 0 12px; }

    .term-modal {
        align-items: stretch;
        padding: 0;
        height: 100vh;        /* fallback navigateurs anciens */
        height: 100dvh;       /* dynamique : s'adapte au clavier virtuel */
    }
    .term-modal__inner {
        max-width: 100%;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        font-size: 0.9rem;
    }
    /* iOS : empêche le zoom auto au focus en passant l'input à 16px min */
    .term-modal__input-row input {
        font-size: 16px;
        line-height: 1.4;
    }
    .term-modal__close {
        width: 36px; height: 36px;
        font-size: 1.4rem;
    }
    .term-modal__body { padding: 12px 14px; }
    .term-modal__input-row { padding: 12px 14px; }
}

/* Désactive le curseur custom + le scroll body quand le terminal est ouvert */
body.term-open { overflow: hidden; }
body.term-open .cursor { display: none !important; }

/* Matrix rain (déclenché par la commande `matrix` du terminal) */
.matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: auto;
    background: #050507;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .term-trigger { transition: none; }
}

/* ==========================================================================
   Accessibilité — focus-visible + skip link
   ========================================================================== */

/* Pas d'outline sur clic souris, mais ring violet visible au focus clavier */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 3px;
    border-radius: 6px;
}
.btn:focus-visible,
.btn-icon:focus-visible,
.nav__menu a:focus-visible,
.term-trigger:focus-visible {
    outline-offset: 4px;
}
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 0;
}

/* Lien d'évitement (skip to content) — masqué par défaut, visible au focus clavier */
.skip-link {
    position: absolute;
    top: -100px;
    left: 12px;
    z-index: 999;
    padding: 10px 18px;
    background: var(--violet);
    color: #fff;
    border-radius: var(--radius-pill);
    font-family: var(--sans);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
    transition: top 200ms var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible {
    top: 12px;
    color: #fff;
    outline: 2px solid var(--text);
    outline-offset: 2px;
}
