html, body {
  margin: 0;
  padding: 0;
  height: 100%;              /* assure le 100vh réel */
  background-color: #fff;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden;          /* on scrolle dans #container */
}

/* HEADER */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100px;
  background: rgba(0, 0, 0, 0.22);        /* pas totalement transparent */
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  backdrop-filter: blur(10px) saturate(115%);
  border-bottom: 1px solid rgba(255,255,255,0.12); /* liseré subtil */
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 2rem;
  z-index: 1600 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Fallback si backdrop-filter n'est pas supporté */
@supports not (backdrop-filter: blur(1px)) {
  header { background: rgba(0, 0, 0, 0.45); }
}


#nav-backdrop { z-index: 1400 !important; }

.logo {
  font-weight: bold;
  font-size: 35px;
  color: white;
  cursor: pointer;
  padding-right: 1.4rem;
  display: flex;
  align-items: center;
}
.logo img { vertical-align: middle; height: 80px; }
.logo span { font-size: 35px; color: #fff; }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { text-decoration: none; color: white; font-weight: bold; cursor: pointer; }

/* Lien actif dans la navbar */
.nav-links a {
  color: rgba(255, 255, 255, 0.9);
  transition: color .2s ease;
}
.nav-links a:hover {
  color: #ffd30d;
}
.nav-links a.active {
  color: #ffd30d; /* ta couleur d’accent */
}

/* --- HAMBURGER : visible par défaut, caché en desktop --- */
.hamburger {
  display: inline-flex;            /* <-- au lieu de display:none */
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}
.hamburger span {
  position: absolute;
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: transform .25s ease, opacity .2s ease;
}
.hamburger span:nth-child(1) { transform: translateY(-8px); }
.hamburger span:nth-child(2) { transform: translateY(0); }
.hamburger span:nth-child(3) { transform: translateY(8px); }

/* État ouvert (croix) */
html.nav-open .hamburger span:nth-child(1) { transform: translateY(0) rotate(45deg); }
html.nav-open .hamburger span:nth-child(2) { opacity: 0; }
html.nav-open .hamburger span:nth-child(3) { transform: translateY(0) rotate(-45deg); }

/* Cache le hamburger uniquement en large écrans */
@media (min-width: 1025px) {
  .hamburger { display: none; }
}

/* Backdrop */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1400;
}
html.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Tiroir nav en mobile/tablette */
@media (max-width: 1024px) {
  header .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    padding: 100px 24px 24px; /* espace sous header */
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #181717;
    backdrop-filter: blur(6px);
    box-shadow: -10px 0 30px rgba(0,0,0,.3);
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 1650;
  }
  html.nav-open header .nav-links { transform: translateX(0); }
}

/* Empêche le scroll du contenu quand le menu est ouvert */
html.nav-open #container { overflow: hidden !important; }

  /* Mobile : cacher le texte "CaledoSite" et garder seulement le logo image */
@media (max-width: 768px) {
  .logo span { 
    display: none !important;
  }
  .logo img {
    height: 56px; /* optionnel : un peu plus compact en mobile */
    margin-left: -80%;
  }
}

/* CONTENEUR — scroller vertical avec scroll-snap */
#container {
  position: relative;
  height: 100vh;                  /* plein viewport */
  width: 100vw;
  overflow-y: auto;               /* on scrolle ici */
  overflow-x: hidden;
  scroll-snap-type: y mandatory;  /* snap natif, robuste */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge */
  overscroll-behavior: contain;
  touch-action: pan-y;
}
#container::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;              /* Chrome/Safari/Edge (WebKit/Blink) */
  background: transparent;
}
/* Chaque slide = plein écran stable */
section {
  width: 100vw;
  min-height: 100vh;
  height: 100vh;                  /* force le plein écran */
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  scroll-snap-align: start;       /* aligne le haut de chaque slide */
}

/* NAV LATERALE DROITE (fond semi-transparent) */
#side-nav {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 8px;
  border-radius: 50px;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.arrow-btn {
  background-color: transparent;
  border-color: transparent;
  border-radius: 12px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  color: white;
}
.arrow-btn:hover { transform: translateY(-1px); }
.arrow-btn:active { transform: translateY(0); }

