/* ------------------------------------------------------------------
   reynarditige.ch — feuille de style unique
   Composition centrée, texte justifié avec césure.
   Palette fonctionnelle : l'encre porte le déterministe, l'ambre porte
   l'appel au modèle. Aucune couleur n'est décorative.
------------------------------------------------------------------- */

:root {
  --paper: #eceff1;
  --surface: #ffffff;
  --ink: #16222c;
  --ink-2: #55636e;
  --ink-3: #7d8b96;
  --line: #cbd5db;
  --line-soft: #dde3e8;
  --det: #0e5c55;
  --llm: #b2560d;
  --focus: #0e5c55;

  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --gut: clamp(1.25rem, 4vw, 2.5rem);
  --band: clamp(3.5rem, 9vw, 7rem);
  --max: 64rem;      /* largeur de page */
  --read: 40rem;     /* largeur de lecture : ~72 caractères */
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101920;
    --surface: #17222b;
    --ink: #e7edf1;
    --ink-2: #a5b3bd;
    --ink-3: #7f8e99;
    --line: #2d3d49;
    --line-soft: #243240;
    --det: #5fbfb2;
    --llm: #e8a35c;
    --focus: #5fbfb2;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  font-feature-settings: 'kern' 1;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, .sans {
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--det); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

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

/* Conteneur centré, commun à toutes les sections. */
.wrap {
  width: min(100% - 2 * var(--gut), var(--max));
  margin-inline: auto;
  text-align: center;
}

/**
 * Texte justifié avec césure automatique (l'attribut lang de <html> pilote
 * le dictionnaire de coupure).
 *
 * La justification n'est lisible qu'à partir d'une cinquantaine de caractères
 * par ligne ; en dessous, elle creuse des rivières de blanc. On part donc en
 * aligné à gauche et on ne justifie que lorsque le bloc est assez large —
 * mesuré sur le bloc lui-même (requête de conteneur) et non sur la fenêtre,
 * car une colonne de 20rem reste étroite sur un écran de 1400px.
 */
.just {
  text-align: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.col,
.row,
.tl-item { container-type: inline-size; }

@container (min-width: 17rem) {
  .just { text-align: justify; text-align-last: center; }
}

/* Blocs de lecture pleine largeur : hors conteneur, on mesure la fenêtre. */
@media (min-width: 36rem) {
  .lead.just,
  .flow-note.just,
  .section-lead.just { text-align: justify; text-align-last: center; }
}

/* Bloc de lecture centré dans la page. */
.read { max-width: var(--read); margin-inline: auto; }

.skip {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 50;
}
.skip:focus { left: var(--gut); top: 0.6rem; }

/* ------------------------------------------------------------- header -- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  min-height: 3.5rem;
  text-align: left;
}
.mark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.mark span { color: var(--ink-3); font-weight: 500; }

.mainnav { display: flex; align-items: center; gap: 1.5rem; }
.mainnav a {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-2);
  white-space: nowrap;
}
.mainnav a:hover { color: var(--ink); }

.langs { display: flex; gap: 0.5rem; align-items: center; }
.langs a {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-3);
  padding: 0.15rem 0.1rem;
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current='true'] { color: var(--ink); border-bottom: 2px solid var(--det); }

/* Sous 60rem le menu passe en deuxième ligne et défile, plutôt que de
   disparaître : sinon aucune navigation sur téléphone. */
@media (max-width: 60rem) {
  .topbar .wrap { flex-wrap: wrap; padding-bottom: 0.35rem; }
  .mainnav {
    order: 3;
    width: 100%;
    gap: 1.15rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.3rem;
    justify-content: center;
  }
  .mainnav::-webkit-scrollbar { display: none; }
  html { scroll-padding-top: 6rem; }
}

/* --------------------------------------------------------------- hero -- */

.hero { padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(2rem, 5vw, 3rem); }

.portrait {
  width: clamp(8.5rem, 24vw, 12.5rem);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  margin: 0 auto 1.75rem;
  border: 1px solid var(--line);
  filter: grayscale(1) contrast(1.04);
}

.role {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--det);
  margin: 0 0 1rem;
}
h1 {
  font-size: clamp(1.95rem, 1.25rem + 3.2vw, 3.5rem);
  font-weight: 700;
  margin: 0 auto 1.25rem;
  max-width: 20ch;
}
.lead {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  color: var(--ink-2);
  margin: 0 auto 2rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.btn {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--det); border-color: var(--det); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: transparent; color: var(--det); border-color: var(--det); }
.btn[disabled] { opacity: 0.55; cursor: progress; }

/* ---------------------------------------------------- rail du parcours -- */

.flow { padding-block: clamp(1rem, 3vw, 2rem) var(--band); }
.flow-title {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-3);
  margin: 0 0 1rem;
}
.rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}
@media (max-width: 62rem) { .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .rail { grid-template-columns: 1fr; } }

