/* ============================================================
   PORTFOLIO — JULIAN LORY · 2026
   Design system : épuré, premium, éditorial
   Accent unique vert menthe · typographie Space Grotesk
   ============================================================ */

/* ─────────────────────────────────────────
   1. Tokens
   ───────────────────────────────────────── */
:root {
    --bg:            #0A0B0A;
    --bg-soft:       #0E100F;
    --surface:       rgba(255, 255, 255, 0.025);
    --surface-2:     rgba(255, 255, 255, 0.045);
    --line:          rgba(255, 255, 255, 0.08);
    --line-strong:   rgba(255, 255, 255, 0.14);

    --txt:           #F4F6F5;
    --txt-soft:      #A6AFAB;
    --txt-faint:     #6B736F;

    --accent:        #34D399;
    --accent-bright: #5EEAD4;
    --accent-deep:   #059669;
    --accent-glow:   rgba(52, 211, 153, 0.16);

    --r-sm: 0.75rem;
    --r:    1.1rem;
    --r-lg: 1.5rem;
    --r-xl: 2rem;

    --ease:   cubic-bezier(0.22, 1, 0.36, 1);
    --ease-2: cubic-bezier(0.16, 1, 0.3, 1);

    --maxw: 1180px;
}

/* ─────────────────────────────────────────
   2. Reset / base — neutralise l'ancien thème chargé
   ───────────────────────────────────────── */
html { scroll-behavior: smooth; }

body,
body.bg-bg-light,
body.min-h-screen {
    background: var(--bg) !important;
    color: var(--txt);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   FOND GLOBAL — épuré, avec une animation douce
   Halos verts qui dérivent/respirent lentement. Identique sur
   tout le site. Pas de grille.
   ============================================================ */
body::before {
    content: '';
    position: fixed;
    inset: -10%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(50% 45% at 50% -6%, rgba(52, 211, 153, 0.12) 0%, transparent 60%),
        radial-gradient(42% 40% at 88% 10%, rgba(94, 234, 212, 0.07) 0%, transparent 55%),
        radial-gradient(45% 45% at 12% 80%, rgba(5, 150, 105, 0.07) 0%, transparent 60%),
        var(--bg) !important;
    background-color: var(--bg) !important;
    animation: bgDrift 24s ease-in-out infinite alternate !important;
}
@keyframes bgDrift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(1.5%, -1.5%, 0) scale(1.04); }
    100% { transform: translate3d(-1.5%, 1%, 0) scale(1.02); }
}

/* Plus de grille / décors hérités */
body::after { display: none !important; }
.binary-bg,
#binary-bg,
.floating-shapes,
.dynamic-bg,
.particles-layer { display: none !important; }

.aurora-layer { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none !important; }
}

main, section, nav, footer, header { position: relative; z-index: 1; }

/* ─────────────────────────────────────────
   3. Typographie
   ───────────────────────────────────────── */
h1, h2, h3, h4, h5,
.font-display {
    font-family: 'Space Grotesk', 'Inter', sans-serif !important;
    letter-spacing: -0.025em;
    color: var(--txt);
}