#dots { display: flex; flex-direction: column; gap: 10px; }
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.55);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}
.dot.active {
  width: 10px; height: 28px;
  border-radius: 6px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* SLIDE 1 — ACCUEIL */
.slide-1 {
  background: url('img/hero-bg.png') no-repeat center center/cover;
  color: white;
  overflow: hidden;
}
.hero-bg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

.hero-content { position: relative; z-index: 2; text-align: center; }
.hero-logo { width: 30%; height: auto; margin-bottom: 1.5rem; }
.hero-title { font-size: 3rem; font-weight: 700; margin: 0; }
.hero-subtitle { font-size: 1.2rem; font-weight: 300; margin-top: 0.5rem; }

/* SLIDE 2..5 (images) */
.slide-2 { background: url('img/hero-bg2.png') no-repeat center center/cover; }
.slide-3 { background: url('img/hero-bg3.png') no-repeat center center/cover; }
.slide-4 { background: url('img/hero-bg4.png') no-repeat center center/cover; }
.slide-5 { background: url('img/hero-bg5.png') no-repeat center center/cover; }

/* Responsive */
@media (max-width: 768px) {
  #side-nav { display: none; }
  .hero-logo { width: 45%; }
}

/* ===== Services (slide 2) ===== */

.slide-2 .services {
  width: min(1200px, 92vw);
  margin-inline: auto;
  padding: 1rem 0;
  color: #fff;
}

.slide-2 .section-title {
  text-align: center;
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem 0;
  color: #fff;
}

.slide-2 .services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

/* Cartes de service */
.slide-2 .service-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.slide-2 .service-card:hover,
.slide-2 .service-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

/* Illustration */
.slide-2 .service-illustration {
  margin: 0;
}

.slide-2 .service-illustration img {
  display: block;
  width: 60%;
  height: auto;
  aspect-ratio: 16 / 10;     /* garde un joli ratio si l’image est trop petite */
  object-fit: contain;
  border-radius: 12px;
  margin: auto;
}

/* Titres & textes */
.slide-2 .service-card h3 {
  margin: 0.25rem 0 0.25rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.25;
  font-weight: 700;
  color: #ffd30d;
}

.slide-2 .service-card p {
  margin: 0;
  font-size: clamp(0.95rem, 1.3vw, 1rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
}

/* Responsive */
/* Mobile : version compacte qui tient vraiment dans l’écran */
@media (max-width: 768px) {
  /* Réduis un peu le header en mobile pour gagner de la place */
  header { height: 72px; padding: 0 1rem; }
  /* Aligne l’ouverture du tiroir par rapport au nouveau header */
  html.nav-open header .nav-links { padding-top: 72px; }

  .slide-2 .section-title {
    font-size: 1.25rem;
    margin: 0 0 .75rem 0;
    text-align: center;
  }

  .slide-2 .services {
    padding-top: .25rem; /* un soupçon d’air */
  }

  .slide-2 .services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .slide-2 .service-card {
    padding: .9rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255,255,255,0.16);
  }

  /* Illustration plus basse pour que 3 blocs tiennent visuellement */
  .slide-2 .service-illustration img {
    width: 30%;
    height: auto;           /* <-- plus compact */
    object-fit: cover;
    border-radius: 10px;
  }

  .slide-2 .service-card h3 {
    font-size: 1.05rem;
    margin: .35rem 0 .25rem;
    color: #ffd30d;
  }

  .slide-2 .service-card p {
    font-size: .95rem;
    line-height: 1.45;
    margin: 0;
    /* Optionnel : limiter la description à 3 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Très petit écran (ex. 360x640) : encore un cran plus compact */
@media (max-width: 380px) {
  .slide-2 .service-illustration img { height: 120px; }
  .slide-2 .service-card { padding: .8rem; }
  .slide-2 .service-card h3 { font-size: 1rem; }
  .slide-2 .service-card p { font-size: .9rem; -webkit-line-clamp: 3; }
}

/* ===== À propos (slide 3) ===== */
.slide-3 .about {
  width: min(1100px, 92vw);
  margin-inline: auto;
  color: #fff;
}

.slide-3 .about-title {
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0 0 1.25rem;
  color: #ffd30d;
}

.slide-3 .about-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  background: rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  border-radius: 18px;
  padding: 22px;
}

.slide-3 .about-text {
  flex: 1 1 50%;
  font-size: clamp(.80rem, 1vw, .9rem);
  line-height: 1.6;
}

.slide-3 .about-media {
  flex: 1 1 50%;
  margin: 0;
}
.slide-3 .about-media img {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: contain;
  border-radius: 14px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
}

/* Responsive : colonne inversée (image en premier) */
@media (max-width: 920px) {
  .slide-3 .about-inner {
    flex-direction: column-reverse;  /* image au-dessus, texte en dessous */
    gap: 18px;
    padding: 16px;
    border-radius: 14px;
  }
  .slide-3 .about-media img {
    height: 150px;
    border-radius: 12px;
  }
}

/* Très petit écran */
@media (max-width: 380px) {
  .slide-3 .about-media img { height: 200px; }
}

/* ===== Portfolio (slide 4) ===== */
.slide-4 { align-items: stretch; }
.slide-4 .portfolio {
  width: min(1200px, 92vw);
  height: 100%;
  margin-inline: auto;
  padding-top: 120px; /* espace sous le header */
  color: #fff;
  display: flex;
  flex-direction: column;
}

.slide-4 .portfolio-title {
  text-align: center;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0 0 12px;
}

/* Filtres */
.slide-4 .portfolio-filters {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px; margin-bottom: 14px;
}
.slide-4 .filter-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.3);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .95rem;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.slide-4 .filter-btn:hover { transform: translateY(-1px); }
.slide-4 .filter-btn.active { background: rgba(253,211,13,.2); border-color: rgba(255,255,255,.5); }

/* Carousel */
.slide-4 .portfolio-carousel {
  position: relative; 
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

/* Flèches */
.slide-4 .car-btn {
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 999px;
  font-size: 22px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, opacity .2s ease;
}
.slide-4 .car-btn:hover { transform: translateY(-1px); }

/* Viewport & track */
.slide-4 .portfolio-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 10px;
  scrollbar-width: none;           /* Firefox */
}
.slide-4 .portfolio-viewport::-webkit-scrollbar { display: none; } /* WebKit */

.slide-4 .portfolio-track {
  --gap: 20px;
  display: flex;
  gap: var(--gap);
  padding-bottom: 6px; /* un peu d'air sous les cartes */
}

/* Cartes projet (taille fluide) */
.slide-4 .project-card {
  flex: 0 0 clamp(240px, 28vw, 340px); /* ↓ base plus compacte (avant: 260/32vw/360) */
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.slide-4 .project-card:hover,
.slide-4 .project-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  cursor: pointer;
}

/* Vignettes — plaque blanche floue derrière les PNG */
.slide-4 .project-thumb {
  position: relative;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;            /* pour contenir le flou */
  background: transparent;
  isolation: isolate;
}
.slide-4 .project-thumb::before {
  content: "";
  position: absolute;
  inset: -12px;                /* halo doux */
  background: rgba(255, 255, 255, 0.65);
  filter: blur(14px);
  z-index: 0;
}
.slide-4 .project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.10);
  -webkit-backdrop-filter: blur(8px) saturate(115%);
  backdrop-filter: blur(8px) saturate(115%);
  z-index: 0;
}
.slide-4 .project-thumb::before,
.slide-4 .project-thumb::after { pointer-events: none; }

