:root {
  --navy: #0F3B73;
  --ink: #0A2342;
  --text: #24324A;
  --muted: #5A6880;
  --ice: #EAF1FA;
  --line: #CFDDF0;
  --blue: #1D5FB8;
  --ok: #2E9E63;
  --white: #FFFFFF;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

a { color: var(--blue); }
a:hover { color: var(--navy); }
a:focus-visible, summary:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; display: block; }

code, pre, .mono { font-family: "IBM Plex Mono", Consolas, monospace; }

.wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 24px; }

/* Barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--navy);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { color: var(--white); font-weight: 700; text-decoration: none; font-size: 18px; }
.brand:hover { color: var(--white); }
.topbar nav { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar nav a { color: #D6E4F7; text-decoration: none; font-size: 15px; font-weight: 500; }
.topbar nav a:hover { color: var(--white); }

/* Hero */
.hero { background: var(--navy); color: var(--white); padding: 56px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.hero h1 { margin: 0 0 12px; font-size: clamp(40px, 6vw, 62px); line-height: 1.05; letter-spacing: -0.5px; }
.hero-role { margin: 0 0 16px; font-size: 20px; font-weight: 600; color: #D6E4F7; max-width: 34em; }
.hero-intro { margin: 0 0 28px; max-width: 36em; color: #E9F0FA; }
.hero-photo {
  width: 220px; height: 280px; object-fit: cover; object-position: center 20%;
  border-radius: 14px; border: 4px solid var(--white);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 8px;
  font-weight: 600; font-size: 16px; text-decoration: none;
}
.btn-primary { background: var(--white); color: var(--navy); }
.btn-primary:hover { background: var(--ice); color: var(--navy); }
.btn-ghost { color: var(--white); border: 2px solid #8FB1E0; }
.btn-ghost:hover { color: var(--white); border-color: var(--white); }

/* Schéma du lab */
.lab { margin: 48px 0 0; }
.lab figcaption { font-size: 15px; color: #B9CDEA; margin-bottom: 12px; }
.lab svg { width: 100%; height: auto; display: block; }
.lab-host { fill: #0B2F5E; stroke: #3D6AA5; stroke-width: 1.5; stroke-dasharray: 6 6; }
.lab-host-label { fill: #B9CDEA; font-size: 15px; font-family: "IBM Plex Sans", sans-serif; }
.node { fill: var(--white); }
.node-main { fill: var(--blue); }
.node-title { font-size: 17px; font-weight: 700; fill: var(--ink); font-family: "IBM Plex Sans", sans-serif; }
.node-sub { font-size: 14px; fill: var(--muted); font-family: "IBM Plex Sans", sans-serif; }
.light { fill: var(--white); }
.mono { font-size: 13.5px; fill: var(--muted); }
.mono.light { fill: #DCE8F8; }
.port { fill: #0F3B73; }
.port-text { font-size: 13px; fill: var(--white); }
.mini { fill: var(--ice); }
.mini-text { font-size: 13px; fill: var(--ink); font-family: "IBM Plex Sans", sans-serif; }
.link { stroke: #8FB1E0; stroke-width: 3; }
.pulse { fill: var(--ok); }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: travel 2.4s ease-in-out infinite; }
  @keyframes travel {
    0% { transform: translateX(-40px); opacity: 0; }
    20%, 80% { opacity: 1; }
    100% { transform: translateX(40px); opacity: 0; }
  }
}

/* Sections */
.section { padding: 72px 0; }
.section-tint { background: var(--ice); }
h2 { margin: 0 0 12px; font-size: 32px; line-height: 1.2; color: var(--ink); }
.h2-spaced { margin-top: 56px; }
.section-lead { margin: 0 0 32px; color: var(--muted); max-width: 40em; }

/* Projets */
.project { border-top: 1px solid var(--line); }
.project:last-of-type { border-bottom: 1px solid var(--line); }
.project summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 24px;
}
.project summary::-webkit-details-marker { display: none; }
.project summary::after {
  content: "+"; position: absolute; right: 4px; top: 18px;
  font-size: 26px; color: var(--blue); font-weight: 400;
}
.project details[open] summary::after { content: "–"; }
.project-title { font-size: 21px; font-weight: 700; color: var(--ink); }
.project-date { color: var(--blue); font-weight: 500; font-size: 15px; align-self: center; }
.project-desc { grid-column: 1 / -1; color: var(--muted); max-width: 44em; }
.project summary:hover .project-title { color: var(--blue); }
.project-body { padding: 0 0 32px; max-width: 760px; }
.project-body h3 { font-size: 18px; color: var(--ink); margin: 24px 0 10px; }
.project-body p { margin: 0 0 12px; }
.steps { margin: 0 0 20px; padding-left: 22px; }
.steps li { margin-bottom: 8px; }
code { background: var(--ice); color: var(--ink); padding: 1px 6px; border-radius: 4px; font-size: 0.88em; }
.terminal {
  background: #0B1F3A; color: #DCE8F8; padding: 18px 20px; border-radius: 10px;
  overflow-x: auto; font-size: 14px; line-height: 1.7; margin: 0 0 8px;
}
.terminal code { background: none; color: inherit; padding: 0; font-size: inherit; }
.prompt { color: #6FCF97; }
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; height: 150px; object-fit: cover; object-position: top left;
  border-radius: 8px; border: 1px solid var(--line); background: #000;
}
.gallery figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.tools { font-size: 15px; color: var(--blue); font-weight: 500; margin-top: 16px !important; }

/* Expérience */
.job { background: var(--white); border-left: 4px solid var(--navy); border-radius: 0 10px 10px 0; padding: 22px 26px; margin-top: 24px; }
.job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.job h3 { margin: 0; font-size: 20px; color: var(--ink); }
.job-date { color: var(--blue); font-weight: 500; font-size: 15px; }
.job-place { margin: 2px 0 12px; color: var(--muted); font-size: 15px; }
.job ul { margin: 0; padding-left: 20px; }
.job li { margin-bottom: 6px; }

/* Compétences */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; margin: 24px 0 0; }
.skills div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.skills dt { font-weight: 700; color: var(--ink); }
.skills dd { margin: 2px 0 0; color: var(--text); }
.edu { display: grid; gap: 16px; margin-top: 20px; }
.edu div { display: flex; flex-direction: column; }
.edu span { color: var(--muted); }

/* Contact */
.contact { background: var(--navy); color: var(--white); }
.contact h2 { color: var(--white); }
.contact p { color: #D6E4F7; max-width: 40em; }
.contact-list { list-style: none; padding: 0; margin: 24px 0 0; display: flex; gap: 14px; flex-wrap: wrap; }
.contact-list a {
  display: inline-block; color: var(--white); text-decoration: none; font-weight: 600;
  padding: 10px 18px; border: 2px solid #8FB1E0; border-radius: 8px;
}
.contact-list a:hover { border-color: var(--white); color: var(--white); }

.footer { background: #0B2F5E; color: #9DB6D8; font-size: 14px; padding: 18px 0; }

/* Mobile */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .topbar nav { display: none; }
  .hero { padding: 40px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-photo { order: -1; width: 140px; height: 170px; }
  .lab svg { min-width: 640px; }
  .lab { overflow-x: auto; }
  .skills { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  h2 { font-size: 27px; }
}
