/* =========================
   RESET
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #000;
  color: #fff;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}


/* =========================
   RIDEAU
========================= */

.curtain {
  position: relative;
  height: 100vh;
  min-height: 700px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  overflow: hidden;

  background: #000;
  color: #fff;
}


.curtain-track {
  display: flex;
  width: max-content;

  white-space: nowrap;

  font-size: clamp(1rem, 2vw, 2rem);
  font-weight: 700;
  text-transform: uppercase;

  padding: 0.35rem 0;
}

.curtain-track span {
  margin-right: 5rem;
}


/* sens différents */

.curtain-track-1 {
  animation: marquee-left 30s linear infinite;
}

.curtain-track-2 {
  animation: marquee-right 38s linear infinite;
}

.curtain-track-3 {
  animation: marquee-left 34s linear infinite;
}


@keyframes marquee-left {

  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-40%);
  }

}


@keyframes marquee-right {

  from {
    transform: translateX(-35%);
  }

  to {
    transform: translateX(0);
  }

}


/* nom */

.curtain-name {
  position: absolute;

  top: 50%;
  left: 50%;

  transform: translate(-50%, -50%);

  text-align: center;

  mix-blend-mode: difference;

  z-index: 5;
}

.curtain-name p {
  font-size: clamp(0.9rem, 1.2vw, 1.3rem);

  letter-spacing: 0.5em;

  margin-bottom: 0.8rem;
}

.curtain-name h1 {
  font-size: clamp(4rem, 13vw, 11rem);

  line-height: 0.8;

  letter-spacing: -0.07em;

  font-weight: 900;
}


/* scroll */

.scroll-indicator {
  position: absolute;

  bottom: 2rem;
  left: 50%;

  transform: translateX(-50%);

  display: flex;
  gap: 1rem;

  font-size: 0.7rem;
  letter-spacing: 0.2em;

  opacity: 0.6;
}


/* =========================
   CARTES
========================= */

.projects {
  position: relative;
}


/* chaque carte */

.project-card {
  position: sticky;
  top: 0;

  min-height: 100vh;

  padding: 2rem;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  border-radius: 2rem 2rem 0 0;

  overflow: hidden;
}


/* couleurs */

.light-card {
  background: #f4f4f0;
  color: #080808;
}

.dark-card {
  background: #080808;
  color: #f4f4f0;

  border-top: 1px solid rgba(255, 255, 255, 0.2);
}


/* meta */

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 2rem;

  font-size: 0.75rem;

  text-transform: uppercase;
  letter-spacing: 0.12em;
}


/* contenu */

.card-content {
  margin-top: auto;
  margin-bottom: auto;

  max-width: 1200px;
}

.card-kicker {
  font-size: clamp(1rem, 1.4vw, 1.3rem);

  margin-bottom: 1rem;

  letter-spacing: 0.1em;
}


.card-content h2 {

  font-size: clamp(4rem, 12vw, 11rem);

  line-height: 0.82;

  letter-spacing: -0.07em;

  text-transform: uppercase;

  max-width: 1000px;
}


.card-description {
  margin-top: 2.5rem;

  font-size: clamp(1rem, 2vw, 1.7rem);

  max-width: 500px;

  line-height: 1.3;
}


/* lien */

.card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: fit-content;

  min-width: 260px;

  padding: 1rem 0;

  border-bottom: 1px solid currentColor;

  font-size: 0.85rem;

  letter-spacing: 0.1em;

  transition:
    gap 0.3s ease,
    opacity 0.3s ease;
}

.card-link span {
  margin-left: 2rem;

  transition: transform 0.3s ease;
}

.card-link:hover span {
  transform: translate(6px, -6px);
}


/* =========================
   FINAL SECTION
========================= */

.final-section {

  position: relative;

  min-height: 100vh;

  background: #050505;
  color: #fff;

  overflow: hidden;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  padding: 2rem;
}


/* =========================
   MOTS FOND
========================= */

.background-words {

  position: absolute;
  inset: 0;

  pointer-events: none;

  overflow: hidden;
}


