:root {
    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-2: #f0f1f8;
    --text: #1c2130;
    --text-muted: #64708a;
    --border: #e6e8f0;
    --accent: #4f46e5;
    --accent-2: #06b6d4;
    --accent-soft: #eef0fd;
    --radius: 16px;
    --shadow: 0 10px 30px -12px rgba(30, 34, 60, 0.15);
    --nav-h: 72px;
}

[data-theme="dark"] {
    --bg: #0b0e17;
    --surface: #121729;
    --surface-2: #171d31;
    --text: #e8eaf3;
    --text-muted: #9aa3bd;
    --border: #232a42;
    --accent: #818cf8;
    --accent-2: #22d3ee;
    --accent-soft: #1a1f38;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, Segoe UI, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    transition: background .3s ease, color .3s ease;
}

h1, h2, h3, .brand { font-family: 'Space Grotesk', 'Inter', sans-serif; }

a { color: inherit; }

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

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- NAVBAR ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.navbar .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; text-decoration: none; }

.brand-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .95rem;
}

.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }

.nav-links a {
    text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: .95rem;
    padding: 8px 14px; border-radius: 999px; transition: all .2s ease;
}

.nav-links a:hover { color: var(--text); background: var(--surface-2); }

.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
    width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); cursor: pointer; display: flex;
    align-items: center; justify-content: center; font-size: 1.05rem; transition: all .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.btn {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    font-weight: 600; font-size: .95rem; padding: 11px 20px; border-radius: 999px;
    border: 1px solid transparent; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }

.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; color: var(--text); cursor: pointer; }

/* ---------- HERO ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 76px 0 64px;
    border-bottom: 1px solid var(--border);
}

.hero::before {
    content: "";
    position: absolute; inset: -40% -10% auto -10%; height: 480px;
    background: radial-gradient(60% 60% at 30% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
                radial-gradient(50% 50% at 80% 20%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
    pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em; color: var(--accent);
    background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}

.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }

.hero h1 { font-size: clamp(2.1rem, 4vw, 3rem); line-height: 1.1; margin: 0 0 14px; }
.hero .gradient-text { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.08rem; color: var(--text-muted); max-width: 560px; margin: 0 0 28px; }

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

.hero-photo-wrap { position: relative; justify-self: center; }
.hero-photo-frame {
    width: 280px; height: 320px; border-radius: 28px;
    background: linear-gradient(160deg, var(--accent-soft), var(--surface-2));
    box-shadow: var(--shadow); border: 4px solid var(--surface);
    display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
}
.hero-photo { width: 94%; height: auto; object-fit: contain; display: block; }
.hero-badge {
    position: absolute; bottom: -14px; right: -14px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px;
    box-shadow: var(--shadow); font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }

/* ---------- SECTIONS ---------- */
section { padding: 64px 0; }
.section-tag { color: var(--accent); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.section-title { font-size: 1.7rem; margin: 0 0 36px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.card-icon {
    width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 16px;
}

.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--text-muted); font-size: .93rem; }

.cta-band {
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
    padding: 44px; text-align: center; margin-top: 12px;
}
.cta-band p { color: var(--text-muted); margin-bottom: 22px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- FOOTER ---------- */
footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--text-muted); font-size: .88rem; }
.footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 18px; list-style: none; padding: 0; margin: 0; }
.footer-links a { text-decoration: none; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ---------- CV PAGE ---------- */
.cv-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.cv-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; position: sticky; top: calc(var(--nav-h) + 20px); }
.cv-side .photo-frame {
    width: 100px; height: 112px; border-radius: 20px; margin-bottom: 14px;
    background: linear-gradient(160deg, var(--accent-soft), var(--surface-2));
    display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
}
.cv-side .profile-photo { width: 92%; height: auto; object-fit: contain; display: block; }
.cv-side h1 { font-size: 1.3rem; margin: 0 0 4px; }
.cv-side .role { color: var(--accent); font-weight: 600; font-size: .92rem; margin-bottom: 18px; }

.side-block { margin-bottom: 26px; }
.side-block h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 0 0 12px; }
.contact-row { display: flex; align-items: center; gap: 10px; font-size: .9rem; margin-bottom: 10px; }
.contact-row .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .85rem; }

.skill-pill { display: inline-block; font-size: .78rem; font-weight: 500; background: var(--accent-soft); color: var(--accent); padding: 5px 12px; border-radius: 999px; margin: 0 6px 8px 0; }

