/* ============ Tokens ============ */
:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-2: #eef2f6;
    --ink: #0f1b2d;
    --muted: #56677d;
    --line: #dde4ec;
    --line-strong: #c4d0dd;
    --blue: #2456e8;
    --blue-ink: #1b43bb;
    --blue-soft: #e7edfd;
    --teal: #0e8f7e;
    --teal-soft: #dff3ef;
    --amber: #b7791f;
    --danger: #c23b3b;
    --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 12px 32px rgba(15, 27, 45, .07);
    --radius-s: 8px;
    --radius: 14px;
    --radius-l: 22px;
    --shell: min(1160px, calc(100% - 48px));
    --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
    --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0b1320;
    --surface: #111c2c;
    --surface-2: #172438;
    --ink: #e6edf6;
    --muted: #93a3b8;
    --line: #22324a;
    --line-strong: #31455f;
    --blue: #7b9bff;
    --blue-ink: #a3b9ff;
    --blue-soft: #1a2a4d;
    --teal: #3cc4ae;
    --teal-soft: #12302d;
    --amber: #e0a648;
    --danger: #ff8080;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px rgba(0, 0, 0, .35);
    color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: var(--text); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; transition: background-color .25s ease, color .25s ease; }
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 650; letter-spacing: -.02em; line-height: 1.12; margin: 0; }
p { margin: 0; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: fixed; z-index: 3000; top: 10px; left: 10px; padding: 10px 14px; color: #fff; background: var(--blue); border-radius: var(--radius-s); transform: translateY(-160%); transition: transform .2s; }
.skip-link:focus { transform: none; }

/* ============ Buttons, chips, stack ============ */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 20px; border: 1px solid transparent; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.button-primary { color: #fff; background: var(--blue); }
:root[data-theme="dark"] .button-primary { color: #0b1320; }
.button-primary:hover { background: var(--blue-ink); }
.button-ghost { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.button-ghost:hover { border-color: var(--blue); color: var(--blue); }
.button:disabled { opacity: .6; cursor: wait; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.chip { padding: 8px 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; transition: color .2s, background-color .2s, border-color .2s; }
.chip span { margin-left: 4px; font-weight: 500; opacity: .7; }
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.active { color: var(--surface); background: var(--ink); border-color: var(--ink); }

.stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stack li { padding: 3px 8px; color: var(--muted); background: var(--surface-2); border-radius: 6px; font-family: var(--mono); font-size: 12px; }
.stack li.tech { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px 4px 4px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-family: var(--text); font-size: 13px; font-weight: 600; }
.tech-logo { display: grid; flex: 0 0 auto; width: 22px; height: 22px; padding: 3px; place-items: center; object-fit: contain; background: #fff; border: 1px solid rgba(15, 27, 45, .06); border-radius: 6px; }
.tech-mono { color: #475569; font-family: var(--mono); font-size: 8.5px; font-weight: 600; letter-spacing: -.02em; }
.stack-large li.tech { padding: 6px 12px 6px 6px; font-size: 14px; }
.stack-large .tech-logo { width: 26px; height: 26px; }

.badge { display: inline-block; margin-left: 8px; padding: 2px 8px; color: var(--muted); background: var(--surface-2); border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: 1px; }
.badge-new { color: var(--teal); background: var(--teal-soft); }

/* ============ Header ============ */
.site-header { position: fixed; z-index: 1000; inset: 0 0 auto; border-bottom: 1px solid transparent; transition: background-color .25s, border-color .25s; }
.site-header.scrolled, .project-page .site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); border-color: var(--line); backdrop-filter: blur(14px); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; color: #fff; background: var(--blue); border-radius: 11px 3px 11px 3px; font-family: var(--display); font-weight: 750; font-size: 15px; letter-spacing: -.04em; }
:root[data-theme="dark"] .brand-mark { color: #0b1320; }
.brand-name { font-family: var(--display); font-weight: 650; font-size: 16px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links > a { position: relative; color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; }
.nav-links > a:hover, .nav-links > a.active { color: var(--ink); }
.nav-links > a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--blue); border-radius: 2px; }
.nav-links .nav-cta { padding: 9px 16px; color: #fff; background: var(--blue); border-radius: 999px; }
:root[data-theme="dark"] .nav-links .nav-cta { color: #0b1320; }
.nav-links .nav-cta:hover { color: #fff; background: var(--blue-ink); }
.nav-links .nav-cta::after { display: none; }
.nav-tools { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.lang-switch button { min-width: 38px; height: 30px; padding: 0 9px; color: var(--muted); background: transparent; border: 0; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; }
.lang-switch button.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }
.theme-toggle { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
.theme-toggle .icon-sun, :root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 13px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; margin: 4px 0; background: var(--ink); border-radius: 2px; transition: transform .2s; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }
.back-link { color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; margin-right: 6px; }
.back-link:hover { color: var(--ink); }

/* ============ Hero ============ */
.hero { padding: 132px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 64px; align-items: center; }
.availability { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px; color: var(--muted); font-size: 15px; font-weight: 600; }
.status-dot { width: 9px; height: 9px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 4px var(--teal-soft); }
.hero h1 { max-width: 15ch; font-size: clamp(42px, 5.6vw, 76px); font-weight: 750; letter-spacing: -.022em; line-height: 1.02; }
.hero-lead { max-width: 58ch; margin-top: 26px; color: var(--muted); font-size: 19px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.portrait { margin: 0; }
.portrait img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; object-position: 62% center; border-radius: var(--radius-l); }
.portrait figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 14px; }

/* Le chemin de la donnée : le seul moment animé de l'accueil. */
.data-path { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 72px 0 0; padding: 0; list-style: none; border-top: 2px solid var(--line); counter-reset: step; }
.data-path::before { content: ""; position: absolute; top: -2px; left: 0; width: 0; height: 2px; background: linear-gradient(90deg, var(--blue), var(--teal)); animation: path-fill 1.8s .4s cubic-bezier(.6, 0, .2, 1) forwards; }
.data-path li { position: relative; display: grid; gap: 2px; padding: 22px 20px 0 0; counter-increment: step; }
.data-path li::before { content: ""; position: absolute; top: -8px; left: 0; width: 14px; height: 14px; background: var(--bg); border: 2px solid var(--line-strong); border-radius: 50%; animation: node-on .3s forwards; }
.data-path li:nth-child(1)::before { animation-delay: .45s; }
.data-path li:nth-child(2)::before { animation-delay: .9s; }
.data-path li:nth-child(3)::before { animation-delay: 1.35s; }
.data-path li:nth-child(4)::before { animation-delay: 1.8s; }
.data-path strong { font-family: var(--display); font-size: 22px; font-weight: 650; }
.data-path span { color: var(--muted); font-size: 15px; }
@keyframes path-fill { to { width: 100%; } }
@keyframes node-on { to { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 5px var(--teal-soft); } }

.stats { display: flex; flex-wrap: wrap; gap: 14px 48px; margin: 48px 0 0; }
.stats div { display: flex; align-items: baseline; gap: 10px; }
.stats dt { font-family: var(--display); font-size: 34px; font-weight: 750; letter-spacing: -.03em; }
.stats dd { margin: 0; color: var(--muted); font-size: 15px; }

/* ============ Sections ============ */
.section { padding: 112px 0; }
.section-tint { background: var(--surface); border-block: 1px solid var(--line); }
#expertise { padding: 40px 0 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: end; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(38px, 4.4vw, 60px); font-weight: 750; letter-spacing: -.025em; }
.section-head p { max-width: 54ch; color: var(--muted); font-size: 18px; }
.list-title { margin: 8px 0 18px; color: var(--muted); font-family: var(--text); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.case-list + .list-title { margin-top: 64px; }
.empty { padding: 40px; color: var(--muted); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.center { display: flex; justify-content: center; margin-top: 32px; }
.text-link { color: var(--blue); font-weight: 600; text-underline-offset: 4px; }

/* ============ Projects ============ */
.case-kind { color: var(--muted); font-size: 14px; font-weight: 600; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.case h4 a, .card h4 a { text-decoration: none; }
.card-side-link { position: relative; z-index: 2; color: var(--muted); font-size: 14px; font-weight: 600; text-underline-offset: 4px; }
.card-side-link:hover { color: var(--blue); }

.case-list { display: grid; gap: 16px; }
.case { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); transition: border-color .2s, box-shadow .2s; }
.case:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.case:hover h4 { color: var(--blue); }
.case h4 { margin: 10px 0 12px; font-size: clamp(26px, 2.6vw, 34px); transition: color .2s; }
.case-text > p:not(.case-kind) { max-width: 52ch; color: var(--muted); }
.case-actions { display: flex; align-items: center; gap: 20px; margin-top: 22px; }
.read-more { color: var(--blue); font-weight: 600; }
.case-visual { min-width: 0; }

.metrics { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 22px 0 0; }
.metrics div { display: grid; }
.metrics dt { font-family: var(--display); font-size: 28px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.metrics dd { margin: 0; color: var(--muted); font-size: 14px; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s, transform .2s; }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 20px 22px 22px; }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.03); }
.card-media-logos { display: grid; place-items: center; background-color: var(--surface-2); background-image: radial-gradient(color-mix(in srgb, var(--muted) 20%, transparent) 1px, transparent 1px); background-size: 16px 16px; }
.card-logos { display: flex; gap: 14px; }
.card-logos .tech-logo { width: 46px; height: 46px; padding: 8px; border-radius: 12px; box-shadow: var(--shadow); }
.section-tint .card { background: var(--bg); }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-3px); }
.card:hover h4 { color: var(--blue); }
.card h4 { font-size: 21px; transition: color .2s; }
.card-body > p:not(.case-kind) { color: var(--muted); font-size: 15px; flex: 1; }
.card .card-side-link { align-self: flex-start; }

/* ============ Barre d'outils des projets ============ */
.project-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 40px; }
.project-toolbar .chips { margin: 0; }
.search { position: relative; display: flex; align-items: center; width: min(100%, 320px); }
.search svg { position: absolute; left: 14px; width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; height: 44px; padding: 0 40px 0 40px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; outline: 0; transition: border-color .2s, box-shadow .2s; }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent); }
.search kbd { position: absolute; right: 12px; padding: 1px 7px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 12px; }
.project-group + .project-group { margin-top: 88px; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.group-head h3 { font-size: clamp(24px, 2.4vw, 30px); }
.group-head h3 span { margin-left: 6px; color: var(--muted); font-family: var(--text); font-size: 15px; font-weight: 600; }
.group-head p { color: var(--muted); font-size: 15px; }
.case-list + .project-grid { margin-top: 16px; }

/* ============ Schéma d'architecture (page projet) ============ */
.arch-stages { display: grid; grid-template-columns: repeat(var(--steps), minmax(0, 1fr)); gap: 36px; margin: 0; padding: 0; list-style: none; }
.arch-stage { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.arch-stage:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); box-shadow: var(--shadow); }
.arch-stage header { display: flex; align-items: baseline; gap: 8px; }
.arch-num { flex: 0 0 auto; color: var(--blue); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.arch-stage h3 { font-size: 16px; line-height: 1.25; }
.arch-stage p, .arch-branch p, .arch-band p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.arch-tech { flex-direction: column; align-items: stretch; gap: 6px; }
.arch-tech li.tech { width: 100%; background: var(--bg); }
.arch-branches { display: grid; gap: 10px; }
.arch-branch { display: grid; gap: 8px; padding: 12px; background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 12px; }
.arch-branch h4 { font-size: 14px; }
.arch-branch .arch-tech li.tech { background: var(--surface); }
/* Liaison entre deux étapes : des pointillés qui avancent, puis une flèche. */
.arch-stage:not(:last-child)::after { content: ""; position: absolute; top: 28px; left: calc(100% + 1px); width: 28px; height: 2px; background: repeating-linear-gradient(90deg, var(--teal) 0 6px, transparent 6px 12px); background-size: 12px 2px; animation: arch-flow-x .7s linear infinite; }
.arch-stage:not(:last-child)::before { content: ""; position: absolute; top: 24px; left: calc(100% + 28px); border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid var(--teal); }
@keyframes arch-flow-x { to { background-position: 12px 0; } }
@keyframes arch-flow-y { to { background-position: 0 12px; } }
.arch-bands { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 22px; }
.arch-band { display: grid; align-content: start; gap: 10px; padding: 16px 18px; background: color-mix(in srgb, var(--teal) 6%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--teal) 55%, var(--line)); border-radius: 16px; }
.arch-band strong { font-family: var(--display); font-size: 15px; }
.arch-band .arch-tech { flex-direction: row; flex-wrap: wrap; }
.arch-band .arch-tech li.tech { width: auto; }

/* ============ Schéma compact (cartes de l'accueil) ============ */
.arch-compact { display: grid; gap: 0; margin: 0; padding: 18px 20px; list-style: none; background: var(--surface-2); border-radius: var(--radius); }
.arch-compact li { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; }
.arch-compact li + li { border-top: 1px dashed var(--line-strong); }
.arch-row-title { font-size: 14px; font-weight: 600; }
.arch-row-logos { display: flex; gap: 6px; }
.arch-row-logos .tech-logo { width: 26px; height: 26px; padding: 4px; border-radius: 7px; }

/* ============ Progression de lecture et retour en haut ============ */
.scroll-progress { position: fixed; z-index: 1100; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--blue), var(--teal)); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.to-top { position: fixed; z-index: 900; right: 24px; bottom: 24px; display: grid; width: 46px; height: 46px; place-items: center; padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; box-shadow: var(--shadow); cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s; }
.to-top.visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Skills ============ */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.skills article { padding: 34px 32px 36px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color .25s; }
.skills article:nth-child(3n) { border-right: 0; }
.skills article:nth-last-child(-n + 3) { border-bottom: 0; }
.skills article:hover { background: color-mix(in srgb, var(--blue-soft) 45%, var(--surface)); }
.skill-domain { color: var(--blue); font-family: var(--mono); font-size: 12px; }
.skills h3 { margin-top: 26px; font-size: 24px; }
.skills p { margin: 10px 0 20px; color: var(--muted); font-size: 16px; }
.section-tint .skills { background: var(--bg); }

/* ============ Journey ============ */
.journey { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 80px; align-items: start; }
.journey-intro { position: sticky; top: 112px; }
.journey-intro h2 { font-size: clamp(38px, 4.4vw, 60px); font-weight: 750; letter-spacing: -.025em; }
.journey-intro p { margin: 18px 0 22px; color: var(--muted); font-size: 18px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline > li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; padding: 30px 0; border-top: 1px solid var(--line); }
.timeline > li:first-child { border-top: 0; padding-top: 0; }
.when { display: grid; gap: 6px; align-content: start; }
.when time { color: var(--muted); font-size: 14px; }
.when span { justify-self: start; padding: 2px 9px; color: var(--blue); background: var(--blue-soft); border-radius: 999px; font-size: 13px; font-weight: 600; }
.org { color: var(--muted); font-size: 15px; font-weight: 600; }
.role { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 18px; }
.role > :not(.org-logo) { grid-column: 2; }
.org-logo { grid-row: 1 / span 6; width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 14px; object-fit: cover; background: #fff; }
.timeline h3 { margin: 4px 0 8px; font-size: 24px; }
.timeline > li > div:last-child > p:not(.org) { margin-bottom: 14px; color: var(--muted); }

/* ============ Certifications ============ */
.cert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cert-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.cert-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.cert-visual { display: grid; place-items: center; aspect-ratio: 16 / 10; padding: 12px; background: var(--surface-2); }
.cert-visual img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.cert-caption { display: grid; gap: 4px; padding: 16px 18px 18px; }
.cert-caption small { color: var(--muted); font-size: 13px; font-weight: 600; }
.cert-caption strong { font-family: var(--display); font-size: 17px; font-weight: 650; line-height: 1.25; }
.cert-partners { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.cert-partners .tech-logo { width: 20px; height: 20px; padding: 2px; border-radius: 5px; }
.cert-partners > span:last-child { margin-left: 3px; }


/* Fiche générée pour les certificats dont l'image d'origine est trop petite. */
.cert-face { --accent: #2456e8; position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 100%; height: 100%; padding: 18px 20px 18px 26px; overflow: hidden; color: #10213a; background: #fbfaf7; border: 1px solid #e3e0d8; border-radius: 6px; text-align: left; }
.cert-face::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--accent); }
.cert-face-ai { --accent: #0e8f7e; }
.cert-face-cloud { --accent: #6b4fd8; }
.cert-face-dev { --accent: #b7791f; }
.cert-seal { position: absolute; top: 14px; right: 14px; display: grid; width: 38px; height: 38px; place-items: center; color: var(--accent); border: 2px solid currentColor; border-radius: 50%; font-family: var(--display); font-size: 13px; font-weight: 750; }
.cert-face-type { color: #6a7486; font-size: 11px; font-weight: 600; }
.cert-face strong { padding-right: 40px; font-family: var(--display); font-size: clamp(15px, 1.6vw, 19px); font-weight: 650; line-height: 1.2; }
.cert-face-meta { color: #4f5b6d; font-size: 12px; }
.cert-face-owner { margin-top: 4px; font-family: var(--display); font-size: 13px; font-weight: 650; }
.cert-figure .cert-face { aspect-ratio: 16 / 10; height: auto; max-width: 620px; }

/* ============ Dialogs ============ */
.viewer { width: min(1180px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: 0 30px 90px rgba(0, 0, 0, .35); overflow: auto; }
.viewer::backdrop { background: rgba(6, 12, 22, .78); backdrop-filter: blur(6px); }
.viewer[open] { animation: viewer-in .22s ease-out; }
@keyframes viewer-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.viewer-bar { position: sticky; z-index: 2; top: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; padding: 0; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.icon-button:disabled { opacity: .35; cursor: default; }
.viewer-close { margin-left: 8px; }
.cert-detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .9fr); gap: 32px; padding: 0 32px 32px; }
.cert-figure { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 320px; margin: 0; padding: 20px; background: var(--surface-2); border-radius: var(--radius); }
.cert-figure .cert-full { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 6px 24px rgba(15, 27, 45, .12); }
.lowres { display: flex; align-items: center; gap: 12px; max-width: 620px; color: var(--muted); font-size: 13px; }
.cert-info { display: grid; align-content: start; gap: 14px; padding-top: 8px; }
.cert-info h2 { font-size: 30px; }
.cert-info dl { display: grid; gap: 14px; margin: 6px 0 8px; }
.cert-info dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.cert-info dd { margin: 4px 0 0; }
.related { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.related a { color: var(--blue); font-weight: 600; text-underline-offset: 4px; }
.cert-info .button { justify-self: start; }
.viewer-image { width: auto; max-width: calc(100% - 24px); }
.image-full { margin: 0; padding: 0 20px 20px; }
.image-full img { margin-inline: auto; border-radius: var(--radius-s); }
.image-full figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; text-align: center; }

/* ============ Contact ============ */
.contact { background: var(--ink); color: var(--bg); }
:root[data-theme="dark"] .contact { background: #050b14; color: var(--ink); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); gap: 72px; align-items: start; }
.contact h2 { max-width: 14ch; font-size: clamp(38px, 4.6vw, 62px); font-weight: 750; letter-spacing: -.025em; }
.contact-copy > p { max-width: 48ch; margin-top: 20px; opacity: .78; font-size: 18px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 34px; }
.email { font-family: var(--display); font-size: clamp(19px, 2.2vw, 26px); font-weight: 650; text-underline-offset: 6px; overflow-wrap: anywhere; }
.copy-button { padding: 7px 14px; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: .8; cursor: pointer; }
.copy-button:hover { opacity: 1; }
.copy-status { font-size: 14px; color: #6fe0cc; }
.contact-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 40px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(255, 255, 255, .16); }
.contact-links li { border-bottom: 1px solid rgba(255, 255, 255, .16); }
.contact-links a { display: grid; gap: 2px; padding: 16px 12px 16px 0; text-decoration: none; }
.contact-links a:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.contact-links span { font-size: 13px; opacity: .65; }
.contact-links strong { font-weight: 600; overflow-wrap: anywhere; }
:root:not([data-theme="dark"]) .contact-links, :root:not([data-theme="dark"]) .contact-links li { border-color: rgba(255, 255, 255, .16); }
.contact-form { display: grid; gap: 18px; padding: 30px; color: var(--ink); background: var(--surface); border-radius: var(--radius-l); }
.contact-form h3 { font-size: 26px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea { width: 100%; padding: 13px 14px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-s); outline: 0; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.field small { color: var(--muted); font-size: 13px; }
.counter { text-align: right; }
.was-validated input:invalid, .was-validated textarea:invalid { border-color: var(--danger); }
.form-submit { width: 100%; }
.feedback { padding: 11px 14px; border-radius: var(--radius-s); font-size: 14px; font-weight: 600; }
.feedback.success { color: #0a6b49; background: #ddf6ea; }
.feedback.error { color: #8d2424; background: #fde8e8; }
.form-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ============ Footer ============ */
.footer { padding: 28px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 14px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-nav a { text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--ink); }

/* ============ Project page ============ */
.project-main { padding: 128px 0 96px; }
.study-head { max-width: 860px; }
.study-head h1 { margin: 14px 0 18px; font-size: clamp(42px, 6vw, 80px); font-weight: 750; letter-spacing: -.025em; line-height: 1.02; }
.study-lead { max-width: 60ch; color: var(--muted); font-size: 21px; line-height: 1.5; }
.study-flow { margin-top: 64px; padding: 36px; background-color: var(--surface-2); background-image: radial-gradient(color-mix(in srgb, var(--muted) 22%, transparent) 1px, transparent 1px); background-size: 18px 18px; border: 1px solid var(--line); border-radius: var(--radius-l); }
.study-flow h2, .study-body h2, .gallery-section h2 { margin-bottom: 22px; color: var(--muted); font-family: var(--text); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.metrics-large { gap: 20px 56px; margin: 48px 0 0; padding: 0 4px; }
.metrics-large dt { font-size: clamp(34px, 4vw, 48px); }
.metrics-large dd { font-size: 15px; }
.study-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; margin-top: 72px; }
.study-body section:nth-child(2) { grid-row: span 2; }
.study-body p { color: var(--ink); font-size: 18px; max-width: 60ch; }
.built { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.built li { position: relative; padding-left: 22px; font-size: 17px; }
.built li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: var(--teal); border-radius: 2px; }
.gallery-section { margin-top: 80px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shot { margin: 0; }
.shot-wide { grid-column: 1 / -1; }
.shot button { display: block; width: 100%; padding: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); cursor: zoom-in; }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #fff; transition: transform .3s; }
.shot-wide img { aspect-ratio: auto; max-height: 620px; }
.shot button:hover img { transform: scale(1.015); }
.shot figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 88px; }
.pager a { display: grid; gap: 4px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .2s; }
.pager a:last-child { text-align: right; }
.pager a:hover { border-color: var(--blue); }
.pager span { color: var(--muted); font-size: 14px; }
.pager strong { font-family: var(--display); font-size: 20px; font-weight: 650; }
.not-found { display: grid; justify-items: start; gap: 24px; padding: 80px 0; }

/* ============ Responsive ============ */
@media (max-width: 1000px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, .7fr); gap: 40px; }
    .case { grid-template-columns: 1fr; gap: 28px; }
    .project-grid, .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .skills article, .skills article:nth-child(3n), .skills article:nth-last-child(-n + 3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
    .skills article:nth-child(2n) { border-right: 0; }
    .skills article:nth-last-child(-n + 2) { border-bottom: 0; }
    .journey { grid-template-columns: 1fr; gap: 40px; }
    .journey-intro { position: static; }
    .contact-grid { grid-template-columns: 1fr; gap: 48px; }
    .cert-detail { grid-template-columns: 1fr; }
    .arch-stages { grid-template-columns: 1fr; gap: 30px; }
    .arch-tech { flex-direction: row; flex-wrap: wrap; }
    .arch-tech li.tech { width: auto; }
    .arch-stage:not(:last-child)::after { top: 100%; left: 30px; width: 2px; height: 22px; margin-top: 1px; background: repeating-linear-gradient(180deg, var(--teal) 0 6px, transparent 6px 12px); background-size: 2px 12px; animation-name: arch-flow-y; }
    .arch-stage:not(:last-child)::before { top: calc(100% + 22px); left: 26px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--teal); border-bottom: 0; }
}

@media (max-width: 820px) {
    .menu-toggle { display: block; }
    .nav-links { position: fixed; inset: 72px 0 auto; display: grid; gap: 0; padding: 12px 24px 24px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); transform: translateY(-120%); visibility: hidden; transition: transform .25s, visibility .25s; }
    .nav-links.open { transform: none; visibility: visible; }
    .nav-links > a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
    .nav-links > a.active::after { display: none; }
    .nav-tools { padding: 16px 0; }
    .nav-links .nav-cta { margin-top: 4px; padding: 14px; text-align: center; border-bottom: 0; }
    .hero { padding-top: 112px; }
    .hero-grid { grid-template-columns: 1fr; }
    .portrait { max-width: 520px; }
    .portrait img { aspect-ratio: 4 / 3; }
    .section-head { grid-template-columns: 1fr; gap: 16px; }
    .data-path { grid-template-columns: repeat(2, 1fr); row-gap: 28px; border-top: 0; }
    .data-path::before { display: none; }
    .data-path li { padding-top: 26px; border-top: 2px solid var(--line); }
    .study-body { grid-template-columns: 1fr; gap: 40px; }
    .study-body section:nth-child(2) { grid-row: auto; }
}

@media (max-width: 600px) {
    :root { --shell: calc(100% - 32px); }
    body { font-size: 16px; }
    .section { padding: 80px 0; }
    .brand-name { display: none; }
    .nav-tools-standalone .back-link span:last-child { display: none; }
    .hero-actions { display: grid; }
    .hero-actions .button { width: 100%; }
    .data-path strong { font-size: 19px; }
    .stats { gap: 12px 28px; }
    .stats dt { font-size: 28px; }
    .case { padding: 22px; }
    .project-grid, .cert-grid, .skills { grid-template-columns: 1fr; }
    .search { width: 100%; }
    .to-top { right: 16px; bottom: 16px; }
    .skills article, .skills article:nth-child(n) { padding: 26px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
    .skills article:last-child { border-bottom: 0; }
    .role { grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; }
    .org-logo { width: 44px; height: 44px; border-radius: 11px; }
    .timeline > li { grid-template-columns: 1fr; gap: 10px; }
    .contact-links { grid-template-columns: 1fr; }
    .contact-form { padding: 22px; }
    .cert-detail { padding: 0 16px 20px; gap: 20px; }
    .cert-figure { min-height: 0; padding: 12px; }
    .study-flow { padding: 20px; }
    .gallery { grid-template-columns: 1fr; }
    .pager { grid-template-columns: 1fr; }
    .pager a:last-child { text-align: left; }
    .project-main { padding-top: 104px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ============ Assistant IA ============ */
.ai-launcher { position: fixed; z-index: 950; right: 24px; bottom: 24px; display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 20px 0 16px; color: #fff; background: linear-gradient(135deg, var(--blue), color-mix(in srgb, var(--teal) 80%, var(--blue))); border: 0; border-radius: 999px; box-shadow: 0 12px 30px color-mix(in srgb, var(--blue) 35%, transparent); font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .2s, box-shadow .2s; }
:root[data-theme="dark"] .ai-launcher { color: #0b1320; }
.ai-launcher:hover { transform: translateY(-2px); }
.ai-launcher svg { width: 20px; height: 20px; fill: currentColor; }
.ai-open .ai-launcher { display: none; }
.to-top { bottom: 90px; }
.ai-panel { position: fixed; z-index: 1200; right: 24px; bottom: 24px; display: flex; flex-direction: column; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 48px)); overflow: hidden; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 70px rgba(6, 12, 22, .35); animation: viewer-in .2s ease-out; }
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; align-items: flex-start; gap: 6px; padding: 16px 14px 14px 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 12%, var(--surface)), var(--surface)); border-bottom: 1px solid var(--line); }
.ai-head div { flex: 1; }
.ai-head h2 { font-size: 18px; }
.ai-head p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.ai-icon { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 10px; font-size: 22px; line-height: 1; cursor: pointer; }
.ai-icon:hover { color: var(--ink); background: var(--surface-2); }
.ai-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-log { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.ai-empty p { color: var(--muted); font-size: 14px; }
.ai-suggestions { display: grid; gap: 8px; margin-top: 12px; }
.ai-suggestions button { padding: 10px 12px; color: var(--ink); text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; cursor: pointer; transition: border-color .2s; }
.ai-suggestions button:hover { border-color: var(--blue); }
.ai-msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.ai-user { align-self: flex-end; color: #fff; background: var(--blue); border-bottom-right-radius: 4px; }
:root[data-theme="dark"] .ai-user { color: #0b1320; }
.ai-bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.ai-bot p + p, .ai-bot ul + p, .ai-bot p + ul { margin-top: 8px; }
.ai-bot ul { margin: 0; padding-left: 18px; }
.ai-bot li + li { margin-top: 4px; }
.ai-bot code { padding: 1px 5px; background: var(--bg); border-radius: 5px; font-family: var(--mono); font-size: 12.5px; }
.ai-error { color: var(--danger); }
.ai-cite { display: inline-grid; min-width: 18px; height: 18px; margin: 0 1px; padding: 0 4px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 6px; font-size: 11px; font-weight: 700; text-decoration: none; vertical-align: 1px; }
.ai-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.ai-sources span { width: 100%; color: var(--muted); font-size: 12px; font-weight: 600; }
.ai-sources a { padding: 3px 9px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; text-decoration: none; }
.ai-sources a:hover { border-color: var(--blue); color: var(--blue); }
.ai-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ai-typing i { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; animation: ai-dot 1s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .15s; }
.ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 8px 8px 8px 14px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 16px; }
.ai-form:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 14%, transparent); }
.ai-form textarea { flex: 1; min-height: 24px; max-height: 140px; padding: 6px 0; overflow-y: hidden; color: var(--ink); background: transparent; border: 0; outline: 0; resize: none; font-size: 15px; line-height: 1.45; }
.ai-send { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; padding: 0; color: #fff; background: var(--blue); border: 0; border-radius: 12px; cursor: pointer; }
:root[data-theme="dark"] .ai-send { color: #0b1320; }
.ai-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ai-form.busy .ai-send { opacity: .5; pointer-events: none; }
.ai-note { padding: 8px 16px 12px; color: var(--muted); font-size: 11.5px; text-align: center; }
@media (max-width: 600px) {
    .ai-launcher { right: 16px; bottom: 16px; height: 46px; padding: 0 16px 0 13px; font-size: 14px; }
    .to-top { bottom: 76px; }
    .ai-panel { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; }
}

/* ============ Page projet : documentation détaillée ============ */
.brief-section { margin-top: 48px; }
.brief { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.brief li { position: relative; display: grid; align-content: start; gap: 8px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--tone, var(--blue)); border-radius: 16px; }
.brief-problem { --tone: #d9534f; }
.brief-solution { --tone: var(--blue); }
.brief-result { --tone: var(--teal); }
.brief-label { color: var(--tone); font-size: 13px; font-weight: 700; }
.brief p { font-size: 16px; line-height: 1.5; }
.brief-arrow { position: absolute; top: 50%; right: -14px; z-index: 1; display: grid; width: 24px; height: 24px; place-items: center; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 50%; font-size: 13px; transform: translateY(-50%); }

.study-layout { margin-top: 56px; }
.toc { position: sticky; z-index: 50; top: 72px; display: flex; align-items: center; gap: 14px; margin: 0 -12px 40px; padding: 10px 12px; background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); overflow-x: auto; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc p { flex: 0 0 auto; color: var(--muted); font-size: 13px; font-weight: 700; }
.toc ol { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.toc a { display: block; padding: 6px 12px; color: var(--muted); border-radius: 999px; font-size: 14px; white-space: nowrap; text-decoration: none; transition: color .2s, background-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--blue); background: var(--blue-soft); font-weight: 600; }
.study-sections { min-width: 0; }
.study-section { padding-top: 8px; scroll-margin-top: 140px; }
.study-section + .study-section { margin-top: 64px; }
.study-section > h2 { margin-bottom: 22px; font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.02em; }
.lead-text { max-width: 68ch; font-size: 18px; line-height: 1.6; }
.sub { margin: 26px 0 12px; color: var(--muted); font-family: var(--text); font-size: 15px; font-weight: 700; letter-spacing: 0; }
.pains { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pains li { position: relative; padding: 12px 16px 12px 44px; background: color-mix(in srgb, #d9534f 6%, var(--surface)); border: 1px solid color-mix(in srgb, #d9534f 22%, var(--line)); border-radius: 12px; }
.pains li::before { content: "!"; position: absolute; top: 12px; left: 14px; display: grid; width: 20px; height: 20px; place-items: center; color: #fff; background: #d9534f; border-radius: 50%; font-size: 12px; font-weight: 800; }

.steps { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.steps li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; padding-bottom: 26px; }
.steps li:not(:last-child)::before { content: ""; position: absolute; top: 44px; bottom: 0; left: 21px; width: 2px; background: linear-gradient(var(--blue), color-mix(in srgb, var(--blue) 20%, transparent)); }
.step-num { display: grid; width: 44px; height: 44px; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-family: var(--display); font-size: 17px; font-weight: 750; box-shadow: 0 0 0 6px var(--bg); }
:root[data-theme="dark"] .step-num { color: #0b1320; }
.steps h3 { margin: 9px 0 6px; font-size: 18px; }
.steps p { max-width: 68ch; color: var(--muted); }
.steps .stack { margin-top: 10px; }

.seg { display: inline-flex; margin-bottom: 18px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.seg button { padding: 8px 14px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button[aria-selected="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }
.arch-panel { padding: 28px; background-color: var(--surface-2); background-image: radial-gradient(color-mix(in srgb, var(--muted) 22%, transparent) 1px, transparent 1px); background-size: 18px 18px; border: 1px solid var(--line); border-radius: var(--radius-l); }

/* Carte des échanges */
.sysmap { position: relative; display: grid; grid-template-columns: repeat(var(--zones), minmax(0, 1fr)); gap: 96px; align-items: stretch; }
.sysmap-links { position: absolute; inset: 0; z-index: 2; overflow: visible; pointer-events: none; }
.sysmap-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.zone { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 34px; padding: 14px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px dashed var(--line-strong); border-radius: 16px; }
.zone h3 { color: var(--muted); font-family: var(--text); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.sysnode { position: relative; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 27, 45, .05); cursor: default; transition: border-color .2s, box-shadow .2s, opacity .2s; }
.sysnode .tech-logo { width: 30px; height: 30px; padding: 5px; border-radius: 8px; }
.sysnode span { display: grid; min-width: 0; }
.sysnode strong { font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.sysnode small { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.sysnode:focus-visible, .sysnode.on { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.link { fill: none; stroke-width: 1.8; transition: opacity .2s, stroke-width .2s; }
.link-data { stroke: var(--teal); stroke-dasharray: 6 5; animation: link-flow 1.2s linear infinite; }
.link-control { stroke: var(--blue); stroke-dasharray: 3 4; }
.link-monitor { stroke: var(--muted); stroke-dasharray: 1 4; stroke-linecap: round; }
.arrow-data { fill: var(--teal); }
.arrow-control { fill: var(--blue); }
.arrow-monitor { fill: var(--muted); }
@keyframes link-flow { to { stroke-dashoffset: -22; } }
.link-tag { position: absolute; padding: 1px 7px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; transform: translate(-50%, -50%); transition: opacity .2s; }
.tag-data { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.tag-control { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); }
.sysmap.focusing .link:not(.on), .sysmap.focusing .link-tag:not(.on) { opacity: .12; }
.sysmap.focusing .sysnode:not(.on) { opacity: .55; }
.sysmap.focusing .link.on { stroke-width: 2.6; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.legend span::before { content: ""; display: inline-block; width: 26px; height: 0; margin-right: 8px; vertical-align: middle; border-top: 2px dashed; }
.lg-data::before { border-color: var(--teal) !important; }
.lg-control::before { border-top-style: dotted !important; border-color: var(--blue) !important; }
.lg-monitor::before { border-top-style: dotted !important; border-color: var(--muted) !important; }
.lg-hint { margin-left: auto; font-style: italic; }
.lg-hint::before { display: none !important; }
.links-list { margin-top: 14px; font-size: 14px; }
.links-list summary { color: var(--blue); font-weight: 600; cursor: pointer; }
.links-list ul { display: grid; gap: 4px; margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.links-list strong { color: var(--ink); font-weight: 600; }

.decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.decisions article { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.decisions h3 { font-size: 16px; line-height: 1.3; }
.decisions p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.decisions p span { color: var(--blue); font-weight: 700; }
.outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.outcomes .sub { margin-top: 0; }
.outcomes-next .built li::before { background: var(--line-strong); }

/* Galerie : cadres identiques, image entière, légende numérotée */
.gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.shot button { position: relative; padding: 12px; background: #fff; border-radius: 14px; transition: border-color .2s, box-shadow .2s; }
.shot button:hover, .shot button:focus-visible { border-color: var(--blue); box-shadow: var(--shadow); }
.shot img, .shot-wide img { width: 100%; aspect-ratio: 16 / 10; max-height: none; object-fit: contain; background: #fff; }
.shot button:hover img { transform: none; }
.shot-zoom { position: absolute; right: 12px; bottom: 12px; display: grid; width: 34px; height: 34px; place-items: center; color: #fff; background: rgba(15, 27, 45, .72); border-radius: 50%; opacity: 0; transition: opacity .2s; }
.shot-zoom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.shot button:hover .shot-zoom, .shot button:focus-visible .shot-zoom { opacity: 1; }
.shot figcaption { display: flex; gap: 10px; align-items: baseline; margin-top: 10px; color: var(--ink); font-size: 14px; }
.shot figcaption span { color: var(--blue); font-family: var(--mono); font-size: 12px; }

@media (max-width: 1100px) {
    .sysmap { gap: 72px; }
}
@media (max-width: 900px) {
    .brief { grid-template-columns: 1fr; }
    .brief-arrow { top: auto; right: 50%; bottom: -14px; transform: translateX(50%) rotate(90deg); }
    /* Sur petit écran, le graphe devient une liste : les composants par zone, puis les échanges en texte. */
    .sysmap { grid-template-columns: 1fr; gap: 16px; }
    .sysmap-links, .sysmap-labels, .legend { display: none; }
    .sysmap.focusing .sysnode:not(.on) { opacity: 1; }
    .links-list summary { margin-top: 4px; }
    .links-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
    .zone { flex-direction: row; flex-wrap: wrap; gap: 10px; }
    .zone h3 { width: 100%; }
    .sysnode { flex: 1 1 180px; }
    .outcomes { grid-template-columns: 1fr; }
    .lg-hint { margin-left: 0; }
}
@media (max-width: 600px) {
    .arch-panel { padding: 16px; }
    .gallery { grid-template-columns: 1fr; }
    .study-section + .study-section { margin-top: 48px; }
}
@media (prefers-reduced-motion: reduce) { .link-data { animation: none; } }
