/* ==========================================================================
   Site CV — Clinical Data Manager
   Palette, typographie et mise en page. Les couleurs se modifient ici.
   ========================================================================== */

@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #f6f8f9;      /* fond, blanc froid */
  --surface: #ffffff;
  --ink: #15232d;        /* texte principal, bleu ardoise profond */
  --muted: #56656f;      /* texte secondaire */
  --line: #d5dee3;       /* filets */
  --accent: #1e5a72;     /* bleu pétrole */
  --accent-soft: #e3eef2;
  --todo: #fff1b8;       /* surlignage des contenus à compléter */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.6rem, 6vw, 4.5rem);

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* Contenu provisoire : visible tant que le texte définitif n'est pas saisi */
.todo { background: var(--todo); box-shadow: 0 0 0 2px var(--todo); border-radius: 2px; }

/* ----- En-tête ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 2rem; height: 4rem; }
.brand { font-family: var(--serif); font-size: var(--step-1); color: var(--ink); text-decoration: none; margin-right: auto; white-space: nowrap; }
.nav { display: flex; gap: 1.75rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: var(--step--1); }
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); }
.lang { display: flex; font-size: var(--step--1); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang a, .lang span { padding: .2rem .7rem; text-decoration: none; color: var(--muted); }
.lang span { background: var(--ink); color: var(--paper); }
@media (max-width: 52rem) { .nav { display: none; } }

/* ----- Boutons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.25rem; border-radius: 4px;
  font: 500 var(--step--1)/1 var(--sans); text-decoration: none;
  border: 1px solid var(--ink); color: var(--ink); background: transparent;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); }
.btn svg { width: 1em; height: 1em; }

/* ----- Accueil ----------------------------------------------------------- */
.hero { padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem); }
.hero h1 {
  font: 400 var(--step-4)/1.02 var(--serif);
  letter-spacing: -0.02em; margin: 0 0 1rem;
}
.hero .role { font-size: var(--step-1); color: var(--accent); font-weight: 500; margin: 0 0 1.5rem; }
.hero .lede { font: 400 var(--step-2)/1.35 var(--serif); max-width: 34ch; margin: 0 0 2rem; }
.hero .facts { display: flex; flex-wrap: wrap; gap: .5rem 2rem; color: var(--muted); font-size: var(--step--1); margin: 0 0 2.5rem; padding: 0; list-style: none; }
.hero .facts strong { color: var(--ink); font-weight: 600; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Cycle de vie des données : l'élément signature de la page */
.lifecycle { margin-top: clamp(3.5rem, 8vw, 5.5rem); }
.lifecycle h2 { font: 500 var(--step--1)/1.4 var(--sans); color: var(--muted); margin: 0 0 1.75rem; }
.lifecycle ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  position: relative; counter-reset: stage;
}
.lifecycle ol::before {
  content: ""; position: absolute; left: 0; right: 0; top: .45rem;
  height: 1px; background: var(--ink);
  transform-origin: left; transform: scaleX(var(--draw, 1));
}
.lifecycle li { position: relative; padding-top: 2rem; counter-increment: stage; }
.lifecycle li::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: .9rem; height: .9rem; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink);
}
.lifecycle li:last-child::before { background: var(--accent); border-color: var(--accent); }
.lifecycle h3 { font: 500 var(--step-1)/1.25 var(--serif); margin: 0 0 .4rem; }
.lifecycle h3::before { content: counter(stage) ". "; color: var(--muted); }
.lifecycle p { margin: 0; font-size: var(--step--1); color: var(--muted); line-height: 1.5; }

@media (max-width: 52rem) {
  .lifecycle ol { grid-template-columns: 1fr; gap: 1.5rem; padding-left: 2rem; }
  .lifecycle ol::before { left: .45rem; right: auto; top: 0; bottom: 0; width: 1px; height: auto; transform-origin: top; transform: scaleY(var(--draw, 1)); }
  .lifecycle li { padding-top: 0; }
  .lifecycle li::before { left: -2rem; top: .35rem; }
}

