/* ================= Couleurs ================= */
:root {
  --navy: #0b1d3a;
  --navy-2: #142d57;
  --accent: #3b82f6;
  --accent-text: #1d4ed8;

  --page: #e8edf4;          /* fond de page */
  --card: #f3f6fa;          /* case au repos */
  --card-hover: #ffffff;    /* case survolée : plus claire */
  --border: #d6dee9;
  --text: #0f1b2d;
  --muted: #5a6779;
  --chip: #e2e9f3;
  --chip-hover: #d3def0;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #08111f;
    --card: #111d31;
    --card-hover: #1b2b47;
    --border: #1f2f4a;
    --text: #e6ecf5;
    --muted: #93a1b8;
    --chip: #1a2840;
    --chip-hover: #243759;
    --accent-text: #7fb0ff;
    color-scheme: dark;
  }
}

/* ================= Base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ================= Bandeau bleu foncé ================= */
.banner {
  background:
    radial-gradient(1000px 400px at 85% -10%, rgba(59,130,246,.35), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
  position: sticky; top: 0; z-index: 20;
}
header.banner { position: relative; }
header.banner .nav { position: relative; }
.nav.stuck {
  position: fixed; left: 0; right: 0; max-width: none;
  background: rgba(11,29,58,.92); backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  padding: 0 max(24px, calc((100vw - 1100px) / 2 + 24px));
}
.logo { color: #fff; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.nav-links { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-links a {
  color: rgba(255,255,255,.78); padding: 8px 14px; border-radius: 8px; font-size: .95rem;
  transition: background .2s, color .2s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.1); }
