/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background-color: #000;
  color: #fff;
  font-family: "Roboto Flex", sans-serif;
  font-weight: 300;
}

/* Page transitions */
body {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

body.fade-in {
  opacity: 1;
}

body.fade-out {
  opacity: 0;
}

main {
  opacity: 1;
  transition: opacity 0.4s ease-in-out;
}

body.content-fade-out main {
  opacity: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  z-index: 100;
}

.nav-left {
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  margin-left: -10px;
  cursor: pointer;
}
.nav-left .first-name { font-weight: 300; color: #bbb; }
.nav-left .last-name { 
  font-weight: 600; 
  color: #fff;
  transition: color 0.3s ease;
}
.nav-left:hover .last-name {
  color: #f5c518;
}
.nav-left:active .last-name {
  color: #f5c518;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.dropdown-btn {
  margin-top: -1.5px;
}

.nav-item, .dropdown-btn {
  font-size: 1rem;
  font-weight: 300;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.3s ease;
}
.nav-item:hover, .dropdown-btn:hover { color: #f5c518; }

.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  list-style: none;
  padding: 10px 0;
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
}
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}
.dropdown-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}
.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
.dropdown-menu li { text-align: left; }
.dropdown-menu a {
  display: block;
  color: #fff;
  padding: 10px 20px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 300;
}
.dropdown-menu a:hover { background: rgba(255,255,255,0.1); }
.dropdown:hover .dropdown-menu { display: block; }

.nav-links-mobile {
  display: none;
  position: fixed;
  top: 60px;
  right: 15px;
  width: 240px;
  max-height: calc(100vh - 80px);
  flex-direction: column;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0;
  gap: 0;
  z-index: 200;
  transform: scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-links-mobile.mobile-active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.nav-item-mobile {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-weight: 300;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.nav-item-mobile:last-child {
  border-bottom: none;
}

.nav-item-mobile:hover {
  background: rgba(255,255,255,0.1);
  color: #f5c518;
}

.nav-item-mobile--highlight {
  color: #f5c518;
  font-weight: 400;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 26px;
  height: 14px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 300;
}
.burger span {
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(4.5px, 4.5px);
}
.burger.active span:nth-child(2) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Carousel */
.carousel-desktop {
  display: block;
}

.carousel { 
  position: relative; 
  width: 100%; 
  height: 100vh; 
  overflow: hidden; 
}

.slides-wrapper { 
  display: flex; 
  width: 100%; 
  height: 100%; 
  transition: transform 0.5s ease; 
}

.carousel-slide { 
  min-width: 100%; 
  position: relative; 
}

.carousel-slide img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
}

.carousel__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 20%, rgba(0,0,0,0));
  padding: 60px 20px 60px;
  text-align: center;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.carousel__text { 
  max-width: 800px; 
  animation: fadeIn 0.8s ease-in-out; 
}

.carousel__text h3 {
  font-size: 2.2rem;
  margin-bottom: 0.3em;
  font-weight: 400;
}

.carousel__text p {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 0.8em;
  font-weight: 300;
  color: #ddd;
}

/* Intro slide specific */
.carousel-slide--intro {
  background-color: #000;
}

.carousel-slide--intro .carousel__overlay {
  background: transparent;
  padding: 0;
  height: 100%;
  top: 0;
  bottom: auto;
  align-items: center;
  justify-content: center;
  padding-left: 0;
}

.carousel-slide--intro .carousel__text {
  max-width: 600px;
  text-align: left;
  margin-left: -200px;
}

.carousel-slide--intro .carousel__text h3 {
  font-size: 2rem;
  margin-bottom: 1.5em;
  font-weight: 300;
  line-height: 1.4;
  color: #fff;
}

.intro-cta-btn {
  font-size: 80%;
  display: inline-block;
  background: transparent;
  color: #f5c518;
  border: 1px solid #f5c518;
  text-decoration: none;
  padding: 0.7em 1.6em;
  border-radius: 5px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Roboto Flex", sans-serif;
}

.intro-cta-btn:hover {
  background: #f5c518;
  color: #000;
}

.carousel__link {
  font-size: 80%;
  display: inline-block;
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  text-decoration: none;
  padding: 0.7em 1.6em;
  border-radius: 5px;
  font-weight: 300;
  transition: all 0.3s ease;
}

.carousel__link:hover { 
  background: #fff; 
  color: #000; 
}

.carousel__indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel__indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.carousel__indicator.active {
  background: #f5c518;
  transform: scale(1.4);
}

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.carousel__btn:hover { opacity: 0.9; }

.carousel__btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform-origin: center;
}

.carousel__btn--prev::before { 
  transform: translate(-50%, -50%) rotate(-135deg); 
}

.carousel__btn--next::before { 
  transform: translate(-50%, -50%) rotate(45deg); 
}

