/* =============================================
   POLICES AUTO-HÉBERGÉES (Fontsource, sous-ensemble latin)
   Chemins relatifs depuis CSS/  ->  ../../FONTS/
============================================= */
@font-face {
    font-family: 'Bebas Neue';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('../../FONTS/bebas-neue-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'DM Sans';
    font-style: normal; font-weight: 300; font-display: swap;
    src: url('../../FONTS/dm-sans-latin-300-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'DM Sans';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('../../FONTS/dm-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'DM Sans';
    font-style: normal; font-weight: 600; font-display: swap;
    src: url('../../FONTS/dm-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'DM Sans';
    font-style: italic; font-weight: 300; font-display: swap;
    src: url('../../FONTS/dm-sans-latin-300-italic.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('../../FONTS/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url('../../FONTS/jetbrains-mono-latin-700-normal.woff2') format('woff2');
}

/* =============================================
   CV LUDOVIC RICHARD — THÈME BLEU (clair/sombre)
============================================= */

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

/* ---- THÈME CLAIR (par défaut) ---- */
:root {
    --page-bg:      #b8c6d6;
    --surface:      #eef3f8;
    --surface-text: #0a1628;
    --muted:        #5a6b80;
    --rule:         #c9d6e3;

    --panel:        #0e1d33;
    --panel-soft:   #1e3252;
    --panel-text:   #d4dde8;
    --panel-muted:  #8497ad;

    --ink:          #0a1628;   /* fond hero, toujours sombre */
    --hero-text:    #e6eef7;
    --hero-muted:   #7e93ad;

    --accent:       #0a84ff;
    --accent2:      #00c2d1;

    --mono:    'JetBrains Mono', monospace;
    --display: 'Bebas Neue', sans-serif;
    --body:    'DM Sans', sans-serif;
    --col-left: 280px;
}

/* ---- THÈME SOMBRE ---- */
:root[data-theme="dark"] {
    --page-bg:      #060d18;
    --surface:      #0d1a2e;
    --surface-text: #e6eef7;
    --muted:        #8a9bb0;
    --rule:         #1e3252;

    --panel:        #0a1322;
    --panel-soft:   #20344f;
    --panel-text:   #e6eef7;
    --panel-muted:  #7e93ad;

    --ink:          #060d18;
    --hero-text:    #e6eef7;
    --hero-muted:   #7e93ad;

    --accent:       #2a96ff;
    --accent2:      #1fd4e3;
}

html {
    background: var(--page-bg);
    font-family: var(--body);
    font-size: 15px;
    color: var(--surface-text);
    transition: background 0.3s ease;
}

body {
    background: var(--surface);
    max-width: 960px;
    margin: 40px auto;
    box-shadow: 0 20px 80px rgba(0,0,0,0.30), 0 0 0 1px rgba(0,0,0,0.08);
    position: relative;
    transition: background 0.3s ease;
}

/* =============================================
   GRAIN OVERLAY
============================================= */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 999;
    opacity: 0.30;
}

/* =============================================
   INTERRUPTEUR THÈME
   (positionnement géré par .hero-controls plus bas ;
   ce bloc ne fait plus que définir l'apparence de base
   réutilisée par les pages internes hors .hero-controls)
============================================= */
.theme-toggle {
    z-index: 50;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: var(--hero-text);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.16);
    border-color: var(--accent2);
    transform: rotate(20deg);
}

.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* =============================================
   HERO HEADER
============================================= */
.hero {
    background: var(--ink);
    color: var(--hero-text);
    display: grid;
    grid-template-columns: var(--col-left) 1fr;
    min-height: 220px;
    position: relative;
    transition: background 0.3s ease;
}

.hero-left {
    background: linear-gradient(140deg, var(--accent) 0%, var(--accent2) 130%);
    padding: 36px 32px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 18px;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 88% 100%, 0% 100%);
}

.hero-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.85);
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    background: #0e1d33;
}