.slide-4 .project-thumb img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;         /* pour PNG transparents */
  border-radius: 12px;
}

.slide-4 .photo-count {
  position: absolute; right: 8px; bottom: 8px; z-index: 3;
  background: rgba(0,0,0,.55); color: #fff; font-size: .85rem;
  padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Infos */
.slide-4 .project-title { margin: 0; font-size: 1.02rem; font-weight: 700;}
.slide-4 .project-meta {
  display: inline-block; margin: 2px 0 4px; font-weight: bold;font-size: .84rem; color: rgba(255,255,255); background-color: rgba(253,211,13,.2);
  padding: 2px 8px; border-radius: 999px;
}
.slide-4 .project-desc {
  margin: 0; font-size: .94rem; line-height: 1.5; color: rgba(255,255,255,.92);
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.82);
  display: none; align-items: center; justify-content: center;
  z-index: 2000;
}
.lightbox[aria-hidden="false"] { display: flex; }

.lb-stage {
  position: relative;
  max-width: min(92vw, 1200px);
  max-height: 76vh;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.lb-stage::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(70vw, 1100px);
  height: min(80vh, 1000px);
  background: rgba(255, 255, 255, 0.40);
  -webkit-backdrop-filter: blur(8px) saturate(115%);
  backdrop-filter: blur(8px) saturate(115%);
  filter: blur(8px);
  border-radius: 16px;
  z-index: 0;
}
#lb-image {
  position: relative;
  z-index: 1;
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
  border-radius: 10px;
}
.lb-caption {
  margin-top: 10px; color: #fff; font-size: .95rem; text-align: center;
  max-width: min(92vw, 1200px);
}
.lb-close, .lb-prev, .lb-next {
  position: fixed; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25); color: #fff;
  width: 44px; height: 44px; border-radius: 999px; font-size: 22px; display: grid; place-items: center; cursor: pointer;
  transition: transform .15s ease, background .2s ease;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { transform: translateY(-1px); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* Lien "Voir le site" */
.slide-4 .project-actions { margin-top: 6px; display: flex; }
.slide-4 .project-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background-color: rgba(253,211,13,.2);
  color: #fff; font-size: .92rem; text-decoration: none;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.slide-4 .project-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.45);
}