.word-layer {

  position: absolute;

  left: -10%;

  width: 120%;

  white-space: nowrap;

  font-size: clamp(6rem, 17vw, 18rem);

  font-weight: 900;

  letter-spacing: -0.08em;

  line-height: 0.8;

  opacity: 0.08;

  user-select: none;

  transition: opacity 1.5s ease;
}


.word-derouiche {

  top: 5%;

  animation:
    drift-right 16s ease-in-out infinite alternate,
    pulse-derouiche 10s ease-in-out infinite;
}


.word-dervish {

  top: 38%;

  text-align: right;

  animation:
    drift-left 20s ease-in-out infinite alternate,
    pulse-dervish 10s ease-in-out infinite;
}


.word-wish {

  top: 70%;

  animation:
    drift-right 18s ease-in-out infinite alternate,
    pulse-wish 10s ease-in-out infinite;
}


/* déplacement très léger */

@keyframes drift-right {

  from {
    transform: translateX(-1%);
  }

  to {
    transform: translateX(3%);
  }

}


@keyframes drift-left {

  from {
    transform: translateX(2%);
  }

  to {
    transform: translateX(-3%);
  }

}


/* =========================
   OPACITÉ DES MOTS
========================= */

@keyframes pulse-derouiche {

  0% {
    opacity: 0.3;
  }

  33% {
    opacity: 0.06;
  }

  66% {
    opacity: 0.04;
  }

  100% {
    opacity: 0.3;
  }
}


@keyframes pulse-dervish {

  0% {
    opacity: 0.05;
  }

  33% {
    opacity: 0.3;
  }

  66% {
    opacity: 0.05;
  }

  100% {
    opacity: 0.05;
  }
}


@keyframes pulse-wish {

  0% {
    opacity: 0.04;
  }

  33% {
    opacity: 0.05;
  }

  66% {
    opacity: 0.3;
  }

  100% {
    opacity: 0.04;
  }
}


/* =========================
   LOGO DERVICHE
========================= */

.dervish-wrapper {

  position: relative;

  z-index: 3;

  width: min(38vw, 420px);

  aspect-ratio: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  transition:
    opacity 1.2s ease,
    transform 1.2s ease;
}


.dervish-logo {

  width: 100%;
  height: 100%;

  object-fit: contain;

  animation: dervish-spin 16s linear infinite;

  filter: grayscale(100%);
}


@keyframes dervish-spin {

  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }

}


/* quand JS déclenche disparition */

.dervish-wrapper.hide-logo {

  opacity: 0;

  transform: scale(0.82);
}


/* =========================
   BOUTONS FINAL
========================= */

.final-actions {

  position: absolute;

  bottom: 3rem;

  left: 2rem;
  right: 2rem;

  z-index: 4;

  display: flex;
  justify-content: space-between;

  gap: 1rem;

  opacity: 0;

  transform: translateY(30px);

  transition:
    opacity 1s ease,
    transform 1s ease;
}


.final-actions.show-actions {

  opacity: 1;

  transform: translateY(0);
}


.final-button {

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 4rem;

  border-bottom: 1px solid #fff;

  padding: 1rem 0;

  font-size: 0.85rem;

  letter-spacing: 0.12em;

  transition:
    opacity 0.3s ease,
    padding 0.3s ease;
}


.final-button:hover {

  opacity: 0.55;

  padding-left: 0.4rem;
  padding-right: 0.4rem;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 700px) {

  .project-card {
    padding: 1.3rem;

    border-radius: 1.5rem 1.5rem 0 0;
  }


  .card-meta {

    flex-direction: column;

    gap: 0.4rem;
  }


  .card-content h2 {

    font-size: clamp(3.3rem, 17vw, 6rem);
  }


  .card-description {

    font-size: 1.05rem;

    max-width: 90%;
  }


  .card-link {

    min-width: 100%;
  }


  .dervish-wrapper {

    width: 70vw;
  }


  .final-actions {

    flex-direction: column;

    bottom: 2rem;
  }


  .final-button {

    width: 100%;
  }


  .word-layer {

    font-size: 27vw;
  }


  .word-derouiche {

    top: 10%;
  }


  .word-dervish {

    top: 38%;
  }


  .word-wish {

    top: 69%;
  }

}


/* =========================
   ACCESSIBILITÉ
   réduire animations
========================= */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {

    animation-duration: 0.01ms !important;

    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }

}