.hero-id { display: flex; flex-direction: column; align-items: center; }

.hero-left .label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    margin-bottom: 6px;
}

.hero-name {
    font-family: var(--display);
    font-size: clamp(34px, 4vw, 44px);
    line-height: 0.95;
    letter-spacing: 1px;
    color: #fff;
    word-break: break-word;
}

.hero-name em {
    display: block;
    color: rgba(255,255,255,0.55);
    font-style: normal;
    font-size: 0.55em;
    letter-spacing: 6px;
    margin-bottom: 4px;
}

.hero-right {
    padding: 36px 48px 36px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-title {
    font-family: var(--display);
    font-size: clamp(22px, 3vw, 34px);
    letter-spacing: 2px;
    line-height: 1.1;
    color: var(--hero-text);
}

.hero-title span { color: var(--accent2); }

.hero-subtitle {
    font-size: 12px;
    color: var(--hero-muted);
    font-family: var(--mono);
    letter-spacing: 1px;
    margin-top: 8px;
}

.hero-contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
    margin-top: auto;
    padding-top: 24px;
}

.contact-item { display: flex; flex-direction: column; gap: 2px; }

.contact-item .key {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent2);
}

.contact-item .val { font-size: 13px; color: #c3d0de; }

/* =============================================
   LAYOUT
============================================= */
.layout {
    display: grid;
    grid-template-columns: var(--col-left) 1fr;
}

/* =============================================
   SIDEBAR
============================================= */
.sidebar {
    background: var(--panel);
    color: var(--panel-text);
    padding: 40px 28px;
    transition: background 0.3s ease;
}

.sidebar-section { margin-bottom: 38px; }

.sidebar-heading {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    border-top: 1px solid var(--panel-soft);
    padding-top: 14px;
    margin-bottom: 16px;
}

.profile-text {
    font-size: 13px;
    line-height: 1.65;
    color: var(--panel-muted);
    font-weight: 300;
}

/* Skills */
.skill-list { display: flex; flex-direction: column; gap: 10px; }
.skill-item { display: flex; flex-direction: column; gap: 4px; }
.skill-name { font-size: 12px; color: var(--panel-text); font-weight: 600; }

.skill-bar {
    height: 3px;
    background: var(--panel-soft);
    border-radius: 2px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
    animation: fillBar 1.2s ease both;
}

@keyframes fillBar { from { width: 0; } }

/* Tools — carrousel défilant qui se déploie au survol */
.tools-carousel {
    position: relative;
    overflow: hidden;
    max-height: 30px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    transition: max-height 0.45s ease;
}

.tools-track {
    display: flex;
    gap: 6px;
    width: max-content;
    animation: marquee 16s linear infinite alternate;
}

.tools-carousel:hover {
    max-height: 320px;
    -webkit-mask-image: none;
            mask-image: none;
}

.tools-carousel:hover .tools-track {
    flex-wrap: wrap;
    width: 100%;
    animation-play-state: paused;
    transform: translateX(0);
}

.tools-hint {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--panel-muted);
    letter-spacing: 1px;
    margin-top: 8px;
    opacity: 0.7;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(-100% + 224px)); }
}

.pill {
    font-family: var(--mono);
    font-size: 10px;
    padding: 4px 9px;
    border: 1px solid var(--panel-soft);
    border-radius: 2px;
    color: var(--panel-muted);
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s;
}

.pill:hover { border-color: var(--accent); color: var(--panel-text); }

/* Languages */
.lang-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--panel-soft);
    font-size: 13px;
}

.lang-item:last-child { border: none; }

.lang-level {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--accent2);
    letter-spacing: 1px;
}

/* Interests */
.interests-list { font-size: 13px; color: var(--panel-muted); line-height: 2; list-style: none; }
.interests-list li::before { content: '→ '; color: var(--accent); font-family: var(--mono); }

