/* Kevin Gonnet — Formation IA
   Feuille de style unique. Les jetons viennent de DESIGN.md §9. */

:root {
  /* Couleurs */
  --papier: #f8f8f2;
  --carte: #ffffff;
  --encre: #1a1a1a;
  --cendre: #6e6e6e;
  --filet: #d4d4d8;
  --vermillon: #fc523b;

  /* Polices */
  --font-titre: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-texte: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Échelle typographique (mobile → desktop) */
  --t-display: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);
  --t-h2:      clamp(2rem, 1.55rem + 2vw, 3rem);
  --t-h3:      clamp(1.375rem, 1.27rem + 0.45vw, 1.625rem);
  --t-chiffre: clamp(2.75rem, 2.2rem + 2.4vw, 4rem);
  --t-lead:    clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem);
  --t-body:    clamp(1rem, 0.98rem + 0.1vw, 1.0625rem);
  --t-small:   0.875rem;
  --t-label:   0.75rem;

  --lh-display: 1.05;
  --lh-h2: 1.1;
  --lh-h3: 1.2;
  --lh-body: 1.6;

  --ls-display: -0.025em;
  --ls-h2: -0.02em;
  --ls-body: 0.01em;
  --ls-label: 0.08em;

  /* Espacements */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 112px;

  --section-y: clamp(64px, 40px + 6vw, 112px);
  --gutter: clamp(16px, 5.714vw - 4.571px, 64px);
  --max-width: 1200px;
  --measure: 65ch;
  --col8: 790px; /* 8 colonnes sur 12 dans 1 200 px, gouttières de 32 px */

  /* Formes */
  --r-card: 12px;
  --r-button: 8px;
  --r-pill: 9999px;
  --rule-strong: 1px solid var(--encre);
  --rule-soft: 1px solid var(--filet);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--font-texte);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-titre);
  font-weight: 400;
  font-optical-sizing: auto;
  text-wrap: balance;
}
h1 { font-size: var(--t-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
h2 { font-size: var(--t-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); }
h3 { font-size: var(--t-h3); line-height: var(--lh-h3); letter-spacing: -0.01em; }
p { margin: 0; }
p + p { margin-top: var(--s-4); }
strong { font-weight: 600; }
em { font-family: var(--font-titre); font-style: italic; letter-spacing: 0; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--vermillon); outline-offset: 2px; }

.skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--encre); color: var(--papier); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-button); text-decoration: none; font-weight: 500;
}
.skip:focus { top: var(--s-4); }

