/* ===========================================
   VARIABLES & RESET
   =========================================== */

:root {
    --color-primary: #1a3a32;
    --color-accent: #3d8b6e;
    --color-accent-light: #9ed4b8;
    --color-light: #f7f9f8;
    --color-warm: #e8ded4;
    --color-text: #2c2c2c;
    --color-muted: #6b7c75;
    --font-display: 'DM Serif Display', serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-light);
    line-height: 1.8;
    font-size: 18px;
}

/* ===========================================
   NAVIGATION
   =========================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition:
        top          0.44s cubic-bezier(0.4, 0, 0.2, 1),
        left         0.44s cubic-bezier(0.4, 0, 0.2, 1),
        width        0.44s cubic-bezier(0.4, 0, 0.2, 1),
        padding      0.44s cubic-bezier(0.4, 0, 0.2, 1),
        border-radius 0.44s cubic-bezier(0.4, 0, 0.2, 1),
        background   0.38s ease,
        box-shadow   0.38s ease,
        border-color 0.38s ease,
        transform    0.44s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: white;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    position: relative;
    transition: color 0.25s ease;
}

/* Soulignement animé (du centre vers les bords) — généralise l'état scrollé/dark */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-mobile-toggle span {
    width: 22px;
    height: 1.5px;
    background: white;
    display: block;
    transition: all 0.3s ease;
}

/* ── État scrollé : pill flottante (mode clair) ─────── */
.nav--scrolled {
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: 860px;
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    mix-blend-mode: normal;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.09), 0 1px 0 rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.nav--scrolled .nav-logo {
    color: var(--color-primary);
}

.nav--scrolled .nav-links a {
    color: var(--color-text);
    position: relative;
}

.nav--scrolled .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1.5px;
    background: var(--color-accent);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav--scrolled .nav-links a:hover {
    color: var(--color-accent);
}

.nav--scrolled .nav-links a:hover::after {
    width: 100%;
}

.nav--scrolled .theme-toggle {
    color: var(--color-primary);
}

.nav--scrolled .nav-mobile-toggle span {
    background: var(--color-text);
}


/* ===========================================
   HERO
   =========================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Gradient décoratif déplacé dans .hero-parallax-bg (parallaxe JS) */

.hero-content {
    max-width: 800px;
    text-align: center;
    color: white;
    animation: fadeIn 1.5s ease-out;
    position: relative;
    z-index: 10;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Entrée du héros : le nom se resserre, le trait se déploie */
@keyframes heroNameSettle {
    from { letter-spacing: 0.14em; transform: translateY(10px); }
    to   { letter-spacing: -0.02em; transform: translateY(0); }
}

@keyframes heroDividerGrow {
    from { width: 0; opacity: 0; }
    to   { width: 48px; opacity: 0.85; }
}

/* Révélation mot à mot de la tagline (délais posés en JS) */
.hero-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.6em);
    animation: heroWordIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes heroWordIn {
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-word { animation: none; opacity: 1; transform: none; }
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(2.65rem, 6.6vw, 4.8rem);
    font-weight: 400;
    line-height: 1.05;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    animation: heroNameSettle 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-divider {
    width: 48px;
    height: 2px;
    background: var(--color-accent);
    margin: 0 auto 1.25rem;
    border: none;
    opacity: 0.85;
    animation: heroDividerGrow 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.45s both;
}

/* Mouvement réduit : pas d'entrée animée, états finaux affichés d'emblée
   (placé après les règles pour primer en cas d'égalité de spécificité) */
@media (prefers-reduced-motion: reduce) {
    .hero-name,
    .hero-divider { animation: none; }
}

.hero-role {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-accent-light);
    margin-bottom: 2rem;
    opacity: 1;
}

.hero-intro {
    font-size: 1.45rem;
    font-weight: 300;
    color: rgba(255,255,255,0.92);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.65;
}

.hero-cta {
    margin-top: 2rem;
}

.hero-cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.5rem;
    border: 1px solid rgba(255,255,255,0.55);
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    border-radius: 2px;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-cv-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(61, 139, 110, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(61, 139, 110, 0.22);
}

.hero-cv-btn:focus-visible {
    outline: 2px solid var(--color-accent-light);
    outline-offset: 3px;
}

.hero-cv-btn svg {
    transition: transform 0.25s ease;
}

.hero-cv-btn:hover svg {
    transform: translateX(4px);
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

#isoline-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.45) 30%, black 62%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.45) 30%, black 62%);
}

/* ===========================================
   SECTIONS NARRATIVES
   =========================================== */

.narrative {
    max-width: 720px;
    margin: 0 auto;
    padding: 8rem 2rem;
}

.narrative p {
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.narrative .lead {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--color-primary);
    margin-bottom: 2rem;
    font-weight: normal;
    margin-top: 0;
}

.narrative .highlight {
    color: var(--color-accent);
    font-weight: 600;
}

.narrative .aside {
    font-style: italic;
    color: var(--color-muted);
    padding-left: 1.5rem;
    border-left: 3px solid var(--color-warm);
    margin: 2.5rem 0;
}

/* Sections avec fond */
.section-warm {
    background: var(--color-warm);
}

.section-dark {
    background: var(--color-primary);
    color: white;
}

.section-dark .lead {
    color: white;
}

.section-dark p {
    color: rgba(255,255,255,0.85);
}

.section-dark .highlight {
    color: var(--color-accent-light);
}

