:root {
  --bg: #faf8f5;
  --bg-alt: #f2eee8;
  --surface: #ffffff;
  --text: #1c1a17;
  --muted: #6b655c;
  --border: #e4ded4;
  --accent: #b4532a;
  --accent-contrast: #ffffff;
  --accent-soft: #f6e4da;
  --shadow: 0 1px 2px rgba(28, 26, 23, .04), 0 8px 24px rgba(28, 26, 23, .06);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151412; --bg-alt: #1c1a17; --surface: #22201c; --text: #f1ede6; --muted: #a59e92;
    --border: #34302a; --accent: #e07a4f; --accent-contrast: #1c1a17; --accent-soft: #3a2519;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --bg: #151412; --bg-alt: #1c1a17; --surface: #22201c; --text: #f1ede6; --muted: #a59e92;
  --border: #34302a; --accent: #e07a4f; --accent-contrast: #1c1a17; --accent-soft: #3a2519;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.4rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); font-weight: 600; text-decoration: none; border: 1px solid var(--accent); cursor: pointer; font: 600 15px/1 var(--font); transition: transform .15s, opacity .15s; }
.btn:hover { transform: translateY(-1px); opacity: .92; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--small { padding: 9px 16px; font-size: 14px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.is-scrolled { border-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.nav__logo { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; text-decoration: none; }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; }
.nav__links a:not(.btn):hover { color: var(--text); }
.nav__actions { display: flex; gap: 8px; }
.nav__burger { display: none; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* Hero */
.hero { padding: 72px 0 56px; }
.hero__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: .2em; }
.hero__titre { font-size: 1.25rem; color: var(--accent); font-weight: 600; }
.hero__accroche { font-size: 1.1rem; color: var(--muted); max-width: 54ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 20px; }
.hero__lieu { color: var(--muted); font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--text); margin-bottom: 20px; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2f9e5b; box-shadow: 0 0 0 3px rgba(47,158,91,.2); }
.badge.is-busy::before { background: #c98a1b; box-shadow: 0 0 0 3px rgba(201,138,27,.2); }
.hero__visual { display: flex; justify-content: center; }
.avatar { width: min(320px, 70vw); aspect-ratio: 1; border-radius: 32% 68% 55% 45% / 45% 40% 60% 55%; background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--bg-alt))); display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow); }
.avatar span { font-family: var(--font-display); font-size: clamp(4rem, 10vw, 6rem); color: var(--accent-contrast); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.stats { list-style: none; padding: 28px 0 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; border-top: 1px solid var(--border); }
.stats strong { display: block; font-family: var(--font-display); font-size: 2.2rem; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 14px; }

/* Sections */
.section { padding: 88px 0; }
.section--alt { background: var(--bg-alt); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.about { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; }
.prose p { font-size: 1.08rem; }
.chips { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; background: var(--surface); }

/* Cards */
.grid { display: grid; gap: 20px; }
.grid--services { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--projects { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card p { color: var(--muted); margin: 0; }
.card__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }

.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project__img { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--accent-soft), var(--bg-alt)); display: grid; place-items: center; font-family: var(--font-display); font-size: 2.5rem; color: var(--accent); }
.project__img img { width: 100%; height: 100%; object-fit: cover; }
.project__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.project__meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.project__meta b { color: var(--accent); font-weight: 600; }
.project .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.project .tags span { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--bg-alt); color: var(--muted); }
.project__link { margin-top: auto; padding-top: 16px; color: var(--accent); font-weight: 600; text-decoration: none; font-size: 14px; }
.project.is-hidden { display: none; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 500 14px var(--font); cursor: pointer; }
.filters button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); max-width: 760px; }
.timeline > li { position: relative; padding: 0 0 36px 32px; }
.timeline > li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg-alt); }
.timeline .periode { font-size: 13px; font-weight: 600; color: var(--accent); }
.timeline h3 { margin: 4px 0 2px; }
.timeline .lieu { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.timeline p { color: var(--muted); margin: 0; }

.quote p { font-style: italic; color: var(--text); }
.quote footer { margin-top: 16px; font-size: 14px; color: var(--muted); }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; }
.contact__infos { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 10px; }
.contact__infos a { text-decoration: none; font-weight: 500; }
.contact__infos a:hover { color: var(--accent); }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.socials a { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-size: 14px; }
.socials a:hover { border-color: var(--accent); color: var(--accent); }
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.form input, .form textarea { font: 15px var(--font); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form .is-invalid { border-color: #c0392b; }
.form__status { margin: 0; font-size: 14px; min-height: 1.4em; }

.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 14px; color: var(--muted); }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer a { text-decoration: none; }

/* ---------- Ajouts : hero ---------- */
.hero__sous { color: var(--muted); font-weight: 500; margin-top: -.4em; }
.hero__visual { position: relative; min-height: 380px; align-items: center; }
.orbit { position: absolute; inset: 0; pointer-events: none; }
.orbit span { position: absolute; top: 50%; left: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--accent); box-shadow: var(--shadow);
  transform: rotate(calc(var(--i) * 60deg - 90deg)) translate(185px) rotate(calc(var(--i) * -60deg + 90deg)); animation: float 6s ease-in-out infinite; animation-delay: calc(var(--i) * -1s); }