.wrap {
  max-width: calc(var(--max-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.measure { max-width: var(--measure); }
.col8 { max-width: var(--col8); }

.lead { font-size: var(--t-lead); line-height: 1.5; letter-spacing: 0; }
.small { font-size: var(--t-small); line-height: 1.5; }
.label {
  font-size: var(--t-label); font-weight: 500; line-height: 1.3;
  text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--cendre);
}
.muted { color: var(--cendre); }
.num { font-variant-numeric: tabular-nums; }

/* Emplacements à compléter (mentions légales) */
.todo {
  display: inline; padding: 0 var(--s-1);
  border: 1px dashed var(--encre); border-radius: 4px;
  font-weight: 500;
}

/* ---------- En-tête ---------- */

.site-header { border-bottom: var(--rule-strong); }
.site-header .wrap {
  display: flex; align-items: center; gap: var(--s-5);
  min-height: 80px;
}
.brand {
  display: flex; flex-direction: column; gap: 2px;
  text-decoration: none; padding-block: var(--s-2);
}
.brand-name { font-family: var(--font-titre); font-size: 20px; line-height: 1.15; letter-spacing: -0.01em; }
.nav { display: none; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 15px; font-weight: 500; text-decoration: none;
  text-underline-offset: 6px; text-decoration-thickness: 1px;
  transition: color .15s;
}
.nav a:hover, .nav a[aria-current="page"] { text-decoration-line: underline; }
.site-header .header-cta { margin-left: auto; display: none; }
.menu-toggle {
  margin-left: auto;
  min-height: 44px; min-width: 44px; padding: 0 var(--s-2);
  background: none; border: 0; color: var(--encre); cursor: pointer;
  font: 500 15px/1 var(--font-texte); letter-spacing: var(--ls-body);
  text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px;
}
@media (min-width: 480px) {
  .site-header .header-cta { display: inline-flex; }
  .header-cta + .menu-toggle { margin-left: 0; }
}
@media (min-width: 1200px) {
  .nav { display: flex; gap: var(--s-5); margin-inline: auto; }
  .site-header .header-cta { margin-left: 0; }
  .menu-toggle { display: none; }
}

/* Menu plein écran (sous 1 200 px) */
.menu-panel {
  position: fixed; inset: 0; z-index: 50;
  background: var(--papier); overflow-y: auto;
}
.menu-panel[hidden] { display: none; }
.menu-panel .menu-top { border-bottom: var(--rule-strong); }
.menu-panel .menu-top .wrap { display: flex; align-items: center; min-height: 80px; }
.menu-panel .menu-close { margin-left: auto; }
.menu-list { list-style: none; padding-block: var(--s-5); }
.menu-list li + li { border-top: var(--rule-soft); }
.menu-list a {
  display: block; padding-block: var(--s-4);
  font-family: var(--font-titre); font-size: 32px; line-height: 1.15; letter-spacing: -0.02em;
  text-decoration: none;
}
.menu-list a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.menu-panel .menu-cta { padding-bottom: var(--s-7); }

/* ---------- Boutons et liens ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  border: 1px solid var(--encre); border-radius: var(--r-button);
  font: 500 16px/1.2 var(--font-texte); letter-spacing: var(--ls-body);
  text-align: center; text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--encre); color: var(--papier); }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-secondary { background: transparent; color: var(--encre); }
.btn-secondary:hover { background: var(--carte); }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-4); }

.arrow {
  font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.arrow::after {
  content: "→"; display: inline-block; margin-left: .4em;
  color: var(--vermillon); text-decoration: none;
  transition: transform .15s;
}
.arrow.ext::after { content: "↗"; }
.arrow:hover::after { transform: translateX(2px); }
.arrow.ext:hover::after { transform: translate(2px, -2px); }
.more { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); }
.more .arrow { display: inline-block; padding-block: 10px; }

/* ---------- Sections ---------- */

/* Moitié de --section-y de part et d'autre du filet : 112 px entre deux sections (64 px sur mobile). */
.sec { padding-block: calc(var(--section-y) / 2); }
.sec:last-of-type, .sec:has(+ .band) { padding-bottom: var(--section-y); }
.sec.ruled {
  background-image: linear-gradient(var(--encre), var(--encre));
  background-size: min(var(--max-width), calc(100% - 2 * var(--gutter))) 1px;
  background-position: top center;
  background-repeat: no-repeat;
}
/* Pas de double filet quand la section précédente se termine déjà par un filet fort */
.hero:has(> .stats) + .sec.ruled { background-image: none; }
.sec:has(> .cols:last-child, > .stats:last-child, > .results:last-child) + .sec.ruled { background-image: none; }
.sec-head { max-width: var(--col8); margin-bottom: var(--s-6); }
.sec-head p { margin-top: var(--s-4); }
.after { margin-top: var(--s-6); max-width: var(--measure); }
.stack > * + * { margin-top: var(--s-6); }

/* ---------- Haut de page ---------- */

.hero { padding-block: clamp(48px, 24px + 6vw, 96px) calc(var(--section-y) / 2); }
.hero-grid { display: grid; gap: var(--s-7); }
.hero-text { max-width: var(--col8); }
.hero-text > * + * { margin-top: var(--s-5); }
.hero-text .label + h1 { margin-top: var(--s-4); }
.hero-text .actions { margin-top: var(--s-6); }
.hero-text .note { margin-top: var(--s-3); }
.hero-photo { max-width: 360px; }
.portrait {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--r-card); filter: grayscale(1);
}
@media (min-width: 960px) {
  .hero-grid.with-photo { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; align-items: start; }
  .hero-grid.with-photo .hero-text { grid-column: 1 / span 7; max-width: none; }
  .hero-grid.with-photo .hero-photo { grid-column: 9 / span 4; max-width: none; }
}

/* ---------- Bandeau de chiffres / colonnes à filets verticaux ---------- */

.stats, .cols {
  display: grid;
  border-top: var(--rule-strong); border-bottom: var(--rule-strong);
}
.stats { margin-top: var(--section-y); }
.stats[data-inline] { margin-top: 0; }
.stats > *, .cols > * { padding-block: var(--s-5); }
.stats > * + *, .cols > * + * { border-top: var(--rule-strong); }
.stat-num {
  display: block; margin-block: var(--s-2);
  font-family: var(--font-titre); font-size: var(--t-chiffre); line-height: 1;
  letter-spacing: -0.025em; font-variant-numeric: tabular-nums;
}
.stat .label { display: block; }
.stat .small { color: var(--cendre); max-width: 32ch; }
.cols h3 { margin-bottom: var(--s-3); }
.cols .arrow { display: inline-block; margin-top: var(--s-3); padding-block: 10px; }
@media (min-width: 640px) {
  .stats, .cols { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
  .stats > *, .cols > * { padding: var(--s-6) var(--s-6); }
  .stats > *:first-child, .cols > *:first-child { padding-left: 0; }
  .stats > *:last-child, .cols > *:last-child { padding-right: 0; }
  .stats > * + *, .cols > * + * { border-top: 0; border-left: var(--rule-strong); }
}
@media (min-width: 640px) and (max-width: 959px) {
  .cols { grid-template-columns: 1fr; }
  .cols > * { padding-inline: 0; }
  .cols > * + * { border-left: 0; border-top: var(--rule-strong); }
}

/* ---------- Listes ---------- */

.rule-list { list-style: none; max-width: var(--col8); border-top: var(--rule-soft); }
.rule-list > li { padding-block: var(--s-5); border-bottom: var(--rule-soft); }
.rule-list .lead { display: block; }

.bullets { list-style: none; max-width: var(--measure); }
.bullets > li { position: relative; padding-left: 24px; }
.bullets > li + li { margin-top: var(--s-2); }
.bullets > li::before {
  content: "·"; position: absolute; left: 4px; top: -0.18em;
  color: var(--vermillon); font-size: 1.6em; font-weight: 700; line-height: 1.2;
}

.numbered { list-style: none; counter-reset: n; }
.numbered > li {
  counter-increment: n;
  display: grid; grid-template-columns: 36px 1fr; gap: var(--s-3);
  padding-block: var(--s-3); border-bottom: var(--rule-soft);
}
.numbered > li:first-child { border-top: var(--rule-soft); }
.numbered > li::before {
  content: counter(n);
  font-family: var(--font-titre); font-size: 26px; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tags > li {
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--encre); border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; line-height: 1.3;
}

/* Grille de points forts */
.points { display: grid; gap: var(--s-7) var(--s-6); }
.point { border-top: var(--rule-strong); padding-top: var(--s-5); }
.point h3 { margin-bottom: var(--s-3); }
.point p { max-width: var(--measure); }
@media (min-width: 640px) { .points { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Cartes d'offre */
.cards { display: grid; gap: var(--s-5); }
.card {
  display: flex; flex-direction: column; gap: var(--s-4);
  padding: var(--s-5);
  background: var(--carte); border: var(--rule-soft); border-radius: var(--r-card);
  text-decoration: none; transition: border-color .15s;
}
.card:hover { border-color: var(--encre); }
.card .arrow { margin-top: auto; padding-top: var(--s-2); }
@media (min-width: 640px) { .card { padding: var(--s-6); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); } }

/* Index de modules */
.index { list-style: none; border-top: var(--rule-strong); }
.index > li {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding-block: var(--s-5); border-bottom: var(--rule-soft);
}
.index .dur {
  order: -1;
  font-size: var(--t-label); font-weight: 500; line-height: 1.3;
  text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--cendre);
  font-variant-numeric: tabular-nums;
}
.index .pub { font-size: var(--t-small); color: var(--cendre); }
.index .desc { max-width: var(--measure); }
.index p + p { margin-top: 0; }
@media (min-width: 960px) {
  .index > li {
    display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    column-gap: 32px; row-gap: var(--s-2);
  }
  .index > li > * { grid-column: 1; }
  .index .dur {
    grid-column: 2; grid-row: 1; order: 0; text-align: right;
    font-size: var(--t-small); font-weight: 400; text-transform: none; letter-spacing: var(--ls-body);
    line-height: 1.6; padding-top: 2px;
  }
}

/* Module mis en avant */
.featured {
  padding: var(--s-5);
  background: var(--carte); border: var(--rule-soft); border-radius: var(--r-card);
}
.featured .meta { margin-top: var(--s-4); color: var(--cendre); }
.featured .intro { margin-top: var(--s-5); max-width: var(--measure); }
.featured-grid { display: grid; gap: var(--s-6); margin-top: var(--s-6); }
.featured-grid h3 { margin-bottom: var(--s-4); font-size: 22px; }
.box { border-left: 1px solid var(--encre); padding-left: var(--s-4); }
.box + .box { margin-top: var(--s-5); }
.box .label { display: block; margin-bottom: var(--s-2); }
@media (min-width: 640px) { .featured { padding: var(--s-7); } }
@media (min-width: 960px) {
  .featured-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-7); }
}

