/*
  Six-Mille, portfolio.

  Le parti pris : la page est noire et vide, les travaux sont la seule
  chose qu'on y voit. L'interface tient en quatre étiquettes dans les
  coins, en petites capitales. Aucun texte de présentation : si le travail
  ne parle pas, une phrase n'y changera rien.

  Le relief vient de la 3D du navigateur, pas d'un moteur de rendu : une
  grille en perspective au sol, des panneaux inclinés selon leur distance
  au centre. Un téléphone sait faire ça sans chauffer.
*/

:root {
  /* La charte Six-Mille, transposée sur fond sombre : l'encre de la marque
     devient le fond, la crème devient l'encre, le vert sapin reste l'accent. */
  --noir: #0d1a16;
  --blanc: #f4efd3;
  --vert: #2e5c50;
  --fond-haut: #122420;
  --gris: rgba(244, 239, 211, 0.42);
  --trait: rgba(244, 239, 211, 0.14);
  --trait-sol: rgba(244, 239, 211, 0.30);
  --marge: clamp(16px, 3.2vw, 40px);
  /* Lu par portfolio.js : c'est ce qui fixe la distance d'un panneau au
     suivant, donc la hauteur de la liste, donc la periode du modulo. */
  --ecart-panneau: 7vh;
  /* L'adouci des sites qui soignent leurs entrees : part vite, finit a
     peine, et c'est ce qui donne la sensation de poids. */
  --expo: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  /* Un fond qui s'éclaircit vers le haut : la scène a un ciel, les
     panneaux s'en détachent au lieu de flotter dans du noir plat. */
  background: radial-gradient(120% 90% at 50% 8%, var(--fond-haut) 0%, var(--noir) 62%);
  color: var(--blanc);
  font-family: Manrope, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  margin: 0;
}

/* Le sol : une grille qui fuit vers l'horizon. Deux dégradés répétés,
   couchés par une rotation. Rien d'autre, et ça ne coûte rien. */
