@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var.woff2") format("woff2-variations"), url("fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #eef1f4;
  --ink: #14213d;
  --muted: #56627a;
  --rule: #c7cfda;
  --signal: #f2b705;
  --field: #ffffff;
  --measure: 38rem;
  --wrap: 72rem;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--signal); text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }

/* ---------- En-tête ---------- */
.site-header { padding: 1.5rem 0; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 800; font-stretch: 125%; font-size: 1.35rem; letter-spacing: -0.02em; text-decoration: none; }
.site-nav { display: flex; gap: 1.5rem; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Héros ---------- */
.hero { padding: clamp(2rem, 7vw, 5.5rem) 0 clamp(3rem, 8vw, 6rem); }
.hero .wrap { display: grid; grid-template-columns: 1fr; gap: clamp(2.5rem, 6vw, 4rem); align-items: center; }
@media (min-width: 60rem) { .hero .wrap { grid-template-columns: 7fr 5fr; } }

.hero h1 {
  margin: 0;
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(2.4rem, 6.2vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 15ch;
}
.hero .lead { margin: 1.75rem 0 0; max-width: 34rem; font-size: 1.2rem; color: var(--muted); }
.hero .actions { margin-top: 2.25rem; display: flex; gap: 1rem 1.5rem; flex-wrap: wrap; align-items: center; }

.button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 0.85rem 1.4rem;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  border-radius: 2px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--signal);
}
.button:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--signal); }
.button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--signal); }

/* Schéma de workflow */
.flow { width: 100%; max-width: 26rem; justify-self: center; }
.flow svg { width: 100%; height: auto; display: block; overflow: visible; }
.flow .node rect { fill: var(--field); stroke: var(--ink); stroke-width: 1.5; }
.flow .node .kind { font-size: 12.5px; font-stretch: 75%; font-weight: 600; fill: var(--muted); }
.flow .node .what { font-size: 15px; font-weight: 600; fill: var(--ink); }
.flow .wire { fill: none; stroke: var(--rule); stroke-width: 2; }
.flow .current { fill: none; stroke: var(--signal); stroke-width: 4; stroke-linecap: round; }
.flow .done { opacity: 0; font-size: 13px; font-weight: 600; fill: var(--ink); }
.flow figcaption { margin-top: 0.75rem; font-size: 0.9rem; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .flow .current { stroke-dasharray: 420; stroke-dashoffset: 420; animation: run 2.6s cubic-bezier(.6,.05,.3,1) 0.6s forwards; }
  .flow .n1 rect { animation: lit 0.3s 0.5s forwards; }
  .flow .n2 rect { animation: lit 0.3s 1.3s forwards; }
  .flow .n3 rect { animation: lit 0.3s 2.0s forwards; }
  .flow .n4 rect { animation: lit 0.3s 2.8s forwards; }
  .flow .done { animation: show 0.4s 3.2s forwards; }
}
@media (prefers-reduced-motion: reduce) {
  .flow .node rect { stroke: var(--ink); stroke-width: 2.5; }
  .flow .done { opacity: 1; }
}
@keyframes run { to { stroke-dashoffset: 0; } }
@keyframes lit { to { stroke-width: 2.5; fill: #fff8e0; } }
@keyframes show { to { opacity: 1; } }

/* ---------- Sections ---------- */
section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
section + section { border-top: 1px solid var(--rule); }

h2 {
  margin: 0 0 1rem;
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 22ch;
}
.intro { margin: 0 0 3rem; max-width: var(--measure); color: var(--muted); font-size: 1.1rem; }
h3 { margin: 0; font-size: 1.3rem; font-weight: 700; font-stretch: 105%; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0 0 1rem; }

/* Automatisations */
.cases { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
.case { display: grid; gap: 1rem 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .case { grid-template-columns: 16rem 1fr; } }
.case header p { margin: 0.6rem 0 0; font-size: 0.95rem; color: var(--muted); }
.case dl { margin: 0; display: grid; gap: 1rem; max-width: 40rem; }
.case dt { font-weight: 700; font-size: 0.95rem; }
.case dd { margin: 0.15rem 0 0; }
.case .tools { font-stretch: 85%; color: var(--muted); }
.status {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  background: var(--field);
  border-left: 4px solid var(--signal);
}

/* Méthode */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; counter-reset: step; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(4, 1fr); gap: 2.5rem; } }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  font-weight: 800;
  font-stretch: 125%;
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: 0.75rem;
  color: var(--ink);
  -webkit-text-stroke: 0;
}
.steps h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.steps p { color: var(--muted); font-size: 0.98rem; }