.interests-list a {
    color: var(--panel-text);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent);
    transition: color 0.2s, border-color 0.2s;
}

.interests-list a:hover { color: var(--accent2); border-color: var(--accent2); }

/* =============================================
   MAIN CONTENT
============================================= */
.main-content { padding: 40px 44px; background: var(--surface); transition: background 0.3s ease; }
.section { margin-bottom: 44px; }

.section-heading {
    font-family: var(--display);
    font-size: 28px;
    letter-spacing: 3px;
    color: var(--surface-text);
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 40px; height: 3px;
    background: var(--accent);
}

/* Timeline */
.timeline { position: relative; padding-left: 20px; }

.timeline::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 1px;
    background: var(--rule);
}

.tl-item {
    position: relative;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px dashed var(--rule);
}

.tl-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.tl-item::before {
    content: '';
    position: absolute;
    left: -24px; top: 6px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--rule);
}

.tl-meta { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.tl-date { font-family: var(--mono); font-size: 10px; color: var(--accent); letter-spacing: 1.5px; white-space: nowrap; }
.tl-company { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.tl-role { font-weight: 600; font-size: 15px; color: var(--surface-text); margin-bottom: 10px; }
.tl-tasks { list-style: none; display: flex; flex-direction: column; gap: 5px; }

.tl-tasks li {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    padding-left: 14px;
    position: relative;
}

.tl-tasks li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); font-size: 11px; top: 1px; }

