/*---------------------------------General---------------------------*/
html,
body {
  width: 100vw;
}

body > *:not(#startAnimationContainer) {
  opacity: 0;
  visibility: hidden;
}

button {
  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  /* Taille et espace */
  padding: 0.6em 1.2em;
  border-radius: 0.5em;
  font-size: 1rem;
  font-weight: 600;
  width: fit-content;

  /* Style de bordure et fond */
  border: 2px solid currentColor;
  background-color: transparent;
  color: inherit;

  /* Effets */
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

button:hover {
  transform: translate(2px, -2px);
  box-shadow: 0 4px 10px var(--shadow-color);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.text-accent {
  color: var(--second-color);
  text-transform: uppercase;
}

.glass {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* Support Safari */
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.37);
  padding: 2rem;
}

.flex {
  display: flex;
  gap: 10px;
}

.section-title {
  font-size: var(--section-title-font-size);
  color: var(--text-color);
  text-align: center;
}

/* ---------------------------- Animation chargement ---------------------------- */
#startAnimationContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.5s;
  overflow: hidden;
  color: var(--background-color);
}

#leftStartMask,
#rightStartMask {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--text-color);
}

#startMidLine {
  position: absolute;
  top: 0;
  left: 50%;
  width: 5px;
  height: 0%;
  background-color: var(--background-color);
  transform: translateX(-50%);
}

#logo {
  opacity: 1;
  z-index: 10;
}

#logoBackgroundMask {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  background-color: var(--text-color);
  transform: translate(-50%, -50%);
  z-index: 1;
  border-radius: 100%;
}

.fade-in {
  animation: fadeIn 1s ease forwards;
}

@keyframes lineAnimation {
  0% {
    height: 0%;
  }
  100% {
    height: 100%;
  }
}

@keyframes fadeIn {
  100% {
    opacity: 1;
    visibility: visible;
  }
}

/*-----------------------------------Background------------------------------------*/
.background {
  position: fixed;
  left: 0;
  right: 0;
}

/*---------------------------------Hero Section---------------------------------------*/
#hero-section {
  padding-top: 35vh;
  color: var(--text-color);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 50px;
  justify-content: center;
  align-items: center;
}

#hero-section h1 {
  text-align: center;
  max-width: 80%;
}

#hero-section p {
  max-width: 30%;
  text-align: justify;
}

#heroProjectButton {
  background-color: var(--first-color);
}

#heroBlogsButton {
  background-color: var(--second-color);
  color: var(--background-color);
  border-color: var(--text-color);
}

/*Hero Section Images*/
#hero-section-images {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
}

#hero-section-images img {
  position: absolute;
  animation-name: moveUp;
  animation-timeline: scroll(); /* timeline liée au scroll */
}

#project1 {
  width: var(--project1-width);
  top: var(--project1-top);
  left: var(--project1-left);
}

#project2 {
  width: var(--project2-width);
  top: var(--project2-top);
  right: var(--project2-right);
}

#project3 {
  width: var(--project3-width);
  top: var(--project3-top);
  left: var(--project3-left);
}

@keyframes moveUp {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-350px);
  }
}

/*Hero Section Responsive*/
@media screen and (max-width: 1700px) {
  #project2 {
    right: calc(var(--project2-right) - 5vw);
  }
}

@media screen and (max-width: 1425px) {
  #project1 {
    width: calc(var(--project1-width) - 100px);
    top: calc(var(--project1-top) + 5vh);
  }

  #project2 {
    width: calc(var(--project2-width) - 100px);
    top: calc(var(--project2-top) + 5vh);
  }

  #project3 {
    width: calc(var(--project3-width) - 100px);
    top: calc(var(--project3-top) + 3vh);
  }
}

@media screen and (max-width: 1250px) {
  #project2 {
    width: calc(var(--project2-width) - 200px);
    top: calc(var(--project2-top) + 10vh);
  }
}

@media screen and (max-width: 975px) {
  #hero-section p {
    max-width: 50%;
  }

  #hero-section {
    padding-top: 20vh;
  }

  #hero-section-images img {
    top: 44%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: fade 12s infinite;
  }

  #hero-section > p {
    padding-top: 225px;
  }

  #project1 {
    width: calc(var(--project1-width) - 150px);
  }

  #project2 {
    width: calc(var(--project2-width) - 235px);
  }

  #project3 {
    width: var(--project1-width);
  }



  #hero-section-images *:nth-child(1) { animation-delay: 0s; }
  #hero-section-images *:nth-child(2) { animation-delay: 4s; }
  #hero-section-images *:nth-child(3) { animation-delay: 8s; }

  @keyframes fade {
    0%   { opacity: 0; }
    5%   { opacity: 1; }
    30%  { opacity: 1; }
    35%  { opacity: 0; }
    100% { opacity: 0; }
  }
}