.nav-links .nav-cta { background: var(--accent); color: #fff; }
.nav-links .nav-cta:hover { background: #2f6fde; }
.menu-btn { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; }

.hero {
  display: flex; align-items: center; gap: 44px;
  padding-top: 48px; padding-bottom: 72px;
}
.avatar {
  width: 190px; height: 190px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 4px solid rgba(255,255,255,.15);
  box-shadow: 0 0 0 8px rgba(59,130,246,.18), 0 20px 40px rgba(0,0,0,.35);
}
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: rgba(34,197,94,.15); color: #86efac; border: 1px solid rgba(34,197,94,.3);
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 800; letter-spacing: -.03em; margin-top: 14px; }
.role { font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: #a9c6ff; margin-top: 6px; font-weight: 500; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; color: rgba(255,255,255,.75); font-size: .93rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-actions, .footer-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }

/* ================= Sections ================= */
.section { padding: 56px 0 8px; }
.title {
  font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.title::before { content: ""; width: 6px; height: 24px; border-radius: 3px; background: var(--accent); }
.title.small { font-size: 1.15rem; margin-bottom: 18px; }
.title.small::before { height: 18px; }
.intro { color: var(--muted); margin: -12px 0 22px; }

/* ================= Cases ================= */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  transition: background-color .25s ease, transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  background: var(--card-hover);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(11,29,58,.12);
}
@media (prefers-color-scheme: dark) { .card:hover { box-shadow: 0 14px 34px rgba(0,0,0,.4); } }
.card h3 { font-size: 1.1rem; }
.org { color: var(--muted); font-size: .92rem; margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stack { display: grid; gap: 16px; }

/* Profil */
.profile-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.profile-text p + p { margin-top: 14px; }
.profile-text p { color: var(--muted); font-size: 1.02rem; }
.profile-text strong { color: var(--text); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fact { padding: 18px; display: flex; flex-direction: column; justify-content: center; }
.fact b { font-size: 1.45rem; color: var(--accent-text); letter-spacing: -.02em; }
.fact span { color: var(--muted); font-size: .86rem; margin-top: 2px; }

/* Expérience */
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pill {
  display: inline-block; white-space: nowrap;
  font-size: .8rem; font-weight: 650; padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text);
}
.ticks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 26px; color: var(--muted); }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: .55em;
  width: 9px; height: 5px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-weight: 600; font-size: .92rem; }
.links a:hover { text-decoration: underline; }
.links a::after { content: " →"; }

/* Compétences */
.skill-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  background: linear-gradient(150deg, var(--navy), var(--navy-2)); color: #8fb6ff;
}
.skill h3 { margin-bottom: 14px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.chips li {
  background: var(--chip); border-radius: 8px; padding: 4px 10px; font-size: .84rem;
  transition: background .2s;
}
.card:hover .chips li { background: var(--chip-hover); }

/* Projets */
.project { display: flex; flex-direction: column; gap: 10px; }
.project p { color: var(--muted); font-size: .94rem; }
.project .links { margin-top: auto; padding-top: 6px; }
.kicker { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.thumb { margin-top: 6px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { transition: transform .4s; }
.thumb:hover img { transform: scale(1.04); }

/* Formation */
.edu h3 { margin: 14px 0 6px; }
.edu p { color: var(--muted); }
.edu .org { margin-top: 10px; }

/* Langues */
.langs { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.langs li { display: grid; grid-template-columns: 90px 1fr 80px; align-items: center; gap: 14px; }
.langs em { font-style: normal; color: var(--muted); font-size: .88rem; text-align: right; }
.bar { height: 7px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-2), var(--accent)); }

/* ================= Pied de page / contact ================= */
.footer { margin-top: 72px; padding: 56px 0 24px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.footer h2 { font-size: 1.8rem; letter-spacing: -.02em; }
.footer p { color: rgba(255,255,255,.72); margin-top: 8px; max-width: 460px; }
.footer-actions { margin-top: 0; }
.copy { color: rgba(255,255,255,.45) !important; font-size: .85rem; margin-top: 44px !important; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); max-width: 1100px; }

/* ================= Apparition au défilement ================= */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.visible { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.visible { opacity: 1; transform: none; transition: none; }
  .card:hover { transform: none; }
}

/* ================= Responsive ================= */
@media (max-width: 920px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .menu-btn { display: block; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; padding: 8px 16px 16px; gap: 2px;
    background: var(--navy); box-shadow: 0 12px 24px rgba(0,0,0,.3);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px; }
  .nav.stuck { padding: 0 16px; }
  .hero { flex-direction: column; text-align: center; gap: 24px; padding-top: 24px; padding-bottom: 52px; }
  .avatar { width: 140px; height: 140px; }
  .hero-meta, .hero-actions { justify-content: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .job-head { flex-direction: column-reverse; gap: 10px; }
  .card { padding: 20px; }
  .langs li { grid-template-columns: 74px 1fr 66px; gap: 10px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ================= Cases cliquables (accueil) ================= */
.project-link { color: inherit; display: flex; }
.project-link:hover { text-decoration: none; }
.project-link .card { width: 100%; }
.more { margin-top: auto; padding-top: 6px; font-weight: 650; font-size: .92rem; color: var(--accent-text); }
.featured { position: relative; }
.featured::after {
  content: "Détaillé"; position: absolute; top: 18px; right: 18px;
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: var(--navy); color: #a9c6ff;
}

/* ================= Page projet ================= */
.page-hero { padding-top: 28px; padding-bottom: 60px; }
.back { color: rgba(255,255,255,.7); font-size: .92rem; display: inline-block; margin-bottom: 22px; }
.back:hover { color: #fff; }
.kicker.light { color: #8fb6ff; display: block; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin-top: 10px; }
.page-lead { color: rgba(255,255,255,.78); font-size: 1.12rem; max-width: 720px; margin-top: 14px; }
.hero-tags { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags li { padding: 5px 12px; border-radius: 8px; font-size: .85rem; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); }

.project-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.block { padding-top: 48px; }
.block .card p + p { margin-top: 12px; }
.block .card > p { color: var(--muted); }
.block .card strong { color: var(--text); }
.project-aside { position: sticky; top: 92px; padding-top: 48px; }
.aside-card h3 { font-size: 1rem; margin-bottom: 14px; }
.aside-sub { margin-top: 24px; }
.facts-list { margin: 0; display: grid; gap: 12px; }
.facts-list dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.facts-list dd { margin: 2px 0 0; font-size: .95rem; }
.doc-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.doc-links a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--text); background: var(--chip); font-size: .93rem; font-weight: 550;
  transition: background .2s;
}
.doc-links a:hover { background: var(--chip-hover); text-decoration: none; }
.doc-links svg { color: var(--accent-text); flex-shrink: 0; }
.doc-links small { margin-left: auto; color: var(--muted); font-weight: 600; font-size: .72rem; }

/* Schéma */
.diagram-card { padding: 22px; }
.diagram { width: 100%; height: auto; display: block; }
.d-col { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; fill: var(--muted); }
.d-box { fill: var(--card-hover); stroke: var(--border); stroke-width: 1.5; }
.d-tool { fill: var(--navy); }
.d-alert { fill: #16a34a; }
.d-title { font-size: 15px; font-weight: 700; fill: var(--text); }
.d-sub { font-size: 12.5px; fill: var(--muted); }
.d-title-l { font-size: 15px; font-weight: 700; fill: #fff; }
.d-sub-l { font-size: 12.5px; fill: #a9c6ff; }
.d-alert-t { font-size: 13.5px; font-weight: 700; fill: #fff; }
.d-line { stroke: var(--accent); stroke-width: 2; }
.d-arrowhead { fill: var(--accent); }
.d-proto { font-size: 12px; font-weight: 650; fill: var(--accent-text); }
.caption { color: var(--muted); font-size: .9rem; margin-top: 12px !important; text-align: center; }

/* Étapes */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; }
.step-n {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--navy), var(--navy-2)); color: #fff; font-weight: 800; font-size: 1.1rem;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); }
.code {
  margin: 14px 0 0; padding: 16px 18px; border-radius: 10px; overflow-x: auto;
  background: #0b1424; color: #dbe6f7; font: 13px/1.7 ui-monospace, "Cascadia Code", Consolas, monospace;
}
.code .c { color: #6f86a8; }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.shot-card { padding: 12px; margin: 0; }
.shot-card a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.shot-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; transition: transform .4s; }
.shot-card a:hover img { transform: scale(1.04); }
.shot-card figcaption { font-size: .88rem; color: var(--muted); padding: 10px 4px 2px; }

/* Tableau */
.table-card { padding: 8px 8px; overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; font-size: .94rem; }
.cmp th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 16px; }
.cmp td { padding: 14px 16px; border-top: 1px solid var(--border); color: var(--muted); }
.cmp td b { color: var(--text); }
.cmp tbody tr { transition: background .2s; }
.cmp tbody tr:hover { background: var(--card-hover); }

@media (max-width: 920px) {
  .project-layout { grid-template-columns: minmax(0, 1fr); }
  .project-aside { position: static; padding-top: 32px; order: -1; }
}
@media (max-width: 720px) {
  .gallery { grid-template-columns: 1fr; }
  .step { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page-hero { padding-bottom: 44px; }
}

/* ================= Pages projets : compléments ================= */
.sub-title { margin-top: 44px; }
.others { padding-top: 64px; }
.links a.detail { color: var(--accent-text); }
.card-h { font-size: 1rem; margin-bottom: 8px; }
.muted-p { color: var(--muted); font-size: .95rem; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; background: var(--chip); padding: 1px 6px; border-radius: 5px; }
.code code { background: none; padding: 0; font-size: inherit; }
.shot-card.wide img { aspect-ratio: auto; }

/* Schémas : zones et éléments */
.d-wire { fill: none; stroke-width: 3; stroke-linecap: round; }
.d-wire.red { stroke: #dc2626; }
.d-wire.orange { stroke: #ea580c; }
.d-wire.green { stroke: #16a34a; }
.d-wire.trunk { stroke: var(--accent); stroke-width: 4; }
.d-wire.plain { stroke: var(--border); stroke-width: 2; }
.d-line { fill: none; }
.d-line.dashed { stroke-dasharray: 6 5; }
.d-box.zone-red { stroke: #dc2626; stroke-width: 2; }
.d-box.zone-orange { stroke: #ea580c; stroke-width: 2; }
.d-box.zone-green { stroke: #16a34a; stroke-width: 2; }
.d-zone { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; }
.d-zone.red { fill: #dc2626; } .d-zone.orange { fill: #ea580c; } .d-zone.green { fill: #16a34a; }
.d-svc rect { fill: rgba(255,255,255,.12); stroke: rgba(255,255,255,.25); }
.d-svc text { font-size: 11.5px; font-weight: 700; fill: #fff; }
.d-vm rect { fill: rgba(255,255,255,.1); stroke: rgba(255,255,255,.2); }
.d-vm text { font-size: 13px; fill: #dbe6f7; }
.d-node rect { fill: var(--card-hover); stroke: var(--border); stroke-width: 1.5; }
.d-node .t { font-size: 12.5px; font-weight: 700; fill: var(--text); }
.d-node .s { font-size: 11px; fill: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dot.red { background: #dc2626; } .dot.orange { background: #ea580c; } .dot.green { background: #16a34a; }

/* ================= Mentions légales ================= */
.copy a { color: rgba(255,255,255,.65); text-decoration: underline; text-underline-offset: 2px; }
.copy a:hover { color: #fff; }
.legal { max-width: 820px; padding-bottom: 8px; }
.legal .card { margin-bottom: 16px; }
.legal h2 { font-size: 1.15rem; margin-bottom: 12px; }
.legal p, .legal li { color: var(--muted); }
.legal p + p { margin-top: 10px; }
.legal strong { color: var(--text); }
.legal ul { margin: 10px 0 0; padding-left: 20px; }
.legal li { margin-bottom: 4px; }
.legal address { font-style: normal; color: var(--text); line-height: 1.7; }
.legal .updated { color: var(--muted); font-size: .88rem; margin-top: 20px; }
.footer > .copy:first-child { margin-top: 0 !important; border-top: 0; padding-top: 0; }
.footer:has(> .copy:first-child) { padding: 28px 0; }
.bar .lv-100 { width: 100%; } .bar .lv-80 { width: 80%; } .bar .lv-35 { width: 35%; }

/* ================= Page 404 ================= */
.notfound { min-height: 100vh; display: flex; flex-direction: column; }
.notfound .page-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; align-items: center; }
.big404 { font-size: clamp(5rem, 18vw, 9rem); font-weight: 800; letter-spacing: -.05em; line-height: 1; color: #8fb6ff; }