/* ===========================================
   TIMELINE (Parcours)
   =========================================== */

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-primary);
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-accent);
}

.timeline {
    position: relative;
    padding-left: 30px;
    margin: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-accent);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 8px;
    width: 10px;
    height: 10px;
    background: var(--color-accent);
    border-radius: 50%;
    border: 3px solid var(--color-warm);
}

.timeline-date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-primary);
    margin-bottom: 0.15rem;
}

.timeline-company {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: var(--color-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===========================================
   COMPÉTENCES
   =========================================== */

.skills-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0;
}

.skill-tag {
    padding: 0.5rem 1.25rem;
    background: rgba(61, 139, 110, 0.1);
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--color-primary);
}

.section-dark .skill-tag {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* ===========================================
   STATISTIQUES
   =========================================== */

.stat-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
}

.stat-inline .number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-accent);
    line-height: 1;
}

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

.section-dark .stat-inline .label {
    color: rgba(255,255,255,0.78);
}

.stats-row {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    margin: 2.5rem 0;
}

/* ===========================================
   CITATION
   =========================================== */

.quote-block {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.75rem;
    line-height: 1.5;
    color: var(--color-primary);
    margin: 3rem 0;
    position: relative;
    padding-left: 2rem;
}

.quote-block::before {
    content: '"';
    position: absolute;
    left: -0.5rem;
    top: -1rem;
    font-size: 5rem;
    color: var(--color-warm);
    font-family: var(--font-display);
    line-height: 1;
}

.quote-author {
    display: block;
    margin-top: 0.75rem;
    margin-left: 1.5rem;
    font-size: 1.1rem;
    font-style: normal;
}

.section-dark .quote-block {
    color: white;
}

.section-dark .quote-block::before {
    color: rgba(255,255,255,0.1);
}

/* ===========================================
   OUTILS (teaser sur accueil)
   =========================================== */

.tools-teaser-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 3rem 0;
}

.tools-teaser {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border-left: 4px solid transparent;
}

.tools-teaser h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.tools-teaser p {
    color: var(--color-muted);
    margin-bottom: 1.5rem;
}

.tools-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    transition: gap 0.3s ease;
}

.tools-link:hover {
    gap: 1rem;
}

.tools-teaser--outils {
    border-left-color: var(--color-accent);
}

.tools-teaser--realisations {
    border-left-color: #4a6fa5;
}

.tools-link--realisations {
    color: #4a6fa5;
}

@media (max-width: 768px) {
    .tools-teaser-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   PAGE OUTILS
   =========================================== */

.page-header {
    background: var(--color-primary);
    padding: 8rem 5% 4rem;
    color: white;
}

.page-header-content {
    max-width: 1200px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: white;
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    font-weight: 300;
}

.outils-section {
    padding: 4rem 5%;
    background: white;
    max-width: 100%;
}

.outils-section:nth-child(even) {
    background: var(--color-light);
}

.outils-categorie {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-primary);
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-accent);
}

.outils-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.outil-card {
    display: block;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.outils-section:nth-child(odd) .outil-card {
    background: var(--color-light);
}

.outil-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-color: var(--color-accent);
}

.outil-card.inactive {
    opacity: 0.5;
    pointer-events: none;
}