.step {
  padding: 1.15rem 1rem 1.3rem;
  border-left: 1px solid var(--line-soft);
  position: relative;
}
.step:first-child { border-left: 0; }
@media (max-width: 62rem) {
  .step { border-left: 1px solid var(--line-soft); border-top: 1px solid var(--line-soft); }
  .step:nth-child(odd) { border-left: 0; }
  .step:nth-child(-n + 2) { border-top: 0; }
}
@media (max-width: 30rem) {
  .step { border-left: 0; border-top: 1px solid var(--line-soft); }
  .step:first-child { border-top: 0; }
}
.step b {
  display: block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.step span {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-2);
  display: block;
  max-width: 26ch;
  margin-inline: auto;
}
.step::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: var(--det);
  transform: scaleX(0);
  transform-origin: left;
  animation: draw 0.42s ease-out forwards;
  animation-delay: 0.25s;
}
.step:nth-child(2)::before { animation-delay: 0.41s; }
.step:nth-child(3)::before { animation-delay: 0.57s; }
.step:nth-child(4)::before { animation-delay: 0.73s; }
.step:nth-child(5)::before { animation-delay: 0.89s; }
.step[data-kind='llm']::before { background: var(--llm); }
.step[data-kind='llm'] b { color: var(--llm); }
@keyframes draw { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .step::before { transform: scaleX(1); } }

.flow-note {
  margin: 1.35rem auto 0;
  max-width: var(--read);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* ----------------------------------------------------------- sections -- */

.band { padding-block: var(--band); border-top: 1px solid var(--line); }
.band-alt { background: var(--surface); }

section > .wrap > h2 {
  font-size: clamp(1.45rem, 1.15rem + 1.4vw, 2rem);
  margin: 0 auto 2rem;
  max-width: 24ch;
}
.section-lead {
  max-width: var(--read);
  color: var(--ink-2);
  margin: -1.25rem auto 2.5rem;
}

/* services */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: clamp(1.75rem, 4vw, 2.5rem);
  align-items: start;
}
.col h3 {
  font-size: 1.0625rem;
  margin: 0 0 0.7rem;
  padding-top: 0.9rem;
  border-top: 2px solid var(--ink);
}
.col p { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }

/* réalisations : des lignes centrées, pas des cartes */
.rows { border-top: 1px solid var(--line); }
.row { padding-block: 1.75rem; border-bottom: 1px solid var(--line-soft); }
.row h3 { font-size: 1.1875rem; margin: 0 0 0.5rem; }
.row p { margin: 0 auto 0.6rem; color: var(--ink-2); font-size: 0.9375rem; max-width: var(--read); }
.row .meta {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.25rem;
  justify-content: center;
}
.row .meta a { color: var(--det); font-weight: 600; }

/* parcours : une vraie séquence, l'année en tête de chaque étape */
.tl { border-top: 1px solid var(--line); }
.tl-item { padding-block: 1.9rem; border-bottom: 1px solid var(--line-soft); }
.tl-year {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--det);
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.4rem;
}
.tl-item h3 { font-size: 1.0625rem; margin: 0 0 0.45rem; }
.tl-item p { margin: 0 auto; color: var(--ink-2); font-size: 0.9375rem; max-width: var(--read); }

/* outils */
.stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.75rem;
  align-items: start;
}
.stack h3 { font-size: 0.875rem; font-weight: 600; color: var(--ink-3); margin: 0 0 0.7rem; }
.stack ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center;
}
.stack li {
  font-family: var(--sans);
  font-size: 0.8125rem;
  border: 1px solid var(--line);
  padding: 0.2rem 0.55rem;
  color: var(--ink-2);
}

.formation { margin-top: clamp(2.25rem, 5vw, 3rem); padding-top: 1.75rem; border-top: 1px solid var(--line-soft); }
.formation h3 { font-size: 0.875rem; font-weight: 600; color: var(--ink-3); margin: 0 0 0.7rem; }
.formation ul { list-style: none; margin: 0; padding: 0; }
.formation li { font-size: 1rem; }
.formation li + li { margin-top: 0.35rem; }

/* ---------------------------------------------------------- formulaires */

.forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(2.25rem, 6vw, 4rem);
  align-items: start;
}
.forms form { max-width: 26rem; margin-inline: auto; text-align: left; }

.field { display: block; margin-bottom: 1rem; }
.field > span {
  display: block;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 0.3rem;
}
input, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem; /* 16px : empêche le zoom automatique sur iOS */
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.6rem 0.7rem;
  border-radius: 0;
}
input:focus, textarea:focus { border-color: var(--det); }
textarea { min-height: 8rem; resize: vertical; }
.hp { position: absolute; left: -9999px; }

.forms .btn { width: 100%; }
.msg { font-size: 0.9375rem; margin: 0.9rem 0 0; }
.msg[data-state='ok'] { color: var(--det); }
.msg[data-state='err'] { color: var(--llm); }

/* --------------------------------------------------------------- footer */

footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}
footer .wrap { display: grid; gap: 1rem; justify-items: center; }
footer p { margin: 0; }
footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding: 0;
  justify-content: center;
}
footer a { color: var(--ink-2); }
footer a:hover { color: var(--det); }