/* Technique */
.tech { display: grid; gap: 2.5rem; }
@media (min-width: 52rem) { .tech { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.tech ul { margin: 0; padding: 0; list-style: none; }
.tech li { padding: 0.7rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; }
.tech li strong { font-weight: 700; }
.tech li span { color: var(--muted); }

/* À propos */
.about p { max-width: var(--measure); font-size: 1.15rem; }

/* Contact */
.contact .wrap { display: grid; gap: 2.5rem; }
@media (min-width: 52rem) { .contact .wrap { grid-template-columns: 5fr 7fr; gap: 4rem; } }
form { display: grid; gap: 1.25rem; max-width: 36rem; }
label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
input, textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 0.75rem 0.85rem;
  width: 100%;
}
textarea { min-height: 9rem; resize: vertical; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.88rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.6em; margin: 0; font-weight: 600; }
.form-status.ok { border-left: 4px solid var(--signal); padding-left: 0.75rem; }
.form-status.err { color: #9b1c1c; }
.consent { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* Pied de page */
.site-footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Page texte (mentions légales) */
.page { padding: clamp(2rem, 6vw, 4rem) 0 5rem; }
.page h1 { font-weight: 800; font-stretch: 112%; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.025em; line-height: 1.05; margin: 0 0 2rem; }
.page h2 { font-size: 1.35rem; margin-top: 2.5rem; }
.page p, .page li { max-width: var(--measure); }

/* ---------- Veille ---------- */
.vl-page section { padding: 0; border-top: 0; }
.vl-page .intro { margin-bottom: 2rem; }

/* Onglets */
.vl-onglets { display: flex; gap: 0.25rem 1.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin-bottom: 2rem; }
.vl-onglets [role="tab"] {
  font: inherit; font-weight: 600; color: var(--muted);
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 0.6rem 0; margin-bottom: -1px; cursor: pointer;
}
.vl-onglets [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--signal); }
.vl-onglets [role="tab"]:hover { color: var(--ink); }
.vl-panneau:focus-visible { outline-offset: 6px; }

/* Formulaire */
#vl-form { max-width: 40rem; margin-bottom: 2rem; }
#vl-form fieldset { border: 0; padding: 0; margin: 0; }
#vl-form legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; padding: 0; }
.vl-cases { display: grid; gap: 0.4rem 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 36rem) { .vl-cases { grid-template-columns: 1fr 1fr; } }
.vl-note-demo { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0; }
.vl-case { display: flex; gap: 0.55rem; align-items: center; font-weight: 400; font-size: 1rem; cursor: pointer; }
.vl-case input { width: 1.15rem; height: 1.15rem; accent-color: var(--ink); margin: 0; flex: none; }
#vl-form select {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--field);
  border: 1.5px solid var(--ink); border-radius: 2px; padding: 0.65rem 0.75rem; width: 100%; max-width: 22rem;
}
#vl-form .button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 var(--rule); }

/* Étapes du traitement, dans l'esprit du schéma .flow */
.vl-etapes { list-style: none; margin: 0 0 2.5rem; padding: 0; max-width: 34rem; counter-reset: vl; }
.vl-etapes li {
  counter-increment: vl; position: relative;
  display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; align-items: center;
  padding: 0.7rem 0.9rem; margin: 0 0 0.9rem 2.2rem;
  background: var(--field); border: 1.5px solid var(--rule); transition: border-color .3s, background .3s;
}
.vl-etapes li::before {
  content: counter(vl); position: absolute; left: -2.2rem; top: 50%; transform: translateY(-50%);
  width: 1.5rem; text-align: center; font-weight: 800; font-stretch: 125%; color: var(--muted);
}
.vl-etapes li + li::after {
  content: ""; position: absolute; left: -1.5rem; top: -0.95rem; width: 2px; height: 0.9rem; background: var(--rule);
}
.vl-etapes .vl-nom { font-weight: 700; }
.vl-etapes .vl-detail { grid-column: 1; font-size: 0.88rem; color: var(--muted); font-stretch: 90%; }
.vl-etapes .vl-compteur {
  grid-column: 2; grid-row: 1 / span 2; font-weight: 800; font-stretch: 112%;
  font-size: 1.6rem; font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right;
}
.vl-etapes li.vl-actif { border-color: var(--signal); background: #fff8e0; }
.vl-etapes li.vl-actif::before, .vl-etapes li.vl-fait::before { color: var(--ink); }
.vl-etapes li.vl-fait { border-color: var(--ink); }
.vl-etapes li.vl-fait::after, .vl-etapes li.vl-actif::after { background: var(--signal); }
.vl-etapes li.vl-echec { border-color: #9b1c1c; }

/* Rapport */
.vl-rapport { max-width: 48rem; }
.vl-entete h2 { margin: 0 0 0.5rem; font-size: clamp(1.5rem, 3vw, 2rem); max-width: none; }
.vl-profil { color: var(--muted); font-size: 0.95rem; }
.vl-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.vl-chiffres div { display: flex; flex-direction: column-reverse; justify-content: flex-end; border-top: 3px solid var(--ink); padding-top: 0.5rem; }
.vl-chiffres dd { margin: 0; font-weight: 800; font-stretch: 125%; font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1; }
.vl-chiffres dt { font-size: 0.88rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.3; }

.vl-priorite { background: var(--field); border-left: 4px solid var(--signal); padding: 1rem 1.25rem !important; margin-bottom: 2.5rem; }
.vl-priorite h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.vl-priorite ul { margin: 0; padding: 0; list-style: none; }
.vl-priorite li { padding: 0.35rem 0; border-top: 1px solid var(--rule); max-width: none; }
.vl-priorite li:first-child { border-top: 0; }
.vl-priorite li span { white-space: nowrap; font-weight: 600; font-size: 0.9rem; }

.vl-metier { margin-bottom: 2.5rem; }
.vl-metier h3 { padding-bottom: 0.4rem; border-bottom: 1px solid var(--rule); margin-bottom: 0.25rem; }
.vl-metier h3 span { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.vl-fiche { padding: 1rem 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 1rem; }
.vl-fiche:target { background: #fff8e0; box-shadow: -0.75rem 0 0 #fff8e0, 0.75rem 0 0 #fff8e0; }
.vl-fiche h4 { margin: 0.2rem 0 0.4rem; font-size: 1.05rem; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.vl-fiche p { margin: 0 0 0.3rem; }
.vl-acheteur { font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }
.vl-date strong { font-weight: 700; }
.vl-montant { font-size: 0.95rem; }
.vl-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.vl-tag { font-size: 0.8rem; font-weight: 600; background: var(--paper); border: 1px solid var(--rule); padding: 0.05rem 0.45rem; }
.vl-lien { font-size: 0.92rem; }
.vl-fiche.vl-cloture { color: var(--muted); opacity: 0.6; }

.vl-annulations { font-size: 0.9rem; color: var(--muted); }
.vl-vide { border-left: 4px solid var(--signal); background: var(--field); padding: 1rem 1.25rem; }
.vl-pied { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.vl-pied .vl-source { font-size: 0.85rem; color: var(--muted); margin-top: 1.25rem; }
.vl-erreur { border-left: 4px solid #9b1c1c; background: var(--field); padding: 1rem 1.25rem; max-width: 40rem; }
.vl-chargement { color: var(--muted); }
