/* =========================================================
   hero.css — ouverture de l'accueil (section #accueil)
   ---------------------------------------------------------
   Direction : « le viseur ». Le nom en très grand, une fenêtre
   entre Paul et Richet ; dessous, toute la planche du photographe
   en une bande qui avance d'une photo à la fois, de droite à
   gauche, comme un film qu'on arme. La photo qui passe à l'aplomb
   de la fenêtre s'affiche dans le nom. Pas de cadre de visée sur
   la bande, ni bouton Pause, ni lien « Voir le portfolio » (retirés
   à la demande du client le 2026-11-03).
   Les photos gardent leur format (portrait, paysage, carré) et
   tiennent entières dans l'écran : rien n'est recadré dans la bande.
   Ouverture : les mots montent de leur masque, la fenêtre s'ouvre
   comme un obturateur (comme sur /contact/), la bande arrive de la
   droite, ses cases apparaissent et les photos y montent comme les
   mots.
   Balisage généré par scripts/photos/hero.mjs (hero.json) ;
   mouvement : assets/js/hero.js. Transform / opacity uniquement,
   coupé sous prefers-reduced-motion. Sans JavaScript : tout est
   visible, immobile, la bande défile au doigt.
   ========================================================= */

.hero {
  --h-ink: #000;
  --h-paper: #fff;
  --h-muted: #5f5a5a;                         /* 6,6:1 sur blanc */
  --h-ph: #e7e7e7;                            /* case vide, avant la photo */
  --h-gutter: var(--chrome-gutter);
  --h-ease: cubic-bezier(.625, .05, 0, 1);    /* = --cubic-default d'odyn */
  --h-ease-out: cubic-bezier(.22, .61, .36, 1);
  --h-gap: clamp(.375rem, .6vw, .75rem);      /* entre deux photos (= albums) */
  --h-radius: .375rem;
  --h-vf: clamp(.4rem, .7vw, .85rem);         /* respiration au-dessus et au-dessous de la bande */
  --h-pas: .85s;                              /* durée d'une avance (= PAS de hero.js) */
  position: relative;
  display: grid;
  /* la bande prend la hauteur qui reste dans l'écran ; si le texte grandit
     (zoom, petit écran), l'ouverture s'allonge au lieu de couper.
     Valeurs en rem d'abord : repli des navigateurs sans svh (Safari < 15.4). */
  grid-template-rows: auto minmax(15rem, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 1.5rem;
  min-height: 40rem;
  padding-top: calc(var(--chrome-h) + .75rem);
  padding-bottom: 2rem;
  font-size: clamp(15px, calc(.55vw + 9px), 20px);
  line-height: 1.3;
  color: var(--h-ink);
  /* pas de fond propre : pendant l'initialisation d'odyn, <main> passe en
     position fixe au-dessus de la barre ; un fond ici la masquerait */
  overflow-x: clip;
}
@supports (height: 1svh) {
  .hero {
    grid-template-rows: auto minmax(clamp(12.5rem, 30svh, 17rem), 1fr) auto;
    row-gap: clamp(1rem, 3svh, 2.5rem);
    min-height: max(100svh, 34rem);
    padding-top: calc(var(--chrome-h) + clamp(.25rem, 1.6svh, 1.25rem));
    padding-bottom: clamp(1.25rem, 3.5svh, 2.5rem);
  }
}

.hero-haut,
.hero-bas { padding-left: var(--h-gutter); padding-right: var(--h-gutter); }

/* --- Le nom ------------------------------------------------------------ */
.hero-haut { container-type: inline-size; align-self: end; }

/* Une ligne : « Paul [ ] Richet » mesure 5,14 em en Diatype (fenêtre et
   espaces compris) ; calé sur la largeur utile, borné par la hauteur sur
   les écrans bas pour laisser la place aux photos. Repli sans unités de
   conteneur ni svh (Safari < 16) : une taille en vw, sans var(). */
.hero-titre {
  --h-em: 5.2;
  margin: 0;
  font-size: 18vw;
  font-weight: 700;
  line-height: .8;
  letter-spacing: -.055em;
  white-space: nowrap;
}
.hero-mot { display: inline-block; overflow: hidden; padding: .06em .02em .1em; margin: -.06em -.02em -.1em; vertical-align: bottom; }
.hero-mot > span { display: inline-block; }

/* La fenêtre : un tirage portrait dans la ligne du nom */
.hero-fenetre {
  position: relative;
  display: inline-block;
  width: .6em;
  height: .74em;
  margin: 0 -.105em 0 -.04em;   /* blancs optiques égaux : le « R » a plus d'approche que le « l » */
  vertical-align: baseline;
  overflow: hidden;
  border-radius: .035em;
  background: var(--h-ph);
}
.hero-fenetre__ph { position: absolute; inset: 0; opacity: 0; }
.hero-fenetre__ph.is-on { opacity: 1; }
.hero-js .hero-fenetre__ph { transition: opacity .3s ease; }
.hero-fenetre .hero-img { object-position: 50% 30%; }

/* Écran en portrait (téléphone, tablette debout) : deux lignes, plus grandes.
   « Paul [ ] » 2,44 em, « Richet » 2,61 em (mesuré). */
@media (max-aspect-ratio: 4/5) {
  .hero-titre { --h-em: 2.64; font-size: 36vw; }
  .hero-mot--2 { display: block; width: fit-content; margin-top: .02em; }
}
@supports (width: 1cqi) and (height: 1svh) {
  .hero-titre { font-size: min(calc(100cqi / var(--h-em)), 25svh); }
  @media (max-aspect-ratio: 4/5) { .hero-titre { font-size: min(calc(100cqi / var(--h-em)), 19svh); } }
}

/* --- La bande ------------------------------------------------------------ */
.hero-bande {
  position: relative;
  min-height: 0;
  padding: var(--h-vf) 0;
  overflow: hidden;
}
/* sans JavaScript : la bande défile au doigt ou à la molette */
html:not(.hero-js) .hero-bande { overflow-x: auto; scrollbar-width: none; }
html:not(.hero-js) .hero-bande::-webkit-scrollbar { display: none; }
html:not(.hero-js) .hero-piste { padding: 0 var(--h-gutter); }

.hero-entree { height: 100%; }
.hero-piste {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--h-gap);
  width: max-content;
  height: 100%;
  margin: 0;
}
.hero-js .hero-piste { transition: transform var(--h-pas) var(--h-ease); will-change: transform; }
.hero-piste.is-instant { transition: none; }