/* ===================== */
/*      BREAKPOINTS      */
/* ===================== */

/* Tablettes ↓ : cartes plus étroites */
@media (max-width: 1024px) {
  .slide-4 .portfolio-track { --gap: 16px; }
  .slide-4 .project-card {
    flex: 0 0 min(62vw, 300px);   /* ↓ largeur fluide mais bornée */
    padding: 12px;
  }
  .slide-4 .project-thumb img { height: 150px; }
}

/* Mobiles ≤ 640px : on cache les flèches pour libérer la largeur, et on réduit encore la carte */
@media (max-width: 640px) {
  .lightbox {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    gap: 10px;
    overscroll-behavior: contain;   /* évite les scrolls du body derrière */
  }

  .lb-stage {
    max-width: 100vw;
    max-height: 72vh;
    padding: 8px;
    touch-action: pan-y;            /* laisse le vertical au navigateur, on gère le swipe horizontal en JS */
  }

  .lb-stage::before {
    width: calc(100vw - 24px);
    height: 68vh;
    background: rgba(255, 255, 255, 0.30);
    -webkit-backdrop-filter: blur(6px) saturate(110%);
    backdrop-filter: blur(6px) saturate(110%);
    filter: blur(6px);
    border-radius: 14px;
  }

  #lb-image {
    max-width: calc(100vw - 24px);
    max-height: 68vh;
    border-radius: 10px;
  }

  /* Légende en-dessous, scrollable si longue */
  .lb-caption {
    order: 2;
    margin-top: 0;
    padding: 8px 12px;
    max-width: calc(100vw - 24px);
    max-height: 22vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    font-size: .92rem;
    line-height: 1.45;
    text-align: center;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px;
  }

  /* Boutons plus petits */
  .lb-prev, .lb-next { width: 36px; height: 36px; font-size: 18px; }
  .lb-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 20px; }
  /* viewport pleine largeur sans colonnes latérales pour les flèches */
  .slide-4 .portfolio-carousel { grid-template-columns: 1fr; }
  .slide-4 .car-btn { display: none; }

  /* un peu d'air sur les bords + snap au bord */
  .slide-4 .portfolio-viewport { padding-inline: 12px; scroll-padding-left: 12px; }
  .slide-4 .portfolio-track { --gap: 12px; }

  /* carte plus étroite pour éviter toute coupe */
  .slide-4 .project-card {
    flex: 0 0 min(82vw, 320px);   /* 82vw max 320px pour bien rentrer */
    padding: 10px;
    gap: 8px;
    border-radius: 16px;
  }
  .slide-4 .project-thumb img { height: 140px; border-radius: 10px; }
  .slide-4 .project-title { font-size: .96rem; }
  .slide-4 .project-meta  { font-size: .78rem; }
  .slide-4 .project-desc  { font-size: .88rem; line-height: 1.45; }
}

/* Petits téléphones ≤ 380px : encore un cran plus étroit */
@media (max-width: 380px) {
  .slide-4 .project-card { flex-basis: min(86vw, 300px); }
  .slide-4 .project-thumb img { height: 128px; }
}

/* ===== Contact (slide 5) — version complète mise à jour ===== */

/* Hauteur de header paramétrable */
:root { --header-h: 100px; }                           /* desktop */
@media (max-width: 820px) { :root { --header-h: 72px; } } /* mobile */

.slide-5 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;   /* pousse le footer en bas de la slide */
  align-items: center;              /* centre horizontalement la carte + footer */
  padding-top: calc(var(--header-h) + 16px);
  padding-bottom: 12px;
}

/* Titre (si présent) */
.slide-5 .contact-title {
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0 0 8px 0;
  color: #ffd30d;
}

