/* ============ Tokens ============ */
:root {
  --bg: #f7f5f0;
  --bg-2: #efece4;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6270;
  --line: #e2ded3;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-ink: #ffffff;
  --gold: #b7791f;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 12px 32px -12px rgba(20, 20, 30, .12);
  --radius: 18px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013; --bg-2: #14171c; --surface: #171a20; --text: #eceef2; --muted: #9aa1ae;
    --line: #262a33; --accent: #2dd4bf; --accent-2: #5eead4; --accent-ink: #062a26; --gold: #f0b54a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1013; --bg-2: #14171c; --surface: #171a20; --text: #eceef2; --muted: #9aa1ae;
  --line: #262a33; --accent: #2dd4bf; --accent-2: #5eead4; --accent-ink: #062a26; --gold: #f0b54a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

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

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { font: 700 22px var(--serif); text-decoration: none; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a {
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav__links a:hover, .nav__links a.is-current { color: var(--text); background: var(--bg-2); }
.nav__tools { display: flex; gap: 6px; }
.tool {
  display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; cursor: pointer; font: 600 12px var(--mono);
  transition: border-color .2s, transform .2s;
}
.tool:hover { border-color: var(--accent); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ============ Hero ============ */
.hero {
  display: grid; grid-template-columns: 1.25fr .9fr; gap: 56px; align-items: center;
  padding: 72px 0 48px; position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: -80px -20% auto auto; width: 560px; height: 560px; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent);
  filter: blur(20px);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px;
  font: 500 13px var(--mono); color: var(--muted);
  border: 1px solid var(--line); background: var(--surface); padding: 6px 14px; border-radius: 999px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
h1 {
  font: 700 clamp(48px, 8vw, 96px)/.98 var(--serif); letter-spacing: -.035em;
}
h1 em { font-style: italic; color: var(--accent); }
.hero__role { font: 500 clamp(18px, 2.2vw, 22px) var(--sans); margin: 18px 0 0; }
.hero__lead { color: var(--muted); font-size: 17px; max-width: 56ch; margin: 14px 0 28px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font: 600 15px var(--sans); padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: transform .2s, border-color .2s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--text); }
.btn--primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--primary:hover { box-shadow: var(--shadow); }
.btn--ghost { background: transparent; }
.btn--lg { font-size: 17px; padding: 16px 28px; }
.btn[hidden] { display: none; }
.socials { list-style: none; display: flex; gap: 20px; padding: 0; margin: 28px 0 0; }
.socials a { font: 500 14px var(--mono); color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.socials a:hover { color: var(--accent); border-color: var(--accent); }
.socials--center { justify-content: center; }

.hero__photo { margin: 0; position: relative; justify-self: end; width: 100%; max-width: 420px; }
.photo-frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #1e293b));
  box-shadow: var(--shadow); transform: rotate(2deg); transition: transform .5s;
}
.photo-frame:hover { transform: rotate(0); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; position: relative; z-index: 1; }
.photo-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 96px var(--serif); color: rgba(255,255,255,.9); letter-spacing: -.04em;
}
.badge {
  position: absolute; left: -28px; bottom: 28px; z-index: 2;
  display: flex; flex-direction: column; gap: 2px; max-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; box-shadow: var(--shadow); font-size: 13px; color: var(--muted);
}
.badge strong { font: 700 15px var(--mono); color: var(--gold); }

/* ============ Stats ============ */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.stat { padding: 22px 24px; display: flex; flex-direction: column; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { font: 700 36px var(--serif); letter-spacing: -.03em; color: var(--accent); }
.stat span { color: var(--muted); font-size: 14px; }

/* ============ Sections ============ */
.section { padding: 112px 0 0; }
.section__head { margin-bottom: 36px; }
.kicker { font: 500 13px var(--mono); color: var(--accent); margin: 0 0 8px; }
h2 { font: 700 clamp(36px, 5vw, 56px) var(--serif); letter-spacing: -.03em; }
.section__sub { color: var(--muted); max-width: 60ch; margin: 12px 0 0; }


/* Logos / monogrammes */
.logo {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); overflow: hidden;
}
.logo:has(img) { background: #fff; }
.logo img { width: 86%; height: 86%; object-fit: contain; }
.logo--fill img { width: 100%; height: 100%; }
.logo b { font: 700 13px var(--mono); color: var(--accent); letter-spacing: -.02em; }
.logo img + b { display: none; }
.logo--xl { width: 168px; height: 120px; border-radius: 20px; }
.logo--xl img { width: 84%; height: 84%; }
.logo--xl b { font: 700 30px var(--serif); }

/* Bandeau établissements */
.trust { margin-bottom: 20px; }
.trust__label { font: 500 12.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.trust__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 12px; }
.trust__item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.trust__item > span:last-child { display: flex; flex-direction: column; line-height: 1.3; font-size: 14px; }
.trust__item small { color: var(--muted); font-size: 12.5px; }
.trust__item--main { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.trust__item--main strong { color: var(--accent); }
.hero__role strong { color: var(--accent); font-weight: 600; }

/* Story Inference-HW */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  counter-increment: step;
}
.step figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: #000; }
.step img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.step:hover img { transform: scale(1.04); }
.step::before {
  content: counter(step); position: absolute; top: 14px; left: 14px; z-index: 1;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font: 700 15px var(--mono);
}
.step__body { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.step__body h3 { font: 700 21px var(--serif); letter-spacing: -.01em; }
.step__body p { margin: 0; color: var(--muted); font-size: 15px; }
.step__date { font: 500 12.5px var(--mono); color: var(--accent) !important; margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.gallery figure { position: relative; margin: 0; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: #000; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption {
  position: absolute; left: 12px; bottom: 12px; font: 500 12px var(--mono); color: #fff;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px); padding: 4px 10px; border-radius: 999px;
}

/* Formation */
.school {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start;
  padding: 32px; border-radius: 24px; margin-bottom: 56px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 70%);
}
.school h3 { font: 700 clamp(30px, 4vw, 42px) var(--serif); letter-spacing: -.02em; margin-top: 4px; }
.school .tl__org { margin: 6px 0 14px; }
.school p { color: var(--muted); }
.school strong { color: var(--text); }
.subhead { font: 700 24px var(--serif); margin: 0 0 8px; }
.edu { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.edu li { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.edu div { display: flex; flex-direction: column; line-height: 1.35; }
.edu small { color: var(--muted); font-size: 13px; }
.timeline + .subhead { margin-top: 48px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  font: 500 14px var(--sans); color: var(--muted); cursor: pointer;
  border: 1px solid var(--line); background: transparent; padding: 7px 14px; border-radius: 999px;
  transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform .3s, border-color .3s, box-shadow .3s;
}
.project:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); }
.project--feature { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 60%); }
.project.is-hidden { display: none; }
.project h3 { font: 700 26px var(--serif); letter-spacing: -.02em; }
.project p { margin: 0; color: var(--muted); }
.project__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 500 12.5px var(--mono); color: var(--muted); }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--text); }
.pill--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill--gold { background: color-mix(in srgb, var(--gold) 18%, transparent); border-color: color-mix(in srgb, var(--gold) 50%, transparent); color: var(--gold); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.tags li { font: 500 12.5px var(--mono); background: var(--bg-2); color: var(--text); padding: 4px 10px; border-radius: 8px; }
.project__link { margin-top: auto; font: 600 14px var(--sans); color: var(--accent); text-decoration: none; }
.project__link:hover { text-decoration: underline; }
.project__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.project__link--muted { color: var(--muted); font-weight: 500; }
.project__link--muted::after { display: none; }

/* Timeline */
.timeline { position: relative; display: grid; gap: 12px; }
.tl {
  display: grid; grid-template-columns: 200px 1fr; gap: 32px;
  padding: 28px 0; border-top: 1px solid var(--line);
}
.tl__date { font: 500 13.5px var(--mono); color: var(--muted); margin: 4px 0 0; }
.tl h3 { font: 600 21px var(--sans); letter-spacing: -.01em; }
.tl__org { color: var(--accent); font-weight: 500; margin: 6px 0 12px; }
.tl ul { margin: 0; padding-left: 18px; color: var(--muted); }
.tl li { margin-bottom: 6px; }
.tl li::marker { color: var(--accent); }
.tl__note { color: var(--muted); font-size: 14.5px; margin: 0; }

.awards { margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.awards__title { font: 700 22px var(--serif); margin-bottom: 18px; }
.awards__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 28px; }
.awards__list li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.awards__list b { font-size: 18px; line-height: 1.4; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.skill h3 { font: 600 17px var(--sans); margin-bottom: 14px; }

/* Contact */
.contact { padding-bottom: 40px; }
.contact__card {
  text-align: center; padding: 72px 32px; border-radius: 28px;
  background:
    radial-gradient(600px 240px at 50% 0%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent),
    var(--surface);
  border: 1px solid var(--line);
}
.contact__card p { color: var(--muted); max-width: 52ch; margin: 16px auto 28px; font-size: 17px; }

.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 32px 0 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); margin-top: 72px;
}
.footer p { margin: 0; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .hero__photo { justify-self: center; max-width: 340px; order: -1; }
  .badge { left: auto; right: -8px; bottom: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .projects, .awards__list, .steps, .edu { grid-template-columns: 1fr; }
  .trust__list { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery figure:first-child { grid-column: 1 / -1; }
  .school { grid-template-columns: 1fr; padding: 24px; }
  .skills { grid-template-columns: 1fr 1fr; }
  .tl { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__tools { margin-left: auto; }
  .skills, .trust__list { grid-template-columns: 1fr; }
  .project { padding: 22px; }
  .section { padding-top: 80px; }
  .contact__card { padding: 48px 20px; }
  .btn--lg { font-size: 15px; padding: 14px 20px; }
}
