/*
  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: #080b0a;
  --blanc: #f4efd3;
  --vert: #2e5c50;
  --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);
  color-scheme: dark;
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--noir);
  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--hautdroite { top: var(--marge); right: var(--marge); }
.coin--basgauche { bottom: var(--marge); left: var(--marge); color: var(--gris); }
.coin--basdroite { bottom: var(--marge); right: var(--marge); }
.coin a, .marque {
  color: var(--blanc);
  text-decoration: none;
  transition: opacity 0.3s;
}
.coin a:hover { opacity: 0.55; }
.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 {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  perspective: 1500px;
  perspective-origin: 50% 50%;
  outline: none;
  padding: 26vh 0;
}
.galerie::-webkit-scrollbar { display: 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(--noir) 18%, transparent); }
main::after { bottom: 0; background: linear-gradient(to top, var(--noir) 18%, transparent); }

.panneau {
  display: block;
  width: min(72vw, 940px);
  margin: 0 auto 7vh;
  scroll-snap-align: center;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: opacity 0.35s;
}
.panneau-cadre {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #0b0e0d;
  box-shadow: 0 50px 110px rgba(0, 0, 0, 0.9);
  aspect-ratio: 16 / 10;
}
.panneau-cadre img,
.panneau-cadre video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  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);
}
.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) {
  .panneau { width: 86vw; margin-bottom: 5vh; }
  .galerie { padding: 22vh 0; }
}

/* Le déroulé d'un projet. */
.fiche {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.94);
  overflow-y: auto;
  animation: monte 0.45s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
@keyframes monte { from { opacity: 0; transform: translateY(24px); } }
.fiche-corps {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(70px, 12vh, 130px) var(--marge) 90px;
}
.etiquette {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gris);
}
.fiche-nom {
  font-family: Jost, sans-serif;
  margin: 0 0 18px;
  font-size: clamp(34px, 7vw, 76px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.fiche-fait {
  margin: 0 0 34px;
  max-width: 34em;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.76);
}
.palette { display: flex; gap: 8px; margin-bottom: 40px; }
.palette span {
  width: 54px;
  height: 54px;
  border-radius: 3px;
  position: relative;
}
.palette span::after {
  content: attr(data-code);
  position: absolute;
  left: 0;
  top: calc(100% + 7px);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--gris);
}
.rendus {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 46px 0 40px;
}
@media (min-width: 860px) {
  .rendus { grid-template-columns: 1fr 300px; align-items: start; }
}
.rendu {
  width: 100%;
  border-radius: 8px;
  display: block;
  background: #0b0b0b;
}
.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;
}
.visiter:hover { border-color: var(--blanc); background: var(--vert); }
.fermer {
  position: fixed;
  top: var(--marge);
  right: var(--marge);
  z-index: 21;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--trait);
  background: rgba(0, 0, 0, 0.6);
  color: var(--blanc);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* Sur un téléphone, un panneau plus large : on ne verra qu'un voisin,
   mais le projet doit rester lisible. */
@media (max-width: 820px) {
  .panneau { width: min(84vw, 520px); }
  .galerie { padding: 0 calc(50vw - min(42vw, 260px)); gap: 26px; }
}

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