.carousel__btn--prev { left: 40px; }
.carousel__btn--next { right: 40px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile list */
.projects-mobile {
  display: none;
}

/* Responsive */
@media (max-width: 1024px) {
  .carousel__text h3 { font-size: 1.8rem; }
  .carousel__text p { font-size: 1rem; }
  .carousel__btn--prev { left: 20px; }
  .carousel__btn--next { right: 20px; }

  .carousel-slide--intro .carousel__text {
    margin-left: -150px;
  }

  .carousel-slide--intro .carousel__text h3 {
    font-size: 1.6rem;
  }
}

@media (max-width: 768px) {
  .navbar { height: 60px; padding: 0 25px; }
  .nav-left { font-size: 1.2rem; margin-left: -10px; }
  
  .nav-links { display: none; }
  .burger { display: flex; }
}

/* Mobile portrait */
@media (max-width: 768px) and (orientation: portrait) {
  html, body {
    overflow-y: auto;
    height: auto;
  }

  .carousel-slide--intro .carousel__overlay {
    padding-left: 30px;
    padding-right: 30px;
  }

  .carousel-slide--intro .carousel__text h3 {
    font-size: 1.3rem;
  }

  .carousel-desktop {
    display: none;
  }

  .projects-mobile {
    display: block;
    padding: 80px 0 40px;
  }

  .project-card {
    margin-bottom: 50px;
  }

  .project-card--intro {
    background-color: transparent; /* Fond transparent */
    margin-bottom: 50px; /* Même espacement qu'entre les project-card */
    border: none;
    border-radius: 4px; /* Même border-radius que les images de projets */
    width: 90%; /* Même largeur que les images de projets */
    margin-left: 15px; /* Même alignement que les images */
    margin-right: auto;
  }

  .project-card__content--intro {
    padding: 0 22px; /* Même que project-card__content */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
  }

  .project-card__intro-text {
    font-size: 1.05rem; /* Légèrement plus petit que navbar (1.2rem) */
    font-weight: 300;
    line-height: 1.5;
    color: #fff; /* Texte blanc */
    text-align: left;
    margin: 0;
    margin-left: -6px; /* Même décalage que les titres de projets */
    letter-spacing: -0.5px;
    max-width: 100%;
  }

  .intro-cta-btn--mobile {
    display: none; /* Cacher le bouton */
  }

  .project-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
  }

  .project-card__image {
    width: 90%;
    height: 40vh;
    margin-bottom: 5px;
    margin-left: 15px;
    margin-right: auto;
    border-radius: 4px;
    overflow: hidden;
  }

  .project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
  }

  .project-card__link:active .project-card__image img {
    transform: scale(1.05);
  }

  .project-card__content {
    padding: 0 22px;
  }

  .project-card__title {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 2px;
    margin-left: -6px;
    color: #fff;
  }

  .project-card__description {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.4;
    color: #999;
    margin-left: -6px;
  }
}

/* Tablette portrait */
@media (min-width: 769px) and (max-width: 1366px) and (orientation: portrait) {
  html, body {
    overflow-y: auto;
    height: auto;
  }

  .carousel-desktop {
    display: none;
  }

  .projects-mobile {
    display: block;
    padding: 80px 0 40px;
  }

  .project-card {
    margin-bottom: 50px;
  }

  .project-card--intro {
    background-color: #000;
    margin-bottom: 50px; /* Même espacement qu'entre les project-card */
    border: none;
    border-radius: 0;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .project-card__content--intro {
    padding: 0;
    padding-left: 22px; /* Même que project-card__content */
    padding-right: 22px;
    padding-top: 5px; /* Très proche de la navbar */
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
  }

  .project-card__intro-text {
    font-size: 1.05rem; /* Légèrement plus petit que navbar */
    font-weight: 300;
    line-height: 1.5;
    color: #fff;
    text-align: left;
    margin: 0;
    margin-left: -6px; /* Même décalage que project-card__description */
    letter-spacing: -0.5px;
    max-width: 100%;
  }

  .intro-cta-btn--mobile {
    display: none; /* Cacher le bouton */
  }

  .project-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
  }

  .project-card__image {
    width: 90%;
    height: 40vh;
    margin-bottom: 5px;
    margin-left: 15px;
    margin-right: auto;
    border-radius: 4px;
    overflow: hidden;
  }

  .project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
  }

  .project-card__link:active .project-card__image img {
    transform: scale(1.05);
  }

  .project-card__content {
    padding: 0 22px;
  }

  .project-card__title {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 2px;
    margin-left: -6px;
    color: #fff;
  }

  .project-card__description {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.4;
    color: #999;
    margin-left: -6px;
  }
}

/* Tablette landscape */
@media (min-width: 769px) and (max-width: 1366px) and (orientation: landscape) {
  .carousel-desktop {
    display: block;
  }

  .projects-mobile {
    display: none;
  }
}

/* Mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
  html, body {
    overflow-y: auto;
    height: auto;
  }
  .carousel-desktop {
    display: none;
  }

  /* Afficher liste */
  .projects-mobile {
    display: block;
    padding: 80px 0 40px;
  }

  .project-card {
    margin-bottom: 50px;
  }

  .project-card--intro {
    background-color: #000;
    margin-bottom: 50px; /* Même espacement qu'entre les project-card */
    border: none;
    border-radius: 0;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .project-card__content--intro {
    padding: 0;
    padding-left: 22px; /* Même que project-card__content */
    padding-right: 22px;
    padding-top: 5px; /* Très proche de la navbar */
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
  }

  .project-card__intro-text {
    font-size: 1.05rem; /* Légèrement plus petit que navbar */
    font-weight: 300;
    line-height: 1.5;
    color: #fff;
    text-align: left;
    margin: 0;
    margin-left: -6px; /* Même décalage que project-card__description */
    letter-spacing: -0.5px;
    max-width: 100%;
  }

  .intro-cta-btn--mobile {
    display: none; /* Cacher le bouton */
  }

  .project-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
  }

  .project-card__image {
    width: 90%;
    height: 40vh;
    margin-bottom: 5px;
    margin-left: 15px;
    margin-right: auto;
    border-radius: 4px;
    overflow: hidden;
  }

  .project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
  }

  .project-card__link:active .project-card__image img {
    transform: scale(1.05);
  }

  .project-card__content {
    padding: 0 22px;
  }

  .project-card__title {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 2px;
    margin-left: -6px;
    color: #fff;
  }

  .project-card__description {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.4;
    color: #999;
    margin-left: -6px;
  }
}