/* Carte contact — frosted + padding + scroll interne discret */
.slide-5 .contact {
  width: min(760px, 90vw);
  color: #fff;
  position: relative;
  isolation: isolate;
  background: rgba(0,0,0,.32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 20px rgba(0,0,0,.24);
  border-radius: 16px;
  padding: 24px 28px;

  /* Hauteur contrôlée + scroll interne (pour messages d’erreur) */
  max-height: min(68vh, 600px);
  overflow: auto;
  scrollbar-width: none;                 /* Firefox: cache la barre */
}
.slide-5 .contact::-webkit-scrollbar {   /* WebKit: cache la barre */
  width: 0; height: 0;
}

/* Halo doux optionnel */
.slide-5 .contact::before {
  content: "";
  position: absolute; inset: -14px; z-index: -1;
  background: rgba(255,255,255,.16);
  filter: blur(16px);
  border-radius: 22px;
}

/* ===== Formulaire compact + espacements uniformes ===== */
.contact-form {
  display: flex; flex-direction: column;
  font-size: .95rem;
  gap: 8px;                                /* espace entre .form-row, Sujet, Message, Actions */
  margin-top: 0;                           /* supprime la marge ajoutée précédemment */
}
.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;                                /* espace entre Nom et Email */
}
.contact-form .form-field {
  display: flex; flex-direction: column;
  gap: 3px;                                /* label ↔ input ↔ message d'erreur */
}
.contact-form label { font-size: .9rem; color: rgba(255,255,255,.95); }

/* Champs */
.contact-form input,
.contact-form textarea {
  color: #fff;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(255,255,255,.6); }

.contact-form input:focus,
.contact-form textarea:focus {
  background: rgba(255,255,255,.18);
  border-color: #FFE600;
  box-shadow: 0 0 0 2px rgba(255,230,0,.22);
}

/* Téléphone plus étroit (si présent) */
.form-field--phone input {
  max-width: 240px;
  padding: 8px 10px;
  font-size: .88rem;
  border-radius: 9px;
}

/* Messages d'erreur : pas d'espace quand vides */
.error-msg {
  min-height: 0;
  margin-top: 3px;
  line-height: 1.25;
  font-size: .83rem;
  color: #FFD2D2;
}
.error-msg:empty { display: none; }

/* Actions : sticky en bas pour garder le bouton visible */
.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex; gap: 8px; align-items: center; justify-content: flex-start;
  padding-top: 8px; margin-top: 6px;
}

.form-status { font-size: .92rem; color: rgba(255,255,255,.9); }

/* Bouton */
.btn-primary {
  appearance: none;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.14);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.btn-primary:hover { transform: translateY(-1px); background: rgba(255,255,255,.20); border-color: rgba(255,255,255,.5); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }

/* Honeypot */
.hp { position: absolute !important; left: -10000px !important; opacity: 0 !important; height: 0 !important; width: 0 !important; }

/* --- Ajustements quand l'écran est petit en hauteur --- */
@media (max-height: 780px) {
  .slide-5 .contact { max-height: min(66vh, 560px); padding: 20px 24px; }
  .slide-5 .contact-title { font-size: clamp(1.25rem, 1.8vw, 1.5rem); margin-bottom: 6px; }
  .contact-form { gap: 8px; font-size: .92rem; }
  .contact-form .form-row { gap: 8px; }
  .contact-form input, .contact-form textarea { padding: 9px 10px; }
  .btn-primary { padding: 7px 12px; font-size: .92rem; }
}

/* --- Responsive largeur --- */
@media (max-width: 820px) {
  .slide-5 { padding-top: calc(var(--header-h) + 12px); padding-bottom: 12px; }
  .slide-5 .contact { width: min(680px, 92vw); max-height: min(66vh, 560px); }
  .contact-form .form-row { grid-template-columns: 1fr; }
  .form-field--phone input { max-width: 100%; }
}

@media (max-width: 480px) {
  .slide-5 .contact { width: 92vw; padding: 16px 18px; max-height: min(64vh, 520px); }
  .contact-form { font-size: .9rem; }
  .contact-form input, .contact-form textarea { padding: 8px 10px; }
  .btn-primary { padding: 7px 12px; font-size: .9rem; }
}

/* ===== Master background continu sur tout le scroll ===== */

:root { --slides: 5; }