/* Formation */
.formation-grid { display: grid; gap: 14px; }
.formation-item { display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: center; }
.formation-year { font-family: var(--display); font-size: 28px; color: var(--rule); line-height: 1; text-align: right; }
.formation-body { border-left: 2px solid var(--accent); padding-left: 14px; }
.formation-title { font-weight: 600; font-size: 14px; color: var(--surface-text); margin-bottom: 2px; }
.formation-detail { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* =============================================
   FOOTER
============================================= */
footer {
    background: var(--ink);
    color: var(--hero-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 40px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1px;
    transition: background 0.3s ease;
}

footer a { color: var(--accent2); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* =============================================
   ANIMATIONS
============================================= */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero, .sidebar-section, .tl-item, .formation-item { animation: fadeUp 0.6s ease both; }

.sidebar-section:nth-child(1) { animation-delay: 0.05s; }
.sidebar-section:nth-child(2) { animation-delay: 0.10s; }
.sidebar-section:nth-child(3) { animation-delay: 0.15s; }
.sidebar-section:nth-child(4) { animation-delay: 0.20s; }
.sidebar-section:nth-child(5) { animation-delay: 0.25s; }
.tl-item:nth-child(1) { animation-delay: 0.10s; }
.tl-item:nth-child(2) { animation-delay: 0.18s; }
.tl-item:nth-child(3) { animation-delay: 0.26s; }
.tl-item:nth-child(4) { animation-delay: 0.34s; }
.formation-item:nth-child(1) { animation-delay: 0.12s; }
.formation-item:nth-child(2) { animation-delay: 0.20s; }
.formation-item:nth-child(3) { animation-delay: 0.28s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =============================================
   RESPONSIVE — TABLETTE
============================================= */
@media (max-width: 900px) {
    body { margin: 20px auto; }
    .hero, .layout { grid-template-columns: 240px 1fr; }
    :root { --col-left: 240px; }
    .hero-right { padding: 28px 28px 28px 36px; }
    .main-content { padding: 32px 28px; }
}

/* =============================================
   RESPONSIVE — TÉLÉPHONE + tablette portrait
============================================= */
@media (max-width: 720px) {
    body { margin: 0; box-shadow: none; }
    .hero, .layout { grid-template-columns: 1fr; }
    :root { --col-left: 100%; }
    .hero-left { clip-path: none; padding: 32px 24px 28px; }
    .hero-photo { width: 110px; height: 110px; }
    .hero-right { padding: 24px; }
    .hero-contact { grid-template-columns: 1fr 1fr; }
    .sidebar { padding: 28px 20px; }
    .main-content { padding: 28px 20px; }
    footer { flex-direction: column; gap: 6px; text-align: center; padding: 16px 20px; }
    .formation-item { grid-template-columns: 64px 1fr; }
    .formation-year { font-size: 22px; }
}

/* =============================================
   TACTILE — déploiement auto du carrousel
   (pas de survol possible au doigt)
============================================= */
@media (hover: none) {
    .tools-carousel {
        max-height: none;
        -webkit-mask-image: none;
                mask-image: none;
    }
    .tools-track {
        flex-wrap: wrap;
        width: 100%;
        animation: none;
        transform: none;
    }
    .tools-hint { display: none; }
    .theme-toggle:hover { transform: none; }
}

/* =============================================
   EFFETS LÉGERS (JS)
============================================= */

/* Barre de progression de lecture en haut de page */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    z-index: 1000;
    transition: width 0.08s linear;
}

/* Révélation au défilement : état initial puis classe .is-visible via JS */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Léger soulèvement des cartes d'expérience au survol (souris) */
@media (hover: hover) {
    .tl-item { transition: transform 0.25s ease; }
    .tl-item:hover { transform: translateX(4px); }
    .formation-item { transition: transform 0.25s ease; }
    .formation-item:hover { transform: translateX(4px); }
}

/* Les barres de compétences ne se remplissent qu'une fois visibles */
.skill-fill { width: 0 !important; transition: width 1s ease; }
.skill-fill.is-filled { width: var(--target) !important; }

/* On neutralise les anciennes animations d'entrée gérées désormais par .reveal */
.sidebar-section, .tl-item, .formation-item { animation: none; }

/* =============================================
   FORMULAIRE DE CONTACT
============================================= */
.contact-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.contact-form input,
.contact-form textarea {
    font-family: var(--body);
    font-size: 13px;
    color: var(--surface-text);
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 10px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(10,132,255,0.15);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--muted); }

.btn-send {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 3px;
    padding: 11px 26px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.btn-send:hover { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(10,132,255,0.3); }
.btn-send:active { transform: translateY(1px); }

/* Honeypot anti-bot : invisible pour l'humain */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

.form-msg {
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 3px;
    margin-bottom: 14px;
    border-left: 3px solid var(--accent);
}
.form-ok   { color: var(--surface-text); border-left-color: var(--accent2); background: rgba(0,194,209,0.10); }
.form-warn { color: var(--surface-text); border-left-color: #e0a800;        background: rgba(224,168,0,0.10); }

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

/* =============================================
   PAGE MENTIONS LÉGALES / CONFIDENTIALITÉ
============================================= */
.legal-hero {
    background: var(--ink);
    color: var(--hero-text);
    padding: 48px 0 40px;
    position: relative;
    transition: background 0.3s ease;
}
.legal-hero .legal-wrap { display: flex; flex-direction: column; gap: 10px; }
.legal-back {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--accent2);
    text-decoration: none;
}
.legal-back:hover { text-decoration: underline; }
.legal-hero h1 {
    font-family: var(--display);
    font-size: clamp(34px, 5vw, 52px);
    letter-spacing: 2px;
    line-height: 1;
}
.legal-hero p { font-family: var(--mono); font-size: 11px; color: var(--hero-muted); letter-spacing: 1px; }

.legal-wrap { width: 88%; max-width: 820px; margin: 0 auto; }

.legal-body { background: var(--surface); padding: 40px 0 60px; transition: background 0.3s ease; }

/* Sommaire */
.legal-toc {
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 22px 26px;
    margin-bottom: 44px;
    background: rgba(10,132,255,0.04);
}
.legal-toc h2 {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}
.legal-toc ol { list-style: none; counter-reset: toc; columns: 2; column-gap: 32px; }
.legal-toc li { counter-increment: toc; margin-bottom: 7px; break-inside: avoid; }
.legal-toc a {
    font-size: 13px;
    color: var(--surface-text);
    text-decoration: none;
    line-height: 1.4;
}
.legal-toc a::before {
    content: counter(toc) '. ';
    font-family: var(--mono);
    color: var(--accent);
    font-size: 11px;
}
.legal-toc a:hover { color: var(--accent); }

/* Bloc de mise en garde */
.legal-note {
    border-left: 3px solid #e0a800;
    background: rgba(224,168,0,0.10);
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 40px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--surface-text);
}

/* Sections */
.legal-section { margin-bottom: 40px; scroll-margin-top: 24px; }
.legal-section h2 {
    font-family: var(--display);
    font-size: 24px;
    letter-spacing: 1.5px;
    color: var(--surface-text);
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.legal-section h2 .num {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--accent);
}
.legal-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--surface-text);
    margin: 20px 0 8px;
}
.legal-section p,
.legal-section li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 12px;
}
.legal-section ul { list-style: none; padding-left: 4px; }
.legal-section ul li { position: relative; padding-left: 18px; }
.legal-section ul li::before {
    content: '▸';
    position: absolute;
    left: 0; top: 1px;
    color: var(--accent);
    font-size: 11px;
}
.legal-section strong { color: var(--surface-text); font-weight: 600; }
.legal-section a { color: var(--accent); }

