/* HEADER GLOBAL */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 35px 0;
  transition: all 0.3s ease;
}

/* LANDING : TRANSPARENT MAIS LISIBLE */

body.home header {
  background: transparent;
  color: black;
}

/* AU SCROLL */

header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  color: black;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* INNER */

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* NAV DESKTOP */

.nav {
  display: flex;
  gap: 20px;
  font-size: 18px;
  letter-spacing: 0.06em;
  will-change: transform;
}

/* LINKS */

.nav a {
  position: relative;
}

/* ONGLET ACTIF */

.nav a.active {
  font-weight: 700;
}

/* TITRE ACTIF */

.active-title {
  font-weight: 700;
}

/* TOUS LES TITRES DE PAGE EN GRAS */

.site-title h1,
.site-title .site-title {
  font-weight: 700;
}

/* UNDERLINE */

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: currentColor;

  transform: scaleX(0);
  transform-origin: right;

  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav a:hover::after,
.nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* BURGER */

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 200;
}

.burger span {
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: all 0.3s ease;
}

/* BURGER ANIMATION */

.burger.active span:nth-child(1) {
  transform: translateY(3px) rotate(45deg);
}

.burger.active span:nth-child(2) {
  transform: translateY(-3px) rotate(-45deg);
}

/* ========================= */
/* MOBILE */
/* ========================= */

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;

    height: 100vh;
    width: 240px;
    background: white;

    flex-direction: column;
    padding: 120px 30px;

    transform: translateX(100%);
    opacity: 0;

    transition:
      transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.4s ease;

    will-change: transform;
    z-index: 150;
  }

  .nav.open {
    transform: translateX(0);
    opacity: 1;
  }

  .nav a {
    opacity: 0;
    transform: translateY(15px);

    transition:
      transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.4s ease;
  }

  .nav.open a {
    opacity: 1;
    transform: translateY(0);
  }

  .nav.open a:nth-child(1) {
    transition-delay: 0.1s;
  }

  .nav.open a:nth-child(2) {
    transition-delay: 0.15s;
  }

  .nav.open a:nth-child(3) {
    transition-delay: 0.2s;
  }

  .nav.open a:nth-child(4) {
    transition-delay: 0.25s;
  }

  .nav.open a:nth-child(5) {
    transition-delay: 0.3s;
  }

  .burger {
    display: flex;
  }
}

/* OVERLAY */

body.menu-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);

  opacity: 0;
  transition: opacity 0.4s ease;

  z-index: 50;
}

body.menu-open::before {
  opacity: 1;
}

.site-title {
  font-size: 18px;
  letter-spacing: 0.06em;
  font-weight: normal;
}

.site-title a,
.site-title span {
  display: block;
}

.back-link {
  font-size: 24px;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s ease;
}

.back-link:hover {
  transform: translateX(-5px);
}

/* NAV PROJET */

body.single-projet .header-inner {
  justify-content: center;
  position: relative;
}

body.single-projet .nav {
  position: absolute;
  right: 0;
}

/* HEADER SINGLE PROJET */

.single-project-header {
  position: relative;

  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* NOM PROJET */

.single-project-title {
  position: fixed;

  top: 36px;
  left: 80px;

  font-size: 18px;
  font-weight: 700;

  text-transform: uppercase;

  letter-spacing: 0.14em;

  white-space: nowrap;

  z-index: 120;
}

/* NAVIGATION PROJET */

.project-nav {
  display: flex;
  align-items: center;
  gap: 18px;

  margin: 0 auto;
}

.project-nav a {
  text-decoration: none;
  color: inherit;
  font-size: 18px;

  transition:
    opacity 0.3s ease,
    transform 0.2s ease;
}

.project-nav a:hover {
  opacity: 0.5;
}

/* GRID ICON */

.nav-grid a {
  font-size: 14px;
  opacity: 0.6;
}

/* HOVER SUBTIL */

.nav-prev a:hover {
  transform: translateX(-3px);
}

.nav-next a:hover {
  transform: translateX(3px);
}

/* FIX MOBILE NAV PROJET */

@media (max-width: 768px) {
  body.single-projet .header-inner {
    justify-content: center;
  }

  .burger {
    position: absolute;
    right: 20px;
  }

  .single-project-title {
    top: 32px;
    left: 20px;

    font-size: 12px;

    letter-spacing: 0.08em;

    line-height: 1.2;
  }

  .project-nav {
    position: relative;
    z-index: 1;
    gap: 14px;
  }

  .project-nav a {
    font-size: 16px;
  }
}
