/* ==========================================================================
   Site PPPE — DA « atelier » : graphite, orange sécurité, papier millimétré.
   ========================================================================== */

:root {
  --fond: #15171a;
  --fond-2: #1a1d21;
  --surface: #1f2327;
  --surface-2: #262b30;
  --ligne: #33393f;
  --texte: #efeae0;
  --texte-2: #b7b0a3;
  --texte-3: #7f7a70;
  --orange: #ff7a1a;
  --bleu: #4fa3d1;
  --vert: #7bd389;
  --accent: var(--orange);

  --titres: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --corps: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;

  --rayon: 10px;
  --gap-frise: 28px;
  --carte-largeur: 272px;
  --rail-y: 30px;
  --largeur-max: 1180px;
  --ombre: 0 18px 40px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--corps);
  font-size: 17px;
  line-height: 1.55;
  color: var(--texte);
  background-color: var(--fond);
  background-image:
    linear-gradient(rgba(239, 234, 224, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 234, 224, .045) 1px, transparent 1px),
    linear-gradient(rgba(239, 234, 224, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 234, 224, .02) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-font-smoothing: antialiased;
}

.conteneur { width: min(100% - 40px, var(--largeur-max)); margin-inline: auto; }

h1, h2, h3 { font-family: var(--titres); line-height: 1.05; margin: 0; }

/* Boutons -------------------------------------------------------------- */
.bouton {
  font: 600 15px/1 var(--titres);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fond);
  background: var(--orange);
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease, background .15s ease;
}
.bouton:hover { background: #ff8f3f; transform: translateY(-1px); }
.bouton--secondaire { background: transparent; color: var(--texte); border: 1px solid var(--ligne); }
.bouton--secondaire:hover { background: var(--surface-2); }
.bouton:disabled { opacity: .35; cursor: default; transform: none; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* En-tête --------------------------------------------------------------- */
.entete {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 80px);
  border-bottom: 1px solid var(--ligne);
  background: linear-gradient(180deg, rgba(255, 122, 26, .07), transparent 60%);
}
.entete .conteneur { position: relative; z-index: 1; max-width: 820px; margin-inline: auto; }
@media (min-width: 1000px) { .entete .conteneur { margin-left: max(20px, calc((100% - var(--largeur-max)) / 2)); } }

.surtitre {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 18px;
  font: 600 14px/1 var(--titres);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
}
.surtitre .sep { width: 40px; height: 1px; background: var(--orange); opacity: .6; }

.titre {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 14px;
}
/* trait de cote sous le titre */
.titre::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 120px; height: 3px;
  background: var(--orange);
  box-shadow: 0 0 0 0 transparent;
}
.sous-titre {
  margin: 14px 0 0;
  font: 500 clamp(22px, 3vw, 32px)/1.2 var(--titres);
  color: var(--texte-2);
}
.intro { max-width: 68ch; margin: 24px 0 0; color: var(--texte-2); }

.organisation {
  list-style: none; padding: 0;
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--ligne);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  overflow: hidden;
}
.organisation li { background: var(--surface); padding: 18px 20px; position: relative; }
.organisation li::before {
  content: ""; position: absolute; top: 10px; left: 12px;
  width: 8px; height: 8px; border-left: 1px solid var(--texte-3); border-top: 1px solid var(--texte-3);
}
.organisation .chiffre {
  display: block;
  font: 700 clamp(34px, 4vw, 44px)/1 var(--titres);
  color: var(--orange);
}
.organisation .libelle { display: block; margin-top: 6px; font-size: 14px; color: var(--texte-2); line-height: 1.3; }

.entete-decor {
  position: absolute; right: -6%; top: 50%;
  width: clamp(320px, 42vw, 620px); height: auto;
  transform: translateY(-50%) rotate(-8deg);
  color: var(--orange);
  opacity: .16;
  pointer-events: none;
}
@media (max-width: 999px) { .entete-decor { right: -40%; opacity: .1; } }

/* Sections -------------------------------------------------------------- */
.section-titre {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  text-transform: uppercase;
  display: flex; align-items: baseline; gap: 14px;
}
.repere {
  font: 600 14px/1 var(--titres);
  letter-spacing: .1em;
  color: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 999px;
  padding: 5px 10px 4px;
  transform: translateY(-6px);
}
.section-sous-titre { margin: 10px 0 0; color: var(--texte-2); max-width: 60ch; }