.legal-divider {
    border: none;
    border-top: 1px dashed var(--rule);
    margin: 50px 0;
}
.legal-part-title {
    font-family: var(--display);
    font-size: 30px;
    letter-spacing: 3px;
    color: var(--accent);
    margin: 10px 0 30px;
}

.back-to-top {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    margin-top: 4px;
}
.back-to-top:hover { text-decoration: underline; }

@media (max-width: 720px) {
    .legal-toc ol { columns: 1; }
    .legal-wrap { width: 90%; }
}

/* =============================================
   CONTRÔLES HEADER (PDF / langue / thème)
============================================= */
.hero-controls {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 50;
    display: flex;
    gap: 8px;
}
.ctrl-btn {
    height: 34px;
    min-width: 34px;
    padding: 0 10px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: var(--hero-text);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.ctrl-btn:hover { background: rgba(255,255,255,0.16); border-color: var(--accent2); }
.theme-toggle { width: 34px; padding: 0; font-size: 15px; }
.theme-toggle:hover { transform: rotate(20deg); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.pdf-btn { font-weight: 700; }

/* =============================================
   LIENS SOCIAUX
============================================= */
.social-links { display: flex; gap: 14px; margin-top: 4px; }
.social-links a {
    color: #fff;
    opacity: 0.85;
    display: inline-flex;
    transition: opacity 0.2s, transform 0.2s;
}
.social-links a:hover { opacity: 1; transform: translateY(-2px); }

/* =============================================
   NAVIGATION LATÉRALE (scrollspy)
============================================= */
.section-nav {
    position: fixed;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.section-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-direction: row-reverse;
}
.section-nav .dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--rule);
    border: 1px solid var(--muted);
    transition: background 0.2s, transform 0.2s;
}
.section-nav .lbl {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--muted);
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
}
.section-nav a:hover .lbl { opacity: 1; transform: translateX(0); }
.section-nav a:hover .dot { background: var(--accent); }
.section-nav a.active .dot { background: var(--accent); transform: scale(1.4); }
.section-nav a.active .lbl { opacity: 1; transform: translateX(0); color: var(--accent); }

/* Masquée sur petits écrans (place insuffisante) */
@media (max-width: 1180px) { .section-nav { display: none; } }