/* Animation unique au chargement : la ligne se trace, les étapes apparaissent */
.js .lifecycle ol { --draw: 0; }
.js .lifecycle li { opacity: 0; transform: translateY(6px); }
.js .lifecycle.is-in ol { --draw: 1; }
.js .lifecycle.is-in ol::before { transition: transform 1.2s cubic-bezier(.6,.05,.2,1); }
.js .lifecycle.is-in li { opacity: 1; transform: none; transition: opacity .5s, transform .5s; }
.js .lifecycle.is-in li:nth-child(1) { transition-delay: .15s; }
.js .lifecycle.is-in li:nth-child(2) { transition-delay: .45s; }
.js .lifecycle.is-in li:nth-child(3) { transition-delay: .75s; }
.js .lifecycle.is-in li:nth-child(4) { transition-delay: 1.05s; }

/* ----- Sections ---------------------------------------------------------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; border-top: 1px solid var(--line); }
.section .wrap { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem 4rem; }
.section-title { font: 400 var(--step-3)/1.1 var(--serif); margin: 0; letter-spacing: -0.01em; }
.section-title-col { position: sticky; top: 6rem; align-self: start; }
.prose { max-width: 40rem; }
.prose p { margin: 0 0 1.1em; }
.prose .intro { font: 400 var(--step-2)/1.4 var(--serif); }
@media (max-width: 52rem) {
  .section .wrap { grid-template-columns: minmax(0, 1fr); }
  .section-title-col { position: static; }
}

/* Expériences : chronologie inverse */
.timeline { list-style: none; margin: 0; padding: 0; max-width: 44rem; }
.job { padding: 0 0 2.75rem; margin: 0 0 2.75rem; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; align-items: baseline; }
.job h3 { font: 500 var(--step-2)/1.2 var(--serif); margin: 0; }
.job .when { color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.job .where { margin: .3rem 0 1rem; color: var(--accent); font-weight: 500; }
.job ul { margin: 0; padding-left: 1.1rem; }
.job li { margin-bottom: .4rem; }
.job li::marker { color: var(--accent); }
.job .result { margin-top: 1rem; padding: .9rem 1.1rem; background: var(--accent-soft); border-radius: 4px; font-size: var(--step--1); }

/* Compétences : groupes en colonnes, sans jauges */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 2.5rem 3rem; max-width: 48rem; }
.skills h3 { font: 500 var(--step-1)/1.3 var(--serif); margin: 0 0 .75rem; padding-bottom: .6rem; border-bottom: 1px solid var(--ink); }
.skills ul { list-style: none; margin: 0; padding: 0; }
.skills li { padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.tools { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.tools li { border: 1px solid var(--line); background: var(--surface); padding: .3rem .75rem; border-radius: 999px; font-size: var(--step--1); }
.skills + .skills-block { margin-top: 3rem; }
.skills-block > h3 { font: 500 var(--step-1)/1.3 var(--serif); margin: 0 0 1rem; }

/* Formation */
.edu { list-style: none; margin: 0; padding: 0; max-width: 44rem; }
.edu li { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.edu .year { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--step--1); padding-top: .2rem; }
.edu strong { display: block; font: 500 var(--step-1)/1.3 var(--serif); }
.edu span { color: var(--muted); font-size: var(--step--1); }

/* Contact */
.contact { background: var(--ink); color: var(--paper); border-top: 0; }
.contact .section-title { color: var(--paper); }
.contact .prose .intro { color: var(--paper); }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
.contact-list a { color: var(--paper); font-size: var(--step-1); }
.contact-list span { display: block; font-size: var(--step--1); color: #a9b8c1; }
.contact .btn { border-color: var(--paper); color: var(--paper); margin-top: 2rem; }
.contact .btn:hover { background: var(--paper); color: var(--ink); }
.contact .todo { color: var(--ink); }

.site-footer { background: var(--ink); color: #a9b8c1; font-size: var(--step--1); padding: 1.5rem 0 2.5rem; border-top: 1px solid #2b3c47; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { color: #a9b8c1; }

/* Suggestion de langue */
.lang-hint { background: var(--accent-soft); font-size: var(--step--1); }
.lang-hint .wrap { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding-top: .6rem; padding-bottom: .6rem; }
.lang-hint button { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: .25rem .5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .lifecycle ol { --draw: 1; }
  .js .lifecycle li { opacity: 1; transform: none; }
}

@media print {
  .site-header, .lang-hint, .actions, .site-footer { display: none; }
  .contact { background: none; color: var(--ink); }
  .contact .section-title, .contact-list a { color: var(--ink); }
}

.job .roles { margin: -.5rem 0 1rem; color: var(--muted); font-size: var(--step--1); }
