/* Accueil du catalogue (index.php). Chargée APRÈS catalogue.css : la base, le header (.head) et le footer (.foot) sont
   ceux du catalogue, à l'identique. Ce fichier ne contient que les sections
   propres à l'accueil, toutes préfixées pour ne pas croiser une classe du
   catalogue (le catalogue a déjà un .hero, d'où .home-hero).
   La CSP interdit style="" et <style> dans le HTML. */

:root {
  --black: #0a0a0a;
  --ink: #1e1e1c;
  --white: #ffffff;
  --grey-100: #f2f2f2;
  --grey-300: #d4d4d4;
  --grey-400: #b3b3b3;   /* texte secondaire sur noir */
  --grey-600: #555555;   /* texte secondaire sur blanc */
  --line-dark: rgba(255, 255, 255, .16);
  --line-light: rgba(30, 30, 28, .14);
  --head: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --gutter: clamp(16px, 5vw, 56px);
  --max: 1280px;
}

/* Titres et paragraphes des sections de l'accueil (hors header/footer). */
main h2, main h3 {
  font-family: var(--head);
  font-weight: 600;
  margin: 0;
}
main p { margin: 0; }
html { scroll-behavior: smooth; }

/* Fond derrière la page et rebond : réglés pour tout le site dans
   catalogue.css (html sombre + overscroll-behavior). L'ancienne bascule
   noir/blanc selon la position (.home-bottom) est supprimée : en bas de
   page elle remettait du blanc derrière le header. */
/* Safari iOS 26 colore la zone de la barre d'état d'après le header s'il a
   un fond, sinon d'après le fond de la page. Le header de l'accueil étant
   transparent, il prenait le blanc puis passait au noir au défilement
   (flash blanc/noir). Fond de page noir sur l'accueil, et fond blanc posé
   explicitement sur le contenu et le footer : rien ne change à l'écran. */
body.page-home { background: var(--ink); }
.page-home main,
.page-home .foot { background: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header transparent sur la vidéo ----------
   Uniquement sur l'accueil : le header flotte sur la vidéo, avec un
   dégradé sombre derrière pour garder le texte lisible (mobile compris).
   Dès que la page défile (.is-scrolled, posé par catalogue.js), il
   redevient le header noir habituel. */
.page-home .head {
  position: fixed;
  left: 0;
  right: 0;
  background-color: transparent;
  transition: background-color .3s ease, box-shadow .2s ease;
}
.page-home .head::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 160%;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 10, 10, .7) 0%, rgba(10, 10, 10, .35) 55%, rgba(10, 10, 10, 0) 100%);
  pointer-events: none;
  transition: opacity .3s ease;
}
.page-home .head.is-scrolled { background-color: var(--ink); }
.page-home .head.is-scrolled::after { opacity: 0; }
.page-home .head:not(.is-scrolled) .head__cat-label,
.page-home .head:not(.is-scrolled) .head__menu-label,
.page-home .head:not(.is-scrolled) .cart-badge__label {
  text-shadow: 0 1px 10px rgba(0, 0, 0, .45);
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  font-family: var(--head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn--light { background: var(--white); color: var(--ink); }
.btn--light:hover { background: var(--grey-300); }
.btn--ghost { color: var(--white); border-color: rgba(255, 255, 255, .6); }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); border-color: var(--white); }
.btn--dark { background: var(--ink); color: var(--white); }
.btn--dark:hover { background: var(--black); }
.btn--dark svg { transition: transform .2s ease; }
.btn--dark:hover svg { transform: translateX(4px); }

/* ---------- Hero ---------- */
.home-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  background: var(--ink) url("video/welcome-v1-poster.jpg") center / cover no-repeat;
  color: var(--white);
  isolation: isolate;
}
.home-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
/* Voile : lisibilité du texte quelle que soit la vidéo. */
.home-hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Même voile que la couverture de /produits : couleur --ink, opacité
     réglée dans les réglages du site (classe hero--opacity-N posée par index.php). */
  background: rgba(30, 30, 28, var(--hero-overlay-a, .7));
}
/* Bloc ancré en bas à gauche ; 150 px en dessous pour laisser la flèche libre. */
.home-hero__inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 156px var(--gutter) 150px; /* 84 px de header fixe au-dessus */
}
/* 16ch (et non 13ch) : coupe en « Impression textile / sur mesure à Lyon. » */
.home-hero__title {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -.03em;
  max-width: 16ch;
  margin: 0;
}
.home-hero__lead {
  margin: 24px 0 0;
  max-width: 44ch;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.5;
  color: rgba(255, 255, 255, .8);
}
.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  margin-top: 32px;
}
.home-hero__cta,
.home-hero__link {
  font-family: var(--head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .01em;
}
.home-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 32px;
  background: var(--white);
  color: var(--black);
  text-decoration: none;
  transition: background-color .2s ease;
}
.home-hero__cta:hover { background: var(--grey-300); }
/* Lien texte : padding vertical pour une cible tactile de 44 px sans cadre visible. */
.home-hero__link {
  display: inline-block;
  padding: 13px 0;
  color: var(--white);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.home-hero__link:hover { text-decoration-thickness: 2px; }
.home-hero__cta:focus-visible,
.home-hero__link:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }
.home-hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  animation: bounce 2.2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---------- Blocs ---------- */
.block { padding: clamp(72px, 10vw, 140px) 0; }
.block--dark { background: var(--ink); color: var(--white); }
.block__title {
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -.035em;
  max-width: 16ch;
  margin-bottom: clamp(40px, 6vw, 72px);
}

