body {
  background: linear-gradient(180deg, #1B1B1B 0%, #2B2B2B 44.23%, #323232 77.88%, #1B1B1B 100%);
  background-attachment: fixed;
  background-size: cover;
}

span, p, strong, .behance-projet a {
  font-family: var(--general-font);
  color: var(--font-color);
}

h1 {
  color: var(--font-color);
  font-family: var(--title-font);
}

.border {
    position: fixed;
    background: var(--border-color-side); /* couleur des bords */
    z-index: 9999;
  }

  .border.gauche {
    top: 0;
    left: 1em;
    width: 1px; /* épaisseur du bord gauche */
    height: 100%;
  }

  .border.droite {
    top: 0;
    right: 1em;
    width: 1px; /* épaisseur du bord droit */
    height: 100%;
  }

  main {
  background-image: linear-gradient(#4e4b4194 1px, transparent 1px), linear-gradient(to right, #4e4b4194 1px, #71718300 1px);
  background-size: 40px 40px;
  background-attachment: scroll;
  margin: 0 auto;
  }

  

/* ================== Titre par lettres ================== */
.titre-graphisme-layer {
  visibility: hidden; /* layer caché au départ */
}

.titre-graphisme-layer .letter {
  display: inline-block;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.7s ease, transform 0.7s ease;

  /* Correction pour la font et le contour */
  font-family: var(--title-font);
  color: inherit; /* hérite de la couleur du parent */
  -webkit-text-stroke-width: inherit; /* hérite du layer */
  -webkit-text-stroke-color: inherit;
}

.titre-graphisme-layer .letter.active {
  opacity: 1;
  transform: translateX(0);
}

/* ================== Arbre ================== */
.tree-wrapper {
  opacity: 0;
  transform: translateX(-50px); /* glisse depuis la gauche */
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.tree-wrapper.active {
  opacity: 1;
  transform: translateX(0); /* position initiale intacte */
}

.retour-graphisme {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.retour-graphisme.active {
  opacity: 1;
  transform: translateX(0);
}


/* ================== Bouton retour ================== */
.retour-graphisme {
  opacity: 0;
  transform: translateX(-20px); /* part de gauche */
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.retour-graphisme.active {
  opacity: 1;
  transform: translateX(0); /* reste à sa position */
}



  

/************************* Motif *******************************************/
  .tree {
  position: absolute;
  right: 15%;
  width: 20vw;
  bottom: 20vw;
  transform: rotateZ(-20deg);
  bottom: 17%;
  right: 8%;
}

/************************* Présentation Graphisme - Mobile First *******************************************/
.titre-graphisme {
  background-image: var(--background-color-graphisme) ;
  position: relative;
  line-height: 0.7;
  padding: 3vw;
  border-bottom: 2px solid var(--border-color-side);
  font-family: var(--title-font);
  text-align: center;
  margin-top: 0;
  
  line-height: 0.6;
  text-transform: uppercase;
  margin: 0;
  -webkit-text-stroke-width: 0.8px;
  -webkit-text-stroke-color: rgb(255, 255, 255);
  letter-spacing: 1px;
  height: auto;
  font-weight: lighter;
  place-content: center;
  padding-top: 10vh;
}

.titre-graphisme > * {
  font-family: var(--title-font);
}

.titre-graphisme-layer {
  display: block;
  font-size: clamp(10px, 10vw, 4rem);
  color: white;
}

.titre-graphisme-layer-1 {
  color: transparent;
  opacity: 0.8;
  -webkit-text-stroke-width: 0.8px;
  -webkit-text-stroke-color: var(--font-color);
}

.titre-graphisme-layer-2 {
  opacity: 0.5;
  color: transparent;
  -webkit-text-stroke-width: 0.6px;
  -webkit-text-stroke-color: var(--font-color);
}

.titre-graphisme-layer-3{
  opacity: 0.5;
  color: transparent;
  -webkit-text-stroke-width: 0.4px;
  -webkit-text-stroke-color: var(--font-color);
}

.lien-retour { color: #fff; text-decoration: none; font-weight: 100; font-size: 16px; display: inline-flex; align-items: center; gap: 5px; }
.lien-retour:hover { text-decoration: underline; cursor: pointer; }

.video-projet, .image-projet, .conteneur-description {
  width: 70%;
  max-width: 400px;
  margin: 1.5em auto;
  border: 2px solid var(--border-color-side);

}

.image-projet-graphisme { 
  width: auto;
  height: auto;
  max-width: 800px;
}

.image-projet {
  display: flex;
  flex-direction: column;
  margin: 2em auto;
  border: 2px solid var(--border-color-side);
  margin: 2em auto;
  width: 80%;
  height: auto;
  max-width: 800px;
}

.infos-etudiants {
  display: flex;
  flex-direction: column;
  width: 70%;
  max-width: 400px;
  margin: 1em auto;
  border: 2px solid var(--border-color-side);
  margin: 2em auto;
  width: 80%;
  max-width: 800px;
}

.infos-etudiants strong {
  border-bottom: 2px solid var(--border-color-side);
  background-image: linear-gradient(177deg, var(--bouton-projet-jt-color) 11.95%, var(--bouton-projet-jt-color) 28.39%, #21212100 82.04%);
  padding: 10px;
}

.nom-etudiant { padding: 10px; }

/* Modifications apportées : Style pour les noms d'étudiants qui sont cliquables */
.nom-etudiant a {color: var(--background-color-finissant);text-decoration: none;letter-spacing: normal;}
.nom-etudiant a:hover {text-decoration: underline;}

.conteneur-description .description-titre {
  background-image: linear-gradient(177deg, var(--bouton-projet-jt-color) 11.95%, var(--bouton-projet-jt-color) 28.39%, #21212100 82.04%);
  border-bottom: 2px solid var(--border-color-side);
  padding: 10px;
  font-weight: bold;
  margin: 0;
}

.conteneur-description {
    margin: 2em auto;
    width: 80%;
    max-width: 800px;
}

.conteneur-description .description-texte { padding-left: 10px; }

.behance-projet {
  width: 50%;
  max-width: 250px;
  margin: 1.5em auto;
  text-align: center;
  border: 2px solid var(--border-color-side);
  padding: 20px 0px;
  border-radius: 10px;
  background-color: rgba(49,49,49,0.84);
  font-weight: bold;
  margin: 2em auto;
  width: 80%;
  max-width: 800px;
}

.behance-projet a { color: white; }

@media screen and (min-width: 576px) {

  main {
  padding: 0 2em;
  background-attachment: fixed;
  }

  .border {
    position: fixed;
    background: var(--border-color-side);
    z-index: 9999;
  }

  .border.gauche { top: 0; left: 2em; width: 1px; height: 100%; }
  .border.droite { top: 0; right: 2em; width: 1px; height: 100%; }

  .video-projet {
    height: 65vh;
  }

  .tree {
    width: 12vw;
  }
}

/********************************************** CSS Desktop ********************************************************/
@media screen and (min-width: 1024px) {
  main {
    max-width: none;
    margin: 0 auto;
    position: relative;
    padding: 0 3em;
  }

  .presentation-graphisme {
    padding-bottom: 5em;
  }

  .border { position: fixed; background: var(--border-color-side); z-index: 9999; }
  .border.gauche { top: 0; left: 3em; width: 1px; height: 100%; }
  .border.droite { top: 0; right: 3em; width: 1px; height: 100%; }

  .titre-graphisme-layer {
    font-size: 4vw;
  }
  
    .tree {
      width: 10vw;
      right: 30%;
      bottom: 7%;
      top: auto;
    }

  .infos-cours-annee {
    width: 20vw;
    padding: 2vw;
    font-size: 2vw;
    display: none;
  }

  .image-projet span, .infos-etudiants .titre-equipe,  .description-projet{
    font-size: clamp(13px, 1.5vw, 22px);
  }

  .image-projet-graphisme  {
    height: 70vh;
    width: auto;
  }

  .description-projet {
    display: grid;
    /* three rows: header (team), description, footer (behance) */
    grid-template-rows: auto 1fr auto;
    /* three columns: image | content-col-1 | content-col-2 */
    grid-template-columns: auto 1fr 1fr;
    /*background-color: rgb(48,48,48);*/
    border: 2px solid var(--border-color-side);
    border: none;
    height: auto;
    justify-self: center;
    position: relative; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: transform 260ms cubic-bezier(.2,.8,.2,1),
                box-shadow 260ms ease,
                filter 260ms ease,
                border-radius 260ms ease;
    will-change: transform, box-shadow;
    transform-origin: center;
    padding: 5em 5em;
    padding-bottom: 0;
    gap: 2em;
    max-width: 1350px;
  }

  /*.description-projet:hover::after {
    opacity: 1;
    transform: translateY(0);
  }

  .description-projet:hover {
    transform: translateY(-10px);
    box-shadow: 16px 16px 0px rgb(5, 25, 28);
    border-radius: 40px;
    color: thistle;
  }*/

  .description-projet:hover > .image-projet,
  .description-projet:hover > .image-projet img,
  .description-projet:hover > .infos-etudiants, 
  .description-projet:hover > .conteneur-description {
    border-radius: 10px;
  }

  .description-projet:hover > .infos-etudiants strong, .description-projet:hover > .conteneur-description .description-titre {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }

  .image-projet,
  .image-projet img,
  .infos-etudiants,
  .conteneur-description,
  .infos-etudiants strong,
   .conteneur-description .description-titre{
    transition: border-radius 260ms;
  }

  .description-projet .image-projet {
    /* left column, span all three rows */
    grid-column: 1 / 2;
    grid-row: 1 / 4;
    height: fit-content;
    margin: 0;
    display: flex;
    width: auto;
    max-width: none;
    justify-content: flex-start;
    align-items: flex-end;
    border: none;
  }

  .description-projet .infos-etudiants {
    /* top row, middle column */
    grid-column: 2 / 4;
    grid-row: 1 / 2;
    width: 100%;
    height: fit-content;
    margin: 0;
    max-width: none;
  }

  .description-projet .conteneur-description {
    /* middle row, span both right columns */
    grid-column: 2 / 4;
    grid-row: 2 / 3;
    width: 100%;
    margin: 0px;
    max-width: none;
  }

  .behance-projet {
    /* bottom row, under description, span both right columns */
    grid-column: 2 / 4;
    grid-row: 3 / 4;
    background-color: rgba(0, 0, 0, 0);
    border: none;
    display: flex;
    max-width: none;
    padding: 0;
    width: 100%;
    margin: 0;
    text-decoration: none;
    font-size: clamp(13px, 1.3vw, 18px);
  }

  .infos-etudiants strong, .conteneur-description .description-titre {
    padding: 15px;
  }

  .infos-etudiants strong { margin-bottom: 20px; }

  .nom-etudiant {padding: 0 0 20px 20px; }

  .conteneur-description .description-texte { padding: 20px; margin: 0; }

  .description-texte, .nom-etudiant {
    font-size: clamp(16px, 1.5vw, 20px);
  }

  .behance-projet > * {
    border: 2px solid var(--border-color-side);
    border-radius: 10px;
    background-color: rgba(49, 49, 49, 0.84);
    font-weight: bold;
    width: 100%;
    padding: 10px;
    text-align: end;
    text-decoration: none;
  }
}