.sol {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 300vw;
  height: 70vh;
  margin-left: -150vw;
  background-image:
    repeating-linear-gradient(to right, var(--trait-sol) 0 1px, transparent 1px 90px),
    repeating-linear-gradient(to bottom, var(--trait-sol) 0 1px, transparent 1px 90px);
  transform: perspective(900px) rotateX(62deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

/* Les quatre étiquettes des coins. */
.coin {
  position: fixed;
  z-index: 10;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.coin--hautgauche { top: var(--marge); left: var(--marge); }
.coin--basgauche { bottom: var(--marge); left: var(--marge); color: var(--gris); }
/* Les deux étiquettes cliquables ne gardent pas de marge : leur pastille
   part du bord de l'écran, c'est elle qui porte l'écart au texte. */
.coin--hautdroite { top: 0; right: 0; }
.coin--basdroite { bottom: 0; right: 0; }
.coin a, .marque {
  color: var(--blanc);
  text-decoration: none;
  transition: opacity 0.3s;
}
.coin a:hover { opacity: 0.55; }

/* ------------------------------------------------------------------ *
 * Les pastilles.
 *
 * Les deux liens se lisaient mal : écrits petit, ils passaient devant des
 * sites qui défilent, et le texte se perdait dans l'image. Ils reposent
 * maintenant sur un aplat qui épouse le coin de l'écran. Seul l'angle
 * intérieur est arrondi : les deux autres suivent le bord, donc la
 * pastille paraît posée dessus plutôt que flottante.
 *
 * Les couleurs sont celles de la charte, à l'envers du reste de la page :
 * le beige devient le fond, le vert devient l'encre. Un fond sombre et
 * translucide avait été essayé d'abord : il détachait mal les deux liens
 * d'une page où des sites clairs défilent en permanence.
 *
 * Minces, volontairement : c'est un repère, pas un bouton de formulaire.
 * ------------------------------------------------------------------ */
/* Le sélecteur porte le `a` : sans lui, la règle `.coin a` plus haut
   gagne la cascade et le texte sort beige sur beige, donc invisible. */
.coin a.pastille {
  display: block;
  padding: 15px calc(var(--marge) + 6px);
  font-size: 12px;
  font-weight: 600;
  background: var(--blanc);
  color: var(--vert);
  transition: background 0.3s, color 0.3s;
}
.coin--hautdroite .pastille {
  border-radius: 0 0 0 18px;
  padding-top: calc(15px + env(safe-area-inset-top, 0px));
}
.coin--basdroite .pastille {
  border-radius: 18px 0 0 0;
  padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
}
/* Au survol, l'inversion s'inverse encore : fond vert, texte beige. */
.coin a.pastille:hover { opacity: 1; background: var(--vert); color: var(--blanc); }
.marque img { display: block; height: 20px; width: auto; filter: brightness(0) invert(1) sepia(0.12); opacity: 0.92; }

/* La galerie : des panneaux empilés qu'on traverse en descendant.
   Le défilement est vertical, et c'est voulu : on voit dépasser le projet
   du dessus et celui du dessous, donc on comprend tout de suite qu'il y a
   quelque chose à faire défiler. En horizontal, rien ne le disait. */
main {
  position: relative;
  z-index: 1;
  height: 100%;
}
.galerie {
  position: fixed;
  inset: 0;
  overflow: hidden;
  perspective: 1500px;
  perspective-origin: 50% 50%;
  outline: none;
  /* Le navigateur ne doit surtout pas s'en meler : c'est portfolio.js qui
     place les panneaux, et son defilement n'a ni debut ni fin. */
  touch-action: none;
}

/* Les panneaux s'effacent en haut et en bas plutôt que de passer sous les
   étiquettes des coins : sans ça, le logotype se superpose à un projet. */
main::before,
main::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  height: 16vh;
  z-index: 5;
  pointer-events: none;
}
main::before { top: 0; background: linear-gradient(to bottom, var(--fond-haut) 14%, transparent); }
main::after { bottom: 0; background: linear-gradient(to top, var(--noir) 16%, transparent); }

.panneau {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: min(72vw, 940px);
  margin: 0;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  /* Pas de transition sur l'opacite : elle est reecrite a chaque image,
     une transition ne ferait que la retarder d'un cran. */
}
.panneau-cadre {
  /* Un bloc, pas un texte : `aspect-ratio` ne s'applique pas à un élément
     en ligne, et la hauteur du cadre serait restée celle de la vidéo. */
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: #0a1411;
  box-shadow: 0 48px 110px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(244, 239, 211, 0.07);
  aspect-ratio: 16 / 10;
}
.panneau-cadre img,
.panneau-cadre video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 20px;
}
.masque {
  display: block;
  overflow: hidden;
}
.masque > * { display: block; }

.panneau-legende {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  text-align: left;
}
.panneau-nom {
  font-family: Jost, sans-serif;
  font-weight: 400;
  font-size: clamp(16px, 1.7vw, 21px);
  letter-spacing: -0.01em;
  color: var(--blanc);
}
.marqueur {
  font-style: normal;
  border: 1px solid var(--trait);
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 10px;
  color: var(--blanc);
}
.panneau-metier {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gris);
}

@media (max-width: 820px) {
  :root { --ecart-panneau: 4.5vh; }
  .panneau { width: min(88vw, 520px); }
}

/* ------------------------------------------------------------------ *
 * Le déroulé d'un projet.
 *
 * Il ne s'ouvre pas comme une fenêtre par-dessus la page : le panneau
 * cliqué grandit jusqu'à devenir le grand visuel, et le texte vient
 * s'écrire à côté. Le même geste à l'envers referme. C'est ce qui fait
 * que l'on sait d'où l'on vient, et où l'on revient.
 *
 * En dessous, un déroulé en chapitres qui se découvrent au défilement.
 * ------------------------------------------------------------------ */
