:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1d1f23;
  --muted: #5d636e;
  --line: #e4e0d8;
  --accent: #0f6b66;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ef;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 6px 20px rgba(20, 20, 20, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416;
    --surface: #1b1e21;
    --ink: #eceae5;
    --muted: #9aa1ab;
    --line: #2b2f34;
    --accent: #5cc4bb;
    --accent-ink: #0b1f1d;
    --accent-soft: #17302e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  --bg: #121416; --surface: #1b1e21; --ink: #eceae5; --muted: #9aa1ab;
  --line: #2b2f34; --accent: #5cc4bb; --accent-ink: #0b1f1d; --accent-soft: #17302e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { width: min(1040px, 100% - 32px); margin-inline: auto; }
h1, h2, h3 { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* En-tête */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { font-family: Georgia, serif; font-weight: 600; text-decoration: none; color: var(--ink); }
nav ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; font-size: .95rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); }
@media (max-width: 720px) { nav { display: none; } }

/* Boutons */
.btn {
  display: inline-block; padding: 13px 22px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; border: 2px solid var(--accent);
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--accent); }

/* Hero */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 7vw, 80px); }
.kicker { color: var(--accent); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; margin-bottom: 1em; }
.hero .lead { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--muted); max-width: 40em; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 28px;
  padding: 6px 14px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: .9rem; font-weight: 600;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Sections */
section { padding: clamp(40px, 7vw, 80px) 0; border-top: 1px solid var(--line); }
.section-intro { color: var(--muted); max-width: 42em; margin-bottom: 2em; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card p:last-child { margin-bottom: 0; }
.card .eg { color: var(--muted); font-size: .95rem; }
.card .eg strong { color: var(--ink); font-weight: 600; }

/* Compétences */
.skills { display: grid; gap: 14px 28px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.skill h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: system-ui, sans-serif; font-weight: 600; margin-bottom: .6em; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .92rem; }

/* Parcours */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 36px 28px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); border: 3px solid var(--bg);
}
.timeline .when { color: var(--accent); font-weight: 600; font-size: .9rem; }
.timeline h3 { margin: .15em 0 .1em; }
.timeline .where { color: var(--muted); margin-bottom: .6em; }
.timeline ul { margin: 0; padding-left: 1.2em; }
.timeline li li { padding: 0; margin-bottom: .3em; }
.timeline li li::before { display: none; }

/* Chiffres */
.stats { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 2.5em; }
.stat { text-align: center; padding: 18px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat b { display: block; font-family: Georgia, serif; font-size: 2.2rem; color: var(--accent); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }

/* Contact */
.contact { text-align: center; }
.contact .card { max-width: 640px; margin-inline: auto; padding: clamp(24px, 5vw, 44px); }
.contact .mail { display: inline-block; margin-top: 8px; font-size: 1.05rem; word-break: break-all; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
footer a { color: var(--muted); }

/* Pages légales */
.legal { padding: 48px 0 24px; max-width: 46em; }
.legal h2 { margin-top: 1.6em; font-size: 1.3rem; }

/* Animations discrètes, coupées si l'utilisateur les a réduites */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .7s ease both; }
  .reveal.d1 { animation-delay: .08s; }
  .reveal.d2 { animation-delay: .16s; }
  .reveal.d3 { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* Intro vidéo (visible seulement si le script de l'en-tête a ajouté .intro-on) */
#intro { display: none; }
html.intro-on { overflow: hidden; }
html.intro-on #intro {
  display: flex; position: fixed; inset: 0; z-index: 100;
  align-items: center; justify-content: center;
  background: #E6E9ED; transition: background .3s ease, opacity .45s ease;
}
#intro.fin { background: #0F6B66; }
#intro.sortie { opacity: 0; pointer-events: none; }
#intro video { width: 100%; height: 100%; object-fit: contain; display: block; }
#intro-skip {
  position: absolute; top: 16px; right: 16px; min-height: 44px; padding: 10px 20px;
  border-radius: 8px; border: 2px solid #1D1F23; background: #FFFFFF; color: #1D1F23;
  font: 700 16px/1 system-ui, sans-serif; cursor: pointer;
}
#intro-skip:hover { background: #1D1F23; color: #FFFFFF; }
#intro-skip:focus-visible { outline: 3px solid #0F6B66; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { #intro { display: none !important; } }

.mt { margin-top: 8px; }