/* Encart */
.callout {
  max-width: var(--col8); padding: var(--s-5);
  background: var(--carte); border: var(--rule-soft); border-radius: var(--r-card);
}
.callout .label { display: block; margin-bottom: var(--s-2); }
.callout + .callout { margin-top: var(--s-4); }
.sec .callout { margin-top: var(--s-6); }

/* Étapes numérotées */
.steps { list-style: none; counter-reset: s; border-top: var(--rule-soft); }
.steps > li {
  counter-increment: s;
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--s-4);
  padding-block: var(--s-5); border-bottom: var(--rule-soft);
}
.steps > li::before {
  content: counter(s);
  font-family: var(--font-titre); font-size: 48px; line-height: 1;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.steps h3 { margin-bottom: var(--s-2); }
.steps p { max-width: var(--measure); }
@media (min-width: 960px) {
  .steps > li { grid-template-columns: minmax(0, 2fr) minmax(0, 10fr); gap: 32px; }
}

/* Parcours types */
.paths { border-top: var(--rule-soft); }
.path { padding-block: var(--s-5); border-bottom: var(--rule-soft); }
.path h3 { margin-bottom: var(--s-3); }
.chain { list-style: none; display: flex; flex-direction: column; gap: var(--s-1); }
.chain > li + li::before { content: "→"; color: var(--vermillon); margin-right: var(--s-2); }
@media (min-width: 640px) {
  .chain { flex-direction: row; flex-wrap: wrap; gap: var(--s-1) 0; }
  .chain > li + li::before { margin-inline: var(--s-3); }
}

/* Frise et liste terme + texte */
.timeline, .terms { border-top: var(--rule-soft); }
.timeline > li, .terms > div {
  display: grid; gap: var(--s-1) 32px;
  padding-block: var(--s-4); border-bottom: var(--rule-soft);
}
.timeline { list-style: none; }
.timeline .when { font-size: var(--t-small); font-weight: 500; font-variant-numeric: tabular-nums; padding-top: 2px; }
.terms { margin: 0; }
.terms dt { font-weight: 600; }
.terms dd { margin: 0; }
@media (min-width: 640px) {
  .timeline > li, .terms > div { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
}

/* Tableau de résultats */
.results { width: 100%; max-width: 960px; border-collapse: collapse; border-top: var(--rule-strong); border-bottom: var(--rule-strong); }
.results th { text-align: left; padding: var(--s-3) 0; border-bottom: var(--rule-soft); }
.results td { padding: var(--s-4) 0; border-bottom: var(--rule-soft); vertical-align: baseline; }
.results tr:last-child td { border-bottom: 0; }
.results td:first-child { padding-right: var(--s-6); width: 40%; }
.res-num { font-family: var(--font-titre); font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.res-note { color: var(--cendre); font-size: var(--t-small); }
@media (max-width: 639px) {
  .results thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .results tr { display: block; padding-block: var(--s-4); border-bottom: var(--rule-soft); }
  .results tr:last-child { border-bottom: 0; }
  .results td { display: block; padding: 0; border: 0; width: auto !important; }
  .results td + td { margin-top: var(--s-1); }
}

/* FAQ */
.faq { max-width: var(--col8); border-top: var(--rule-strong); }
.faq details { border-bottom: var(--rule-soft); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  min-height: 44px; padding-block: var(--s-5); cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: 22px; }
.faq .sign {
  flex: none; color: var(--vermillon); font-size: 30px; line-height: 1; font-weight: 300;
  transition: transform .15s;
}
.faq details[open] .sign { transform: rotate(45deg); }
.faq .answer { max-width: var(--measure); padding-bottom: var(--s-5); }

/* « Par où commencer ? » */
.start { list-style: none; max-width: var(--col8); border-top: var(--rule-soft); }
.start > li { padding-block: var(--s-5); border-bottom: var(--rule-soft); }
.start .who { font-weight: 600; }
.start .to { color: var(--vermillon); margin-inline: var(--s-2); }
.start em { font-size: 1.15em; }

/* Texte courant (mentions légales) */
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--t-h3); line-height: var(--lh-h3); letter-spacing: -0.01em; margin-top: var(--s-7); margin-bottom: var(--s-3); }
.prose h2:first-child { margin-top: 0; }

/* ---------- Bande d'appel finale ---------- */

.band { background: var(--encre); color: var(--papier); padding-block: var(--section-y); }
.band h2 { max-width: var(--col8); }
.band .lead { margin-top: var(--s-5); max-width: var(--measure); }
.band .actions { margin-top: var(--s-6); }
.band .note { margin-top: var(--s-3); }
.band .btn-primary { background: var(--papier); color: var(--encre); border-color: var(--papier); }
.band .btn-primary:hover { background: #fff; border-color: #fff; }
.band .btn-secondary { color: var(--papier); border-color: var(--papier); }
.band .btn-secondary:hover { background: #000; }

/* ---------- Pied de page ---------- */

.site-footer { border-top: var(--rule-strong); padding-block: var(--s-8) var(--s-7); font-size: var(--t-small); line-height: 1.6; }
.band + .site-footer { border-top: 0; }
.footer-grid { display: grid; gap: var(--s-6); }
.footer-grid .footer-title { font-family: var(--font-titre); font-size: 20px; line-height: 1.2; margin-bottom: var(--s-2); }
.footer-grid .label { display: block; margin-bottom: var(--s-2); }
.footer-grid ul { list-style: none; }
.footer-grid a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.footer-grid li a { display: inline-block; padding-block: 10px; }
.footer-grid li + li a { margin-top: -12px; }
.footer-grid .arrow { font-weight: 400; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .footer-grid { grid-template-columns: 4fr 3fr 2fr 3fr; gap: 32px; } }

/* ---------- Mouvement ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
