/* ModelIA Studio, site vitrine.
   Parti pris : la planche à dessin. Tout est clair : papier quadrillé en ouverture, calque
   ensuite, et une seule encre, le bleu de Prusse de l'atelier. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/bricolage-grotesque-latin.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face { font-family: "IBM Plex Sans"; src: url("assets/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("assets/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("assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --nuit: #0f2c56;        /* encre bleue foncée : texte des diagrammes, survols */
  --prusse: #1c4c8f;      /* accent de l'atelier */
  --calque: #f1f3f2;      /* papier calque, froid */
  --papier: #ffffff;
  --encre: #14171c;
  --encre-2: #4b5159;
  --filet: #cfd4d3;
  --rouge: #bf3526;       /* le stylo du correcteur, section norme uniquement */

  --titre: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --texte: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --marge: clamp(16px, 4vw, 56px);
  --large: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--calque);
  color: var(--encre);
  font: 400 17px/1.55 var(--texte);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
code { font: 0.9em var(--mono); }
:focus-visible { outline: 2px solid var(--prusse); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--papier); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- La planche d'ouverture : papier quadrillé, encre bleue ---------- */

.plan {
  color: var(--encre);
  background-color: var(--papier);
  background-image:
    linear-gradient(rgba(28, 76, 143, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 76, 143, 0.11) 1px, transparent 1px),
    linear-gradient(rgba(28, 76, 143, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 76, 143, 0.05) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  padding: 0 var(--marge) clamp(40px, 6vw, 88px);
  border-bottom: 1px solid var(--encre);
}

.nav-fixe { position: sticky; top: 0; z-index: 20; margin: 0 calc(-1 * var(--marge)); padding: 0 var(--marge); transition: background-color 0.25s, box-shadow 0.25s; }
.nav-fixe.colle { background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); box-shadow: 0 1px 0 var(--encre); }
.nav {
  max-width: var(--large);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}