/* Frise ----------------------------------------------------------------- */
.frise { padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 6vw, 72px); }
.frise-tete { margin-bottom: 36px; }

.legende {
  list-style: none; padding: 0;
  margin: 22px 0 0;
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  font-size: 14px; color: var(--texte-2);
}
.legende li { display: flex; align-items: center; gap: 10px; }
.legende .pastille { width: 22px; height: 4px; border-radius: 2px; background: var(--accent); }
.legende .num { font: 600 13px/1 var(--titres); letter-spacing: .08em; color: var(--texte-3); }

.frise-cadre { position: relative; }
.frise-defile {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: max(60px, calc((100vw - var(--largeur-max)) / 2));
  scrollbar-width: thin;
  scrollbar-color: var(--ligne) transparent;
  padding: 12px 0 28px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
.frise-rail {
  list-style: none; margin: 0;
  display: flex; align-items: flex-start;
  gap: var(--gap-frise);
  padding: 0 max(60px, calc((100vw - var(--largeur-max)) / 2));
  width: max-content;
  min-width: 100%;
}

.frise-nav {
  position: absolute; top: calc(var(--rail-y) + 12px); z-index: 2;
  width: 44px; height: 44px;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px solid var(--ligne);
  background: var(--surface);
  color: var(--texte);
  font-size: 28px; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--ombre);
  transition: background .15s;
}
.frise-nav:hover { background: var(--surface-2); }
.frise-nav--prec { left: 8px; }
.frise-nav--suiv { right: 8px; }
@media (max-width: 899px) { .frise-nav { display: none; } }

/* Carte séance */
.seance {
  --accent: var(--orange);
  position: relative;
  flex: 0 0 var(--carte-largeur);
  scroll-snap-align: start;
  padding-top: calc(var(--rail-y) + 34px);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
  transition-delay: var(--delai, 0ms);
}
.seance.visible { opacity: 1; transform: none; }
.seance--conception { --accent: var(--orange); }
.seance--miseAuPoint { --accent: var(--bleu); }
.seance--tournoi { --accent: var(--vert); }

/* le rail : un segment par carte, prolongé pour couvrir l'espace */
.seance::before {
  content: "";
  position: absolute;
  top: var(--rail-y);
  left: 0; right: calc(-1 * var(--gap-frise));
  height: 4px;
  background: var(--accent);
  opacity: .55;
}
.seance:last-child::before { right: 0; }

/* repère de nomenclature posé sur le rail */
.seance-repere {
  position: absolute;
  top: calc(var(--rail-y) + 2px);
  left: 0;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--fond);
  color: var(--texte);
  font: 700 18px/1 var(--titres);
  display: grid; place-items: center;
  z-index: 1;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.seance-carte {
  display: block; width: 100%;
  text-align: left;
  font: inherit; color: inherit;
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-top: 3px solid var(--accent);
  border-radius: var(--rayon);
  padding: 16px 18px 18px;
  cursor: pointer;
  min-height: 190px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.seance-carte:hover, .seance-carte:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--ombre);
}
.seance:hover .seance-repere { background: var(--accent); color: var(--fond); transform: translateY(-50%) scale(1.08); }

