@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');

:root {
  --yellow: #E8CF23;
  --purple: #4A2E75;
  --light-gray: #919191;
  --dark-bg: #1A1A1A;
  --text-dark: #333;
  --white: #ffffff;
  --border-radius-sm: 12px;
  --border-radius-md: 20px;
  --border-radius-lg: 50px;
  --transition-speed: 0.3s;
  --shadow-sm: 0 5px 15px rgba(0,0,0,0.1);
  --shadow-md: 0 8px 25px rgba(0,0,0,0.15);
}

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

body {
  font-family: "Poppins", sans-serif;
  color: var(--text-dark);
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10vw;
  margin: 15px 20px;
  font-weight: 300;
}

nav span {
  flex-grow: 1;
  text-align: center;
}

nav a {
  transition: color var(--transition-speed) ease;
}

nav a:hover {
  color: var(--yellow);
}

nav a.active {
  color: var(--purple);
  font-weight: 500;
}

.logo {
  text-align: left;
}

#nav-center {
  flex-grow: 4;
  display: flex;
  justify-content: center;
  gap: 30px;
}

#nav-end {
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
}

header > hr {
  width: 80vw;
  margin: 0 auto;
  border: none;
  height: 1px;
  background-color: var(--yellow);
}

/* Intro Section */
#intro {
  min-height: 90vh;
  position: relative;
  overflow: hidden;
  padding-bottom: 100px;
}

#port {
  position: relative;
  left: 50px;
  top: 50px;
  width: 900px;
  z-index: 1;
}

#anat-tram {
  position: absolute;
  bottom: 100px;
  left: 20px;
  width: 500px;
  z-index: 2;
}

#pres {
  position: absolute;
  right: 40px;
  bottom: 160px;
  text-align: right;
  color: var(--light-gray);
  font-weight: 300;
  line-height: 1.5;
  z-index: 3;
  font-size: 1.35rem;
}

.separator {
  width: 100%;
}

.separator {
  background-color: var(--yellow);
  height: 100px;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
}

/* Services Section */
#services {
  padding: 80px 0;
  overflow: hidden;
}

#logo-packaging {
  width: 50vw;
  display: block;
  margin: 0 auto 40px;
}

.gold {
  color: var(--yellow);
}

.purple {
  color: var(--purple);
}

/* Projects Grid */
.carousel-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.projects-wrapper {
  width: 100%;
  overflow: hidden;
  padding: 20px 0;
}

.projects-grid {
  display: flex;
  gap: 40px;
  width: max-content;
  animation: infiniteScroll 60s linear infinite;
}

/* Animation pour le défilement infini */
@keyframes infiniteScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-1 * (350px + 40px) * 4));
  }
}

/* Pause de l'animation au survol */
.projects-grid:hover {
  animation-play-state: paused;
}

.project-card, .project-card-clone {
  flex: 0 0 350px;
  height: 450px;
  overflow: hidden;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.project-card:hover, .project-card-clone:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.project-card img, .project-card-clone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed) ease;
}

.project-card:hover img, .project-card-clone:hover img {
  transform: scale(1.05);
}

/* Scrollbar styling */
.projects-grid::-webkit-scrollbar {
  height: 8px;
  background-color: transparent;
  margin-top: 15px;
}

.projects-grid::-webkit-scrollbar-track {
  background: rgba(241, 241, 241, 0.5);
  border-radius: 20px;
  border: 1px solid rgba(74, 46, 117, 0.1);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
}

.projects-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--yellow), var(--purple));
  border-radius: 20px;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.projects-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, var(--purple), var(--yellow));
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Button Styles */
.see-more {
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

.btn-purple {
  background-color: var(--purple);
  color: var(--white);
  padding: 12px 30px;
  border-radius: var(--border-radius-lg);
  font-weight: 500;
  transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
  display: inline-block;
}

.btn-purple:hover {
  background-color: #5d3b94;
  transform: translateY(-2px);
}

.plus {
  font-weight: bold;
  font-size: 1.2em;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background-color: var(--dark-bg);
  color: var(--white);
  padding: 50px 0 20px;
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background-color: var(--yellow);
  border-radius: 50%;
}

.social-icon img {
  width: 24px;
  height: 24px;
}

.copyright {
  font-size: 0.9rem;
  color: #999;
  margin-top: 20px;
}

/* Media Queries */
@media (max-width: 1200px) {
  #port {
    width: 700px;
  }

  #anat-tram {
    width: 450px;
  }

  #pres {
    font-size: 0.95rem;
  }

  .project-card, .project-card-clone {
    flex: 0 0 300px;
    height: 380px;
  }

  @keyframes infiniteScroll {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-1 * (300px + 40px) * 4));
    }
  }
}