.display-xl { font-size: clamp(2.6rem, 7vw, 5rem);  line-height: 1.02; font-weight: 700; }
.display-lg { font-size: clamp(2rem, 5vw, 3.4rem);  line-height: 1.05; font-weight: 700; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}
.eyebrow::before {
    content: '';
    width: 1.6rem;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.lead { color: var(--txt-soft); font-size: clamp(1rem, 1.4vw, 1.2rem); line-height: 1.7; }

.text-accent { color: var(--accent) !important; }

.text-gradient,
.gradient-text {
    background: linear-gradient(100deg, #FFFFFF 0%, var(--accent-bright) 55%, var(--accent) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* ─────────────────────────────────────────
   4. Layout helpers
   ───────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.5rem; }

.section-pad { padding-block: clamp(4rem, 9vw, 8rem); }

.divider {
    height: 1px;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
    margin: 0;
}

/* ─────────────────────────────────────────
   5. Cartes "surface"
   ───────────────────────────────────────── */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.4s var(--ease), transform 0.4s var(--ease), background 0.4s var(--ease);
}
.card:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.card-i {
    border-color: rgba(52, 211, 153, 0.0);
}
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.card-link:hover {
    transform: translateY(-6px);
    border-color: rgba(52, 211, 153, 0.30);
    box-shadow: 0 26px 60px -28px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(52, 211, 153, 0.10);
}

/* halo accent au survol (subtil) */
.card-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(140deg, rgba(52,211,153,0.5), transparent 40%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
}
.card-glow:hover::after { opacity: 1; }

/* ─────────────────────────────────────────
   6. Boutons
   ───────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.btn-primary {
    background: var(--accent);
    color: #04130D;
    box-shadow: 0 10px 30px -10px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-bright); transform: translateY(-2px); }

.btn-ghost {
    background: transparent;
    color: var(--txt);
    border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ─────────────────────────────────────────
   7. Tags / chips
   ───────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--txt-soft);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    transition: all 0.3s var(--ease);
}
.tag:hover { color: var(--accent); border-color: rgba(52, 211, 153, 0.35); }
.tag i { color: var(--accent); font-size: 0.78rem; }

/* override des anciennes chips (parcours) */
.chip-glow {
    display: inline-flex; align-items: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.04em; text-transform: none;
    color: var(--accent) !important;
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid var(--line) !important;
    box-shadow: none !important;
    transition: all 0.3s var(--ease) !important;
}
.chip-glow:hover {
    border-color: rgba(52,211,153,0.4) !important;
    box-shadow: none !important;
    transform: translateY(-2px) !important;
}

/* ─────────────────────────────────────────
   8. Stat / numbers
   ───────────────────────────────────────── */
.stat-num {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1;
    background: linear-gradient(180deg, #fff, var(--accent));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--txt-faint); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 0.4rem; }

/* ─────────────────────────────────────────
   9. Timeline épurée (parcours)
   ───────────────────────────────────────── */
.tl { position: relative; padding-left: 2rem; }
.tl::before {
    content: '';
    position: absolute;
    left: 6px; top: 4px; bottom: 4px;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--line-strong) 12%, var(--line-strong) 88%, transparent);
}
.tl-item { position: relative; padding-bottom: 3rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: '';
    position: absolute;
    left: -1.72rem; top: 0.45rem;
    width: 13px; height: 13px;
    border-radius: 999px;
    background: var(--bg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.10);
}

/* On masque l'ancienne timeline lourde si présente */
.timeline::before { display: none !important; }
.timeline-step::after { display: none !important; }

/* ─────────────────────────────────────────
   10. Reveal au scroll
   ───────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

/* ─────────────────────────────────────────
   11. Footer
   ───────────────────────────────────────── */
footer {
    background: transparent !important;
    border-top: 1px solid var(--line);
    color: var(--txt-soft) !important;
}
footer a { transition: color 0.3s var(--ease); }

/* ─────────────────────────────────────────
   12. Liens sociaux ronds
   ───────────────────────────────────────── */
.social {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--txt-soft);
    transition: all 0.3s var(--ease);
}
.social:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }

/* ─────────────────────────────────────────
   13. Mode clair
   ───────────────────────────────────────── */
body.light-mode {
    --bg:          #EDF1EF;
    --bg-soft:     #FFFFFF;
    --surface:     rgba(255, 255, 255, 0.72);
    --surface-2:   rgba(255, 255, 255, 0.95);
    --line:        rgba(8, 35, 26, 0.12);
    --line-strong: rgba(8, 35, 26, 0.20);
    --txt:         #0B1A14;
    --txt-soft:    #45554E;
    --txt-faint:   #79857E;
    --accent:      #0D9668;
    --accent-bright:#10B981;
    --accent-deep: #0A7C57;
    --accent-glow: rgba(13, 150, 104, 0.30);
    background: var(--bg) !important;
    color: var(--txt);
}