.hero-ph {
  position: relative;
  flex: none;
  display: block;
  height: 100%;
  aspect-ratio: var(--r, 1);
  overflow: hidden;
  border-radius: var(--h-radius);
  background: var(--h-ph);
  max-width: 92vw;   /* repli sans unités de conteneur : au pire un léger recadrage */
}
/* Une photo tient toujours entière dans la largeur de l'écran (paysage sur
   téléphone, panorama sur tablette) : elle perd alors en hauteur, pas en cadre. */
@supports (width: 1cqh) {
  .hero-bande { container-type: size; }
  .hero-ph { height: auto; max-width: none; width: min(calc(100cqh * var(--r, 1)), calc(100cqw - 2 * var(--h-gutter))); }
}
.hero-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Bas : présentation (ni bouton ni lien : demande client du 2026-11-03) */
.hero-bas { display: block; }
.hero-lead {
  max-width: 31em;
  margin: 0;
  font-size: clamp(1.0625rem, 1.25vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.hero :focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }

/* Téléphone couché : peu de hauteur, l'ouverture dépasse l'écran */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: 0; grid-template-rows: auto 13rem auto; }
  @supports (height: 1svh) { .hero { grid-template-rows: auto clamp(13rem, 58svh, 18rem) auto; } }
}

/* --- Ouverture ------------------------------------------------------------
   Jouée quand hero.js pose .is-anim (police chargée). Sans JavaScript, ou si
   boot.js a déjà rendu la page (filet), rien ne bouge. */
@media (prefers-reduced-motion: no-preference) {
  .hero.is-anim .hero-mot > span { animation: hero-monte 1.1s var(--h-ease) .05s both; }
  .hero.is-anim .hero-mot--2 > span { animation-delay: .17s; }
  .hero.is-anim .hero-fenetre { animation: hero-obt .9s var(--h-ease) .4s both; }
  .hero.is-anim .hero-entree { animation: hero-glisse 1.5s var(--h-ease) .2s both; }
  .hero.is-anim .hero-ph { animation: hero-case .7s var(--h-ease-out) calc(.3s + var(--k, 10) * .06s) both; }
  .hero.is-anim .hero-ph .hero-img { animation: hero-monte .95s var(--h-ease) calc(.5s + var(--k, 10) * .06s) both; }
  /* la photo de départ (préchargée) est là d'emblée : c'est l'image LCP,
     les autres cases apparaissent autour d'elle */
  .hero.is-anim .hero-ph--depart,
  .hero.is-anim .hero-ph--depart .hero-img { animation: none; }
  .hero.is-anim .hero-bas > * { animation: hero-pose .9s var(--h-ease-out) .95s both; }
}
@keyframes hero-monte { from { transform: translateY(101%); } }
@keyframes hero-obt { from { transform: scaleY(0); } }
@keyframes hero-glisse { from { transform: translateX(26vw); } }
@keyframes hero-case { from { opacity: 0; transform: scale(.94); } }
@keyframes hero-pose { from { opacity: 0; transform: translateY(1rem); } }

@media (prefers-reduced-motion: reduce) {
  .hero-js .hero-piste,
  .hero-js .hero-fenetre__ph { transition: none; }
}