@media screen and (max-width: 650px) {
  #hero-section h1 {
    font-size: 1.75em;
  }

  #hero-section p {
    font-size: 0.85em;
  }

  #hero-section button {
    font-size: 0.95rem;
  }
}

@media screen and (max-width: 550px) {
  #hero-section h1 {
    font-size: 1.5em;
  }

  #hero-section p {
    font-size: 0.75em;
  }

  #hero-section button {
    font-size: 0.85rem;
  }
}

/* --------------------------------------- Transition Arrow --------------------------------------- */
.transition-arrow-container {
  padding-top: 50px;
  color: var(--text-color);
  display: flex;
  align-items: centers;
  justify-content: center;
  width: 100%;
}

.transition-arrow-container svg {
  width: 700px;
}

.transition-arrow-container svg path {
  stroke-dashoffset: 0%;
}

/* --------------------------------------- Latest Video --------------------------------------- */
.latest-releases-container {
  display: flex;
  width: 80%;
  align-items: center;
  justify-content: center;
  gap: 50px;
  margin-left: auto;
  margin-right: auto;
  max-width: 90%;
}

.latest-releases-container iframe {
  width: calc(50% - 25px);
  height: var(--release-height);
  border: 3px var(--second-color) solid;
}

/* Style de base pour le blog */
#latestBlog {
  background-color: var(--text-color);
  color: var(--background-color);
  height: calc(var(--release-height) - 30px);
  width: calc(50% - 50px);

  /* Améliorations visuelles */
  border-radius: 20px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 15px; /* Réduit de 20px à 15px pour moins d'espacement */
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
}

/* Effet hover */
#latestBlog:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* Conteneur image */
#latestBlog > div:first-child {
  width: 100%;
  height: 280px;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
}

/* Image */
#blogImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  border-radius: 15px;
}

#latestBlog:hover #blogImage {
  transform: scale(1.08);
}

/* Overlay gradient sur l'image */
#latestBlog > div:first-child::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.1) 100%
  );
  border-radius: 15px;
}

/* Auteur */
#authorBlog {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.8;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

/* Titre */
#titleBlog {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 10px 0; /* Petit espacement en bas */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Lien de lecture */
#blogLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  transition: all 0.3s ease;
  align-self: flex-start;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#blogLink::after {
  content: "→";
  transition: transform 0.3s ease;
}

#blogLink:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

#blogLink:hover::after {
  transform: translateX(5px);
}

/* Responsive Design */

/* Tablettes */
@media (max-width: 1024px) {
  #latestBlog {
    width: calc(60% - 40px);
    padding: 25px;
    gap: 18px;
  }

  #latestBlog > div:first-child {
    height: 250px;
  }

  #titleBlog {
    font-size: 1.3rem;
  }
}

/* Tablettes portrait et petits écrans */
@media (max-width: 768px) {
  #latestBlog {
    height: auto;
    min-height: 400px;
    padding: 20px;
    gap: 16px;
  }

  #latestBlog > div:first-child {
    height: 160px;
  }

  #titleBlog {
    font-size: 1.2rem;
    -webkit-line-clamp: 2;
  }

  #authorBlog {
    font-size: 0.85rem;
  }

  #blogLink {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* Mobiles */
@media (max-width: 480px) {
  #latestBlog {
    width: calc(100% - 50px);
    padding: 16px;
    gap: 14px;
    border-radius: 16px;
  }

  #latestBlog > div:first-child {
    height: 140px;
    border-radius: 12px;
  }

  #blogImage {
    border-radius: 12px;
  }

  #titleBlog {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  #authorBlog {
    font-size: 0.8rem;
  }

  #blogLink {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 20px;
  }

  /* Réduction des effets sur mobile pour les performances */
  #latestBlog:hover {
    transform: translateY(-4px) scale(1.01);
  }
}

/* Très petits écrans */
@media (max-width: 320px) {
  #latestBlog {
    padding: 12px;
    gap: 12px;
  }

  #latestBlog > div:first-child {
    height: 120px;
  }

  #titleBlog {
    font-size: 1rem;
  }

  #blogLink {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

@media (max-width: 800px) {
  .latest-releases-container {
    flex-direction: column;
    width: 90%;
    gap: 30px;
    align-items: stretch; /* Les éléments prennent toute la largeur */
    margin: 0;
  }

  .latest-releases-container iframe {
    margin-left: 2%;
    width: 100%;
    height: 300px; /* Hauteur réduite sur mobile */
  }

  #latestBlog {
    width: 100%;
    height: auto;
    min-height: 350px;
  }
}

/* Mobile plus petit */
@media (max-width: 600px) {
  .latest-releases-container {
    width: 95%;
    gap: 20px;
    margin: 0;
  }

  .latest-releases-container iframe {
    height: 250px;
  }

  #latestBlog {
    min-height: 320px;
    padding: 10px;
  }
}