/* =============================================
   BOUTON RETOUR EN HAUT
============================================= */
.back-to-top-btn {
    position: fixed;
    bottom: 22px; right: 22px;
    z-index: 60;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.back-to-top-btn.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top-btn:hover { filter: brightness(1.1); }

/* =============================================
   SECTION PROJETS
============================================= */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.project-card {
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 20px;
    background: rgba(10,132,255,0.03);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
    border-color: var(--accent);
}
.project-title { font-size: 15px; font-weight: 600; color: var(--surface-text); }
.project-desc { font-size: 13px; line-height: 1.6; color: var(--muted); flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-tags .tag {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--accent);
    color: #fff;
}
:root[data-theme="dark"] .project-tags .tag { color: #fff; }
.project-link {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--accent);
    text-decoration: none;
    align-self: flex-start;
}
.project-link:hover { text-decoration: underline; }

/* =============================================
   IMPRESSION / PDF
============================================= */
@media print {
    @page { margin: 12mm; size: A4; }

    /* Force une palette claire, lisible à l'impression */
    :root, :root[data-theme="dark"] {
        --page-bg: #fff; --surface: #fff; --surface-text: #111;
        --muted: #333; --rule: #ccc;
        --panel: #f2f5f8; --panel-soft: #d8e0ea; --panel-text: #111; --panel-muted: #444;
        --ink: #0a1628; --hero-text: #fff; --hero-muted: #cfd8e3;
    }

    html, body { background: #fff !important; }
    body { margin: 0; max-width: none; box-shadow: none; }
    body::before { display: none; }

    /* On masque tout l'habillage interactif */
    .hero-controls, .scroll-progress, .back-to-top-btn,
    .section-nav, .tools-hint, .social-links { display: none !important; }

    /* On déplie les éléments animés */
    .reveal { opacity: 1 !important; transform: none !important; }
    .skill-fill { width: var(--target) !important; transition: none !important; }
    .tools-carousel { max-height: none !important; -webkit-mask-image: none !important; mask-image: none !important; }
    .tools-track { flex-wrap: wrap !important; width: 100% !important; animation: none !important; transform: none !important; }

    /* Conserve les aplats de couleur */
    .hero, .sidebar, .project-tags .tag, .section-heading::after, .skill-fill {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }

    a { color: inherit; text-decoration: none; }
    .tl-item, .formation-item, .project-card { break-inside: avoid; }
    footer { background: #fff; color: #666; }
    footer a { color: #666; }
}

/* =============================================
   BANDEAU CHIFFRES CLÉS
============================================= */
.stats-band {
    background: var(--panel);
    color: var(--panel-text);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--panel-soft);
    transition: background 0.3s ease;
}
.stat {
    padding: 26px 16px;
    text-align: center;
    border-right: 1px solid var(--panel-soft);
}
.stat:last-child { border-right: none; }
.stat-num {
    font-family: var(--display);
    font-size: 44px;
    line-height: 1;
    color: var(--accent);
    letter-spacing: 1px;
}
.stat-num .suffix { color: var(--accent2); }
.stat-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--panel-muted);
    margin-top: 8px;
}
@media (max-width: 720px) {
    .stats-band { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border-right: none; }
    .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--panel-soft); }
    .stat-num { font-size: 36px; }
}

/* =============================================
   FIL D'ARIANE (breadcrumb)
============================================= */
.breadcrumb {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--hero-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.breadcrumb a { color: var(--accent2); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--hero-muted); opacity: 0.6; }
.breadcrumb [aria-current="page"] { color: var(--hero-text); }

/* =============================================
   PAGE PROJETS (informatique)
============================================= */
.proj-intro { margin-bottom: 26px; }

.proj-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 32px; }
.proj-filter {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1px;
    padding: 9px 16px;
    border-radius: 50px;
    cursor: pointer;
    border: 1px solid var(--rule);
    background: var(--surface);
    color: var(--muted);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.proj-filter:hover {
    border-color: var(--accent);
    color: var(--surface-text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10,132,255,0.12);
}
.proj-filter.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(10,132,255,0.30);
}
.proj-filter .count { opacity: 0.65; margin-left: 2px; }