.outil-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.outil-card p {
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.outil-badge {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.25rem 0.75rem;
    background: var(--color-warm);
    color: var(--color-muted);
    border-radius: 20px;
    margin-top: 1rem;
}

.outil-card:not(.inactive) .outil-badge {
    background: var(--color-accent);
    color: white;
}

/* ===========================================
   PAGE RÉALISATIONS
   =========================================== */

.page-header--realisations {
    background: #1a2d4a;
}

.realisations-section {
    padding: 4rem 5%;
    background: var(--color-light);
    max-width: 100%;
}

.realisation-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
    margin-bottom: 4rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.realisation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

/* --- Prévisualisation navigateur --- */

.realisation-preview {
    background: #e8eef6;
    padding: 2rem 2rem 0;
}

.browser-mockup {
    background: white;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.browser-bar {
    background: #e8eaed;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.browser-dots {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.browser-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c5c7ca;
}

.browser-dots span:nth-child(1) { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #ffbd2e; }
.browser-dots span:nth-child(3) { background: #28ca41; }

.browser-url {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 0.2rem 0.75rem;
    font-size: 0.75rem;
    color: #555;
    font-family: var(--font-body);
}

.browser-content {
    background: #f7f9fc;
    overflow: hidden;
}

.browser-screenshot {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: top;
    max-height: 480px;
}

/* --- Infos réalisation --- */

.realisation-info {
    padding: 2rem 2.5rem 2.5rem;
}

.realisation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.realisation-tag {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.25rem 0.75rem;
    background: #e8eef6;
    color: #4a6fa5;
    border-radius: 20px;
    font-weight: 600;
}

.realisation-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: #1a2d4a;
    margin-bottom: 0.75rem;
}

.realisation-desc {
    color: var(--color-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.realisation-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: #4a6fa5;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.realisation-link:hover {
    background: #3a5f95;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 111, 165, 0.35);
}

@media (max-width: 768px) {
    .realisations-section {
        padding: 3rem 5%;
    }

    .realisation-info {
        padding: 1.5rem;
    }


}

/* ===========================================
   CONTACT
   =========================================== */

.contact-section {
    text-align: center;
    padding: 8rem 2rem;
    background: var(--color-primary);
}

.contact-section .lead {
    color: white;
    margin-bottom: 1rem;
    font-weight: normal;
    margin-top: 0;
}

.contact-section p {
    color: rgba(255,255,255,0.7);
    max-width: 500px;
    margin: 0 auto 2.5rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: var(--color-accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: #4a9f7f;
    transform: translateY(-2px);
}

/* -------------------------------------------
   BLOC DISPONIBILITÉ (page d'accueil)
   ------------------------------------------- */

.dispo-banner {
    max-width: 640px;
    margin: 0 auto 3.5rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    text-align: left;
}

.dispo-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: white;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.dispo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
    box-shadow: 0 0 7px #4caf50;
}

.dispo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2rem;
    margin: 0 0 1.25rem;
}

.dispo-grid > div { display: flex; flex-direction: column; }

.dispo-grid dt {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.2rem;
}

.dispo-grid dd {
    color: rgba(255,255,255,0.85);
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.4;
}

.dispo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dispo-tags span {
    font-size: 0.78rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    color: rgba(255,255,255,0.85);
}

@media (max-width: 600px) {
    .dispo-grid { grid-template-columns: 1fr; }
    .dispo-banner { padding: 1.25rem 1.25rem; }
}

/* ===========================================
   FOOTER
   =========================================== */

.footer {
    background: var(--color-primary);
    border-top: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.72);
    padding: 2rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 768px) {
    /* Pill désactivée sur mobile : nav pleine largeur ancrée en haut */
    .nav--scrolled {
        left: 0;
        transform: none;
        width: 100%;
        top: 0;
        padding: 0.9rem 5%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    /* mix-blend-mode: difference rendrait le dropdown illisible sur mobile */
    .nav:not(.nav--scrolled) {
        mix-blend-mode: normal;
    }

    /* Le dropdown mobile a toujours un fond sombre : forcer le texte en clair */
    .nav--scrolled .nav-links a {
        color: rgba(255, 255, 255, 0.9);
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-primary);
        flex-direction: column;
        padding: 1rem 5%;
        gap: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-mobile-toggle {
        display: flex;
    }

    .narrative {
        padding: 5rem 1.5rem;
    }

    .narrative .lead {
        font-size: 1.5rem;
    }

    .stats-row {
        gap: 2rem;
    }

    .timeline {
        padding-left: 25px;
    }

    .timeline-item::before {
        left: -29px;
    }

    .outils-grid {
        grid-template-columns: 1fr;
    }

    .outils-section {
        padding: 3rem 5%;
    }
}

/* ===========================================
   BARRE DE PROGRESSION DE LECTURE
   =========================================== */

#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--color-accent);
    z-index: 300;
    width: 0%;
    pointer-events: none;
    transition: width 0.08s linear;
}

/* ===========================================
   ANIMATIONS AU SCROLL (Intersection Observer)
   =========================================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================================
   TIMELINE INTERACTIVE
   =========================================== */

.timeline-item {
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.timeline-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    background-color: rgba(255, 255, 255, 0.65);
}

.timeline-item::before {
    transition: background-color 0.3s ease, transform 0.3s ease;
    transform-origin: center center;
}

.timeline-item:hover::before {
    background-color: var(--color-primary);
    transform: scale(1.5);
}

.timeline-date {
    display: inline-block;
    background: rgba(61, 139, 110, 0.12);
    border-radius: 20px;
    padding: 0.1rem 0.7rem;
}

/* ===========================================
   EFFET TYPEWRITER
   =========================================== */

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: rgba(255, 255, 255, 0.75);
    vertical-align: text-bottom;
    margin-left: 1px;
    animation: cursorBlink 0.75s step-end infinite;
}

.typewriter-cursor.done {
    display: none;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ===========================================
   COMPTEURS ANIMÉS
   =========================================== */

.stat-counter {
    font-variant-numeric: tabular-nums;
}

/* ===========================================
   GRILLE DE COMPÉTENCES
   =========================================== */

/* Wrapper élargi : casse la contrainte max-width: 720px du .narrative sur desktop */
.skills-wide {
    width: min(90vw, 1100px);
    margin-left: calc((100% - min(90vw, 1100px)) / 2);
    margin-right: calc((100% - min(90vw, 1100px)) / 2);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0 1.5rem;
}

.skill-card {
    position: relative;
    min-height: 130px;
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    cursor: default;
    overflow: hidden;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.skill-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-color, rgba(255, 255, 255, 0.35));
    background: rgba(255, 255, 255, 0.09);
}

.skill-card-icon {
    display: block;
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 0.6rem;
}

.skill-card-name {
    display: block;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Badge catégorie : positionné en haut à droite, visible au survol */
.skill-card-tag {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid var(--card-color, rgba(255, 255, 255, 0.3));
    color: var(--card-color, rgba(255, 255, 255, 0.6));
    border-radius: 20px;
    padding: 0.12rem 0.5rem;
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
}

.skill-card:hover .skill-card-tag {
    opacity: 1;
}

/* Description courte : apparaît au survol */
.skill-card-desc {
    margin: 0.55rem 0 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.28s ease, opacity 0.28s ease;
}

.skill-card:hover .skill-card-desc {
    max-height: 5rem;
    opacity: 1;
}

/* Filtres de compétences */
.skills-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.filter-btn {
    padding: 0.35rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    letter-spacing: 0.02em;
}

.filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.55);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--color-accent-light);
    outline-offset: 2px;
}

.filter-btn.active {
    background: #1D9E75;
    border-color: #1D9E75;
    color: #fff;
}