/* Fond clair : mêmes halos doux animés, teintés vert menthe */
body.light-mode::before {
    background:
        radial-gradient(50% 45% at 50% -6%, rgba(13, 150, 104, 0.10) 0%, transparent 60%),
        radial-gradient(42% 40% at 88% 10%, rgba(16, 185, 129, 0.07) 0%, transparent 55%),
        radial-gradient(45% 45% at 12% 80%, rgba(13, 150, 104, 0.06) 0%, transparent 60%),
        var(--bg) !important;
}

/* Cartes claires : blanches et surélevées (ombre douce) */
body.light-mode .card,
body.light-mode .glass,
body.light-mode [class*="rounded-2xl"][class*="border"][class*="bg-gradient-to-br"],
body.light-mode [class*="rounded-3xl"][class*="border"][class*="bg-gradient-to-br"] {
    box-shadow: 0 1px 2px rgba(8, 35, 26, 0.05), 0 14px 34px -20px rgba(8, 35, 26, 0.20);
}
body.light-mode .card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 2px 4px rgba(8, 35, 26, 0.06), 0 20px 46px -22px rgba(8, 35, 26, 0.26);
}
body.light-mode .card-link:hover {
    box-shadow: 0 18px 46px -22px rgba(8, 35, 26, 0.28), 0 0 0 1px rgba(13, 150, 104, 0.14) !important;
}

/* Tags / chips lisibles en clair */
body.light-mode .tag,
body.light-mode .chip-glow {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: var(--line) !important;
}
body.light-mode .tag:hover { border-color: rgba(13, 150, 104, 0.45) !important; }

/* Boutons clairs */
body.light-mode .btn-primary {
    color: #FFFFFF;
    box-shadow: 0 12px 28px -12px var(--accent-glow);
}
body.light-mode .btn-ghost { border-color: var(--line-strong); }
body.light-mode .social { background: rgba(255, 255, 255, 0.6); }

body.light-mode .text-gradient,
body.light-mode .gradient-text {
    background: linear-gradient(100deg, #0B1A14 0%, var(--accent) 100%) !important;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
body.light-mode .stat-num {
    background: linear-gradient(180deg, #0B1A14, var(--accent));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* Forcer la lisibilité par-dessus les classes Tailwind héritées */
.text-gray-300, .text-gray-400 { color: var(--txt-soft) !important; }
.text-gray-500 { color: var(--txt-faint) !important; }
.text-white { color: var(--txt) !important; }

/* ─────────────────────────────────────────
   14. Accessibilité / mobile
   ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
}

img, svg, video { max-width: 100%; height: auto; }

/* ─────────────────────────────────────────
   15. Compatibilité — pages conservant l'ancien markup
   (veille, expériences, détails de projets)
   ───────────────────────────────────────── */
.gradient-bg {
    background: transparent !important;
    animation: none !important;
}

/* Adoucit les gros halos décoratifs colorés */
.blur-2xl, .blur-3xl { opacity: 0.4 !important; }
.animate-pulse { animation: none !important; }

/* Toute carte sombre arrondie → surface épurée cohérente */
[class*="rounded-2xl"][class*="border"][class*="bg-gradient-to-br"],
[class*="rounded-3xl"][class*="border"][class*="bg-gradient-to-br"] {
    background: var(--surface) !important;
    border-color: var(--line) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Cartes "glass" héritées */
.glass {
    background: var(--surface) !important;
    border-color: var(--line) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Anciens points de timeline / barres décoratives unifiés en vert */
.bg-yellow-400\/20, .text-yellow-300 { color: var(--accent) !important; }

/* Liens texte verts hérités */
.text-primary-new, .text-accent-new { color: var(--accent) !important; }
.hover\:text-primary-new:hover { color: var(--accent-bright) !important; }

body.light-mode .blur-2xl, body.light-mode .blur-3xl { opacity: 0.25 !important; }

/* Sections sans bande de fond (épuré) */
#qui-suis-je,
body.light-mode #qui-suis-je,
section.bg-bg-light,
body.light-mode section.bg-bg-light {
    background: transparent !important;
}