/* Grille de cartes : autant de colonnes que la largeur le permet
   (≈3 sur grand écran, réduit automatiquement sur petit écran) */
.proj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
    align-items: start;
}

/* La carte réutilise .project-card, on la rend cliquable */
.proj-card { cursor: pointer; }
.proj-card .proj-cat {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent2);
}
.proj-card .proj-period { font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* Vue article (blog) */
.proj-list.hidden { display: none; }
.proj-article { display: none; }
.proj-article.active { display: block; animation: fadeUp 0.4s ease both; }

.proj-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 22px;
}
.proj-back:hover { text-decoration: underline; }

.art-title { font-family: var(--display); font-size: 36px; letter-spacing: 1px; color: var(--surface-text); margin-bottom: 8px; line-height: 1; }
.art-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.art-meta .cat { color: var(--accent2); }
.art-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
.art-tags .tag {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--accent);
    color: #fff;
}
.art-body p { font-size: 14px; line-height: 1.75; color: var(--muted); margin-bottom: 14px; }
.art-body h3 { font-size: 16px; color: var(--surface-text); margin: 24px 0 10px; }
.art-body ul { list-style: none; padding: 0; margin-bottom: 14px; }
.art-body li {
    font-size: 14px; line-height: 1.6; color: var(--muted);
    padding-left: 18px; position: relative; margin-bottom: 6px;
}
.art-body li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); font-size: 11px; top: 2px; }

/* État vide de la page projets */
.proj-empty {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--muted);
    padding: 40px 0;
    text-align: center;
    border: 1px dashed var(--rule);
    border-radius: 8px;
}

/* =============================================
   PHOTOGRAPHIE — carrousel, albums, galerie, lightbox
============================================= */

/* Carrousel des dernières photos */
.photo-carousel-wrap { margin: 0 0 40px; }
.photo-carousel-title {
    font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
    text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.photo-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.photo-carousel::-webkit-scrollbar { height: 8px; }
.photo-carousel::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }
.photo-carousel .shot {
    flex: 0 0 auto;
    scroll-snap-align: start;
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: var(--panel);
}
.photo-carousel .shot img { height: 100%; width: auto; display: block; object-fit: cover; transition: transform 0.3s; }
.photo-carousel .shot:hover img { transform: scale(1.05); }

/* Grille d'albums (même esprit que les projets) */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}
.album-card {
    border: 1px solid var(--rule);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.album-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,0.14); border-color: var(--accent); }
.album-cover { aspect-ratio: 16/10; background: var(--panel); overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-body { padding: 14px 16px 16px; }
.album-title { font-size: 15px; font-weight: 600; color: var(--surface-text); margin-bottom: 4px; }
.album-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.album-meta .count { color: var(--accent2); }

/* Galerie d'un album */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}
.gallery-item {
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    background: var(--panel);
    position: relative;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .zoom {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10,22,40,0.0); color: #fff; opacity: 0;
    transition: opacity 0.2s, background 0.2s; font-size: 22px;
}
.gallery-item:hover .zoom { opacity: 1; background: rgba(10,22,40,0.35); }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(6,13,24,0.92);
    display: none; align-items: center; justify-content: center;
    flex-direction: column; gap: 14px; padding: 24px;
    backdrop-filter: blur(3px);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 74vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox-info {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.5px;
    color: #cfd8e3; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center;
}
.lightbox-info b { color: var(--accent2); font-weight: 700; }
.lightbox-info .name { color: #fff; }
.lb-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2);
    width: 46px; height: 46px; border-radius: 50%; font-size: 22px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.lb-btn:hover { background: rgba(255,255,255,0.2); }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-close { position: absolute; top: 18px; right: 18px; transform: none; }
@media (max-width: 600px) { .lb-prev{left:6px;} .lb-next{right:6px;} .lightbox img{max-height:64vh;} }
