/* =========================
BASE
========================= */

.projects {
  margin-top: 15px;
  padding: 80px 0px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  height: 600px;
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: transform 0.4s ease;
}

.card:hover img {
  transform: scale(1.1);
}

.card.active img {
  transform: scale(1.05);
}

/* OVERLAY */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: 0.3s;
}

/* Desktop hover */
@media (hover: hover) {
  .card:hover .overlay {
    opacity: 1;
  }
}

/* Classe active (mobile click) */
.card.active .overlay {
  opacity: 1;
}


/* =========================
RESPONSIVE
========================= */

/* Tablet */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: 1fr; /* suffit largement */
  }
}

/* Mobile */
@media (max-width: 600px) {
  .projects {
    padding: 40px 0px;
    margin-top: 67px;
  }

  .card {
    height: 400px;
  }
}

/* MOBILE */
@media (max-width: 768px) {

  .burger {
    display: flex;
    justify-content: center;
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: none;

    display: flex;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 20px 0;

    /* 👇 animation fluide */
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;

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

  nav a {
    margin: 15px 0;
    font-size: 22px;

    /* petit effet smooth sur les liens */
    transform: translateY(-10px);
    opacity: 0;
    transition: 0.3s ease;
  }

  nav.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  }

  header {
    background: #ffffff;
  }

  /* apparition progressive des liens */
  nav.active a {
    transform: translateY(0);
    opacity: 1;
  }

  nav.active a:nth-child(1) { transition-delay: 0.1s; }
  nav.active a:nth-child(2) { transition-delay: 0.2s; }
  nav.active a:nth-child(3) { transition-delay: 0.3s; }

  /* burger animation */
  .burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .burger.active span:nth-child(2) {
    opacity: 0;
  }

  .burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .hero h2 {
    font-size: 24px;
    padding-top: 80px;
  }

  .scroll-down {
    bottom: 45vh;
    font-size: 1.5rem;
  }

  .project-inner h1 {
    font-size: 40px;
  }
}