.seance-date {
  font: 600 13px/1 var(--titres);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.seance-titre { font: 600 22px/1.15 var(--titres); flex: 1; }
.seance-etat {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  font-size: 12.5px; font-weight: 500;
  color: var(--texte-3);
  border: 1px dashed var(--ligne);
  border-radius: 999px;
  padding: 4px 10px;
}
.seance-etat--docs { color: var(--texte); border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.seance-etat--docs::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.seance--passee .seance-carte { opacity: .62; }
.seance--passee .seance-repere { border-style: dashed; }
.seance--passee .seance-carte:hover { opacity: 1; }

.seance--prochaine .seance-repere { background: var(--accent); color: var(--fond); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 22%, transparent); }
.seance--prochaine .seance-carte { border-color: var(--accent); background: var(--surface-2); }
.seance--prochaine::after {
  content: "Prochaine séance";
  position: absolute; top: calc(var(--rail-y) - 30px); left: 0;
  font: 600 12px/1 var(--titres);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}

/* Jalons (livrable, fabrication) */
.jalon {
  position: relative;
  flex: 0 0 auto;
  padding-top: calc(var(--rail-y) + 34px);
  width: 150px;
  opacity: 0; transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
  transition-delay: var(--delai, 0ms);
}
.jalon.visible { opacity: 1; transform: none; }
.jalon::before {
  content: "";
  position: absolute; top: var(--rail-y); left: 0; right: calc(-1 * var(--gap-frise)); height: 4px;
  background: repeating-linear-gradient(90deg, var(--texte-3) 0 8px, transparent 8px 16px);
  opacity: .6;
}
.jalon-icone {
  position: absolute; top: calc(var(--rail-y) + 2px); left: 0; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--texte-3);
  display: grid; place-items: center; z-index: 1;
  color: var(--texte);
}
.jalon-icone svg { width: 20px; height: 20px; }
.jalon--livrable .jalon-icone { border-color: var(--orange); color: var(--orange); }
.jalon-texte { font: 600 15px/1.2 var(--titres); color: var(--texte-2); text-transform: uppercase; letter-spacing: .04em; }
.jalon-date { display: block; margin-top: 4px; font: 500 12px/1 var(--corps); color: var(--texte-3); text-transform: none; letter-spacing: 0; }

/* Frise verticale sur petit écran */
@media (max-width: 899px) {
  :root { --rail-y: 0px; }
  .frise-defile { overflow: visible; padding: 0; mask-image: none; -webkit-mask-image: none; }
  .frise-rail {
    flex-direction: column; align-items: stretch;
    gap: 22px; width: auto; min-width: 0;
    padding: 0 20px 0 20px;
  }
  .seance, .jalon { flex: none; width: auto; padding: 0 0 0 64px; }
  .seance::before, .jalon::before {
    top: 0; bottom: -22px; left: 20px; right: auto; width: 4px; height: auto;
  }
  .jalon::before { background: repeating-linear-gradient(180deg, var(--texte-3) 0 8px, transparent 8px 16px); }
  .seance:last-child::before { bottom: 0; }
  .seance-repere, .jalon-icone { top: 18px; left: 0; transform: none; }
  .seance:hover .seance-repere { transform: scale(1.08); }
  .seance--prochaine::after { top: -4px; left: 64px; }
  .seance--prochaine { padding-top: 16px; }
  .seance-carte { min-height: 0; }
  .jalon { padding-top: 6px; min-height: 48px; }
}

.frise-erreur { color: var(--orange); padding: 20px; }

.sans-js { color: var(--texte-2); }

/* Livrable -------------------------------------------------------------- */
.livrable { padding: clamp(48px, 7vw, 96px) 0; border-top: 1px solid var(--ligne); background: var(--fond-2); }
.livrable-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 899px) { .livrable-grille { grid-template-columns: 1fr; gap: 28px; } }
.livrable-date { margin: 18px 0 0; font: 600 22px/1 var(--titres); text-transform: uppercase; }
.etiquette { font-size: 13px; letter-spacing: .14em; color: var(--orange); margin-right: 8px; }
.livrable-intro { color: var(--texte-2); margin: 16px 0 0; }
.livrable-apres { color: var(--texte-3); font-size: 15px; margin: 14px 0 0; padding-left: 14px; border-left: 2px solid var(--ligne); }
.livrable-elements {
  list-style: none; margin: 0; padding: 0;
  counter-reset: piece;
  border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden;
  background: var(--surface);
}
.livrable-elements li {
  counter-increment: piece;
  display: flex; gap: 16px; align-items: baseline;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ligne);
}
.livrable-elements li:last-child { border-bottom: 0; }
.livrable-elements li::before {
  content: counter(piece, decimal-leading-zero);
  font: 600 14px/1 var(--titres);
  letter-spacing: .08em;
  color: var(--orange);
  min-width: 26px;
}
.livrable-elements li::first-letter { text-transform: uppercase; }

