/* v22 — home-hero. Les cinq premières secondes : clarté, désir, une seule action.
   Tout est scopé à #hero.hero-v22. Chargé après toutes les feuilles existantes. */

#hero.hero-v22 {
  --hh-ease: cubic-bezier(.2, .7, .2, 1);
  --hh-par: 0px;          /* parallaxe de l'aquarelle, pilotée par section.js, |valeur| <= 12px */
  --hh-hint: 1;           /* opacité de l'indice de scroll */
  position: relative;
  min-height: 820px;
  height: min(100svh, 1060px);
  padding: 80px 0 30px;
}

/* ---------- Colonne de texte ---------- */
#hero.hero-v22 .hero-copy {
  width: min(100%, 1320px);
  padding-top: 0;
  padding-left: var(--gutter);
  padding-right: 49%;
  text-align: left;
}

/* Titre : deux lignes maîtrisées, jamais recomposées par le navigateur.
   Chaque ligne est masquée par son propre cadre pour l'entrée. */
#hero.hero-v22 .hero-title {
  /* Le titre porte sa propre largeur : le padding-right en % du parent ne peut plus le rogner. */
  width: max-content;
  max-width: none;
  font-size: clamp(2.85rem, 4.8vw, 4.75rem);
  line-height: 1.06;
  letter-spacing: -.045em;
  font-weight: 600;
  white-space: normal;
}
#hero.hero-v22 .hero-line {
  display: block;
  overflow: hidden;
  /* de la place pour les jambages (p, y) et pour l'approche négative du dernier signe */
  padding: 0 .06em .14em 0;
  margin: 0 -.06em -.14em 0;
}
#hero.hero-v22 .hero-line-in {
  display: block;
  white-space: nowrap;
}
#hero.hero-v22 .hero-line-in.ink-blue { color: #1775ca; }

/* Ligne de support : la promesse en clair, sur une seule ligne. */
#hero.hero-v22 .hero-support {
  margin: 24px 0 0;
  max-width: none;
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.5;
  letter-spacing: -.011em;
  color: #687581;  /* 4,7:1 sur blanc */
  text-wrap: pretty;
}

#hero.hero-v22 .hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 24px;
  margin-top: 32px;
}
/* .btn-primary appartient à l'agent global : on n'orchestre que son entrée, via .hero-actions. */

/* ---------- Aquarelle ---------- */
/* Le cadre ne fait que découper ; le fondu est porté par l'image elle-même,
   pour que le dégradé suive exactement la boîte de la peinture à toute largeur. */
#hero.hero-v22 .hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: none;
  mask-image: none;
}
#hero.hero-v22 .hero-art-plane {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  transform: translate3d(0, var(--hh-par), 0);
  will-change: transform;
}
#hero.hero-v22 .hero-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  filter: none;
  /* Fondu des bords de la peinture dans le blanc. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 5%, #000 91%, transparent 99.8%),
    linear-gradient(to bottom, transparent 0, #000 3%, #000 90%, transparent 99.6%);
  mask-image:
    linear-gradient(to right, transparent 0, #000 5%, #000 91%, transparent 99.8%),
    linear-gradient(to bottom, transparent 0, #000 3%, #000 90%, transparent 99.6%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* Écrans très larges et courts : la peinture est limitée par la hauteur. */
@media (min-aspect-ratio: 178/100) {
  #hero.hero-v22 .hero-art img { width: auto; height: 100%; max-width: 100%; }
}

/* ---------- Indice de scroll ---------- */
#hero.hero-v22 .hero-scroll {
  position: absolute;
  /* aligné au millimètre sur le bord gauche du titre */
  left: calc(max(0px, (100% - 1320px) / 2) + var(--gutter));
  bottom: 40px;
  z-index: 1;
  pointer-events: none;
}
#hero.hero-v22 .hero-scroll-rail {
  display: block;
  position: relative;
  opacity: var(--hh-hint);
  transition: opacity .3s linear;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(11, 18, 32, .17), rgba(11, 18, 32, .02));
  overflow: hidden;
}
#hero.hero-v22 .hero-scroll-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 13px;
  background: rgba(11, 18, 32, .5);
}

/* ---------- Texture : grain papier, imperceptible ---------- */
#hero.hero-v22::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .04;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 220px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 220px), transparent 100%);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
#hero.hero-v22 .content { position: relative; z-index: 1; }