/* Atouts : liste numérotée, filets noirs, pas de cartes. */
.points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
}
.point {
  padding: 28px 28px 8px 0;
  border-right: 1px solid var(--line-light);
}
.point + .point { padding-left: 28px; }
.point:last-child { border-right: 0; }
.point__num {
  display: block;
  font-family: var(--head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--grey-600);
  margin-bottom: 18px;
}
.point h3 {
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}
.point p { color: var(--grey-600); font-size: 15px; }

/* Étapes : fond noir, gros chiffres. */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line-dark);
}
.step {
  padding: 28px 28px 8px 0;
  border-right: 1px solid var(--line-dark);
}
.step + .step { padding-left: 28px; }
.step:last-child { border-right: 0; }
.step__num {
  display: block;
  font-family: var(--head);
  font-weight: 600;
  font-size: clamp(56px, 6vw, 88px);
  line-height: 1;
  letter-spacing: -.05em;
  margin-bottom: 20px;
}
.step h3 {
  font-size: 20px;
  letter-spacing: -.015em;
  margin-bottom: 10px;
}
.step p { color: var(--grey-400); font-size: 15px; }

/* ---------- Nos réalisations (galerie) ----------
   Grille carrée sobre : la photo prend toute la case, la légende glisse
   au survol sur un dégradé sombre. Au clic : agrandissement (dialog). */
.home-gallery { padding-top: 0; } /* suit un bloc blanc : pas de double marge */
.home-gallery__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 4vw, 48px);
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--ink);
}
.home-gallery__head .block__title { margin-bottom: 0; }
.home-gallery__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-family: var(--head);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.home-gallery__more:hover { border-bottom-color: currentColor; }
.home-gallery__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.home-gallery__link {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--grey-100);
  color: var(--white);
  text-decoration: none;
}
.home-gallery__link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.home-gallery__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 16px 14px;
  font-family: var(--head);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0) 0%, rgba(10, 10, 10, .75) 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.home-gallery__link:hover img, .home-gallery__link:focus-visible img { transform: scale(1.04); }
.home-gallery__link:hover .home-gallery__caption,
.home-gallery__link:focus-visible .home-gallery__caption { opacity: 1; transform: none; }
.home-gallery__link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.js .home-gallery__grid .reveal:nth-child(4n+2) { transition-delay: .06s; }
.js .home-gallery__grid .reveal:nth-child(4n+3) { transition-delay: .12s; }
.js .home-gallery__grid .reveal:nth-child(4n+4) { transition-delay: .18s; }

/* Agrandissement */
.home-lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 10, 10, .94);
  color: var(--white);
}
.home-lightbox::backdrop { background: rgba(10, 10, 10, .6); }
.home-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.home-lightbox__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 64px 72px;
  max-width: 100%;
  max-height: 100%;
}
.home-lightbox__img {
  display: block;
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.home-lightbox__caption {
  font-family: var(--head);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  color: var(--grey-300);
}
.home-lightbox__caption:empty { display: none; }
.home-lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: none;
  border: 1px solid rgba(255, 255, 255, .35);
  color: var(--white);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.home-lightbox__btn:hover { background: var(--white); color: var(--ink); }
.home-lightbox__btn:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
.home-lightbox__btn[hidden] { display: none; }
.home-lightbox__close { top: 16px; right: 16px; }
.home-lightbox__prev { left: 16px; top: 50%; margin-top: -24px; }
.home-lightbox__next { right: 16px; top: 50%; margin-top: -24px; }
html.has-lightbox { overflow: hidden; }

/* ---------- Appel final ---------- */
.cta {
  padding: clamp(72px, 10vw, 140px) 0;
  background: var(--grey-100);
  text-align: center;
}
.cta__inner { display: flex; flex-direction: column; align-items: center; }
.cta__title {
  font-size: clamp(36px, 6.4vw, 88px);
  line-height: 1;
  letter-spacing: -.045em;
}
.cta p {
  margin: 20px 0 34px;
  max-width: 40ch;
  color: var(--grey-600);
  font-size: 17px;
}

/* Variante avec photo de l'atelier en fond (même voile que la vidéo de
   l'accueil : couleur --ink, opacité réglée via hero--opacity-N). */
.cta--photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  padding: clamp(96px, 13vw, 180px) 0;
}
.cta__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%; /* photo recadrée sous le visage (écran, mains, presse) : pas de personne identifiable */
}
.cta__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(30, 30, 28, var(--hero-overlay-a, .7));
}
.cta--photo p { color: var(--grey-300); }
.cta__btn svg { transition: transform .2s ease; }
.cta__btn:hover svg { transform: translateX(4px); }

