/* DLR Multi-Services : hero de l'accueil (logo, construction 3D, photo, visite) */
/* ================================================================== HERO
   Version statique par defaut (sans JavaScript, mouvement reduit, sans WebGL) :
   photo, logo, accroche et appel a l'action. La version animee est activee par html.anim. */
.hero { position: relative; background: var(--noir); }
.hero__scene {
  position: relative; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: max(28px, env(safe-area-inset-top)) var(--gouttiere) 96px;
}
.hero__photo, .hero__photo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__photo img { object-fit: cover; object-position: 50% 70%; }
.hero__scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(13,13,13,.82) 0%, rgba(13,13,13,.25) 34%, rgba(13,13,13,.1) 55%, rgba(13,13,13,.86) 100%);
}
.hero__intro, .hero__appel { position: relative; z-index: 2; }
.hero__intro { --ecart-logo: clamp(18px, 3.2svh, 34px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
/* logo, un espace franc, puis l'accroche (h1) plus petite et le lieu */
.hero__logo { width: min(460px, 80vw); height: auto; margin-bottom: var(--ecart-logo); }
.hero__accroche {
  font-family: var(--police); font-stretch: 100%; font-weight: 500; letter-spacing: .005em;
  font-size: clamp(1rem, .55rem + 1.2vw, 1.375rem); line-height: 1.35; color: var(--blanc); max-width: 36em; text-wrap: balance;
}
.hero__lieu { font-size: clamp(.875rem, .8rem + .3vw, 1rem); color: var(--acier); margin-top: -6px; }
.hero__inviter, .hero__barre, .hero__progression, .hero__ciel, .hero__nuages, .hero__gl, .hero__plongee, .hero__vignette, .hero__cotes, .hero__chantier, .hero__visite, .hero__passer, .hero__chargement { display: none; }
.hero__appel { text-align: center; }
.appel__bloc { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.appel__ombre, .appel__logo { display: none; }           /* version statique : le logo est deja en haut */
.appel__titre {
  font-family: var(--titres); font-stretch: 118%; font-weight: 760; letter-spacing: -.025em;
  font-size: clamp(2rem, 6vw, 4.2rem); line-height: 1.02; max-width: 16ch; text-wrap: balance;
}
.appel__titre, .appel__texte { text-shadow: 0 1px 14px rgba(0,0,0,.55); }
.appel__texte { font-family: var(--police); color: rgba(247,247,245,.86); font-size: clamp(1.02rem, 2.2vw, 1.25rem); line-height: 1.45; max-width: 40ch; text-wrap: balance; }
.appel__boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }

/* ------------------------------------------------------------------ version animee */
.anim .hero { height: calc(var(--unites, 17) * var(--hauteur-ecran)); }
.anim .hero__scene {
  position: sticky; top: 0; height: var(--hauteur-ecran); min-height: 0; padding: 0; display: block;
  background: var(--noir); contain: strict;
}
.anim .hero__scene::after, .anim .hero__photo { display: none; }
/* ciel du chantier : degrade (legere parallaxe), calque dore qui se rechauffe, nuages en mode screen.
   Le ciel est isole (les nuages lointains ne se melangent qu'avec lui) ; les nuages proches se melangent avec le canevas. */
.anim .hero__ciel {
  display: block; position: absolute; inset: 0; overflow: hidden; visibility: hidden; pointer-events: none;
  background: linear-gradient(180deg, #8fbdf0 0%, #cfdcf2 45%, #f6cdb9 80%, #fbdcae 100%);   /* avant l'image du ciel */
}
.ciel__fond { position: absolute; left: 0; top: -5%; width: 100%; height: 110%; will-change: transform; }
.ciel__fond img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.ciel__or {
  position: absolute; inset: 0; opacity: 0; will-change: opacity;
  background:
    radial-gradient(120% 85% at 10% 100%, rgba(255,172,88,.5), rgba(255,186,116,.16) 55%, rgba(255,196,130,0) 80%),
    linear-gradient(180deg, rgba(255,214,162,.08), rgba(255,170,92,.2));
}
.anim .hero__nuages { display: block; position: absolute; inset: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.nuage { position: absolute; opacity: 0; will-change: transform, opacity; }
/* derive permanente (traversee en boucle, ondulation, respiration) : transformation ecrite par hero.js a chaque image */
.nuage img { display: block; width: 100%; height: auto; }
.nuage--1 { width: 46vw; left: -7vw; top: 3%; }
.nuage--4 { width: 52vw; right: -10vw; top: 30%; }
.nuage--2 { width: 21vw; right: -5vw; top: 8%; }
.nuage--3 { width: 30vw; left: -8vw; bottom: 2%; }
/* nuages traverses a la fin de la plongee : centres sur l'ecran, deplaces et agrandis par hero.js */
.traversee {
  position: absolute; left: 50%; top: 50%; width: 46vw; margin-left: -23vw; margin-top: -8vw;
  opacity: 0; visibility: hidden; will-change: transform, opacity;
}
.traversee img { display: block; width: 100%; height: auto; }
.traversee--3 { width: 34vw; margin-left: -17vw; margin-top: -7vw; }
@media (max-aspect-ratio: 9/10) {
  .traversee { width: 100vw; margin-left: -50vw; margin-top: -18vw; }
  .traversee--3 { width: 80vw; margin-left: -40vw; margin-top: -17vw; }
  .nuage--1 { width: 120vw; left: -38vw; top: 22%; }
  .nuage--4 { width: 125vw; right: -50vw; top: 44%; }
  .nuage--2 { width: 52vw; right: -20vw; top: 27%; }
  .nuage--3 { width: 70vw; left: -26vw; bottom: 1%; }
}
.anim .hero__gl { display: block; position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; }
/* plongee : le logo vectoriel est redessine en SVG plein ecran (net a toutes les echelles) */
.anim .hero__plongee { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.anim .hero__intro.svg-pret .hero__logo { visibility: hidden; }
.anim .hero__accroche, .anim .hero__lieu { will-change: opacity; }
/* vignettage de vitesse pendant la plongee (opacite pilotee par hero.js) */
.anim .hero__vignette {
  display: block; position: absolute; inset: 0; pointer-events: none; opacity: 0; visibility: hidden; will-change: opacity;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(0,0,0,.45) 78%, rgba(0,0,0,.8) 100%);
}
/* ecran d'ouverture immobile : logo et accroche affiches des le premier rendu, a leur place definitive */
.anim .hero__intro { position: absolute; inset: 0; justify-content: center; padding: 0 var(--gouttiere) 8svh; }
/* ecran d'ouverture = ecran de chargement (html.hero-chargement : script de l'en-tete, retire par hero.js) :
   fine barre doree sous le logo, « Scroll » masque (le defilement est bloque par le script de l'en-tete, sans
   toucher a la mise en page). La barre est placee au milieu de l'espace entre le logo et l'accroche sans rien
   decaler : sa hauteur nette dans la colonne est nulle (marges negatives, ecart de 14 px compris). */
.anim .hero__barre {
  display: block; position: relative; width: min(168px, 40vw); height: 2px; border-radius: 2px; overflow: hidden;
  margin: calc(-.5 * (var(--ecart-logo) + 14px) - 1px) 0 calc(.5 * (var(--ecart-logo) + 14px) - 15px);
  background: rgba(247,247,245,.14); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .5s ease .3s, visibility 0s linear .8s;
}
.hero__barre span { display: block; height: 100%; background: var(--or); transform-origin: left center; transform: scaleX(0); transition: transform .3s ease-out; }
.anim.hero-chargement .hero__barre { opacity: 1; visibility: visible; transition: none; }
.anim .hero__inviter > * { transition: opacity .6s ease .45s; }
.anim.hero-chargement .hero__inviter > * { opacity: 0; transition: none; }
/* invitation a defiler : mot « Scroll » au-dessus du trait dore qui descend en boucle */
.anim .hero__inviter {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: absolute; left: 50%; bottom: max(28px, 4svh); transform: translateX(-50%);
}
.inviter__mot {
  font: 600 .78rem/1 var(--police); letter-spacing: .32em; text-transform: uppercase;
  color: var(--or); opacity: .8; padding-left: .32em;
}
.anim .hero__defiler { display: block; position: relative; width: 2px; height: 54px; background: rgba(227,168,43,.25); overflow: hidden; border-radius: 2px; }
.anim .hero__defiler span { position: absolute; left: 0; top: 0; width: 2px; height: 18px; background: var(--or); animation: defiler 1.8s ease-in-out infinite; }
@media (max-width: 767px) { .anim .hero__inviter { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 74px); } }
/* barre de progression du hero, sous l'encoche eventuelle */
.anim .hero__progression {
  display: block; position: absolute; left: 0; right: 0; top: env(safe-area-inset-top, 0px); height: 3px; z-index: 8;
  background: rgba(127,127,127,.18); pointer-events: none;
}
.hero__progression span { display: block; height: 100%; background: var(--or); transform-origin: left center; transform: scaleX(0); will-change: transform; }
@keyframes defiler { 0% { transform: translateY(-18px); } 70%, 100% { transform: translateY(54px); } }

/* chantier en direct : indicateur d'etape et compteur de tuiles (colonne a gauche / bandeau en haut), lisibles sur le ciel */
.anim .hero__chantier {
  display: block; position: absolute; left: max(28px, 4.5vw); top: 50%; width: min(26vw, 360px);
  transform: translateY(-50%); pointer-events: none; color: #24272b; text-shadow: 0 0 14px rgba(255,249,240,.7);
}
.chantier__etapes { position: relative; min-height: 1.5em; }
.chantier__etape {
  position: absolute; left: 0; top: 0; width: 100%; opacity: 0; visibility: hidden; will-change: opacity, transform;
  font: 600 1.08rem/1.3 var(--police); color: #6f4b07; white-space: nowrap;
}
.chantier__etape::before { content: ""; display: inline-block; width: 22px; height: 2px; background: var(--or); vertical-align: middle; margin: -2px 10px 0 0; }
.chantier__nom { color: #24272b; }
.chantier__nom::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--or); vertical-align: .16em; margin: 0 .6em 0 .5em; }
.chantier__compteur {
  margin-top: 10px; font: 600 1.05rem/1.2 var(--police);
  font-variant-numeric: tabular-nums; color: #24272b; opacity: 0; visibility: hidden;
}
.compteur__n { display: inline-block; min-width: 4.2ch; text-align: right; color: #6f4b07; font-size: 1.35em; }
@media (max-aspect-ratio: 9/10) {
  .anim .hero__chantier { left: 20px; right: 20px; top: max(46px, 6svh); width: auto; transform: none; }
  .chantier__etape { font-size: 1rem; }
}
.anim .hero__cotes { display: block; position: absolute; inset: 0; pointer-events: none; }
.cote {
  position: absolute; left: 0; top: 0; padding: 2px 6px; white-space: nowrap; opacity: 0;
  font: 600 .88rem/1 var(--police); color: #33373b;
  background: rgba(247,244,238,.85); border-radius: 2px; will-change: transform, opacity;
}
/* visite guidee : point dore pulsant sur la zone, trait de 1 px qui se dessine (stroke-dashoffset), puis etiquette
   en verre sombre qui glisse hors du trait. Tout est pilote par le defilement (hero.js) ; seule la pulsation tourne
   seule (animation CSS sur le compositeur, active pendant l'arret en cours). Portrait : etiquette en bas de l'ecran. */
.anim .hero__visite { display: block; position: absolute; inset: 0; pointer-events: none; }
.visite__traits { position: absolute; inset: 0; overflow: visible; }
.visite__traits line { stroke: var(--or); stroke-width: 1; stroke-linecap: round; opacity: 0; }
.visite__point {
  position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--or); box-shadow: 0 0 0 1px rgba(13,13,13,.28), 0 0 10px rgba(227,168,43,.55);
  opacity: 0; visibility: hidden; will-change: transform, opacity;
}
.visite__point::after {
  content: ""; position: absolute; left: -11px; top: -11px; width: 32px; height: 32px; box-sizing: border-box;
  border-radius: 50%; border: 1.5px solid var(--or); opacity: 0; transform: scale(.33);
}
.visite__point.actif::after { animation: pouls 2.4s cubic-bezier(.25,.6,.35,1) infinite; }
@keyframes pouls { 0% { transform: scale(.33); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
/* cadre de decoupe (rectangulaire) : le corps de l'etiquette en sort du cote du trait */
.etiquette { position: absolute; left: 0; top: 0; width: max-content; max-width: min(340px, 40vw); overflow: hidden; visibility: hidden; }
.etiquette__corps {
  display: block; padding: 16px 22px 17px 20px; color: var(--blanc);
  background: rgba(0,0,0,.55); border: 1px solid rgba(227,168,43,.35); border-radius: 14px;
  opacity: 0; will-change: transform, opacity;
}
.etiquette__titre { display: block; font: 600 clamp(1rem, .7rem + .5vw, 1.15rem)/1.25 var(--titres); font-stretch: 112%; letter-spacing: -.005em; text-wrap: balance; }
.etiquette__detail { display: block; margin-top: 5px; font: 400 .9rem/1.4 var(--police); color: rgba(247,247,245,.7); text-wrap: pretty; }
/* flou de verre sur ordinateur seulement (sur telephone : verre sombre sans flou, pour la fluidite) */
@media (min-width: 1100px) and (min-aspect-ratio: 9/10) {
  .etiquette { max-width: none; }
  .etiquette__titre { white-space: nowrap; }
}
@media (pointer: fine) and (min-width: 768px) {
  .etiquette__corps { -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15); }
}
/* progression : 4 barres en bas de l'ecran, visibles pendant la visite seulement */
.visite__progres {
  position: absolute; left: 50%; bottom: max(20px, calc(env(safe-area-inset-bottom) + 8px)); display: flex; gap: 6px;
  padding: 6px 8px; margin-bottom: -6px; border-radius: 10px; background: rgba(0,0,0,.28);
  transform: translateX(-50%); opacity: 0; visibility: hidden; will-change: opacity;
}
.visite__progres span { position: relative; display: block; width: 26px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); }
.visite__progres span::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--or); opacity: var(--actif, 0); }
@media (max-aspect-ratio: 9/10) {
  /* bas de l'ecran, au-dessus de la barre d'appel fixe (52 px, a 12 px du bord + zone sure) et des barres de progression */
  .hero__visite { --bas-progres: 24px; --bas-etiquette: 44px; }
  .etiquette { left: 16px; right: 16px; top: auto; bottom: var(--bas-etiquette); width: auto; max-width: 520px; margin: 0 auto; }
  .etiquette__corps { padding: 14px 18px 15px; }
  .visite__progres { bottom: var(--bas-progres); }
}
@media (max-aspect-ratio: 9/10) and (max-width: 767px) {
  .hero__visite { --bas-progres: calc(max(12px, env(safe-area-inset-bottom)) + 52px + 13px); --bas-etiquette: calc(var(--bas-progres) + 3px + 16px); }
}
@media (prefers-reduced-motion: reduce) {
  .visite__point.actif::after { animation: none; opacity: .5; transform: none; }
}
.anim .hero__passer {
  display: inline-flex; align-items: center; gap: 6px; position: absolute; z-index: 8;
  right: max(14px, env(safe-area-inset-right), var(--gouttiere)); top: calc(env(safe-area-inset-top, 0px) + 13px);
  min-height: 34px; padding: 0 14px; border-radius: 30px; text-decoration: none;
  font: 500 .95rem/1 var(--police);
  color: var(--blanc); background: rgba(13,13,13,.58); border: 1px solid rgba(227,168,43,.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background-color .2s;
}
.anim .hero__passer span { color: var(--or); letter-spacing: 0; font-size: 1.1em; }
.anim .hero__passer:hover { background: rgba(13,13,13,.8); }
/* appel a l'action sur la photo entiere, du jour au soir : degrade sombre discret sous les textes.
   Paysage : logo agrandi dans le ciel au-dessus du toit, textes et boutons en bas sur la pelouse (sous les baies).
   Portrait : logo, textes et boutons dans le ciel, en haut (la maison occupe le bas de l'ecran). */
.anim .hero__appel { position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none; }
.anim .appel__ombre {
  display: block; position: absolute; inset: 0; opacity: 0; will-change: opacity;
  background: linear-gradient(0deg, rgba(7,9,16,.66) 0%, rgba(7,9,16,.36) 13%, rgba(7,9,16,.1) 22%, rgba(7,9,16,0) 28%);
}
.anim .appel__bloc {
  position: absolute; left: 0; right: 0; bottom: max(3svh, 18px); gap: min(10px, 1.1svh);
  padding: 0 var(--gouttiere); pointer-events: auto;
}
.anim .appel__logo {
  --h: min(17svh, 190px);
  display: block; position: absolute; left: 0; right: 0; top: max(3.5svh, 20px); margin: 0 auto;
  height: var(--h); width: calc(var(--h) * 762 / 392);
  opacity: 0; will-change: opacity, transform; filter: drop-shadow(0 2px 12px rgba(0,0,0,.4));
}
.anim .appel__titre, .anim .appel__texte, .anim .appel__boutons { opacity: 0; visibility: hidden; will-change: opacity, transform; }
.anim .appel__titre { font-size: clamp(1.6rem, min(2.6vw, 4.4svh), 2.6rem); max-width: none; }
.anim .appel__texte { font-size: clamp(.95rem, min(1.3vw, 2.1svh), 1.15rem); color: rgba(247,247,245,.92); max-width: 64ch; line-height: 1.4; }
.anim .appel__boutons { margin-top: 2px; }
@media (max-aspect-ratio: 9/10) {
  .anim .appel__ombre {
    background:
      linear-gradient(180deg, rgba(7,9,16,.6) 0%, rgba(7,9,16,.32) 30%, rgba(7,9,16,0) 50%),
      linear-gradient(0deg, rgba(7,9,16,.45) 0%, rgba(7,9,16,0) 18%);
  }
  .anim .appel__logo { --h: calc(min(170px, 44vw) * 392 / 762); top: calc(env(safe-area-inset-top, 0px) + max(4svh, 24px)); }
  .anim .appel__bloc { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + max(4svh, 24px) + min(170px, 44vw) * 392 / 762 + 14px); gap: 10px; }
  .anim .appel__titre { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  .anim .appel__texte { font-size: clamp(1rem, 4.2vw, 1.15rem); max-width: 40ch; }
}
.anim .hero__chargement {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 16px; opacity: 0; visibility: hidden; transition: opacity .3s;
}
.hero__chargement img { width: 96px; height: auto; filter: brightness(0); opacity: .85; }
.chargement__barre { display: block; width: 140px; height: 3px; background: rgba(13,13,13,.12); border-radius: 3px; overflow: hidden; }
.chargement__barre span { display: block; height: 100%; width: 100%; background: var(--or); transform-origin: left; transform: scaleX(0); transition: transform .25s; }
.anim .hero__chargement.sur-noir img { filter: none; }
.anim .hero__chargement.sur-noir .chargement__barre { background: rgba(247,247,245,.14); }


/* ------------------------------------------------------------------ retour a l'accueil (#appel)
   html.arrivee-appel (script de l'en-tete, puis hero.js) : des le premier affichage, ni ecran de chargement, ni logo
   d'ouverture ; la maison du soir (image fixe), le logo dans le ciel et l'appel a l'action sont deja en place.
   L'image fixe reprend exactement le cadrage du canevas (cadrer() de hero.js, sans zoom) : largeur
   min(max(L, H x pw/ph), L / largeurMin), centree ; trop haute, recadree a 55 % ; trop basse, posee en bas, le haut
   de la photo prolonge (second calque tres etire, comme le bord de texture du canevas). hero.js la retire en fondu
   quand le canevas affiche le soir. */
.hero__soir { display: none; }
.anim.arrivee-appel .hero__scene { container-type: size; }
.anim.arrivee-appel .hero__soir {
  --pw: 2688; --ph: 1520; --lm: .72;
  --L: 100cqw; --H: 100cqh;
  --dw: min(max(var(--L), var(--H) * var(--pw) / var(--ph)), var(--L) / var(--lm));
  --dh: calc(var(--dw) * var(--ph) / var(--pw));
  --ox: calc((var(--L) - var(--dw)) / 2);
  --oy: max(var(--H) - var(--dh), (var(--H) - var(--dh)) * .55);
  display: block; position: absolute; inset: 0; pointer-events: none; background-color: #0b1020;
  background-image: var(--soir), var(--soir);
  background-repeat: no-repeat;
  background-size: var(--dw) var(--dh), var(--dw) calc(var(--dh) * 40);
  background-position: var(--ox) var(--oy), var(--ox) 0;
}
@supports not (width: 1cqw) { .anim.arrivee-appel .hero__soir { --L: 100vw; --H: var(--hauteur-ecran); } }
@supports not (background-image: image-set(url("x.webp") type("image/webp"))) {
  .anim.arrivee-appel .hero__soir { background-image: var(--soir-repli), var(--soir-repli); }
}
@media (max-aspect-ratio: 9/10) { .anim.arrivee-appel .hero__soir { --pw: 1520; --ph: 2688; --lm: .94; } }
.anim .hero__soir.fondu { transition: opacity .5s ease; }
.anim.arrivee-appel .hero__intro, .anim.arrivee-appel .hero__progression, .anim.arrivee-appel .hero__passer { visibility: hidden; }
.anim.arrivee-appel .hero__appel, .anim.arrivee-appel .appel__ombre, .anim.arrivee-appel .appel__logo,
.anim.arrivee-appel .appel__titre, .anim.arrivee-appel .appel__texte, .anim.arrivee-appel .appel__boutons { opacity: 1; visibility: visible; transform: none; }
/* hero statique (mouvement reduit, sans WebGL) : #appel ouvre le hero entier (logo et appel a l'action) */
html:not(.anim) .hero__appel { scroll-margin-top: 100vh; }