@keyframes float { 50% { margin-top: -27px; } }
.domains { list-style: none; padding: 0; margin: 48px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--font-display); font-size: 1.05rem; color: var(--muted); }
.domains li { display: flex; align-items: center; gap: 10px; }
.domains li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.stats { margin-top: 28px; }
.stats span { display: block; max-width: 22ch; }
.nav__links a.is-active:not(.btn) { color: var(--text); }
.nav__links { gap: 22px; }

/* ---------- À propos ---------- */
.atouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 28px; }
.atout { padding: 18px; border-radius: 12px; background: var(--bg-alt); border-left: 3px solid var(--accent); }
.atout strong { display: block; margin-bottom: 4px; }
.atout span { color: var(--muted); font-size: 14px; }

/* ---------- Listes & tags communs ---------- */
.checks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.checks li { position: relative; padding-left: 22px; color: var(--muted); }
.checks li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.checks--small li { font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tags span { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border); }

/* ---------- Expériences ---------- */
.timeline { max-width: 880px; }
.timeline > li { padding-bottom: 28px; }
.timeline > li::before { top: 28px; }
.exp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; }
.exp h3 { font-size: 1.3rem; }
.exp .lieu strong { color: var(--text); }
.exp__resume { color: var(--text); margin: 12px 0 0; }
.exp details { margin-top: 10px; }
.exp summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; list-style: none; padding: 6px 0; }
.exp summary::-webkit-details-marker { display: none; }
.exp summary::after { content: " ↓"; }
.exp details[open] summary::after { content: " ↑"; }
.exp details .checks { margin-top: 4px; }