.fiche {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--noir);
  /* Le fond arrive avant le visuel : sans ça, on verrait la galerie
     bouger derrière pendant que le panneau grandit. */
  animation: fondu 0.35s ease-out both;
}
@keyframes fondu { from { opacity: 0; } }
.fiche.part { animation: fondu 0.4s ease-in 0.25s reverse both; }

.fiche-defile {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.fiche-defile::-webkit-scrollbar { display: none; }

/* L'ouverture : le visuel et, à côté, ce qu'il faut savoir en dix
   secondes. Au-delà, on défile. */
.ouvre {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(26px, 4vw, 54px);
  align-items: center;
  max-width: 1540px;
  margin: 0 auto;
  padding: clamp(60px, 9vh, 110px) var(--marge) clamp(50px, 8vh, 90px);
  min-height: 100vh;
}
@media (min-width: 900px) {
  .ouvre { grid-template-columns: 1.62fr 1fr; }
}
.ouvre-visuel {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  overflow: hidden;
  background: #0a1411;
  box-shadow: 0 48px 110px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(244, 239, 211, 0.07);
  will-change: transform;
}
.ouvre-visuel img,
.ouvre-visuel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 20px;
}
.ouvre-texte > * { opacity: 0; }
.fiche.posee .ouvre-texte > * {
  animation: lever 0.8s var(--expo) both;
  animation-delay: calc(0.26s + var(--i, 0) * 0.07s);
}
@keyframes lever {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
.ouvre-texte > :nth-child(1) { --i: 0; }
.ouvre-texte > :nth-child(2) { --i: 1; }
.ouvre-texte > :nth-child(3) { --i: 2; }
.ouvre-texte > :nth-child(4) { --i: 3; }
.ouvre-texte > :nth-child(5) { --i: 4; }

.etiquette {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gris);
}
.fiche-nom {
  font-family: Jost, sans-serif;
  margin: 0 0 20px;
  font-size: clamp(38px, 5.4vw, 72px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.fiche-resume {
  margin: 0 0 30px;
  max-width: 34em;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.62;
  color: rgba(244, 239, 211, 0.78);
}
.fiche-faits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 18px 22px;
  margin: 0 0 34px;
  padding: 22px 0 0;
  border-top: 1px solid var(--trait);
}
.fiche-faits dt {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gris);
  margin-bottom: 6px;
}
.fiche-faits dd { margin: 0; font-size: 15px; }

.visiter {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  display: inline-block;
  padding: 15px 28px;
  border: 1px solid var(--trait);
  border-radius: 999px;
  color: var(--blanc);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.14em;
  transition: background 0.3s, border-color 0.3s;
}
.visiter:hover { border-color: var(--vert); background: var(--vert); }

/* La mention d'un projet mené sans commande. Elle prend la place du lien,
   au même endroit : c'est là qu'on cherche où aller voir. */
.concept {
  margin: 0;
  max-width: 32em;
  padding: 16px 20px;
  border-left: 2px solid var(--vert);
  background: rgba(46, 92, 80, 0.16);
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 239, 211, 0.8);
}

/* ---- Les chapitres ------------------------------------------------- */
.fiche-corps { padding-bottom: clamp(70px, 12vh, 140px); }

.chapitre {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(50px, 9vh, 104px) var(--marge);
  border-top: 1px solid var(--trait);
}
.chapitre-numero {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--vert-clair, var(--gris));
  margin: 0 0 18px;
}
.chapitre h3 {
  font-family: Jost, sans-serif;
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 42px);
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0 0 20px;
  max-width: 18em;
}
.chapitre p {
  margin: 0 0 18px;
  max-width: 38em;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.68;
  color: rgba(244, 239, 211, 0.74);
}
/* Un chapitre à deux colonnes quand il porte une capture. */
.chapitre--duo { display: grid; gap: clamp(26px, 4vw, 56px); align-items: center; }
@media (min-width: 900px) {
  .chapitre--duo { grid-template-columns: 1fr 1fr; }
  .chapitre--duo:nth-of-type(even) .chapitre-image { order: -1; }
}
.chapitre-image {
  border-radius: 16px;
  overflow: hidden;
  background: #0a1411;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(244, 239, 211, 0.07);
}
.chapitre-image img { display: block; width: 100%; height: auto; border-radius: 16px; }