/* Compétences ------------------------------------------------------------ */
.competences { padding: clamp(48px, 7vw, 96px) 0; border-top: 1px solid var(--ligne); }
.competences-liste {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 32px;
}
.competences-liste li {
  position: relative; padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--ligne);
  color: var(--texte-2);
}
.competences-liste li::first-letter { text-transform: uppercase; }
.competences-liste li::before {
  content: ""; position: absolute; left: 0; top: 19px;
  width: 12px; height: 12px;
  border: 2px solid var(--orange); border-radius: 2px; transform: rotate(45deg) scale(.7);
}

/* Pied ------------------------------------------------------------------- */
.pied { border-top: 1px solid var(--ligne); padding: 28px 0 36px; font-size: 14px; color: var(--texte-3); }
.pied p { margin: 0; }
.pied-note { margin-top: 4px; }

/* Fiche (dialog) --------------------------------------------------------- */
.fiche {
  --accent: var(--orange);
  position: fixed; inset: 0 0 0 auto;
  width: min(520px, 100vw);
  height: 100dvh; max-height: none; max-width: none;
  margin: 0; padding: 0;
  border: 0; border-left: 1px solid var(--ligne);
  background: var(--fond-2);
  color: var(--texte);
  box-shadow: var(--ombre);
  overflow-y: auto;
  transform: translateX(24px); opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.fiche[open] { transform: none; opacity: 1; }
.fiche::backdrop { background: rgba(10, 11, 13, .7); backdrop-filter: blur(2px); }
.fiche--conception { --accent: var(--orange); }
.fiche--miseAuPoint { --accent: var(--bleu); }
.fiche--tournoi { --accent: var(--vert); }

.fiche-contenu { padding: 28px 30px 34px; display: flex; flex-direction: column; gap: 26px; min-height: 100%; }
.fiche-tete { position: relative; border-left: 4px solid var(--accent); padding-left: 18px; padding-right: 48px; }
.fiche-fermer {
  position: absolute; right: -6px; top: -8px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--ligne); background: var(--surface);
  color: var(--texte); font-size: 26px; line-height: 1; cursor: pointer;
}
.fiche-fermer:hover { background: var(--surface-2); }
.fiche-periode { margin: 0; font: 600 13px/1 var(--titres); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.fiche-numero { margin: 10px 0 0; display: flex; align-items: center; gap: 12px; color: var(--texte-2); font-size: 15px; }
.fiche-numero-repere {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--accent); font: 700 15px/1 var(--titres); color: var(--texte);
}
.fiche-titre { margin-top: 10px; font-size: clamp(28px, 4vw, 36px); font-weight: 600; }

.fiche-bloc h3 {
  font-size: 15px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--texte-3);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.fiche-bloc h3::after { content: ""; flex: 1; height: 1px; background: var(--ligne); }
.fiche-bloc p { margin: 0; color: var(--texte-2); }

.fiche-documents { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.doc-groupe { display: flex; flex-direction: column; gap: 8px; }
.doc-categorie {
  align-self: flex-start;
  font: 600 12px/1 var(--titres); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 4px 8px 3px;
}
.doc-liste { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.doc {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--ligne); border-radius: 8px; background: var(--surface);
}
.doc-titre { font-weight: 500; }
.doc-boutons { display: flex; gap: 8px; }
.doc-boutons .bouton { padding: 9px 14px; font-size: 14px; }
.documents-projet { margin-top: 28px; }
.documents-projet h3 { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--texte-3); margin-bottom: 10px; }
.fiche-documents .bouton { background: var(--accent); }
.fiche-documents .bouton:hover { filter: brightness(1.12); }
.fiche-documents .bouton--secondaire { background: transparent; }
.fiche-documents .bouton--secondaire:hover { background: var(--surface-2); filter: none; }
.fiche-bientot {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border: 1px dashed var(--ligne); border-radius: 6px;
  color: var(--texte-3); font-size: 15px;
}
.fiche-bientot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--texte-3); }

.fiche-nav { margin-top: auto; display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--ligne); }

@media (max-width: 899px) {
  .fiche { width: 100vw; border-left: 0; }
  .fiche-contenu { padding: 22px 20px 28px; }
}

/* Mouvement réduit --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .seance, .jalon { opacity: 1; transform: none; transition: none; }
  .fiche { transition: none; transform: none; }
  .seance-carte, .seance-repere, .bouton { transition: none; }
}
