:root {
  --bg: #f6f4ef;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #5e6470;
  --faint: #7a808b;
  --line: #e3e0d8;
  --accent: #1f3b63;
  --accent-soft: #e6ecf5;
  --accent-ink: #ffffff;
  --shadow: 0 20px 50px -25px rgba(22, 24, 29, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318; --bg-alt: #171a21; --surface: #1c2029; --ink: #eef0f4; --muted: #a7adb9;
    --faint: #8a909c; --line: #2a2f3a; --accent: #8fb0e0; --accent-soft: #1f2a3c; --accent-ink: #0d1420;
    --shadow: 0 20px 50px -25px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg: #111318; --bg-alt: #171a21; --surface: #1c2029; --ink: #eef0f4; --muted: #a7adb9;
  --faint: #8a909c; --line: #2a2f3a; --accent: #8fb0e0; --accent-soft: #1f2a3c; --accent-ink: #0d1420;
  --shadow: 0 20px 50px -25px rgba(0,0,0,.6);
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.65 "Plus Jakarta Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.serif { font-family: "Cormorant Garamond", Georgia, serif; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* Bilingue : on n'affiche que la langue active */
html[lang="fr"] [lang="en"]:not(html), html[lang="en"] [lang="fr"]:not(html) { display: none !important; }

/* Navigation */
nav { position: sticky; top: 0; z-index: 50; background: var(--bg); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
nav .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { font: 600 20px "Cormorant Garamond", serif; text-decoration: none; white-space: nowrap; }
.links { display: flex; gap: 20px; margin: 0 auto; font-size: 13.5px; }
.links a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.links a:hover { color: var(--ink); }
.tools { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang button { border: 0; background: transparent; color: var(--muted); font-family: inherit; font-weight: 600; font-size: 12px; padding: 6px 10px; cursor: pointer; }
.lang button.on { background: var(--accent); color: var(--accent-ink); }
.theme { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 15px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid var(--line); background: var(--surface); transition: transform .15s, box-shadow .15s; white-space: nowrap; }
@media (max-width: 1240px) { .links { display: none; } .tools { margin-left: auto; } }
@media (min-width: 1241px) { nav .btn { display: none; } } /* le lien Contact du menu suffit */
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
nav .btn { padding: 9px 16px; }

/* Hero */
.hero { padding: 80px 0 90px; }
.hero .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 99px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2f9e5b; box-shadow: 0 0 0 4px color-mix(in srgb, #2f9e5b 20%, transparent); }
h1 { font: 500 clamp(48px, 7vw, 86px)/1 "Cormorant Garamond", serif; margin: 26px 0 22px; letter-spacing: -.01em; }
h1 .soft { color: var(--faint); }
h1 em { color: var(--accent); }
.tagline { color: var(--muted); max-width: 520px; font-size: 17px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 44px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stats b { display: block; font: 500 40px/1 "Cormorant Garamond", serif; color: var(--accent); }
.stats span { font-size: 12.5px; color: var(--muted); line-height: 1.4; display: block; margin-top: 6px; }
.portrait { aspect-ratio: 4/5; border-radius: 22px; background: linear-gradient(150deg, #1f3b63 0%, #6f7f8c 100%); background: linear-gradient(150deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 55%, #c9a96b) 100%); box-shadow: var(--shadow); position: relative; overflow: hidden; display: grid; place-items: center; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; position: absolute; inset: 0; }
.portrait .initials { font: 600 140px "Cormorant Garamond", serif; color: rgba(255,255,255,.92); letter-spacing: -.02em; }
.portrait .badge { position: absolute; left: 18px; bottom: 18px; right: 18px; background: rgba(255,255,255,.92); color: #16181d; border-radius: 12px; padding: 12px 16px; font-size: 13px; }
.portrait .badge b { display: block; font-size: 14px; }

/* Sections */
section.block { padding: 96px 0; border-top: 1px solid var(--line); }
section.block.alt { background: var(--bg-alt); }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
h2 { font: 500 clamp(38px, 5vw, 56px)/1.05 "Cormorant Garamond", serif; margin: 12px 0 48px; }
h2 em { color: var(--accent); }

.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; }
.about p { color: var(--muted); margin-bottom: 18px; font-size: 16.5px; }
.about .quote { border-left: 3px solid var(--accent); padding: 6px 0 6px 22px; font: italic 500 24px/1.35 "Cormorant Garamond", serif; color: var(--ink) !important; margin-top: 28px; }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 8px 26px; }
.facts div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts div:last-of-type { border-bottom: 0; }
.facts small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 3px; }
.facts .btn { margin: 8px 0 20px; width: 100%; justify-content: center; }

/* Timeline */
.job { display: grid; grid-template-columns: 180px 1fr; gap: 36px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.when { font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.status { display: inline-block; margin-top: 10px; font-size: 10.5px; letter-spacing: .12em; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.status.done { background: transparent; border: 1px solid var(--line); color: var(--faint); }
.job h3 { font: 600 28px/1.15 "Cormorant Garamond", serif; }
.org { color: var(--accent); font-size: 14px; font-weight: 600; margin: 6px 0 14px; }
.job ul { list-style: none; color: var(--muted); }
.job li { padding-left: 22px; position: relative; margin: 6px 0; }
.job li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags span { font-size: 12px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); }

/* Skills */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .ico { font-size: 26px; }
.card h4 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 14px 0 16px; }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.project { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.project .head { padding: 34px 30px; background: var(--accent-soft); display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.project .num { font: 500 64px/1 "Cormorant Garamond", serif; color: var(--accent); }
.project .head small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; text-align: right; }
.project .body { padding: 26px 30px 30px; }
.project h3 { font: 600 26px/1.15 "Cormorant Garamond", serif; margin-bottom: 10px; }
.project p { color: var(--muted); font-size: 15px; }

/* CAD projects gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.work { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.work:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.work .cover { position: relative; aspect-ratio: 16/10; border: 0; padding: 0; margin: 0; width: 100%; background: #e9e7e1; cursor: zoom-in; display: block; overflow: hidden; }
.work .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.work .cover:hover img { transform: scale(1.04); }
.work .cover:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.work .cover .count { position: absolute; right: 12px; bottom: 12px; background: rgba(22,24,29,.78); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; }
.work .cover .count::before { content: "▣ "; }
.work .placeholder { cursor: default; display: grid; place-items: center; background: var(--accent-soft); }
.work .placeholder span { font: 500 72px/1 "Cormorant Garamond", serif; color: var(--accent); }
.work-body { padding: 22px 24px 26px; }
.work h3 { font: 600 24px/1.2 "Cormorant Garamond", serif; margin-bottom: 8px; }
.work p { color: var(--muted); font-size: 14.5px; }
.work-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.work-links a { font-size: 12.5px; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--accent); background: var(--bg); }
.work-links a:hover { border-color: var(--accent); }

/* Lightbox */
#lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
#lightbox::backdrop { background: rgba(10,12,16,.92); }
#lightbox[open] { display: grid; place-items: center; }
#lightbox img { max-width: calc(100vw - 120px); max-height: calc(100vh - 100px); border-radius: 10px; object-fit: contain; }
#lightbox button { position: fixed; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; cursor: pointer; }
#lightbox button:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 18px; right: 18px; font-size: 20px !important; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-count { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; opacity: .8; }

/* Certifications */
.certs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cert { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
a.cert:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.cert-yr { font: 500 26px/1 "Cormorant Garamond", serif; color: var(--accent); }
.cert-main b { display: block; font-weight: 600; font-size: 15px; line-height: 1.35; }
.cert-main small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.cert-go { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.cert-go.muted { color: var(--faint); }

/* Education */
.edu { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; }
.sub { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-bottom: 18px; }
.degree { padding: 22px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 16px; }
.degree h3 { font: 600 24px/1.2 "Cormorant Garamond", serif; }
.degree p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.degree .yr { font: 500 28px "Cormorant Garamond", serif; color: var(--accent); }
.langs .lng { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.bar { width: 46%; height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; }
.contact > div > p { color: var(--muted); margin-bottom: 28px; }
.channel { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.channel .i { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; font-size: 18px; flex: none; }
.channel small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
form { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: grid; gap: 16px; }
form h3 { font: 600 28px "Cormorant Garamond", serif; }
label { font-size: 12px; font-weight: 600; color: var(--muted); display: grid; gap: 6px; }
input, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
form .btn { justify-content: center; cursor: pointer; font-family: inherit; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Formulaire : statut d'envoi, piège à robots, icône LinkedIn */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { font-size: 14px; padding: 12px 14px; border-radius: 10px; }
.form-status.ok { background: var(--accent-soft); color: var(--accent); }
.form-status.err { background: color-mix(in srgb, #c0392b 12%, transparent); color: #c0392b; }
form .btn:disabled { opacity: .6; cursor: wait; }
.channel .i.in { font: 700 17px "Plus Jakarta Sans", sans-serif; color: #fff; background: #0a66c2; }
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--ink); }

footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--faint); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* L'animation ne s'active que si le JavaScript tourne (l'aperçu de fichiers iPhone le désactive) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

@media (max-width: 960px) {
  .links { display: none; }
  .tools { margin-left: auto; }
  .hero .wrap, .about, .edu, .contact { grid-template-columns: 1fr; }
  .portrait { max-width: 380px; }
  .grid3, .projects { grid-template-columns: 1fr 1fr; }
  .certs { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  nav .btn { display: none; }
  .hero { padding: 48px 0 64px; }
  .stats { grid-template-columns: 1fr 1fr; }
  section.block { padding: 72px 0; }
  .job { grid-template-columns: 1fr; gap: 10px; }
  .grid3, .projects, .row2 { grid-template-columns: 1fr; }
  form { padding: 22px; }

  /* Lisibilité sur téléphone : textes plus grands, rien sous 13px */
  body { font-size: 17px; line-height: 1.7; }
  .tagline, .about p, .job ul, .project p, .contact > div > p { font-size: 17px; }
  .pill { font-size: 12.5px; letter-spacing: .06em; }
  .eyebrow, .when, .sub, .card h4 { font-size: 13px; letter-spacing: .1em; }
  .status, .facts small, .channel small, .project .head small { font-size: 12px; letter-spacing: .08em; }
  .stats span { font-size: 14px; }
  .stats b { font-size: 44px; }
  .tags span { font-size: 14px; padding: 6px 12px; }
  .org, .degree p, label { font-size: 15px; }
  .lang button { font-size: 13px; padding: 8px 12px; }
  .theme { width: 40px; height: 40px; }
  .job h3 { font-size: 28px; }
  .project .num { font-size: 52px; }
  .cta .btn { flex: 1 1 auto; justify-content: center; padding: 14px 18px; font-size: 15px; }
  .degree { grid-template-columns: 1fr; gap: 4px; }
  .degree .yr { order: -1; font-size: 24px; }
  .bar { width: 40%; }
  footer { font-size: 14px; }
  .gallery { grid-template-columns: 1fr; }
  .certs { grid-template-columns: 1fr; }
  .cert { gap: 14px; padding: 16px; }
  .cert-main b { font-size: 16px; }
  .cert-main small { font-size: 14px; }
  .work p { font-size: 16px; }
  .work-links a { font-size: 14px; }
  #lightbox img { max-width: calc(100vw - 24px); }
  .lb-prev, .lb-next { top: auto !important; bottom: 16px; transform: none !important; }
}