section.slide::before { content: none !important; }
.slide-1, .slide-2, .slide-3, .slide-4, .slide-5 { background: none !important; }


#container { position: relative; z-index: 0; }
section.slide > * { position: relative; z-index: 1; }


#container::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: calc(var(--slides) * 100vh);
  background: url("img/hero-bg.png") no-repeat 50% 0 / 100% 100%;
  z-index: 0;
  pointer-events: none;
}

@supports (height: 100svh) {
  #container::before {
    height: calc(var(--slides) * 100svh);
  }
}

/* ===== Footer (slide 5 uniquement) ===== */
.slide-5 .site-footer {
  width: min(760px, 90vw);
  margin: 12px 0 4px;
}

.slide-5 .footer-inner {
  width: 100%;
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 10px;
  background: rgba(0,0,0,.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
}
.slide-5 .copyright { margin: 0; font-size: .92rem; opacity: .95; }
.slide-5 .footer-links { display: flex; gap: 10px; }
.slide-5 .footer-link {
  appearance: none; border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.10); color: #fff;
  padding: 6px 10px; border-radius: 999px; font-size: .9rem; cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.slide-5 .footer-link:hover { transform: translateY(-1px); background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.45); }

/* ===== Modals ===== */
.modal[aria-hidden="true"] { display: none; }
.modal[aria-hidden="false"] {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 3000;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-dialog {
  position: relative;
  width: min(800px, 92vw);
  max-height: min(74vh, 720px);
  display: flex; flex-direction: column;
  background: rgba(0,0,0,.32);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  border-radius: 14px;
  padding: 12px;
  color: #fff;
  overflow: hidden;
  outline: none;          
}
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 8px; border-bottom: 1px solid rgba(255,255,255,.14); }
.modal-header h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.modal-close {
  appearance: none; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12); color: #fff;
  width: 36px; height: 36px; border-radius: 999px; font-size: 20px; line-height: 1; margin-right: 6%;
  display: grid; place-items: center; cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.modal-close:hover { transform: translateY(-1px); background: rgba(255,255,255,.20); border-color: rgba(255,255,255,.45); }
.modal-body { padding: 10px 6px 6px; overflow: auto; -webkit-overflow-scrolling: touch; font-size: .96rem; line-height: 1.55; }

/* Empêche le scroll du site sous la modal */
html.modal-open #container { overflow: hidden !important; }

/* Responsive */
@media (max-width: 820px) {
  .slide-5 .contact { width: min(680px, 92vw); }
  .slide-5 .site-footer { width: min(680px, 92vw); }
}
@media (max-width: 480px) {
  .modal-dialog { padding: 10px; }
  .modal-close { width: 32px; height: 32px; font-size: 18px; }
}

.modal-dialog{
  display: grid;
  grid-template-rows: auto 1fr;   
  padding: 0;                    
  overflow: hidden;               
  border-radius: 14px;           
}

.modal-header{
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 16px;            
  background: rgba(0,0,0,.32);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.14);
  border-top-left-radius: 14px;  
  border-top-right-radius: 14px;
}

.modal-body{
  overflow: auto;                 
  padding: 14px 16px 12px;        
}

.modal-close{ z-index: 3; }

.modal-header{ position: sticky !important; }

/* Master background : hauteur pilotée en JS */
#container::before{
  height: var(--bg-h, calc(var(--slides) * 100svh));  /* fallback si JS absent */
  background: url("img/hero-bg.png") no-repeat 50% 0 / 100% 100%;
}

:root { --footer-h: 56px; } /* hauteur approx. du footer */

.slide-5{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;                 /* on démarre en haut */
  min-height: 100svh;                          /* viewport mobile fiable */
  padding-top: calc(var(--header-h) + 12px);
  padding-bottom: 10px;
}

/* La carte n'occupe jamais toute la hauteur : place au footer */
.slide-5 .contact{
  max-height: calc(100svh - var(--header-h) - var(--footer-h) - 28px);
  overflow: auto;                               /* pour les erreurs longues */
}

/* Le footer est toujours “accroché” en bas de la slide */
.slide-5 .site-footer{ 
  width: min(760px, 90vw);
  margin-top: auto;                             /* pousse en bas */
}

/* Mobile : footer un peu plus haut, carte un peu plus courte */
@media (max-width: 820px){
  :root { --footer-h: 64px; }
  .slide-5 .contact{
    max-height: calc(100svh - var(--header-h) - var(--footer-h) - 24px);
  }
}