.contraintes { list-style: none; padding: 0; margin: 26px 0 0; max-width: 38em; }
.contraintes li {
  position: relative;
  padding: 13px 0 13px 26px;
  border-top: 1px solid var(--trait);
  font-size: 15px;
  color: rgba(244, 239, 211, 0.74);
}
.contraintes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 21px;
  width: 12px;
  height: 1px;
  background: var(--gris);
}

/* ---- Le schéma ----------------------------------------------------- */
/* Des traits et des boîtes vides : la page ne cherche pas à faire joli
   ici, elle cherche à être lue. Les traits se dessinent quand le
   chapitre arrive, ce qui donne le sens de lecture. */
.schema { margin-top: 38px; }
.schema-rangee + .schema-rangee { margin-top: 42px; }
.schema-nom {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gris);
  margin: 0 0 16px;
}
.schema svg { display: block; width: 100%; height: auto; overflow: visible; }
.schema .boite { fill: none; stroke: var(--trait-sol); stroke-width: 1; }
.schema .boite--fort { stroke: rgba(244, 239, 211, 0.55); }
.schema .lien {
  stroke: var(--trait-sol);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.schema .pointe { fill: var(--trait-sol); opacity: 0; }
.vu .schema .lien {
  animation: tracer 0.8s ease-out both;
  animation-delay: calc(0.15s + var(--n, 0) * 0.1s);
}
.vu .schema .pointe {
  animation: venir 0.3s ease-out both;
  animation-delay: calc(0.85s + var(--n, 0) * 0.1s);
}
@keyframes tracer { to { stroke-dashoffset: 0; } }
.schema text { fill: var(--blanc); font-family: Manrope, sans-serif; font-size: 13px; }
.schema .logo path { fill: rgba(244, 239, 211, 0.62); }
.schema .boite--fort + .logo path { fill: var(--blanc); }
.schema .note { fill: var(--gris); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; letter-spacing: 0.05em; }

/* ---- Les parcours --------------------------------------------------- *
 * Même langage que le schéma : des traits fins sur le fond de la page.
 * Les écrans sont dessinés, pas photographiés, et ça doit se voir.
 * ------------------------------------------------------------------ */
.parcours {
  margin-top: 36px;
  /* Un parcours de cinq écrans ne tient pas sur un téléphone : on le fait
     glisser plutôt que de l'écraser jusqu'à l'illisible. */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.parcours::-webkit-scrollbar { display: none; }
.parcours svg {
  display: block;
  height: auto;
  min-width: 560px;
  width: 100%;
  overflow: visible;
}
.parcours {
  /* Le repli, pour un projet sans palette : les teintes de la page. */
  --m-fond: rgba(244, 239, 211, 0.04);
  --m-encre: #f4efd3;
  --m-accent: var(--vert);
}
.parcours .cadre { fill: var(--m-fond); stroke: rgba(244, 239, 211, 0.34); stroke-width: 1; }
.parcours .trace { fill: var(--m-encre); fill-opacity: 0.2; }
.parcours .trace--fort { fill: var(--m-encre); fill-opacity: 0.72; }
.parcours .trace--plein { fill: var(--m-encre); fill-opacity: 0.11; }
.parcours .trace--creux { fill: none; stroke: var(--m-encre); stroke-opacity: 0.26; stroke-width: 1; }
.parcours .trace--accent { fill: var(--m-accent); fill-opacity: 1; }
.parcours .trace--barre { fill: var(--m-encre); fill-opacity: 0.32; }
.parcours text { fill: var(--blanc); font-family: Manrope, sans-serif; font-size: 13px; }
.parcours .note {
  fill: var(--gris);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
}
.parcours .lien { stroke: var(--trait-sol); stroke-width: 1; fill: none; stroke-dasharray: 1; stroke-dashoffset: 1; }
.parcours .pointe { fill: var(--trait-sol); opacity: 0; }
.vu .parcours .lien { animation: tracer 0.7s ease-out both; animation-delay: calc(0.3s + var(--n, 0) * 0.12s); }
.vu .parcours .pointe { animation: venir 0.3s ease-out both; animation-delay: calc(0.95s + var(--n, 0) * 0.12s); }

/* ---- Les chiffres --------------------------------------------------- */
.chiffres {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--trait);
  border: 1px solid var(--trait);
  margin-top: 34px;
}
@media (min-width: 760px) { .chiffres { grid-template-columns: repeat(4, 1fr); } }
.chiffre { background: var(--noir); padding: 28px clamp(16px, 2vw, 26px); }
.chiffre b {
  display: block;
  font-family: Jost, sans-serif;
  font-weight: 300;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.chiffre span {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--gris);
  max-width: 16em;
}

/* ---- La page d'une offre -------------------------------------------- *
 * Elle ne reprend rien du gabarit des projets : pas de numéro de
 * chapitre, pas de schéma en boîtes, pas de mosaïque. Ce qu'elle vend
 * étant une conversation, elle se déroule comme une conversation.
 * ------------------------------------------------------------------ */
.offre-fil {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
@media (min-width: 900px) { .offre-fil { grid-template-columns: .85fr 1.15fr; } }

.offre-tel {
  background: var(--fond-haut);
  border: 1px solid var(--trait);
  border-radius: 26px;
  padding: 16px 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 380px;
  width: 100%;
}
.offre-tete {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--trait);
  font-size: 14.5px;
  font-weight: 600;
}
.offre-tete .rond {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #25D366;
  color: #07140F;
  display: grid; place-items: center;
  font-family: Jost, sans-serif;
  font-size: 13px;
  font-weight: 400;
}
.bulle {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}
/* Le client à gauche, l'agent à droite : la convention de toutes les
   messageries, donc personne n'a à l'apprendre. */
.bulle.eux { background: rgba(244, 239, 211, 0.08); border-bottom-left-radius: 4px; align-self: flex-start; }
.bulle.nous { background: #1d7a46; border-bottom-right-radius: 4px; align-self: flex-end; }

.offre-dit h3 { margin-bottom: 18px; }
.offre-dit p { max-width: 42em; margin-bottom: 14px; }
.offre-dit b { color: var(--blanc); font-weight: 600; }

.offre-chapo { margin-bottom: 8px; }
.veille { margin-top: 30px; border-top: 1px solid var(--trait); }
.veille .v {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--trait);
  align-items: baseline;
}
.veille .pastille {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #25D366;
  grid-row: span 2;
  align-self: center;
}
@media (min-width: 760px) {
  .veille .v { grid-template-columns: auto 230px 1fr; gap: clamp(14px, 3vw, 34px); }
  .veille .pastille { grid-row: auto; }
}
.veille .q {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blanc);
  margin: 0;
}
.veille .r { margin: 0; }