/* ---------- Logos clients ("Ils nous font confiance") ----------
   Par défaut (sans JS, animations réduites) : logos fixes, centrés, sur
   plusieurs lignes. home.js répète la série, pose .is-animated et la durée
   (--logos-duration, proportionnelle à la longueur : vitesse constante).
   Cases de taille fixe : la largeur de la piste est connue sans attendre le
   chargement des images, et rien ne bouge quand elles arrivent. */
/* Bloc discret (demande de Lorenzo) : plus bas que les autres, titre en
   sur-titre centré (même style que celui de la vidéo) pour que les logos
   restent le sujet du bloc. */
.home-logos { padding: clamp(32px, 4vw, 56px) 0; }
.home-logos__title {
  max-width: none;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--grey-600);
  margin-bottom: clamp(24px, 3vw, 36px);
}

.home-logos__viewport { overflow: hidden; }
.home-logos__track {
  list-style: none;
  margin: 0 auto;
  padding: 0 var(--gutter);
  max-width: var(--max);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.home-logos__item {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 56px;
  padding: 0 24px;
}
.home-logos__item img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .7;
  transition: filter .3s ease, opacity .3s ease;
}
/* Couleur d'origine au survol (souris seulement : au doigt, pas de survol). */
@media (hover: hover) {
  .home-logos__item:hover img { filter: none; opacity: 1; }
  .home-logos.is-animated .home-logos__viewport:hover .home-logos__track { animation-play-state: paused; }
}

.home-logos.is-animated .home-logos__viewport {
  /* Fondu sur les bords : les logos apparaissent et disparaissent en douceur. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.home-logos.is-animated .home-logos__track {
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: max-content;
  max-width: none;
  padding: 0;
  will-change: transform;
  /* 2 × la même séquence, -50 % (voir @keyframes ticker). */
  animation: ticker var(--logos-duration, 40s) linear infinite;
}
.is-hidden-tab .home-logos__track { animation-play-state: paused; }

/* Défilement des logos : la piste contient 2 × la même séquence, -50 % boucle sans à-coup. */
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Apparition au scroll ----------
   L'état caché n'existe que si site.js a posé html.js : sans JS, tout est
   visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .points .reveal:nth-child(2), .js .steps .reveal:nth-child(2) { transition-delay: .08s; }
.js .points .reveal:nth-child(3), .js .steps .reveal:nth-child(3) { transition-delay: .16s; }
.js .points .reveal:nth-child(4), .js .steps .reveal:nth-child(4) { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .points, .steps { grid-template-columns: repeat(2, 1fr); }
  .point, .step { padding: 28px 24px 28px 0; border-bottom: 1px solid var(--line-light); }
  .step { border-bottom-color: var(--line-dark); }
  .point + .point, .step + .step { padding-left: 0; }
  .point:nth-child(even), .step:nth-child(even) { padding-left: 24px; border-right: 0; }
}

@media (max-width: 1024px) {
  .home-gallery__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .home-gallery__head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .home-logos__title { font-size: 12px; }
  .home-logos__item { width: 112px; height: 44px; padding: 0 16px; }
  .home-gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .home-gallery__caption { display: none; } /* pas de survol au doigt : légende dans l'agrandissement */
  .home-lightbox__figure { padding: 72px 16px 96px; }
  .home-lightbox__img { max-height: calc(100dvh - 200px); }
  .home-lightbox__prev, .home-lightbox__next { top: auto; bottom: 20px; margin-top: 0; }
  .home-lightbox__prev { left: calc(50% - 56px); }
  .home-lightbox__next { right: calc(50% - 56px); }
  .points, .steps { grid-template-columns: 1fr; }
  .point, .step,
  .point:nth-child(even), .step:nth-child(even) { padding: 24px 0; border-right: 0; }
  .step__num { font-size: 48px; margin-bottom: 12px; }
}

/* Hero sur mobile : marges de 20 px, bloc à 110 px du bas. */
@media (max-width: 768px) {
  .home-hero__inner { padding: 120px 20px 110px; }
}
/* Les deux actions ne tiennent plus sur une ligne (~400 px) : colonne, bouton pleine largeur. */
@media (max-width: 480px) {
  .home-hero__actions { flex-direction: column; align-items: stretch; gap: 16px; }
  .home-hero__link { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home-hero__scroll, .home-logos__track { animation: none; }
  .home-logos__item img { transition: none; }
  .home-gallery__link img, .home-gallery__caption { transition: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