/* ---------- Chorégraphie d'entrée : titre → support → bouton → aquarelle → indice ---------- */
@keyframes hh-line-in { from { transform: translate3d(0, 112%, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes hh-rise-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes hh-art-in { from { opacity: 0; transform: scale(1.014); } to { opacity: 1; transform: scale(1); } }
@keyframes hh-hint-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hh-dot { 0% { transform: translateY(-14px); opacity: 0; } 22% { opacity: 1; } 76% { opacity: 1; } 100% { transform: translateY(40px); opacity: 0; } }

#hero.hero-v22 .hero-line:nth-child(1) .hero-line-in { animation: hh-line-in .84s var(--hh-ease) both; animation-delay: 80ms; }
#hero.hero-v22 .hero-line:nth-child(2) .hero-line-in { animation: hh-line-in .84s var(--hh-ease) both; animation-delay: 180ms; }
#hero.hero-v22 .hero-support { animation: hh-rise-in .6s var(--hh-ease) both; animation-delay: 330ms; }
#hero.hero-v22 .hero-actions { animation: hh-rise-in .6s var(--hh-ease) both; animation-delay: 430ms; }
#hero.hero-v22 .hero-art img { animation: hh-art-in 1s var(--hh-ease) both; animation-delay: 500ms; }
#hero.hero-v22 .hero-scroll { animation: hh-hint-in .7s var(--hh-ease) both; animation-delay: 1250ms; }
#hero.hero-v22 .hero-scroll-dot { animation: hh-dot 2.8s var(--hh-ease) infinite; animation-delay: 1600ms; }

@media (prefers-reduced-motion: reduce) {
  #hero.hero-v22 .hero-line-in,
  #hero.hero-v22 .hero-support,
  #hero.hero-v22 .hero-actions,
  #hero.hero-v22 .hero-art img,
  #hero.hero-v22 .hero-scroll,
  #hero.hero-v22 .hero-scroll-dot { animation: none; opacity: 1; transform: none; }
  #hero.hero-v22 .hero-art-plane { transform: none; }
  #hero.hero-v22 .hero-scroll-dot { top: 8px; }
}

/* ---------- Largeurs intermédiaires ---------- */
@media (min-width: 1700px) {
  #hero.hero-v22 .hero-copy { width: min(100%, 1500px); margin-inline: 0; padding-right: var(--gutter); }
  #hero.hero-v22 .hero-scroll { left: var(--gutter); }
}
@media (max-width: 1240px) {
  #hero.hero-v22 .hero-title { font-size: clamp(2.5rem, 4.55vw, 4.2rem); }
  #hero.hero-v22 .hero-support { font-size: 15px; }
}
@media (max-width: 1200px) {
  /* On resserre la hauteur avec la largeur : la peinture continue d'habiter le cadre,
     pas de grande bande blanche au-dessus et en dessous. */
  #hero.hero-v22 { height: min(100svh, 72vw); min-height: 620px; }
}
@media (max-width: 1024px) {
  #hero.hero-v22 .hero-copy { padding-right: 46%; }
  #hero.hero-v22 .hero-title { font-size: 4.9vw; }
  #hero.hero-v22 .hero-support { font-size: 14.5px; }
  #hero.hero-v22 .hero-scroll { bottom: 32px; }
}
@media (max-width: 860px) {
  #hero.hero-v22 .hero-support { letter-spacing: -.014em; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  #hero.hero-v22 {
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    padding: 0 0 8px;
  }
  #hero.hero-v22 .hero-copy {
    width: 100%;
    padding: 124px 20px 0;
    text-align: center;
  }
  #hero.hero-v22 .hero-title {
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(2.3rem, 9.1vw, 4rem);
    line-height: 1.08;
    letter-spacing: -.042em;
  }
  #hero.hero-v22 .hero-line { padding-bottom: .1em; margin-bottom: -.1em; }
  #hero.hero-v22 .hero-support {
    margin-top: 18px;
    font-size: clamp(12.5px, 3.55vw, 15px);
    letter-spacing: -.015em;
  }
  #hero.hero-v22 .hero-actions { justify-content: center; margin-top: 26px; }
  #hero.hero-v22 .hero-actions .btn-primary { width: auto; min-width: 200px; }
  #hero.hero-v22 .hero-art {
    position: relative;
    inset: auto;
    height: min(87.4vw, 420px);
    min-height: 0;
    margin-top: 14px;
    z-index: -1;
  }
  /* Cadrage mobile calé sur la boîte d'encre réelle de la peinture (x 581-1650, y 167-927
     sur 1672x941). Tout est exprimé en vw : le recadrage garde les mêmes proportions
     de 320 à 760 px, la scène entière tient dans la largeur, les bords fondent dans le blanc. */
  #hero.hero-v22 .hero-art img {
    position: absolute;
    width: min(166.7vw, 800px);
    height: auto;
    max-width: none;
    max-height: none;
    left: calc(50% - min(102.8vw, 493px));
    top: max(-6.67vw, -32px);
    object-fit: contain;
    -webkit-mask-image:
      linear-gradient(to right, transparent 31%, #000 37%, #000 82%, transparent 93%),
      linear-gradient(to bottom, #000 0, #000 94%, transparent 100%);
    mask-image:
      linear-gradient(to right, transparent 31%, #000 37%, #000 82%, transparent 93%),
      linear-gradient(to bottom, #000 0, #000 94%, transparent 100%);
  }
  #hero.hero-v22 .hero-scroll { display: none; }
  #hero.hero-v22::after { opacity: .028; -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 120px), transparent 100%); mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 120px), transparent 100%); }
}