.zeros { display: grid; grid-template-columns: 1fr; gap: clamp(18px, 3vw, 34px); margin-top: 30px; }
@media (min-width: 760px) { .zeros { grid-template-columns: repeat(3, 1fr); } }
.zeros > div { border-left: 2px solid #25D366; padding-left: 18px; }
.zeros .g {
  font-family: Jost, sans-serif;
  font-weight: 300;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1;
  margin: 0 0 10px;
  color: var(--blanc);
}
.zeros p { margin: 0; }

.etapes { counter-reset: e; list-style: none; padding: 0; margin: 28px 0 0; max-width: 46em; }
.etapes li {
  counter-increment: e;
  position: relative;
  padding: 16px 0 16px 48px;
  border-top: 1px solid var(--trait);
  color: rgba(244, 239, 211, 0.74);
}
.etapes li::before {
  content: counter(e, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 17px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--blanc);
}

/* Le comparatif : deux chemins à la même échelle. La démonstration est
   dans la longueur, donc rien ne doit distraire d'elle. */
.chemins { display: grid; gap: clamp(26px, 4vw, 44px); margin-top: clamp(28px, 4vw, 46px); }
.chemin .quand {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--gris);
}
.chemin.apres .quand { color: var(--blanc); }
.barre { display: flex; gap: 3px; height: 56px; }
.bloc {
  display: grid;
  place-items: center;
  border-radius: 4px;
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
}
.bloc .nom {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* Le chemin d'avant est éteint, celui d'après porte la couleur. */
.bloc.froid { background: rgba(244, 239, 211, 0.09); color: var(--gris); }
.bloc.chaud { background: #25D366; color: #07140F; font-weight: 600; }
.chemin .duree {
  margin: 10px 0 0;
  font-family: Jost, sans-serif;
  font-weight: 300;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
  color: var(--gris);
}
.chemin.apres .duree { color: var(--blanc); }
@media (max-width: 700px) {
  .barre { height: 46px; }
  .bloc .nom { font-size: 11px; }
}

/* Les marques du fil : une étiquette, une ligne. */
.marques { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.marques li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 15px 0;
  border-bottom: 1px solid var(--trait);
}
.marques li:first-child { border-top: 1px solid var(--trait); }
@media (min-width: 620px) {
  .marques li { grid-template-columns: 180px 1fr; gap: 20px; align-items: baseline; }
}
.marques b { color: var(--blanc); font-weight: 600; font-size: 15px; }
.marques span { color: rgba(244, 239, 211, 0.68); font-size: 14.5px; }

/* ---- Les morceaux de site ------------------------------------------- *
 * Une mosaïque de composants réels. Les hauteurs diffèrent d'une section
 * à l'autre, donc on laisse chaque image garder la sienne plutôt que de
 * les rogner toutes au même format : un bouton écrasé ne prouve rien.
 * ------------------------------------------------------------------ */
.bouts {
  margin-top: 34px;
  columns: 1;
  column-gap: 22px;
}
@media (min-width: 720px) { .bouts { columns: 2; } }
@media (min-width: 1180px) { .bouts { columns: 3; } }
.bout {
  margin: 0 0 22px;
  break-inside: avoid;
  border-radius: 14px;
  overflow: hidden;
  background: #0a1411;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(244, 239, 211, 0.08);
}
.bout img { display: block; width: 100%; height: auto; border-radius: 14px; }

/* ---- La palette ----------------------------------------------------- */
.palette { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.palette span {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  position: relative;
}
.palette span::after {
  content: attr(data-code);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--gris);
}

/* ---- La sortie ------------------------------------------------------ */
/* Visible en permanence : on doit pouvoir partir à tout moment, sans
   remonter chercher le bouton. */
.fermer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 25;
  width: 62px;
  height: calc(46px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  border: 0;
  border-radius: 0 0 0 18px;
  background: var(--blanc);
  color: var(--vert);
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.fermer:hover { background: var(--vert); color: var(--blanc); }
.fermer-trait {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 1px;
  background: currentColor;
}
.fermer-trait:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.fermer-trait:last-child { transform: translate(-50%, -50%) rotate(-45deg); }

/* Les chapitres se découvrent au défilement, un par un. */
.chapitre > * { opacity: 0; transform: translateY(26px); }
.chapitre.vu > * {
  animation: lever 0.85s var(--expo) both;
  animation-delay: calc(var(--j, 0) * 0.08s);
}

@media (prefers-reduced-motion: reduce) {
  *, .panneau { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ *
 * L'ouverture.
 *
 * Le principe est celui des sites dont Nathan a donné la référence : rien
 * n'apparaît en transparence, tout monte de derrière une arête. Chaque
 * ligne vit dans un masque, et c'est le masque qui coupe ce qui dépasse.
 * Le texte entre par le bas, se tient, repart par le haut, puis le voile
 * se lève comme un rideau et découvre une scène qui s'anime déjà dessous.
 *
 * Les éléments arrivent ensuite les uns après les autres : le sol, les
 * panneaux dans l'ordre où ils sont posés, leurs légendes, et les
 * étiquettes des coins en dernier. C'est cet échelonnement qui donne
 * l'impression qu'un lieu s'ouvre, plutôt qu'une page qui s'affiche.
 *
 * Elle ne se rejoue pas dans la même visite, et pas du tout si le
 * visiteur a demandé moins d'animations.
 * ------------------------------------------------------------------ */
.ouverture {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--noir);
}
.ouverture-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.ouverture-logo {
  height: 30px;
  width: auto;
  filter: brightness(0) invert(1) sepia(0.12);
}
.ouverture-ligne {
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gris);
}

/* Un seul passage par ligne, aller et retour : deux animations enchaînées
   sur la même propriété se marcheraient dessus, celle qui attend son tour
   imposant déjà son premier état. L'adouci change à chaque étape, à
   l'intérieur même des étapes. */
@keyframes passeMasque {
  0%   { transform: translateY(112%); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  30%  { transform: translateY(0); animation-timing-function: linear; }
  68%  { transform: translateY(0); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0); }
  100% { transform: translateY(-112%); }
}
@keyframes monteMasque {
  from { transform: translateY(120%); }
  to   { transform: translateY(0); }
}
@keyframes rideau {
  to { clip-path: inset(0 0 100% 0); }
}
@keyframes devoiler {
  from { clip-path: inset(100% 0 0 0 round 20px); }
  to   { clip-path: inset(0 0 0 0 round 20px); }
}
@keyframes approcher {
  from { transform: scale(1.14); }
  to   { transform: scale(1); }
}
@keyframes venir {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* L'état d'attente : posé avant la première image, pour qu'aucun élément
   ne soit visible une fraction de seconde avant son entrée. */
body.sattend .sol,
body.sattend .compte-valeur { opacity: 0; }
body.sattend .ouverture-centre .masque > *,
body.sattend .panneau-legende .masque > *,
body.sattend .coin .masque > * { transform: translateY(120%); }
body.sattend .panneau-cadre { clip-path: inset(100% 0 0 0 round 20px); }
body.sattend .panneau-cadre video { transform: scale(1.14); }

body.entre .ouverture { animation: rideau 0.85s cubic-bezier(0.76, 0, 0.24, 1) 2.1s both; }
body.entre .ouverture-logo { animation: passeMasque 2s 0.1s both; }
body.entre .ouverture-ligne { animation: passeMasque 2s 0.2s both; }

body.entre .sol { animation: venir 1.4s ease-out 2.15s both; }
body.entre .panneau-cadre {
  animation: devoiler 1.1s var(--expo) both;
  animation-delay: calc(2.2s + var(--rang, 0) * 0.08s);
}
body.entre .panneau-cadre video {
  animation: approcher 1.5s var(--expo) both;
  animation-delay: calc(2.2s + var(--rang, 0) * 0.08s);
}
body.entre .panneau-legende .masque > * {
  animation: monteMasque 0.9s var(--expo) both;
  animation-delay: calc(2.45s + var(--rang, 0) * 0.08s);
}
body.entre .compte-valeur { animation: venir 0.8s ease-out 2.9s both; }
body.entre .coin .masque > * {
  animation: monteMasque 0.85s var(--expo) both;
  animation-delay: calc(2.8s + var(--rang-coin, 0) * 0.07s);
}
.coin--hautdroite .masque,
.coin--basdroite .masque { display: block; }

.coin--hautgauche { --rang-coin: 0; }
.coin--hautdroite { --rang-coin: 1; }
.coin--basgauche { --rang-coin: 2; }
.coin--basdroite { --rang-coin: 3; }

@media (prefers-reduced-motion: reduce) {
  .ouverture { display: none; }
}