/* Carte atténuée lors du filtrage */
/* !important nécessaire : l'animation skillCardIn (fill-mode both) contrôle
   l'opacity après le reveal au scroll et passe outre les règles normales. */
.skill-card.dimmed {
    opacity: 0.18 !important;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

/* Apparition en cascade au scroll — via animation (délai posé en JS) pour ne
   pas interférer avec les transitions de survol/filtrage */
.skill-card.skill-reveal { opacity: 0; }

.skill-card.skill-reveal.is-visible {
    animation: skillCardIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes skillCardIn {
    from { opacity: 0; translate: 0 24px; }
    to   { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .skill-card.skill-reveal { opacity: 1; }
    .skill-card.skill-reveal.is-visible { animation: none; }
}

/* ===========================================
   PARALLAXE HÉROS
   =========================================== */

.hero-parallax-bg {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(61, 139, 110, 0.15) 0%, transparent 70%);
    pointer-events: none;
    will-change: transform;
}

/* ===========================================
   SÉPARATEURS EN VAGUE SVG
   =========================================== */

.wave-separator {
    display: block;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
    margin-bottom: -2px;
}

.wave-separator svg {
    display: block;
    width: 200%;
    height: 100%;
    animation: waveMove 8s linear infinite;
}

@keyframes waveMove {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.wave-dark  { background: var(--color-primary); }
.wave-light { background: var(--color-light); }
.wave-warm  { background: var(--color-warm); }

/* ===========================================
   RESPONSIVE — AJOUTS
   =========================================== */

/* Grille de compétences : 3 colonnes sur tablette large, wrapper recentré */
@media (max-width: 1024px) {
    .skills-wide {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Désactiver l'élévation au hover sur mobile */
    .timeline-item:hover {
        transform: none;
        box-shadow: none;
        background-color: transparent;
    }

    /* Grille de compétences : 2 colonnes sur tablette */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Réduire l'amplitude des vagues sur petits écrans */
    .wave-separator svg {
        animation-duration: 12s;
    }
}

/* Grille de compétences : 1 colonne sur petit mobile */
@media (max-width: 480px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   TIMELINE ANIMÉE — EXPÉRIENCES
   =========================================== */

/* Palette géo (ajoutée aux variables globales via custom props locaux) */
:root {
    --tl-teal:      #1a5c4e;
    --tl-teal-mid:  #2a8c72;
    --tl-ochre:     #b87614;
    --tl-orange:    #d95521;
    --tl-dot-glow:  rgba(217, 85, 33, 0.28);
}

/* Titre de section — géométrique/bold distinctif */
.section-title-geo {
    font-family: var(--font-body);
    font-size: clamp(1.15rem, 3vw, 1.85rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tl-teal);
    margin-bottom: 3rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--tl-orange);
}

/* Conteneur de la timeline */
.tl {
    position: relative;
    padding-left: 40px;
    margin: 0 0 3rem;
}

/* Ligne de fond (track) */
.tl__track {
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: rgba(26, 92, 78, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

/* Ligne animée — se dessine au scroll via JS */
.tl__track-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(
        to bottom,
        var(--tl-orange) 0%,
        var(--tl-teal-mid) 100%
    );
    border-radius: 2px;
    will-change: height;
}

/* Item de la timeline */
.tl__item {
    position: relative;
    margin-bottom: 2.75rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.tl__item:last-child {
    margin-bottom: 0;
}

.tl__item:hover {
    background: rgba(255, 255, 255, 0.55);
}

/* Point sur la ligne — s'illumine quand la ligne passe */
.tl__dot {
    position: absolute;
    left: -39px;
    top: 1.35rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(26, 92, 78, 0.12);
    border: 2px solid rgba(26, 92, 78, 0.2);
    transition:
        background 0.5s ease,
        border-color 0.5s ease,
        box-shadow 0.5s ease,
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.tl__item.is-lit .tl__dot {
    background: var(--tl-orange);
    border-color: var(--tl-orange);
    box-shadow:
        0 0 0 5px var(--tl-dot-glow),
        0 0 18px var(--tl-dot-glow);
    transform: scale(1.3);
}

/* Contenu — invisible avant activation, fade-in au passage de la ligne */
.tl__body {
    opacity: 0;
    transform: translateX(14px);
    transition:
        opacity 0.55s ease 0.15s,
        transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s;
}

.tl__item.is-lit .tl__body {
    opacity: 1;
    transform: translateX(0);
}

/* Date — monoespace */
.tl__date {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--tl-orange);
    letter-spacing: 0.12em;
    display: inline-block;
    background: rgba(217, 85, 33, 0.08);
    padding: 0.2rem 0.65rem;
    border-radius: 3px;
    margin-bottom: 0.6rem;
    border-left: 2px solid var(--tl-orange);
}

/* Titre du poste */
.tl__title {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tl-teal);
    line-height: 1.35;
    margin-bottom: 0.3rem;
}

/* Organisation */
.tl__company {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--tl-ochre);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.55rem;
}

/* Description */
.tl__desc {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.93rem;
    color: #5a4e3c;
    line-height: 1.75;
    margin: 0;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .tl {
        padding-left: 32px;
    }

    .tl__track {
        left: 5px;
    }

    .tl__dot {
        left: -31px;
    }

    .tl__item:hover {
        background: transparent;
    }
}

/* ===========================================
   BOUTON TOGGLE THÈME (soleil / lune)
   =========================================== */

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.25s ease, transform 0.25s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    opacity: 1;
    transform: scale(1.15);
}

.theme-icon {
    display: block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Mode jour : on montre la lune (pour basculer en mode nuit) */
.theme-icon--sun  { display: none; }
.theme-icon--moon { display: block; }

/* Mode nuit : on montre le soleil (pour revenir en mode jour) */
[data-theme="dark"] .theme-icon--sun  { display: block; }
[data-theme="dark"] .theme-icon--moon { display: none; }

/* ===========================================
   TRANSITION DOUCE AU CHANGEMENT DE THÈME
   =========================================== */

body,
.narrative,
.section-warm,
.hero,
.contact-section,
.footer,
.tools-teaser,
.outil-card,
.realisation-card,
.outils-section,
.realisations-section,
.page-header,
.browser-bar,
.browser-content,
.browser-url,
.tl__item,
.timeline-item {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

/* ===========================================
   MODE NUIT — VARIABLES GLOBALES
   =========================================== */

[data-theme="dark"] {
    --color-primary: #0a1a10;
    --color-accent:  #5aad8a;
    --color-light:   #131e17;
    --color-warm:    #1c2a20;
    --color-text:    #d4e8dc;
    --color-muted:   #8aaa9a;

    /* Palette timeline */
    --tl-teal:     #5aad8a;
    --tl-teal-mid: #4a9d7a;
    --tl-ochre:    #c8962e;
    --tl-dot-glow: rgba(217, 85, 33, 0.45);
}

/* ===========================================
   MODE NUIT — TEXTES SUR FOND CLAIR DEVENUS FONCÉS
   Les éléments qui utilisent --color-primary comme couleur
   de texte seraient illisibles : on les surcharge.
   =========================================== */

[data-theme="dark"] .section-title,
[data-theme="dark"] .outils-categorie {
    color: #9dd4ba;
}

[data-theme="dark"] .narrative .lead {
    color: #b8d8c8;
}

[data-theme="dark"] .quote-block {
    color: #b8d8c8;
}

[data-theme="dark"] .tools-teaser h3,
[data-theme="dark"] .outil-card h3 {
    color: #b8d8c8;
}

[data-theme="dark"] .timeline-title {
    color: #b8d8c8;
}

/* Timeline géo */
[data-theme="dark"] .section-title-geo {
    color: #5aad8a;
    border-bottom-color: var(--tl-orange, #d95521);
}

[data-theme="dark"] .tl__title {
    color: #b8d8c8;
}

[data-theme="dark"] .tl__desc {
    color: #8aaa9a;
}

/* Page réalisations */
[data-theme="dark"] .realisation-title {
    color: #b8cce8;
}

/* ===========================================
   MODE NUIT — FONDS HARDCODÉS EN BLANC / CLAIR
   =========================================== */

/* Cards teaser accueil */
[data-theme="dark"] .tools-teaser {
    background: #1a2e24;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Page outils */
[data-theme="dark"] .outils-section {
    background: #131e17;
}

[data-theme="dark"] .outils-section:nth-child(even) {
    background: #1c2a20;
}

[data-theme="dark"] .outil-card {
    background: #1a2e24;
    border-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .outils-section:nth-child(odd) .outil-card {
    background: #1a2e24;
}

[data-theme="dark"] .outil-badge {
    background: #253c2e;
    color: #8aaa9a;
}

/* Page réalisations */
[data-theme="dark"] .realisations-section {
    background: #131e17;
}

[data-theme="dark"] .realisation-card {
    background: #1a2e24;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .realisation-preview {
    background: #1a2535;
}

[data-theme="dark"] .browser-bar {
    background: #252d38;
}

[data-theme="dark"] .browser-url {
    background: #1a2535;
    color: #7a9ab8;
}

[data-theme="dark"] .browser-content {
    background: #141b25;
}

[data-theme="dark"] .realisation-tag {
    background: #1a2535;
    color: #7aa0c8;
}

/* ===========================================
   MODE NUIT — SURVOLS & ÉTATS
   =========================================== */

[data-theme="dark"] .timeline-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .tl__item:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .outil-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* ===========================================
   MODE NUIT — VAGUES SVG (fill hardcodé dans le HTML)
   On cible les paths par leur attribut fill et on
   les remplace par les équivalents mode nuit.
   =========================================== */

/* fill="#f7f9f8"  (fond clair) → fond sombre */
[data-theme="dark"] .wave-separator path[fill="#f7f9f8"] {
    fill: #131e17;
}

/* fill="#e8ded4"  (fond chaud) → fond chaud sombre */
[data-theme="dark"] .wave-separator path[fill="#e8ded4"] {
    fill: #1c2a20;
}

/* fill="#1a3a32"  (fond primaire) → fond primaire sombre */
[data-theme="dark"] .wave-separator path[fill="#1a3a32"] {
    fill: #0a1a10;
}

/* ===========================================
   MODE NUIT — NAVIGATION
   =========================================== */

/* Base dark : veil léger en haut de page (hero toujours sombre) */
[data-theme="dark"] .nav:not(.nav--scrolled) {
    mix-blend-mode: normal;
    background: linear-gradient(to bottom,
        rgba(5, 15, 9, 0.55) 0%,
        rgba(5, 15, 9, 0.0) 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
}

/* Logo et liens */
[data-theme="dark"] .nav-logo {
    color: #d8ede4;
}

[data-theme="dark"] .nav-links a {
    color: rgba(210, 235, 220, 0.78);
    position: relative;
}

[data-theme="dark"] .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1.5px;
    background: #6ecba0;
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .nav-links a:hover {
    color: #8ed8b8;
}

[data-theme="dark"] .nav-links a:hover::after {
    width: 100%;
}

/* Toggle thème (soleil) */
[data-theme="dark"] .theme-toggle {
    color: rgba(210, 235, 220, 0.78);
}

/* Burger */
[data-theme="dark"] .nav-mobile-toggle span {
    background: rgba(210, 235, 220, 0.78);
}

/* ── Dark mode scrollé : pill sombre premium ────────── */
[data-theme="dark"] .nav--scrolled {
    background: rgba(9, 20, 13, 0.84);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(90, 173, 138, 0.22);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(110, 203, 160, 0.10),
        0 0 0 0 transparent;
}

[data-theme="dark"] .nav--scrolled .nav-logo {
    color: #d8ede4;
}

[data-theme="dark"] .nav--scrolled .nav-links a {
    color: rgba(200, 228, 212, 0.82);
}

[data-theme="dark"] .nav--scrolled .nav-links a:hover {
    color: #8ed8b8;
}

[data-theme="dark"] .nav--scrolled .theme-toggle {
    color: rgba(200, 228, 212, 0.82);
}

[data-theme="dark"] .nav--scrolled .nav-mobile-toggle span {
    background: rgba(200, 228, 212, 0.82);
}

/* Menu mobile déroulant en mode nuit */
@media (max-width: 768px) {
    [data-theme="dark"] .nav-links {
        background: rgba(10, 26, 16, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(90, 173, 138, 0.14);
    }
}

/* ===========================================
   MODE NUIT — SKILL TAGS (section light)
   =========================================== */

[data-theme="dark"] .skill-tag {
    background: rgba(90, 173, 138, 0.15);
    color: #b8d8c8;
}

/* ===========================================
   MODE NUIT — CITATION (guillemet décoratif)
   =========================================== */

[data-theme="dark"] .quote-block::before {
    color: rgba(255, 255, 255, 0.08);
}

/* ===========================================
   MODE NUIT — ASIDE (bordure gauche)
   =========================================== */

[data-theme="dark"] .narrative .aside {
    border-left-color: rgba(255, 255, 255, 0.15);
    color: var(--color-muted);
}

/* =============================================
   HORIZONTAL SCROLLING TIMELINE — Parcours
   ============================================= */

.htl-section {
    position: relative;
    min-height: 100vh;
    background: #1a2e25;
}

.htl-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.htl-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 20;
}

.htl-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #d95521, #2a8c72);
    border-radius: 2px;
    will-change: width;
}

.htl-viewport {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.htl-axis {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

.htl-axis-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, rgba(217, 85, 33, 0.45), rgba(42, 140, 114, 0.45));
    border-radius: 2px;
    will-change: width;
}

.htl-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    align-items: stretch;
    will-change: transform;
}

/* Intro slide */
.htl-intro-slide {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 3rem 2rem 5vw;
    z-index: 2;
}

.htl-section-title {
    font-family: var(--font-body);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #f7f9f8;
    margin: 0 0 0.35rem;
    line-height: 1.1;
}

.htl-section-sub {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(247, 249, 248, 0.7);
    margin: 0 0 2rem;
}

.htl-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.htl-legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(247, 249, 248, 0.75);
}

.htl-legend-item::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.htl-legend-item--exp::before { background: #d95521; }
.htl-legend-item--edu::before { background: #2a8c72; }

.htl-scroll-hint {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: rgba(247, 249, 248, 0.28);
    margin: 0;
    animation: htl-hint 2.2s ease-in-out infinite;
}

@keyframes htl-hint {
    0%, 100% { opacity: 0.3; transform: translateX(0); }
    50%       { opacity: 0.65; transform: translateX(6px); }
}

/* Timeline item */
.htl-item {
    position: relative;
    flex: 0 0 400px;
    height: 100%;
    z-index: 2;
}

/* Dot on the axis */
.htl-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    z-index: 5;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s,
                box-shadow 0.45s ease 0.05s;
}

.htl-item.is-visible .htl-dot {
    transform: translate(-50%, -50%) scale(1);
}

.htl-item--exp .htl-dot { background: #d95521; }
.htl-item--edu .htl-dot { background: #2a8c72; }

.htl-item.is-visible.htl-item--exp .htl-dot {
    box-shadow: 0 0 0 5px rgba(217, 85, 33, 0.2), 0 0 18px rgba(217, 85, 33, 0.3);
}

.htl-item.is-visible.htl-item--edu .htl-dot {
    box-shadow: 0 0 0 5px rgba(42, 140, 114, 0.2), 0 0 18px rgba(42, 140, 114, 0.3);
}

/* Connector: thin vertical line linking dot to card */
.htl-connector {
    position: absolute;
    left: calc(50% - 1px);
    width: 1px;
    height: 44px;
    background: rgba(255, 255, 255, 0.14);
    z-index: 3;
    transform: scaleY(0);
    transition: transform 0.3s ease 0.22s;
}

.htl-item.is-visible .htl-connector {
    transform: scaleY(1);
}

/* Card */
.htl-card {
    position: absolute;
    width: 320px;
    left: 50%;
    padding: 1.1rem 1.2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 4;
    opacity: 0;
    transition: opacity 0.42s ease 0.3s,
                transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
}

.htl-item--exp .htl-card { border-left: 3px solid rgba(217, 85, 33, 0.55); }
.htl-item--edu .htl-card { border-left: 3px solid rgba(42, 140, 114, 0.55); }

.htl-item.is-visible .htl-card { opacity: 1; }

/* Cards ABOVE the axis */
.htl-item--above .htl-connector {
    bottom: 50%;
    transform-origin: bottom center;
}

.htl-item--above .htl-card {
    bottom: calc(50% + 44px);
    transform: translateX(-50%) translateY(14px);
}

.htl-item--above.is-visible .htl-card {
    transform: translateX(-50%) translateY(0);
}

/* Cards BELOW the axis */
.htl-item--below .htl-connector {
    top: 50%;
    transform-origin: top center;
}

.htl-item--below .htl-card {
    top: calc(50% + 44px);
    transform: translateX(-50%) translateY(-14px);
}

.htl-item--below.is-visible .htl-card {
    transform: translateX(-50%) translateY(0);
}

/* Card typography */
.htl-period {
    font-family: var(--font-mono);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    display: inline-block;
    padding: 0.16rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.55rem;
}

.htl-item--exp .htl-period {
    color: #d95521;
    background: rgba(217, 85, 33, 0.12);
}

.htl-item--edu .htl-period {
    color: #3db88d;
    background: rgba(42, 140, 114, 0.12);
}

.htl-title {
    font-family: var(--font-body);
    font-size: 0.93rem;
    font-weight: 700;
    color: #f0ede8;
    line-height: 1.3;
    margin: 0 0 0.3rem;
}

.htl-org {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 0.5rem;
}

.htl-item--exp .htl-org { color: rgba(217, 85, 33, 0.9); }
.htl-item--edu .htl-org { color: rgba(61, 184, 141, 0.9); }

.htl-desc {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(247, 249, 248, 0.75);
    line-height: 1.65;
    margin: 0;
}

.htl-end-spacer {
    /* 48vw assure que maxScrollX > seg.end pour tout écran jusqu'à ~7000 px.
       Avec l'espace de 22vw, à V≥1700 px le maxScrollX était inférieur à
       seg.start du dernier segment → la barre ne se remplissait jamais.
       Formule : condition 100% ⟺ V ≤ W_today/(2*(0.5-k))
       → k=0.48, W_today=280px → V ≤ 7000 px ✓ */
    flex: 0 0 48vw;
    min-width: 280px;
}

/* Year labels near dots on the axis */
.htl-year-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.4s ease 0.5s;
    pointer-events: none;
    z-index: 6;
}

.htl-item--above .htl-year-label {
    top: calc(50% + 12px);
    padding-top: 4px;
}

.htl-item--below .htl-year-label {
    bottom: calc(50% + 12px);
    padding-bottom: 4px;
    flex-direction: column-reverse;
}

.htl-item.is-visible .htl-year-label {
    opacity: 1;
}

.htl-item--exp .htl-year-start { color: rgba(217, 85, 33, 0.85); }
.htl-item--exp .htl-year-end   { color: rgba(217, 85, 33, 0.5);  }
.htl-item--edu .htl-year-start { color: rgba(61, 184, 141, 0.85); }
.htl-item--edu .htl-year-end   { color: rgba(61, 184, 141, 0.5);  }

.htl-year-end { font-size: 0.53rem; }

/* -----------------------------------------------
   Marqueur "Aujourd'hui" (--now)
   Dot pulsant orange — positionné après le dernier
   item pour indiquer la date courante (mi-2026).
   Largeur : ~280 px assure que :
     • le segment "2015-2025 → 2025-Présent" = 100 % rempli
     • le segment "2025-Présent → aujourd'hui" = ~23 % rempli
       (ligne qui s'élance vers "aujourd'hui" sans l'atteindre,
        métaphore du parcours en cours)
----------------------------------------------- */
.htl-item--now {
    flex: 0 0 280px;
}

.htl-item--now .htl-dot {
    width: 18px;
    height: 18px;
}

/* Pulsation orange quand le marqueur est visible */
.htl-item.is-visible.htl-item--now .htl-dot {
    animation: htl-now-pulse 2.2s ease-in-out infinite;
}

@keyframes htl-now-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 4px  rgba(217, 85, 33, 0.35),
            0 0 16px   rgba(217, 85, 33, 0.30);
    }
    50% {
        box-shadow:
            0 0 0 12px rgba(217, 85, 33, 0.0),
            0 0 28px   rgba(217, 85, 33, 0.55);
    }
}

/* Libellés du marqueur "Aujourd'hui" */
.htl-item--now .htl-year-start {
    color: rgba(217, 85, 33, 1);
    font-size: 0.65rem;
    letter-spacing: 0.04em;
}

.htl-item--now .htl-year-end {
    font-family: var(--font-mono);
    font-size: 0.48rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(247, 249, 248, 0.45);
}

/* Segment progress bar on the axis — between consecutive dots */
.htl-seg-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 4px;
    width: 0;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    pointer-events: none;
    border-radius: 2px;
}

.htl-seg-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    will-change: width;
}

.htl-item--exp .htl-seg-fill {
    background: linear-gradient(to right, #d95521, rgba(217, 85, 33, 0.55));
}

.htl-item--edu .htl-seg-fill {
    background: linear-gradient(to right, #2a8c72, rgba(42, 140, 114, 0.55));
}

/* Duration bar inside cards */
.htl-duration-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    margin-top: 0.8rem;
    overflow: hidden;
}

.htl-duration-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.65s;
    will-change: width;
}

.htl-item--exp .htl-duration-fill {
    background: linear-gradient(to right, #d95521, rgba(217, 85, 33, 0.3));
}

.htl-item--edu .htl-duration-fill {
    background: linear-gradient(to right, #2a8c72, rgba(42, 140, 114, 0.3));
}

/* ---- Mobile: native horizontal touch scroll ---- */
/* ---- Mobile: vertical timeline ---- */
@media (max-width: 768px) {
    .htl-section {
        height: auto !important;
        min-height: auto;
    }

    .htl-sticky {
        position: static;
        height: auto;
        overflow: visible;
    }

    .htl-viewport {
        overflow: visible;
        position: static;
    }

    .htl-progress-bar { display: none; }
    .htl-axis { display: none; }
    .htl-end-spacer { display: none; }

    /* Vertical column with a left timeline line */
    .htl-track {
        position: relative;
        transform: none !important;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        min-height: auto;
        padding: 0 1.25rem 3rem 2.75rem;
        gap: 0;
    }

    /* The vertical line */
    .htl-track::before {
        content: '';
        position: absolute;
        left: 1.1rem;
        top: 0;
        bottom: 0;
        width: 2px;
        background: rgba(255, 255, 255, 0.08);
    }

    .htl-intro-slide {
        flex: none;
        width: 100%;
        padding: 3rem 0 2.5rem 0;
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
    }

    /* No horizontal scroll hint on mobile */
    .htl-scroll-hint { display: none; }

    .htl-item {
        position: relative;
        flex: none;
        height: auto;
        width: 100%;
        display: block;
        padding: 0;
        margin-bottom: 2rem;
        min-height: auto;
    }

    /* Dot on the left vertical line
       Line is at left: 1.1rem from track.
       Items start at padding-left: 2.75rem from track.
       Dot is 14px wide → left edge at 1.1rem − 7px = 0.663rem from track
       Relative to item: 0.663rem − 2.75rem ≈ −2.09rem */
    .htl-dot {
        position: absolute;
        left: -2.09rem;
        top: 1.25rem;
        transform: scale(0);
        display: block;
        transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s,
                    box-shadow 0.4s ease 0.05s;
    }

    .htl-item.is-visible .htl-dot {
        transform: scale(1);
    }

    .htl-connector { display: none; }
    .htl-seg-bar   { display: none; }
    .htl-year-label { display: none; }

    /* Use !important to override desktop specificity (.htl-item--above .htl-card etc.) */
    .htl-card {
        position: static !important;
        width: 100% !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        opacity: 0 !important;
        transform: translateX(10px) !important;
        transition: opacity 0.42s ease 0.18s,
                    transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.18s !important;
    }

    .htl-item.is-visible .htl-card {
        opacity: 1 !important;
        transform: translateX(0) !important;
    }

    .htl-duration-fill {
        transition: width 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.55s;
        width: 0%;
    }
}

/* ===========================================
   SECTION OUTILS RECOMMANDÉS
   =========================================== */

.recommandes-header {
    background: var(--color-primary);
    padding: 3rem 5%;
    color: white;
}

.recommandes-header-content {
    max-width: 1200px;
}

.recommandes-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    color: white;
    margin-bottom: 0.75rem;
}

.recommandes-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

.recommandes-body {
    padding: 3rem 5%;
    background: var(--color-light);
    max-width: 100%;
}

.recommandes-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.rec-filter-btn {
    padding: 0.35rem 1.1rem;
    border: 1px solid var(--color-accent);
    border-radius: 20px;
    background: transparent;
    color: var(--color-accent);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    letter-spacing: 0.02em;
}

.rec-filter-btn:hover {
    background: rgba(61, 139, 110, 0.1);
}

.rec-filter-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.recommandes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.rec-card {
    display: block;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.25s ease;
}

.rec-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--color-accent);
}

.rec-card.dimmed {
    opacity: 0.2;
    pointer-events: none;
}

.rec-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rec-card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--color-primary);
    margin: 0;
    line-height: 1.3;
}

.rec-card-arrow {
    flex-shrink: 0;
    color: var(--color-accent);
    margin-top: 0.15rem;
    transition: transform 0.2s ease;
}

.rec-card:hover .rec-card-arrow {
    transform: translate(2px, -2px);
}

.rec-card-desc {
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1rem;
}

.rec-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rec-tag {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.2rem 0.65rem;
    background: var(--color-warm);
    color: var(--color-muted);
    border-radius: 20px;
    font-weight: 500;
}

/* Dark mode */
[data-theme="dark"] .recommandes-body {
    background: #131e17;
}

[data-theme="dark"] .rec-card {
    background: #1a2e24;
    border-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .rec-card-title {
    color: #b8d8c8;
}

[data-theme="dark"] .rec-tag {
    background: #253c2e;
    color: #8aaa9a;
}

@media (max-width: 768px) {
    .recommandes-header {
        padding: 2rem 5%;
    }

    .recommandes-body {
        padding: 2rem 5%;
    }
}

/* Dark mode — no changes needed (section is already dark) */

/* ===========================================
   ACCESSIBILITÉ — prefers-reduced-motion
   Coupe les animations décoratives (vagues, bounce,
   curseur typewriter, hints) et rend les transitions
   instantanées pour les utilisateurs qui le demandent.
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