/* ---------- Expertises ---------- */
.grid--expertises { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.expertise { display: flex; flex-direction: column; }
.expertise .tags { margin-top: auto; padding-top: 16px; }

/* ---------- Compétences ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px 40px; }
.skill h3 { font-family: var(--font); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.skill .chips { margin-top: 14px; gap: 6px; }
.skill .chips li { font-size: 13px; padding: 5px 12px; }

/* ---------- Projets ---------- */
.grid--projects { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.project__img { position: relative; font-size: 0; }
.project__img svg { width: 100%; height: 100%; display: block; }
.project__client { font-size: 14px; color: var(--muted); margin: -4px 0 8px; font-weight: 500; }
.project .checks { margin-bottom: 4px; }
.status { position: absolute; top: 12px; left: 12px; font: 600 12px/1 var(--font); padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.92); color: #1c1a17; display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2f9e5b; }
.status--wip::before { background: #d68a12; }
.status--info::before { background: #2f7ed8; }
.filters button small { opacity: .6; margin-left: 4px; font-size: 12px; }

/* ---------- Certifications ---------- */
.grid--certs { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.cert { display: flex; gap: 18px; align-items: flex-start; text-decoration: none; }
.cert__logo { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 15px var(--font); overflow: hidden; }
.cert__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 6px; }
.cert__type { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.cert h3 { margin-bottom: 4px; }
.cert p { font-size: 14px; }

/* ---------- Services ---------- */
.service { display: flex; flex-direction: column; }
.service__cta { margin-top: auto; padding-top: 18px; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.form select { font: 15px var(--font); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .orbit span { animation: none; }
}

/* Responsive */
@media (max-width: 1080px) {
  .nav__burger { display: grid; }
  .nav__links { position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--border); transform: translateY(-120%); transition: transform .25s; visibility: hidden; }
  .nav__links.is-open { transform: none; visibility: visible; }
  .nav__links a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .nav__links .btn { margin-top: 16px; }
}
@media (max-width: 860px) {
  .container { padding: 0 16px; }
  .hero { padding: 40px 0; }
  .hero__inner, .about, .contact { grid-template-columns: 1fr; gap: 32px; }
  .hero__visual { order: -1; justify-content: flex-start; }
  .avatar { width: 140px; }
  .avatar span { font-size: 3rem; }
  .hero__visual { min-height: 0; }
  .orbit { display: none; }
  .grid--expertises, .grid--certs, .skills { grid-template-columns: 1fr; }
  .exp { padding: 20px; }
  .timeline > li { padding-left: 22px; }
  .section { padding: 64px 0; }
  .grid--projects { grid-template-columns: 1fr; }
}

/* =========================================================
   ANIMATIONS « développeur »
   ========================================================= */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #ffd36b)); transform-origin: 0 50%; transform: scaleX(0); }

/* Hero : réseau animé */
.hero { position: relative; overflow: hidden; }
.hero__net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 100%); opacity: .75; }
.hero > .container { position: relative; z-index: 1; }
.hero__inner { grid-template-columns: 1.15fr 1fr; }
.hero__visual { min-height: 0; }
.hero__id { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.hero__id .badge { margin: 0; }
.hero .avatar--sm { width: 52px; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--border); }
.hero .avatar--sm span { font-size: 1.15rem; }
.scr { color: var(--accent); opacity: .75; }
.hero__sous { font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace; font-size: 15px; color: var(--text); margin-top: -.2em; min-height: 1.6em; }
.hero__sous .prompt { color: var(--accent); font-weight: 700; }
.caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -.2em; margin-left: 2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Terminal */
.term { position: relative; width: 100%; max-width: 500px; margin-left: auto; border-radius: 14px; background: #0d1117; border: 1px solid #263041; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.02); }
.term::before { content: ""; position: absolute; inset: -30px; z-index: -1; border-radius: 40px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 35%, transparent), transparent); filter: blur(20px); opacity: .55; }
.term__bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid #1f2733; }
.term__bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__bar span:nth-child(2) { background: #febc2e; }
.term__bar span:nth-child(3) { background: #28c840; }
.term__bar em { margin-left: 10px; font: 12px ui-monospace, Consolas, monospace; color: #6e7b8f; font-style: normal; }
.term__body { height: 330px; overflow: hidden; padding: 16px 18px; font: 13px/1.65 ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace; color: #c9d4e3; white-space: pre-wrap; word-break: break-word; }
.t-user { color: #7ee787; } .t-path { color: #79c0ff; } .t-dim { color: #6e7b8f; } .t-ok { color: #7ee787; } .t-out { color: #c9d4e3; }
.t-caret { display: inline-block; width: 8px; height: 15px; vertical-align: -3px; background: #c9d4e3; animation: blink 1s steps(1) infinite; }

/* Défilement continu des technologies */
.marquee { display: flex; overflow: hidden; margin-top: 56px; padding: 14px 0; border-block: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { flex: none; display: flex; gap: 36px; padding-right: 36px; animation: marquee 70s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span { white-space: nowrap; font: 500 14px ui-monospace, Consolas, monospace; color: var(--muted); display: inline-flex; align-items: center; gap: 36px; }
.marquee__track span::after { content: "/"; color: var(--accent); opacity: .6; }
@keyframes marquee { to { transform: translateX(-100%); } }
.stats { border-top: 0; }

/* Entrée du hero */
.anim .hero__text > *, .anim .hero__visual { animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }
.anim .hero__text > :nth-child(2) { animation-delay: .05s; }
.anim .hero__text > :nth-child(3) { animation-delay: .15s; }
.anim .hero__text > :nth-child(4) { animation-delay: .25s; }
.anim .hero__text > :nth-child(5) { animation-delay: .35s; }
.anim .hero__text > :nth-child(6) { animation-delay: .45s; }
.anim .hero__text > :nth-child(7) { animation-delay: .55s; }
.anim .hero__visual { animation-delay: .3s; animation-duration: 1.1s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* Titres : balayage */
/* Titres visibles par défaut ; le balayage est joué une fois en animation, sans jamais pouvoir les laisser masqués */
.anim .section h2.is-in { animation: wipe 1s cubic-bezier(.7,0,.2,1) both; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.anim .section h2.is-done { animation: none; }

/* Cartes : lumière qui suit la souris */
.card, .exp { position: relative; isolation: isolate; }
.card::before, .exp::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 45%); }
.card:hover::before, .exp:hover::before { opacity: 1; }
.card:hover, .exp:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card { will-change: transform; transform-style: preserve-3d; }
.card__icon { transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.card:hover .card__icon { transform: translateZ(20px) rotate(-6deg) scale(1.08); }

/* Illustrations des projets : paquets qui circulent, LED qui clignotent */
.project__img { overflow: hidden; }
.project__img svg, .project__img img { transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.project:hover .project__img svg, .project:hover .project__img img { transform: scale(1.05); }
.anim .project__img svg [stroke-dasharray] { animation: packets 4s linear infinite; }
@keyframes packets { to { stroke-dashoffset: -72; } }
.anim .project__img svg circle[fill="#22c55e"] { animation: led 1.6s ease-in-out infinite; }
.anim .project__img svg circle[fill="#38bdf8"] { animation: led 1.1s steps(2) infinite; }
@keyframes led { 50% { opacity: .25; } }

/* Lien de navigation actif : soulignement animé */
.nav__links a:not(.btn) { position: relative; }
.nav__links a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.nav__links a.is-active:not(.btn)::after, .nav__links a:not(.btn):hover::after { transform: scaleX(1); }

/* Boutons : reflet */
.btn { position: relative; overflow: hidden; transition: transform .2s cubic-bezier(.2,.8,.2,1), opacity .15s; }
.btn:not(.btn--ghost)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-120%); }
.btn:not(.btn--ghost):hover::after { transform: translateX(120%); transition: transform .7s; }

/* Puce de la chronologie : pulsation */
.anim .timeline > li::before { animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 4px var(--bg-alt), 0 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent); } 100% { box-shadow: 0 0 0 4px var(--bg-alt), 0 0 0 14px transparent; } }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { order: 0; }
  .term { margin: 0; max-width: none; }
  .term__body { height: 290px; font-size: 12px; padding: 14px; }
  .hero__net { opacity: .5; }
  .marquee { margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee__track { animation: none; flex-wrap: wrap; flex: 1 1 auto; row-gap: 8px; }
  .marquee__track[aria-hidden] { display: none; }
  .caret, .t-caret { animation: none; }
}

/* =========================================================
   CERTIFICATIONS PROFESSIONNELLES
   ========================================================= */
.certs__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.certs__bar .filters { margin: 0; }
#certFilters button i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--org); margin-right: 7px; vertical-align: 1px; }
.sort-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 500 14px var(--font); cursor: pointer; }
.sort-btn:hover { color: var(--text); border-color: var(--accent); }
.sort-btn svg { transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.sort-btn.is-asc svg { transform: scaleY(-1); }

.grid--certifs { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.certif { padding: 0; overflow: hidden; display: flex; flex-direction: column; cursor: default; }
.certif[tabindex] { cursor: pointer; }
.certif.is-hidden { display: none; }
.certif::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--org); }

/* Aperçu façon « certificat papier » */
.certif__paper { position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--org) 22%, var(--bg-alt)), var(--bg-alt)); }
.certif__paper > img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.paper { position: relative; width: 72%; aspect-ratio: 1.414; background: #fffdf8; color: #2a2620; border-radius: 3px; padding: 7% 8%;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 14px 30px -12px rgba(0,0,0,.35); border: 1px solid rgba(0,0,0,.06);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px;
  transform: rotate(-2deg) translateY(10px); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.paper::before { content: ""; position: absolute; inset: 5px; border: 1px solid color-mix(in srgb, var(--org) 45%, transparent); border-radius: 2px; pointer-events: none; }
.paper__ribbon { position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--org); }
.paper__kicker { font: 600 7px/1 var(--font); letter-spacing: .25em; text-transform: uppercase; color: #8a8174; margin-top: 2px; }
.paper__title { font: 600 clamp(11px, 1.4vw, 14px)/1.15 var(--font-display); color: #1c1a17; max-width: 95%; }
.paper__line { width: 60%; height: 3px; border-radius: 2px; background: #e6e0d6; }
.paper__line--short { width: 40%; }
.paper__name { font: italic 500 10px var(--font-display); color: #4a443b; margin-top: auto; }
.paper__seal { position: absolute; right: 8%; bottom: 10%; width: 26px; height: 26px; border-radius: 50%; background: var(--org); color: #fff; display: grid; place-items: center; font: 700 8px var(--font); box-shadow: 0 0 0 3px color-mix(in srgb, var(--org) 25%, transparent); overflow: hidden; }
.paper__seal img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.certif:hover .paper { transform: rotate(0deg) translateY(2px) scale(1.04); }
.certif:hover .certif__paper > img { transform: scale(1.05); }
.certif__badge { position: absolute; top: 12px; right: 12px; font: 600 12px/1 var(--font); padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.92); color: #1c1a17; text-transform: capitalize; }

.certif__body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.certif__org { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.certif__logo { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--org); color: #fff; display: grid; place-items: center; font: 700 11px var(--font); overflow: hidden; }
.certif__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.certif h3 { font-size: 1.08rem; line-height: 1.3; margin-bottom: 8px; }
.certif p { font-size: 14px; }
.certif__date { font-size: 13px; color: var(--muted); margin-top: 12px; }
.certif__date::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--org); margin-right: 7px; vertical-align: 1px; }
.certif__actions { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.certif__na { font-size: 13px; }
.certs__formations { margin: 28px 0 0; font-size: 14px; color: var(--muted); }
.certs__formations strong { color: var(--text); font-weight: 600; }

/* Fenêtre modale */
.modal-open { overflow: hidden; }
.modal { width: min(1000px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 40px 80px -20px rgba(0,0,0,.5); overflow: hidden; }
.modal::backdrop { background: rgba(10, 9, 8, .72); backdrop-filter: blur(6px); }
.modal[open] { animation: modalIn .35s cubic-bezier(.2,.8,.2,1); }
.modal[open]::backdrop { animation: fadeIn .3s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
@keyframes fadeIn { from { opacity: 0; } }
.modal__inner { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
.modal__head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); border-top: 4px solid var(--org); }
.modal__head .certif__logo { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; }
.modal__titles { flex: 1; min-width: 0; }
.modal__titles .certif__org { margin: 0 0 2px; }
.modal__titles h3 { margin: 0; font-size: 1.15rem; }
.modal__titles .certif__date { margin-top: 4px; }
.modal__body { flex: 1; min-height: 0; background: var(--bg-alt); display: grid; place-items: center; overflow: auto; }
.modal__body iframe { width: 100%; height: min(70dvh, 720px); border: 0; display: block; background: #fff; }
.modal__body img { max-width: 100%; max-height: 70dvh; object-fit: contain; display: block; margin: 0 auto; }
.modal__fallback { padding: 48px 24px; text-align: center; display: grid; justify-items: center; gap: 16px; }
.modal__fallback .certif__logo { width: 56px; height: 56px; border-radius: 16px; font-size: 16px; }
.modal__fallback p { margin: 0; color: var(--muted); }
.modal__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal__foot p { margin: 0; font-size: 14px; flex: 1 1 280px; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 860px) {
  .grid--certifs { grid-template-columns: 1fr; }
  .modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .modal__head { padding: 12px 14px; }
  .modal__foot { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .modal[open], .modal[open]::backdrop { animation: none; }
  .paper, .certif__paper > img { transition: none; }
}

/* =========================================================
   PHOTO « À PROPOS » + AVATAR
   ========================================================= */
.hero .avatar--sm img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(2.3); transform-origin: 50% 9%; }
/* Ordinateur : « À propos » en haut à gauche, titre en haut à droite, photo alignée sur le texte */
.about { align-items: start; }
.about__side { position: sticky; top: 96px; }
.about__side .eyebrow { margin: .9em 0 0; }
.about__photo { margin-top: 18px; }
.about__photo { position: relative; margin: 28px 0 0; max-width: 340px; }
.about__photo::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: 0; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, var(--accent) 10%, transparent) 70%); }
.about__photo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); }
.about__photo img { position: relative; display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(#000 78%, transparent 100%); mask-image: linear-gradient(#000 78%, transparent 100%); }
.anim .about__photo img { transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.about__photo:hover img { transform: translateY(-6px); }

/* =========================================================
   PAGE PLUS COURTE
   ========================================================= */
.section { padding: 76px 0; }
.swipe-hint { display: none; }

@media (max-width: 860px) {
  .section { padding: 48px 0; }
  h2 { margin-bottom: 1.1rem; }
  .hero { padding: 28px 0 32px; }
  .hero__cta { margin: 20px 0 14px; }
  .term__body { height: 220px; }
  .marquee { margin-top: 28px; }
  .stats { margin-top: 20px; padding-top: 16px; gap: 16px; }
  .stats strong { font-size: 1.8rem; }

  /* À propos : photo à côté du titre */
  .about { gap: 0; }
  .about__side { position: static; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
  .about__side .eyebrow { margin: 0 0 6px; }
  .about__photo { width: 128px; flex: none; margin: 0; }
  .about__main h2 { font-size: 1.5rem; margin: 10px 0 14px; }
  .about__photo { grid-area: photo; margin: 0; }
  .prose p { font-size: 1rem; margin-bottom: .8em; }

  /* Carrousels horizontaux au lieu de longues colonnes */
  .grid--expertises, .grid--projects, .grid--certifs, .grid--services, .atouts {
    display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; gap: 14px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
    margin-left: -16px; margin-right: -16px; padding: 4px 16px 14px; scrollbar-width: none; }
  .grid--expertises::-webkit-scrollbar, .grid--projects::-webkit-scrollbar, .grid--certifs::-webkit-scrollbar, .grid--services::-webkit-scrollbar, .atouts::-webkit-scrollbar { display: none; }
  .grid--expertises > *, .grid--projects > *, .grid--certifs > *, .grid--services > *, .atouts > * { scroll-snap-align: start; }
  .atouts { grid-auto-columns: 72%; margin-top: 18px; }
  .card { padding: 22px; }
  .project, .certif { padding: 0; }
  .project__body, .certif__body { padding: 18px; }
  .project .checks li:nth-child(n+4) { display: none; }
  .swipe-hint { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin: -4px 0 10px; }
  .swipe-hint span::after { content: " →"; color: var(--accent); }
  .swipe-hint b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }

  /* Compétences : une ligne défilante par groupe */
  .skills { gap: 14px; }
  .skill h3 { padding-bottom: 6px; }
  .skill .chips { flex-wrap: nowrap; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
  .skill .chips::-webkit-scrollbar { display: none; }
  .skill .chips li { flex: none; }

  /* Expériences et certifications plus compactes */
  .exp { padding: 18px; }
  .exp__resume { font-size: 15px; }
  .timeline > li { padding-bottom: 18px; }
  .certs__bar { margin-bottom: 16px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; }
  .certs__bar { flex-wrap: nowrap; }
  .certs__bar .filters { flex: 1; min-width: 0; margin-right: 0; }
  .sort-btn span { display: none; }
  .contact { gap: 24px; }
}

/* Empêche les éléments défilants (carrousels, lignes de compétences) d'élargir leur colonne et la page */
.hero__inner > *, .about > *, .skills > *, .contact > *, .grid > * { min-width: 0; }
.skills { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
@media (max-width: 860px) { .skills { grid-template-columns: minmax(0, 1fr); } }
html, body { overflow-x: clip; }

/* ---------- Logo DOUTECHPRO (une version par thème) ---------- */
.nav__logo--img { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.nav__logo--img img { height: 44px; width: auto; display: block; }
.nav__logo--img .logo--sombre { display: none; }
:root[data-theme="dark"] .nav__logo--img .logo--clair { display: none; }
:root[data-theme="dark"] .nav__logo--img .logo--sombre { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav__logo--img .logo--clair { display: none; }
  :root:not([data-theme="light"]) .nav__logo--img .logo--sombre { display: block; }
}
@media (max-width: 860px) { .nav__logo--img img { height: 36px; } }
@media (max-width: 360px) { .nav__logo--img img { height: 30px; } }

/* ---------- Aperçus réels des certificats : feuille entière posée ---------- */
.certif__paper > img { width: 66%; height: auto; object-fit: contain; border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 14px 30px -12px rgba(0,0,0,.45); border: 1px solid rgba(0,0,0,.06);
  transform: rotate(-2deg) translateY(5px); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.certif:hover .certif__paper > img { transform: rotate(0deg) translateY(2px) scale(1.06); }
