:root {
    --ink: #0a1c2e;
    --ink-soft: #3d5166;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --line: #dde3ea;
    --blue: #1d5cff;
    --blue-dark: #1347cc;
    --sky: #5fc3ff;
    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-body: 'Instrument Sans', system-ui, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
}

img { max-width: 100%; display: block; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1120px, 100% - 48px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; }

/* ---------- Header ---------- */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px max(24px, calc((100% - 1120px) / 2));
    color: #fff;
    transition: background .3s, box-shadow .3s, padding .3s;
}
.header.scrolled {
    background: rgba(10, 28, 46, .92);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(255,255,255,.08);
    padding-block: 12px;
}
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.02em; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; font-size: .95rem; font-weight: 500; opacity: .8; transition: opacity .2s; }
.nav a:hover, .nav a.active { opacity: 1; }
.nav a.active:not(.nav-cta) { box-shadow: 0 2px 0 var(--sky); padding-bottom: 4px; }
.nav .nav-cta {
    opacity: 1;
    background: var(--blue);
    padding: 9px 18px;
    border-radius: 8px;
    transition: background .2s;
}
.nav .nav-cta:hover { background: var(--blue-dark); }

.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    background: var(--ink);
    color: #fff;
    overflow: hidden;
}
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(95,195,255,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(95,195,255,.07) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; align-items: center; }

.hero-role { color: var(--sky); font-weight: 600; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.8rem); font-weight: 800; margin-bottom: 24px; }
.hero-desc { color: #b8c7d6; max-width: 56ch; margin-bottom: 36px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 10px;
    font: 600 1rem var(--font-body);
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .2s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-2px); }
.btn-ghost { border-color: rgba(255,255,255,.3); color: #fff; }
.btn-ghost:hover { border-color: var(--sky); color: var(--sky); }

.socials { display: flex; gap: 12px; }
.socials a {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    color: #dbe6f1;
    font-size: 1.1rem;
    transition: border-color .2s, color .2s, transform .2s;
}
.socials a:hover { border-color: var(--sky); color: var(--sky); transform: translateY(-3px); }

.hero-photo { justify-self: center; }
.photo-frame {
    position: relative;
    width: min(380px, 80vw);
    aspect-ratio: 4 / 5;
    border-radius: 24px;
    background: linear-gradient(160deg, #16385a, #0d2540);
    border: 1px solid rgba(95,195,255,.35);
    overflow: hidden;
}
.photo-frame::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(95,195,255,.25);
    border-radius: 14px;
    pointer-events: none;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* Animation d'arrivée : un seul moment, sur le hero */
.hero-text > *, .hero-photo { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-text > :nth-child(2) { animation-delay: .08s; }
.hero-text > :nth-child(3) { animation-delay: .16s; }
.hero-text > :nth-child(4) { animation-delay: .24s; }
.hero-text > :nth-child(5) { animation-delay: .32s; }
.hero-photo { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section-alt { background: #e9eef4; }

.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 800; margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 34px 30px;
}
.service i { font-size: 1.8rem; color: var(--blue); display: block; margin-bottom: 20px; }
.service h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }
.service p { color: var(--ink-soft); font-size: .98rem; }

/* Compétences */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.skill-group h3 { font-size: 1.15rem; font-weight: 700; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 2px solid var(--ink); }
.skill-group ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.skill-group li {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: .93rem;
    font-weight: 500;
}

/* Projets */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.project {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow .25s, transform .25s;
}
.project:hover { box-shadow: 0 18px 40px -18px rgba(10,28,46,.35); transform: translateY(-4px); }
.project-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--line); }
.project-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project-body { padding: 22px 24px 26px; }
.project-body h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.project-body p { color: var(--ink-soft); font-size: .95rem; }
.link { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--blue); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
.contact-info h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 800; margin-bottom: 16px; }
.contact-info > p { color: var(--ink-soft); margin-bottom: 28px; max-width: 44ch; }
.contact-info ul { list-style: none; display: grid; gap: 14px; }
.contact-info li { display: flex; align-items: center; gap: 12px; }
.contact-info i { color: var(--blue); font-size: 1.2rem; }
.contact-info a { text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.contact-info a:hover { color: var(--blue); }

.form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
}
.form label { font-weight: 600; font-size: .93rem; margin-top: 8px; }
.form input, .form textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #c7d0da;
    border-radius: 10px;
    font: inherit;
    color: var(--ink);
    background: #fbfcfd;
    transition: border-color .2s, box-shadow .2s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,92,255,.18); }
.form textarea { resize: vertical; }
.form .btn { margin-top: 18px; justify-content: center; }
.form-status { min-height: 1.4em; font-size: .93rem; margin-top: 6px; }
.form-status.error { color: #b42318; }
.form-status.ok { color: #067647; }

/* Footer */
.footer { background: var(--ink); color: #b8c7d6; padding: 28px 0; font-size: .93rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--sky); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .hero-inner { grid-template-columns: 1fr; gap: 48px; }
    .hero-photo { order: -1; }
    .photo-frame { width: min(260px, 70vw); }
    .services, .skills, .projects { grid-template-columns: 1fr; }
    .contact { grid-template-columns: 1fr; gap: 40px; }
    .section { padding: 80px 0; }
}

@media (max-width: 820px) {
    .menu-btn { display: block; }
    .nav {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(10, 28, 46, .98);
        padding: 8px 24px 20px;
        display: none;
    }
    .nav.open { display: flex; }
    .nav a { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
    .nav a.active:not(.nav-cta) { box-shadow: none; color: var(--sky); }
    .nav .nav-cta { margin-top: 14px; text-align: center; border: 0; }
}

@media (max-width: 520px) {
    .form { padding: 22px; }
    .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}