.marque { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 18px var(--titre); letter-spacing: -0.01em; }
.marque svg { color: var(--prusse); }
.marque b { font-weight: 600; color: var(--prusse); }
.nav ul { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 30px); list-style: none; margin: 0; padding: 0; font-size: 15px; }
.nav ul a { text-decoration: none; color: var(--encre-2); padding: 6px 0; background: linear-gradient(var(--prusse), var(--prusse)) no-repeat 0 100% / 0 1.5px; transition: background-size 0.25s ease-out, color 0.2s; }
.nav ul a:hover { color: var(--encre); background-size: 100% 1.5px; }
.nav .nav-cta { color: #fff; background: var(--prusse); padding: 8px 15px; border-radius: 3px; transition: background-color 0.2s; }
.nav .nav-cta:hover { color: #fff; background: var(--nuit); }

.hero {
  max-width: var(--large);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  padding-top: clamp(28px, 5vw, 68px);
}
.soude { white-space: nowrap; }
.cote { font: 400 13px var(--mono); color: var(--prusse); margin: 0 0 22px; }
h1 {
  font: 600 clamp(36px, 4.05vw, 58px)/1.03 var(--titre);
  font-stretch: 90%;
  letter-spacing: -0.02em;
  margin: 0 0 26px;
  text-wrap: balance;
}
.chapo { font-size: clamp(17px, 1.35vw, 19px); line-height: 1.55; color: var(--encre-2); max-width: 33em; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.bouton {
  display: inline-flex; flex-direction: column; gap: 2px;
  text-decoration: none; padding: 13px 22px 12px; border-radius: 3px;
  font: 600 17px var(--texte);
}
.bouton small { font: 400 12.5px var(--mono); opacity: 0.78; }
.bouton.plein { background: var(--prusse); color: #fff; box-shadow: 5px 5px 0 rgba(28, 76, 143, 0.2); transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, background-color 0.2s; }
.bouton.plein:hover { background: var(--nuit); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 rgba(28, 76, 143, 0.26); }
.bouton.plein:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(28, 76, 143, 0.26); }
.lien-clair { color: var(--encre); text-underline-offset: 4px; text-decoration-color: var(--filet); font-size: 15.5px; transition: text-decoration-color 0.2s; }
.lien-clair:hover { text-decoration-color: currentColor; }

/* La planche : le vrai diagramme, tracé à l'encre bleue */
.planche { margin: 0; border: 1px solid var(--encre); background: var(--papier); box-shadow: 10px 10px 0 rgba(28, 76, 143, 0.12); }
.consigne { display: flex; gap: 14px; align-items: baseline; padding: 13px 16px; border-bottom: 1px solid var(--encre); font-size: 15.5px; min-height: 50px; }
.consigne .qui { font: 500 12px var(--mono); color: var(--prusse); flex: none; }
.consigne .dit.frappe::after { content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -0.18em; background: var(--prusse); animation: clignote 0.9s steps(1) infinite; }
@keyframes clignote { 50% { opacity: 0; } }
.trace { padding: clamp(10px, 1.6vw, 22px); aspect-ratio: 1175 / 792; }
.trace svg, .trace img { width: 100%; height: 100%; display: block; }
/* Recoloration de l'export (noir sur blanc) à l'encre bleue : seuls les attributs de couleur changent. */
.trace svg { background: transparent !important; }
.trace svg > rect:first-child { fill: transparent; }
.trace svg [fill="#111111"] { fill: var(--nuit); }
.trace svg [stroke="#111111"] { stroke: #17427e; }
.trace svg .pas { opacity: 0; transition: opacity 0.22s ease-out; }
.trace svg .pas.vu { opacity: 1; }
.planche figcaption { display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--encre); font-size: 13.5px; color: var(--encre-2); }
.planche figcaption span:nth-child(2) { flex: 1; }
.compte { font: 500 12.5px var(--mono); color: var(--prusse); min-width: 5.2em; }
.mini { font: 500 13.5px var(--texte); color: inherit; background: none; border: 1px solid currentColor; border-radius: 3px; padding: 5px 11px; cursor: pointer; transition: background-color 0.18s, color 0.18s; }
.planche .mini { color: var(--prusse); }
.planche .mini:hover { background: var(--prusse); color: #fff; }

/* ---------- Le calque ---------- */

.bloc { max-width: calc(var(--large) + 2 * var(--marge)); margin: 0 auto; padding: clamp(64px, 9vw, 128px) var(--marge) 0; }
.tete { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(20px, 4vw, 72px); align-items: end; margin-bottom: clamp(28px, 4vw, 52px); }
h2 { font: 600 clamp(29px, 3.2vw, 46px)/1.06 var(--titre); font-stretch: 90%; letter-spacing: -0.016em; margin: 0; text-wrap: balance; }
.tete p { margin: 0; color: var(--encre-2); max-width: 34em; }
h3 { font: 600 clamp(22px, 2vw, 28px)/1.1 var(--titre); font-stretch: 86%; letter-spacing: -0.015em; margin: 0 0 14px; }

/* Capture annotée : repères sur l'image, légende à côté */
.releve { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: clamp(18px, 2.4vw, 36px); align-items: start; }
.vue { position: relative; border: 1px solid var(--encre); background: var(--papier); box-shadow: 10px 10px 0 rgba(20, 23, 28, 0.07); }
.repere {
  transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.25s, box-shadow 0.2s;
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: 26px; height: 26px; display: grid; place-items: center;
  font: 500 13px var(--mono); color: #fff; background: var(--prusse);
  box-shadow: 0 0 0 2px #fff;
}
.legende { list-style: none; margin: 0; padding: 0; counter-reset: l; display: grid; gap: 18px; font-size: 15px; line-height: 1.45; color: var(--encre-2); }
.legende li { counter-increment: l; display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 6px; margin: -6px; cursor: default; transition: background-color 0.2s; }
.legende li.actif { background: rgba(28, 76, 143, 0.08); }
.correction .legende li.actif { background: rgba(191, 53, 38, 0.08); }
.repere.actif { transform: translate(-50%, -50%) scale(1.35); box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(28, 76, 143, 0.35); z-index: 2; }
.correction .repere.actif { box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(191, 53, 38, 0.35); }
.anime .releve:not(.vu) .repere { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
.releve.vu .repere:nth-of-type(2) { transition-delay: 0.12s; }
.releve.vu .repere:nth-of-type(3) { transition-delay: 0.24s; }
.releve.vu .repere:nth-of-type(4) { transition-delay: 0.36s; }
.releve.vu .repere:nth-of-type(5) { transition-delay: 0.48s; }
.releve.vu .repere.actif { transition-delay: 0s; }
.legende li::before { content: counter(l); width: 26px; height: 26px; display: grid; place-items: center; font: 500 13px var(--mono); color: #fff; background: var(--prusse); }
.legende.lettres li::before { content: counter(l, upper-alpha); }
.legende b { display: block; color: var(--encre); font-weight: 600; }

.correction .repere, .correction .legende li::before { background: var(--rouge); }

.duo { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 80px); align-items: center; margin-top: clamp(48px, 7vw, 96px); }
.vignette { margin: 0; border: 1px solid var(--encre); background: var(--papier); box-shadow: 10px 10px 0 rgba(20, 23, 28, 0.07); max-width: 460px; }
.duo .texte p { color: var(--encre-2); max-width: 36em; margin: 0 0 22px; }
.fiche { margin: 0; border-top: 1px solid var(--encre); }
.fiche div { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--filet); font-size: 15.5px; }
.fiche dt { font-weight: 600; }
.fiche dd { margin: 0; color: var(--encre-2); }

/* Atlas des 14 diagrammes */
.atlas { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: start; }
.arbre { display: grid; gap: 26px; }
.branche { display: grid; border-left: 1px solid var(--encre); }
.genre { margin: 0 0 4px; padding: 0 0 0 14px; font: 600 15px var(--titre); position: relative; left: -1px; border-left: 5px solid var(--encre); line-height: 1.2; }
.genre.sous { margin: 12px 0 4px 16px; border-left: 0; padding-left: 0; font: 400 12.5px var(--mono); color: var(--encre-2); }
.genre.sous ~ button { margin-left: 16px; }
.arbre button {
  transition: background-color 0.18s, color 0.18s, padding-left 0.18s;
  font: 400 15.5px var(--texte); color: var(--encre-2); text-align: left;
  background: none; border: 0; border-radius: 0; padding: 7px 12px 7px 16px; cursor: pointer; position: relative;
}
.arbre button::before { content: ""; position: absolute; left: 0; top: 50%; width: 9px; border-top: 1px solid var(--encre); }
.genre.sous ~ button::before { left: -16px; width: 25px; }
.arbre button:hover { color: var(--encre); background: rgba(20, 23, 28, 0.05); padding-left: 20px; }
.arbre button[aria-selected="true"] { color: #fff; background: var(--prusse); font-weight: 500; padding-left: 20px; }
.feuille { margin: 0; }
.feuille-cadre { border: 1px solid var(--encre); background: var(--papier); padding: clamp(12px, 2.4vw, 32px); display: grid; place-items: center; aspect-ratio: 16 / 10; box-shadow: 10px 10px 0 rgba(20, 23, 28, 0.07); }
.feuille-cadre img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; transition: opacity 0.18s ease-out; }
.feuille-cadre img.change { opacity: 0; }
.feuille figcaption { display: grid; gap: 2px; margin-top: 16px; font-size: 15.5px; color: var(--encre-2); }
.feuille figcaption b { color: var(--encre); font: 600 17px var(--titre); }
.apres { margin: clamp(28px, 4vw, 48px) 0 0; padding-top: 18px; border-top: 1px solid var(--filet); color: var(--encre-2); max-width: 46em; }

/* Feuilleteur de dispositions */
.feuilleteur { max-width: 980px; margin: 0 auto; }
.feuilleteur-vue { border: 1px solid var(--encre); background: var(--papier); box-shadow: 10px 10px 0 rgba(20, 23, 28, 0.07); }
.feuilleteur-vue img { width: 100%; transition: opacity 0.18s ease-out; }
.feuilleteur-vue img.change { opacity: 0; }
.avance { height: 3px; background: rgba(255, 255, 255, 0.18); flex: 1 1 100%; order: 9; overflow: hidden; }
.avance i { display: block; height: 100%; width: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }
.avance.tourne i { animation: avance 4.2s linear forwards; }
@keyframes avance { to { transform: scaleX(1); } }
.barre { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 12px; background: var(--encre); color: #fff; }
.barre-nom { flex: 1 1 260px; font-size: 15px; }
.barre-nom b { font-weight: 600; }
.mini.sombre { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.mini.sombre:hover { background: #fff; color: var(--encre); }
.note-bas { font-size: 14px; color: var(--encre-2); margin: 12px 0 0; }

/* Jour, nuit */
.jour-nuit { margin: 0; }
.jour-nuit .vue img { transition: opacity 0.18s ease-out; }
.jour-nuit .vue img.change { opacity: 0; }
.jour-nuit figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; font-size: 15px; color: var(--encre-2); }
.bascule { display: inline-flex; border: 1px solid var(--encre); }
.bascule button { font: 500 14.5px var(--texte); background: none; border: 0; padding: 7px 16px; cursor: pointer; color: var(--encre); }
.bascule button[aria-pressed="true"] { background: var(--encre); color: #fff; }

.sorties { display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 72px); margin-top: clamp(48px, 7vw, 96px); align-items: start; }
.sorties table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--encre); font-size: 15.5px; }
.sorties thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sorties th, .sorties td { text-align: left; vertical-align: top; padding: 12px 0; border-bottom: 1px solid var(--filet); }
.sorties tbody th { font: 500 14.5px var(--mono); width: 11.5em; padding-right: 16px; }
.sorties td { color: var(--encre-2); }

/* Téléchargement : une nomenclature */
.telecharger { padding-bottom: clamp(64px, 9vw, 120px); }
.nomenclature { border: 1px solid var(--encre); background: var(--papier); }
.ligne { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; border-bottom: 1px solid var(--encre); }
.ligne:last-child { border-bottom: 0; }
.os { padding: 20px; border-right: 1px solid var(--encre); display: grid; align-content: start; gap: 2px; }
.os b { font: 600 22px var(--titre); font-stretch: 86%; }
.os span { font: 400 12.5px var(--mono); color: var(--encre-2); }
.ligne ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.ligne li a { display: grid; gap: 3px; padding: 20px; height: 100%; text-decoration: none; font-weight: 500; border-right: 1px solid var(--filet); transition: background-color 0.18s, color 0.18s; }
.ligne li:last-child a { border-right: 0; }
.ligne li a small { font: 400 12.5px var(--mono); color: var(--encre-2); }
.ligne li a:hover { background: var(--prusse); color: #fff; }
.ligne li a:hover small { color: rgba(255, 255, 255, 0.75); }
.ligne.ici .os { background: var(--prusse); color: #fff; }
.ligne.ici .os span { color: rgba(255, 255, 255, 0.75); }
.ligne.ici .os::after { content: "votre système"; font: 400 12.5px var(--mono); margin-top: 10px; }
.premier-lancement { margin-top: 22px; font-size: 15.5px; color: var(--encre-2); max-width: 52em; }
.premier-lancement summary { cursor: pointer; color: var(--encre); font-weight: 500; padding: 6px 0; }
.premier-lancement ul { padding-left: 1.1em; display: grid; gap: 6px; }
.premier-lancement b { color: var(--encre); }

/* Cartouche : le pied de page est le cartouche du plan */
.cartouche {
  background: var(--papier); color: var(--encre);
  display: grid; grid-template-columns: 1.5fr 1.2fr 1fr 1.6fr 0.8fr 0.55fr 0.65fr;
  border-top: 1px solid var(--encre);
  font-size: 14px; line-height: 1.45;
}
.case { padding: 16px 18px 20px; border-right: 1px solid var(--encre); min-width: 0; }
.case:last-child { border-right: 0; }
.case p { margin: 0; color: var(--encre-2); }
.etq { display: block; font: 400 11.5px var(--mono); color: var(--prusse); margin-bottom: 8px; }
.gros { font: 600 24px/1.1 var(--titre) !important; font-stretch: 86%; color: var(--encre) !important; margin-bottom: 4px !important; }
.equipe ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.equipe li span { color: var(--encre-2); font-size: 12.5px; }
.equipe li span::before { content: " · "; }

/* ---------- Mouvement : chaque bloc monte en place une fois, à son entrée dans l'écran ---------- */
.anime .entree { opacity: 0; transform: translateY(22px); }
.entree { transition: opacity 0.6s ease-out, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.entree.vu { opacity: 1; transform: none; }
.anime .hero-texte > * { opacity: 0; transform: translateY(14px); animation: monte 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.anime .hero-texte > :nth-child(2) { animation-delay: 0.08s; }
.anime .hero-texte > :nth-child(3) { animation-delay: 0.16s; }
.anime .hero-texte > :nth-child(4) { animation-delay: 0.24s; }
.anime .planche { opacity: 0; animation: monte 0.7s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
@keyframes monte { to { opacity: 1; transform: none; } }
.vue img, .vignette img { transition: opacity 0.18s ease-out; }
.vue, .vignette, .feuille-cadre, .feuilleteur-vue { transition: box-shadow 0.25s ease-out, transform 0.25s ease-out; }
.vue:hover, .vignette:hover, .feuille-cadre:hover, .feuilleteur-vue:hover { transform: translate(-3px, -3px); box-shadow: 13px 13px 0 rgba(20, 23, 28, 0.09); }

/* ---------- Petits écrans ---------- */

@media (max-width: 1020px) {
  br.large { display: none; }
  .hero, .tete, .duo, .sorties { grid-template-columns: minmax(0, 1fr); }
  .tete { align-items: start; }
  .releve { grid-template-columns: minmax(0, 1fr); }
  .legende { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
  .atlas { grid-template-columns: minmax(0, 1fr); }
  .arbre { grid-template-columns: 1fr 1fr; gap: 18px; }
  .cartouche { grid-template-columns: repeat(3, 1fr); }
  .case { border-bottom: 1px solid var(--encre); }
  .case.large, .case.equipe { grid-column: span 3; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav ul li:not(:last-child) { display: none; }
  .repere { width: 18px; height: 18px; font-size: 10px; box-shadow: 0 0 0 1px #fff; }
  .arbre { grid-template-columns: minmax(0, 1fr); }
  .ligne { grid-template-columns: minmax(0, 1fr); }
  .os { border-right: 0; border-bottom: 1px solid var(--filet); }
  .ligne li a { border-right: 0; border-bottom: 1px solid var(--filet); }
  .fiche div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .planche figcaption { flex-wrap: wrap; }
  .cartouche { grid-template-columns: 1fr 1fr; }
  .case.large, .case.equipe { grid-column: span 2; }
  .sorties tbody th { width: 7.5em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
