* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root {
  --header-height: 64px;
  --gap-md: 1.5rem;
  --carousel-visible: 4;
}

/* Base */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  font-size: clamp(14px, 1.2vw, 16px);
  padding-top: var(--header-height); /* espace pour header fixe */
}

/* Header */
header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 10px 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo img {
  display: block;
  height: 48px;
  width: auto;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  list-style: none;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s;
}

nav a:hover {
  color: #000;
}

/* Hero Section */
#accueil {
  background: #000;
  color: white;
  padding: clamp(80px, 10vh, 140px) 1.25rem clamp(60px, 8vh, 100px);
  text-align: center;
  margin-top: 80px;
  position: relative;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  width: 100%;
  padding: 0 0.75rem;
  box-sizing: border-box;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.hero-bg-content {
  position: relative;
  z-index: 1;
}

.hero-bg-content .text {
  font-size: clamp(1.8rem, 6.5vw, 4rem);
  line-height: 1;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.hero-bg-content .card-copy {
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

.cta-button {
  display: inline-block;
  background: white;
  color: #000;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
}

/* Sections */
section {
  padding: 80px 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

section h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  color: #000;
}

/* Services */
#services {
  background: #fff;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap-md);
}

.service-card {
  background: #f9f9f9;
  padding: 2rem;
  border-radius: 10px;
  border: 1px solid #e5e5e5;
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.service-img {
  max-width: 160px;
  width: 100%;
  height: auto;
  margin: 0 auto 1rem;
  object-fit: contain;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #000;
}

.service-card p {
  color: #666;
}

/* Clients Section */
#clients {
  background: #f9f9f9;
}

/* Carousel logos */
.carousel {
  position: relative;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-track-container {
  overflow: hidden;
  flex: 1;
}

.carousel-track {
  display: flex;
  gap: 18px;
  padding: 10px 0;
  margin: 0;
  list-style: none;
  transition: transform 0.5s ease;
}

.carousel-slide {
  flex: 0 0 calc(100% / var(--carousel-visible));
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.75rem;
  box-sizing: border-box;
  min-height: 120px;
}

.carousel-slide img {
  max-height: 140px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: grayscale(0%);
  opacity: 1;
  transition: transform 0.3s;
}

.carousel-slide:hover img {
  transform: scale(1.05);
}

/* Carousel controls */
.carousel-button {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: grid;
  place-items: center;
}

.carousel-button:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-dots {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  border: none;
  padding: 0;
}

.carousel-dot.active {
  background: #333;
}

/* À propos */
#apropos {
  background: #fff;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.about-text h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #000;
}

.about-text p {
  margin-bottom: 1rem;
  color: #666;
  line-height: 1.8;
}

.about-image {
  background: #000;
  border-radius: 10px;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.about-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* Contact */
#contact {
  background: #f9f9f9;
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact-item-icon {
  font-size: 1.5rem;
  color: #000;
  margin-top: 0.2rem;
}

.contact-item h3 {
  color: #000;
  margin-bottom: 0.5rem;
}

.contact-item p {
  color: #666;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #000;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-button {
  background: #000;
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.submit-button:hover {
  background: #333;
}

/* Message de confirmation du formulaire */
.form-message {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  display: none;
  animation: slideIn 0.5s ease-out;
}

.form-message.success {
  background-color: #000;
  color: #fff;
  border: 2px solid #fff;
  display: block;
}

.form-message.error {
  background-color: #000;
  color: #ff4444;
  border: 2px solid #ff4444;
  display: block;
}

.form-message.loading {
  background-color: #000;
  color: #fff;
  border: 2px solid #666;
  display: block;
}

.form-message strong {
  font-size: 1.1rem;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation du bouton pendant l'envoi */
.submit-button.sending {
  background: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Footer */
footer {
  background: #000;
  color: white;
  text-align: center;
  padding: 2rem;
}

footer p {
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

/* Animations fade-in */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Classes pour les animations */
.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
}

.fade-in-up.visible {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Animation au chargement de la page */
.hero-bg-content {
  animation: fadeInUp 1.2s ease-out;
}

.hero-bg-content .text {
  animation: fadeInUp 1.2s ease-out 0.2s backwards;
}

.hero-bg-content .card-copy {
  animation: fadeInUp 1.2s ease-out 0.4s backwards;
}

.hero-bg-content .cta-button {
  animation: fadeInUp 1.2s ease-out 0.6s backwards;
}

/* Animations pour les sections au scroll */
section h2 {
  opacity: 0;
}

section h2.visible {
  animation: fadeInUp 0.8s ease-out forwards;
}

.service-card,
.carousel,
.about-content,
.contact-container {
  opacity: 0;
}

.service-card.visible,
.carousel.visible,
.about-content.visible,
.contact-container.visible {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Délai pour les cartes de service */
.service-card:nth-child(1).visible {
  animation-delay: 0.1s;
}
.service-card:nth-child(2).visible {
  animation-delay: 0.2s;
}
.service-card:nth-child(3).visible {
  animation-delay: 0.3s;
}
.service-card:nth-child(4).visible {
  animation-delay: 0.4s;
}
.service-card:nth-child(5).visible {
  animation-delay: 0.5s;
}
.service-card:nth-child(6).visible {
  animation-delay: 0.6s;
}

/* Hamburger menu (mobile) */
.hamburger {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hamburger-box {
  display: inline-block;
  width: 24px;
  height: 16px;
  position: relative;
}
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  content: "";
  display: block;
  background: #111;
  height: 2px;
  border-radius: 2px;
  position: absolute;
  left: 0;
  right: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.hamburger-inner {
  top: 50%;
  transform: translateY(-50%);
}
.hamburger-inner::before {
  top: -7px;
}
.hamburger-inner::after {
  bottom: -7px;
}

/* transform to X when open */
body.nav-open .hamburger-inner {
  transform: rotate(45deg);
}
body.nav-open .hamburger-inner::before {
  transform: rotate(90deg) translateX(0);
  top: 0;
}
body.nav-open .hamburger-inner::after {
  opacity: 0;
}

/* Mobile: hide normal menu, show hamburger */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  nav {
    align-items: center;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: min(320px, 80%);
    height: calc(100vh - var(--header-height));
    background: #fff;
    padding: 1.5rem;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1100;
  }

  .nav-links li {
    list-style: none;
  }
  .nav-links a {
    color: #111;
    font-size: 1.05rem;
    padding: 0.6rem 0;
    display: inline-block;
  }

  body.nav-open .nav-links {
    transform: translateX(0);
  }

  /* ensure nav links are horizontal on desktop remain unchanged */
  nav ul {
    gap: 1rem;
  }
}

/* optional: close menu when large screen to avoid stuck state */
@media (min-width: 769px) {
  .nav-links {
    position: static;
    transform: none;
    height: auto;
    width: auto;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  .hamburger {
    display: none;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .about-content,
  .contact-container {
    grid-template-columns: 1fr;
  }
  .carousel {
    --carousel-visible: 3;
  }
  .carousel-slide img {
    max-height: 120px;
  }
}

/* tablettes */
@media (max-width: 768px) {
  nav ul {
    gap: 0.75rem;
  }
  .hero-bg-content .text {
    font-size: clamp(1.6rem, 8vw, 2.6rem);
  }
  .hero-content {
    max-width: 720px;
  }
  .service-img {
    max-width: 140px;
  }
  .carousel {
    --carousel-visible: 2;
  }
  .carousel-slide img {
    max-height: 110px;
  }
  .about-image {
    min-height: 260px;
  }
}

/* mobiles */
@media (max-width: 560px) {
  body {
    padding-top: calc(var(--header-height) + 6px);
  }
  header nav {
    align-items: flex-start;
  }
  nav ul {
    width: 100%;
    justify-content: center;
  }
  .hero-bg-content .text {
    font-size: 1.9rem;
  }
  .hero-bg-content .card-copy {
    font-size: 0.95rem;
  }
  .services-grid {
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .service-card {
    padding: 1rem;
  }
  .carousel {
    --carousel-visible: 1;
  }
  .carousel-slide {
    padding: 0.5rem;
  }
  .carousel-slide img {
    max-height: 90px;
  }
  .submit-button {
    width: 100%;
  }
  .contact-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* petites corrections pour images / vidéos */
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* s'assurer que le footer et sections s'étendent correctement */
section {
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}
@media (min-width: 1200px) {
  .hero-content {
    max-width: 900px;
  }
}

/* Desktop: affichage 3x2 pour les services */
@media (min-width: 1000px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-md);
  }
  .service-card {
    padding: 2rem;
  }
}