.progress-row { margin-bottom: 12px; }
.progress-row .label { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 5px; }
.progress-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.cv-main-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 34px; margin-bottom: 20px; }
.cv-main-block h2 { font-size: 1.15rem; margin: 0 0 22px; display: flex; align-items: center; gap: 10px; }
.cv-main-block h2 .ic { color: var(--accent); }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 26px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -26px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--accent-soft); }
.ti-header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ti-title { font-weight: 600; font-size: 1rem; }
.ti-company { color: var(--accent); font-weight: 500; font-size: .9rem; }
.ti-date { font-size: .82rem; color: var(--text-muted); white-space: nowrap; background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.ti-list { margin: 0; padding-left: 20px; color: var(--text-muted); font-size: .92rem; }
.ti-list li { margin-bottom: 5px; }

/* ---------- PROJECTS / REALISATIONS PAGE ---------- */
.project-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px 32px; margin-bottom: 22px; transition: transform .25s ease, box-shadow .25s ease;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.project-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.project-title { font-size: 1.2rem; margin: 0; }
.project-status {
    font-size: .78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft);
    padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.project-image { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 20px; }
.project-desc { color: var(--text-muted); margin: 0 0 18px; max-width: 720px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tag-pill {
    font-size: .78rem; font-weight: 500; background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px;
}
.project-steps { list-style: none; list-style-type: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.project-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--text); }
.project-steps li::marker { content: ""; }
.project-steps .step-num {
    width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
    font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 1px;
}

/* ---------- LETTER PAGE ---------- */
.letter-sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 48px; max-width: 780px; margin: 0 auto; }
.letter-meta { display: flex; justify-content: space-between; margin-bottom: 30px; font-size: .92rem; flex-wrap: wrap; gap: 16px; }
.letter-meta strong { display: block; margin-bottom: 4px; }
.letter-date { text-align: right; color: var(--text-muted); font-style: italic; margin-bottom: 20px; }
.letter-object { font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 26px; }
.letter-text p { margin-bottom: 18px; text-align: justify; color: var(--text); }
.letter-text .salutation { margin-bottom: 22px; }
.signature-block { margin-top: 30px; text-align: right; }
.signature-block img { width: 170px; margin-left: auto; }
.signature-block .sig-dark { display: none; }
[data-theme="dark"] .signature-block .sig-light { display: none; }
[data-theme="dark"] .signature-block .sig-dark { display: block; }

/* ---------- VEILLE PAGE ---------- */
.veille-list { display: flex; flex-direction: column; gap: 22px; }
.veille-entry {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px 32px; transition: transform .25s ease, box-shadow .25s ease;
}
.veille-entry:hover { box-shadow: var(--shadow); }
.veille-entry-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.veille-date {
    font-size: 1.1rem; margin: 0; color: var(--accent); background: var(--accent-soft);
    padding: 6px 16px; border-radius: 999px; display: inline-block;
}
.veille-cat { margin-bottom: 22px; }
.veille-cat:last-child { margin-bottom: 0; }
.veille-cat h3 { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 12px; }
.veille-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.veille-items li { border-left: 3px solid var(--accent-soft); padding-left: 16px; }
.veille-items p { margin: 0 0 6px; font-size: .95rem; color: var(--text); }
.veille-items p:last-child { margin-bottom: 0; }
.veille-items a { color: var(--accent); text-decoration: none; font-weight: 500; }
.veille-items a:hover { text-decoration: underline; }
.veille-action { color: var(--text-muted) !important; font-size: .9rem !important; }

/* ---------- MOBILE ---------- */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-photo-wrap { order: -1; }
    .cv-layout { grid-template-columns: 1fr; }
    .cv-side { position: static; }
}

@media (max-width: 760px) {
    .nav-links { position: fixed; top: var(--nav-h); left: 0; right: 0; background: var(--surface);
        flex-direction: column; align-items: stretch; padding: 12px 20px; border-bottom: 1px solid var(--border);
        transform: translateY(-130%); opacity: 0; transition: all .25s ease; }
    .nav-links.open { transform: translateY(0); opacity: 1; }
    .nav-links a { padding: 12px 14px; }
    .nav-toggle { display: block; }
    .grid-2 { grid-template-columns: 1fr; }
    .letter-sheet { padding: 28px; }
    .veille-entry { padding: 22px 20px; }
}