@media (max-width: 992px) {
  nav {
    margin: 15px 15px;
  }

  #nav-center {
    gap: 20px;
    font-size: 0.9rem;
  }

  #port {
    width: 550px;
    left: 20px;
  }

  #anat-tram {
    width: 350px;
  }

  #services {
    padding: 60px 0;
  }

  #logo-packaging {
    width: 60vw;
  }

  .project-card, .project-card-clone {
    flex: 0 0 280px;
    height: 360px;
  }

  @keyframes infiniteScroll {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-1 * (280px + 40px) * 4));
    }
  }
}

/* ============================================
   LOADER
   ============================================ */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#loader img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#loader.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 12px;
    margin: 10px;
  }

  #nav-center, #nav-end {
    width: 100%;
    justify-content: center;
  }

  #nav-center {
    gap: 15px;
    font-size: 0.85rem;
  }

  #nav-end {
    font-size: 0.8rem;
  }

  header > hr {
    width: 90vw;
  }

  #intro {
    padding-top: 30px;
    min-height: 70vh;
    padding-bottom: 80px;
  }

  #port {
    width: 90%;
    left: 5%;
    top: 30px;
  }

  #anat-tram {
    width: 250px;
    bottom: 70px;
    z-index: 2;
  }

  #pres {
    width: 85%;
    right: 7.5%;
    left: 7.5%;
    font-size: 0.8rem;
    bottom: auto;
    top: 200px;
    line-height: 1.4;
    text-align: center;
  }

  #pres br {
    display: none;
  }

  .separator {
    height: 70px;
  }

  #services {
    padding: 40px 0;
  }

  #logo-packaging {
    width: 75vw;
    margin-bottom: 30px;
  }

  .carousel-container {
    padding: 0 10px;
  }

  .projects-grid {
    gap: 20px;
  }

  .project-card, .project-card-clone {
    flex: 0 0 250px;
    height: 320px;
  }

  @keyframes infiniteScroll {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-1 * (250px + 20px) * 4));
    }
  }

  .btn-purple {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

  footer {
    padding: 40px 20px 20px;
  }

  .social-links {
    gap: 15px;
    margin-bottom: 25px;
  }

  .social-icon {
    width: 45px;
    height: 45px;
  }

  .social-icon img {
    width: 22px;
    height: 22px;
  }
}

/* Very Small Screens (Mobile Portrait) */
@media (max-width: 480px) {
  nav {
    font-size: 0.75rem;
  }

  #nav-center {
    gap: 10px;
    font-size: 0.75rem;
    flex-wrap: wrap;
  }

  #nav-end {
    gap: 15px;
  }

  #intro {
    min-height: 65vh;
    padding-bottom: 60px;
  }

  #port {
    width: 95%;
    left: 2.5%;
    top: 20px;
  }

  #anat-tram {
    width: 200px;
    bottom: 50px;
    left: calc(50% - 100px);
    z-index: 2;
  }

  #pres {
    width: 90%;
    right: 5%;
    left: 5%;
    font-size: 0.7rem;
    bottom: auto;
    top: 150px;
    text-align: center;
  }

  .separator {
    height: 50px;
  }

  #services {
    padding: 30px 0;
  }

  #logo-packaging {
    width: 85vw;
    margin-bottom: 25px;
  }

  .carousel-container {
    padding: 0 5px;
  }

  .projects-grid {
    gap: 15px;
  }

  .project-card, .project-card-clone {
    flex: 0 0 220px;
    height: 280px;
  }

  @keyframes infiniteScroll {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-1 * (220px + 15px) * 4));
    }
  }

  .see-more {
    margin: 30px 0;
  }

  .btn-purple {
    padding: 8px 20px;
    font-size: 0.85rem;
  }

  footer {
    padding: 30px 15px 15px;
  }

  .social-links {
    gap: 12px;
    margin-bottom: 20px;
  }

  .social-icon {
    width: 40px;
    height: 40px;
  }

  .social-icon img {
    width: 20px;
    height: 20px;
  }

  .copyright {
    font-size: 0.8rem;
  }
}