/* Très petit mobile */
@media (max-width: 480px) {
  .latest-releases-container {
    width: 100%;
    margin: 0;
  }

  .latest-releases-container iframe {
    height: 200px;
  }

  #latestBlog {
    min-height: 280px;
    padding: 16px;
  }
}

/* --------------------------------------- Goals --------------------------------------- */

.goals-container {
  padding-top: var(--section-spacing);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px; /* Espacement entre les goals pour l'effet de scroll */
}

.goals-container > h2 {
  font-size: var(--section-title-font-size);
  color: var(--text-color);
}

.goal {
  position: sticky;
  width: 80%;
  color: var(--text-color);
  background-color: var(--background-color);
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: top;
  justify-content: space-between;
  gap: 15px;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: var(--text-color) solid 1px;
}

.goal:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.goal:nth-child(1) {
  top: var(--goals-start);
  z-index: 1;
}

.goal:nth-child(2) {
  top: calc((var(--goals-start) + var(--goals-spacing)));
  z-index: 2;
}

.goal:nth-child(3) {
  top: calc((var(--goals-start) + 2 * var(--goals-spacing)));
  z-index: 3;
}

.goal:nth-child(4) {
  top: calc((var(--goals-start) + 3 * var(--goals-spacing)));
  z-index: 4;
}

.goal:nth-child(5) {
  top: calc((var(--goals-start) + 3 * var(--goals-spacing)));
  z-index: 5;
}

.goal-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  min-width: 60px;
}

.goal-text {
  text-align: left;
  width: 40%;
}

.goal-text > h2 {
  color: var(--second-color);
}

/*-----------------------------------Actions------------------------------------*/
.horizontal-section {
  margin-top: 50px;
  padding-top: 500px;
  position: relative;
  width: 100%;
  height: 100vh;
}

.horizontal-section > h2 {
  font-size: var(--section-title-font-size);
  color: var(--text-color);
  text-align: center;
}

.sticky-wrapper {
  position: sticky;
  top: 50%;
  transform: translateY(-50%);
  height: 100vh;
  overflow: hidden;
}

.actions-background {
  position: absolute;
  top: 61%;
  left: 49%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  background-color: var(--second-color);
  z-index: -1;
  transition: all 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.actions-container {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  gap: 300px;
  background-color: var(--text-color);
  will-change: transform;
}

.action-made {
  width: 300px;
  min-width: 300px;
  flex-shrink: 0;
  padding: 20px;
  border-radius: 10px;
}

.action-made a {
  color: var(--background-color);
  text-transform: none;
}

.action-made a::after {
  background-color: var(--background-color);
}

.lieu-action::after {
  content: ", ";
}

.lieu-action {
  font-weight: 1000;
}

.date-action {
  font-style: italic;
}

/*--------------------- Members ---------------------*/
.members {
  display: flex;
  width: 100%;
  justify-content: space-evenly;
  flex-wrap: wrap;
  gap: 20px;
}

.member-container {
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  width: var(--member-container-width);
  min-width: 200px;
}

.member-container > img {
  margin-bottom: 10px;
  background-color: var(--text-color);
}

.member-role {
  font-style: italic;
  color: var(--second-text-color);
  font-size: 12px;
}


/*--------------------- Partenaires ---------------------*/
.partenaires {
  padding-top: var(--section-spacing);
}

.partner-information {
  display: none;
  width: calc(var(--current-circle-size) - 200px);
  max-height: calc(var(--current-circle-size) - 100px);
  background-color: var(--background-color);
  z-index: 1;
}

.current-partner {
  border: 3px solid var(--text-color);
  opacity: 1 !important;
}

.center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-color);
  padding: 20px 30px;
  border-radius: 50%;
  text-align: center;
  font-weight: bold;
}

.circle-container {
  --current-circle-size: var(--partner-circle-size);
  position: relative;
  width: var(--current-circle-size);
  height: var(--current-circle-size);
  margin: auto;
  max-width: 100%;
}

.circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--current-circle-size);
  height: var(--current-circle-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px dashed var(--text-color);
}

/* Calcul du rayon dynamiquement */
.item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: -40px;
  animation: orbit 25s linear infinite;
  opacity: 0.5;
}

.item:hover {
  opacity: 0.7;
  cursor: pointer;
}

@keyframes orbit {
  from {
    transform: rotate(var(--start-angle)) translate(calc((var(--current-circle-size) / 2))) rotate(calc(-1 * var(--start-angle)));
  }
  to {
    transform: rotate(calc(var(--start-angle) + 360deg)) translate(calc((var(--current-circle-size) / 2))) rotate(calc(-1 * (var(--start-angle) + 360deg)));
  }
}

.item:nth-child(1) { --start-angle: 0deg; }
.item:nth-child(2) { --start-angle: 120deg; }
.item:nth-child(3) { --start-angle: 240deg; }

/*Partners Responsive*/
@media screen and (max-width: 650px) {
  .circle-container {
    --current-circle-size: calc(var(--partner-circle-size) - 150px);
  }
}