:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --ink: #14202e;
  --muted: #5a6b7d;
  --primary: #1f4a7d;
  --accent: #4a9cc4;
  --accent-soft: #e3f0f8;
  --line: #dbe4ec;
  --shadow: 0 8px 28px rgba(20, 40, 70, .08);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141c;
    --surface: #152130;
    --ink: #e8eef5;
    --muted: #9db0c3;
    --primary: #6bb3dd;
    --accent: #4a9cc4;
    --accent-soft: #1b3347;
    --line: #243649;
    --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 "Inter", system-ui, sans-serif;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; line-height: 1.15; margin: 0 0 .5em; }
a { color: var(--primary); }
.muted { color: var(--muted); }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px clamp(16px, 5vw, 56px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__logo { font: 700 1.25rem "Fraunces", serif; text-decoration: none; color: var(--primary); }
.nav nav { display: flex; gap: 20px; align-items: center; }
.nav nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav nav a:hover { color: var(--primary); }
.nav__cta { color: #fff !important; background: var(--primary); padding: 6px 16px; border-radius: 999px; }
@media (max-width: 720px) { .nav nav a:not(.nav__cta) { display: none; } }

main { max-width: 1040px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 32px); }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center;
  padding: clamp(40px, 8vw, 96px) 0 48px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--accent); margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 700; color: var(--ink); }
.hero__titre { font-size: 1.2rem; font-weight: 600; color: var(--primary); margin: 0 0 16px; }
.hero__accroche { color: var(--muted); max-width: 52ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.hero__photo img {
  display: block; width: 100%; height: auto; border-radius: 28px;
  box-shadow: var(--shadow); border: 4px solid var(--surface);
  transform: rotate(2deg);
}
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero__photo { order: -1; max-width: 340px; }
}

.chiffres { display: flex; flex-wrap: wrap; gap: 32px; margin: 32px 0 0; }
.chiffres div { min-width: 90px; }
.chiffres dt { font: 700 1.9rem "Fraunces", serif; color: var(--primary); }
.chiffres dd { margin: 0; font-size: .85rem; color: var(--muted); }

/* Boutons */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 999px; font-weight: 600;
  text-decoration: none; border: 2px solid var(--primary); color: var(--primary);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--primary { background: var(--primary); color: #fff; }
@media (prefers-color-scheme: dark) { .btn--primary, .nav__cta { color: #0d141c !important; } }
.btn--ghost { background: transparent; }
.btn--small { padding: 6px 16px; font-size: .9rem; }

/* Blocs */
.bloc { padding: 48px 0; }
.bloc h2 { font-size: 2rem; position: relative; padding-bottom: 12px; margin-bottom: 28px; }
.bloc h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 2px; background: var(--accent); }
.bloc__intro { color: var(--muted); margin: -12px 0 24px; }

.grille { display: grid; gap: 20px; }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.carte {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.carte h3 { font-size: 1.25rem; }
.carte p { margin: 0 0 10px; }
.periode { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }

/* Compétences */
.competences { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.competences li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.barres__nom { font-weight: 600; font-size: .95rem; }
.niveau {
  font-size: .8rem; font-weight: 600; padding: 3px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--primary);
}

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 3px solid var(--accent-soft); }
.timeline__item { position: relative; padding: 0 0 36px 8px; }
.timeline__item::before {
  content: ""; position: absolute; left: -38px; top: 4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent); border: 4px solid var(--bg);
}
.timeline__item h3 { font-size: 1.35rem; }
.points { margin: 0 0 12px; padding-left: 20px; color: var(--muted); }
.points li { margin-bottom: 6px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tags span {
  font-size: .78rem; font-weight: 600; padding: 3px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--primary);
}

/* Projets */
.carte--projet { display: flex; flex-direction: column; transition: transform .2s; }
.carte--projet:hover { transform: translateY(-4px); }
.carte__icone { font-size: 2rem; margin-bottom: 8px; }
.carte__accroche { font-weight: 600; color: var(--primary); }
.carte--projet .liens { margin-top: auto; padding-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bientot { font-size: .85rem; color: var(--muted); font-style: italic; }

/* Formation */
.formations { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.formations li {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.formations .periode { margin: 3px 0 0; }
@media (max-width: 560px) { .formations li { grid-template-columns: 1fr; gap: 2px; } }

/* Contact */
.contact { text-align: center; }
.contact h2::after { left: 50%; transform: translateX(-50%); }
.contact__liens { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 24px 0; }

.pied { text-align: center; padding: 32px 16px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .carte--projet { transition: none; }
}

.timeline__item .description { color: var(--muted, #5b6470); font-style: italic; margin: .25rem 0 .75rem; }

/* Galerie */
.bloc--galerie { padding-top: 0; }
.galerie { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.galerie a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.galerie img { display: block; width: 100%; height: auto; transition: transform .2s; }
.galerie a:hover img { transform: scale(1.03); }
.carte__icone img { display: block; width: 48px; height: 48px; object-fit: contain; border-radius: 10px; }

/* Visionneuse */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 12, 18, .92); padding: 56px 72px;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lightbox__btn {
  position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .14);
  width: 48px; height: 48px; border-radius: 50%; font-size: 2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0 0 4px;
}
.lightbox__btn:hover, .lightbox__btn:focus-visible { background: rgba(255, 255, 255, .3); }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__compteur { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; margin: 0; font-size: .9rem; }
@media (max-width: 600px) { .lightbox { padding: 56px 8px; } .lightbox__prev, .lightbox__next { top: auto; bottom: 8px; transform: none; } .lightbox__compteur { bottom: 24px; } }
