/* ==========================================================================
   hero.css : section 01, premier écran. Préfixe hero-.
   Mobile d'abord ; seuils 600 px et 1024 px. État de base = état final lisible.
   ========================================================================== */

/* ---- 1. Cadre de la section --------------------------------------------- */
.hero{
  display:flex; flex-direction:column; min-width:0;
  min-height:max(640px, calc(100vh - var(--nav-h)));
  min-height:max(640px, calc(100svh - var(--nav-h)));
  padding-block:var(--space-5) 0;
  overflow:hidden;
}
/* Table lumineuse : le canvas ne s'affiche que lorsque hero.js a dessiné (classe is-live). */
.hero-table{
  position:absolute; inset:0; z-index:0; display:block; width:100%; height:100%;
  contain:strict; pointer-events:none; opacity:0;
  transition:opacity var(--dur-slow) var(--ease-out);
}
.hero.is-live .hero-table{ opacity:1; }
/* Halo unique + repli statique de la matrice de points (sans canvas, sans JavaScript). */
.hero-halo{
  position:absolute; inset:0; z-index:0; pointer-events:none;
  background-image:var(--grad-halo), radial-gradient(circle, var(--color-line-1) 1px, transparent 1.5px);
  background-size:auto, 20px 20px;
  background-position:0 0, 10px 10px;
}
.hero.is-live .hero-halo{ background-image:var(--grad-halo); background-size:auto; background-position:0 0; }

/* ---- 2. Grille et colonne de texte --------------------------------------- */
.hero-grid{
  position:relative; z-index:var(--z-content); flex:1 0 auto;
  align-content:start; row-gap:var(--space-7); padding-bottom:var(--space-7);
}
.hero-copy{ grid-column:1 / -1; min-width:0; }
.hero-eyebrow{ margin:0 0 var(--space-4); }
.hero-title{ margin:0 0 var(--space-4); }
.hero-title .t-key{ display:block; }
/* Titre découpé par data-split : marge de respiration pour les jambages (overflow:clip du socle). */
.hero-title span[aria-hidden="true"]{ padding-block:.08em; margin-block:-.08em; }
/* Safari : le dégradé ne traverse pas les spans en inline-block, on le repose sur chaque mot. */
.hero-title .t-key span span{
  background:var(--grad-ice); -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent;
}
.hero-lead{ margin:0 0 var(--space-5); max-width:34em; color:var(--color-text-2); }
.hero-actions{ display:flex; flex-direction:column; gap:var(--space-3); }
.hero-reassure{ margin:var(--space-3) 0 0; }
.hero-reassure__link{
  color:var(--color-ice); text-decoration:underline; text-decoration-thickness:1px;
  text-decoration-color:color-mix(in srgb,var(--color-ice) 45%,transparent); text-underline-offset:4px;
  transition:text-decoration-color var(--dur-fast);
}
@media (hover:hover){ .hero-reassure__link:hover{ text-decoration-color:var(--color-ice); } }

/* ---- 3. Cadrans de l'offre ----------------------------------------------- */
.hero-dials{ display:grid; margin:var(--space-6) 0 0; padding:0; }
.hero-dial{
  position:relative; display:flex; align-items:baseline; justify-content:space-between;
  gap:var(--space-4); min-width:0; padding-block:var(--space-3);
  border-top:1px solid var(--color-line-1);
}
/* Repère de graduation : 16 px plus clairs au début de chaque filet. */
.hero-dial::before{
  content:""; position:absolute; top:-1px; left:0; width:var(--space-4); height:1px;
  background:var(--color-line-3);
}
.hero-dial__label{ margin:0; min-width:0; }
.hero-dial__value{ margin:0; font-size:1.25rem; line-height:1.2; text-align:right; color:var(--color-text-1); }
.hero-dial__to{ color:var(--color-silver); }

/* ---- 4. Scène : mesures réelles + maquette ------------------------------- */
.hero-stage{
  grid-column:1 / -1; display:grid; gap:var(--space-4);
  width:100%; max-width:var(--container-form); min-width:0; margin:0;
}
.hero-measures{
  display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:var(--space-3);
  margin:0; padding:0 0 var(--space-3); border-bottom:1px solid var(--color-line-1);
}
.hero-measure{ display:grid; gap:var(--space-1); min-width:0; }
.hero-measure__label{ color:var(--color-text-3); }
.hero-measure__value{ margin:0; color:var(--color-text-1); white-space:nowrap; }
.hero-badge{ top:auto; bottom:var(--space-3); background-color:var(--color-bg-0); }

.hero-screen{ position:relative; overflow:hidden; background:var(--color-bg-0); }
.hero-plan{ position:absolute; inset:0; display:block; width:100%; height:100%; }
.hero-plan__r{ fill:var(--color-surface-2); stroke:var(--color-silver); stroke-width:.75; }
.hero-scan{
  position:absolute; top:0; bottom:0; left:0; width:40%;
  background:var(--grad-scan); opacity:0; pointer-events:none;
}
/* Écran du visuel d'accueil : captures de vrais sites d'exemple, une par métier (data-mock-state). */
.hero-mock{ position:absolute; inset:0; overflow:hidden; background:#FFFFFF; }
.hero-shot{
  position:absolute; inset:0; display:block; width:100%; height:100%;
  object-fit:cover; object-position:50% 0; opacity:0; transition:opacity .5s var(--ease-out, ease);
}
.hero-mock[data-mock-state="boulangerie"] .hero-shot[data-shot="boulangerie"],
.hero-mock[data-mock-state="hotel"] .hero-shot[data-shot="hotel"],
.hero-mock[data-mock-state="immobilier"] .hero-shot[data-shot="immobilier"],
.hero-mock[data-mock-state="restaurant"] .hero-shot[data-shot="restaurant"],
.hero-mock[data-mock-state="groupe"] .hero-shot[data-shot="groupe"]{ opacity:1; }
.hero-mock__name{
  position:absolute; left:var(--space-3); bottom:var(--space-3); z-index:1; margin:0;
  padding:.45em .9em; border-radius:var(--radius-pill, 999px);
  background:rgba(10,12,16,.82); color:#FFFFFF; font:500 .75rem/1.2 var(--font-mono); letter-spacing:.04em;
  white-space:nowrap; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
}

/* Anti-flash : la maquette attend l'intro (hero.js pose is-ready). Filet CSS au bout de 3 s si le
   script ne s'exécute pas ; en mouvement réduit, rien n'est masqué. */
html.js .hero-stage:not(.is-ready) .hero-mock{ opacity:0; animation:hero-ready 1ms linear 3s forwards; }
html.js .hero-stage:not(.is-ready) .hero-plan{ opacity:0; }
html.js.motion-reduced .hero-stage:not(.is-ready) .hero-mock,
html.js[data-motion="reduce"] .hero-stage:not(.is-ready) .hero-mock{ opacity:1; }
@keyframes hero-ready{ to{ opacity:1; } }
@media (prefers-reduced-motion:reduce){
  html.js:not([data-motion="full"]) .hero-stage:not(.is-ready) .hero-mock{ opacity:1; }
}

/* ---- 6. Note « mouvement réduit » : visible seulement sous html.motion-reduced ---- */
.hero-gate{
  display:none; z-index:var(--z-content);
  width:min(100% - 2*var(--space-gutter), var(--container-max));
  margin:0 auto var(--space-6);
}
html.motion-reduced .hero-gate{ display:flex; }
.hero-gate__text{ display:grid; gap:var(--space-2); min-width:0; }
.hero-gate__title{ margin:0; line-height:1.3; }
.hero-gate__body{ margin:0; max-width:var(--container-prose); color:var(--color-text-2); }
.hero-gate__btn{ flex:none; align-self:flex-start; max-width:100%; padding-block:var(--space-3); line-height:1.25; white-space:normal; }

/* ---- 8. Bandeau des repères ---------------------------------------------- */
/* Le bandeau défile ; la commande de pause, ronde et discrète, reste fixe au bord droit du contenu. */
.hero-reperes{
  position:relative; z-index:var(--z-content); display:flex; align-items:center; gap:var(--space-4); min-width:0;
  padding-block:var(--space-3);
  padding-right:max(var(--space-gutter), calc((100% - var(--container-max)) / 2));
  border-top:1px solid var(--color-line-1);
}
.hero-reperes__band{ flex:1 1 auto; min-width:0; }
.hero-reperes.is-paused .marquee__track{ animation-play-state:paused; }
.hero-reperes__item{ display:inline-flex; align-items:center; gap:var(--space-6); }
.hero-reperes__item::before{ content:"·"; color:var(--color-ice); }
.hero-reperes__pause{
  flex:none; display:inline-flex; align-items:center; justify-content:center;
  width:44px; height:44px; margin:0; padding:0;
  border:1px solid var(--color-line-2); border-radius:var(--radius-pill);
  background:transparent; color:var(--color-text-2); cursor:pointer; appearance:none;
  touch-action:manipulation; -webkit-tap-highlight-color:transparent;
  transition:border-color var(--dur-fast), color var(--dur-fast);
}
.hero-reperes__ico{
  flex:none; width:16px; height:16px; fill:none; stroke:currentColor;
  stroke-width:1.25; stroke-linecap:round; stroke-linejoin:round;
}
.hero-reperes__tri{ display:none; }
.hero-reperes__pause[aria-pressed="true"]{ border-color:var(--color-ice); color:var(--color-ice); }
.hero-reperes__pause[aria-pressed="true"] .hero-reperes__tri{ display:inline; }
.hero-reperes__pause[aria-pressed="true"] .hero-reperes__bars{ display:none; }
.hero-reperes__pause:active{ color:var(--color-text-1); }

/* ---- 9. Survol (pointeur fin) --------------------------------------------- */
@media (hover:hover){
  .hero-reperes__pause:hover{ border-color:var(--color-line-3); color:var(--color-text-1); }
}

/* ---- 10. Tablette : 600 px et plus ---------------------------------------- */
@media (min-width:600px){
  .hero{ padding-block:var(--space-7) 0; }
  .hero-halo{ background-size:auto, 28px 28px; background-position:0 0, 14px 14px; }
  .hero-eyebrow{ margin-bottom:var(--space-5); }
  .hero-title{ margin-bottom:var(--space-5); }
  .hero-lead{ margin-bottom:var(--space-6); }
  .hero-actions{ flex-direction:row; flex-wrap:wrap; align-items:center; }
  .hero-dials{ grid-template-columns:repeat(3, minmax(0, 1fr)); column-gap:var(--space-gap); }
  .hero-dial{ flex-direction:column; align-items:flex-start; gap:var(--space-2); padding-block:var(--space-3) 0; }
  .hero-dial__value{ font-size:clamp(1.25rem, .7rem + .8vw, 1.625rem); text-align:left; }
}

/* ---- 11. Bureau : texte 7/12, scène 5/12, centrée en hauteur ----------------------------------- */
@media (min-width:1024px){
  .hero-grid{ padding-bottom:var(--space-8); }
  .hero-copy{ grid-column:1 / span 7; }
  .hero-title{ font-size:clamp(3.5rem, 1.25rem + 4.2vw, 5.5rem); }
  .hero-stage{ grid-column:8 / span 5; align-self:center; justify-self:end; max-width:none; }
  html.motion-reduced .hero-gate{ flex-direction:row; align-items:center; justify-content:space-between; gap:var(--space-6); }
  .hero-gate__btn{ align-self:center; }
}

/* ---- 12. Mouvement réduit : bandeau à plat ------------- */
:where(html.motion-reduced, html[data-motion="reduce"]) .hero-table{ transition:none; }
:where(html.motion-reduced, html[data-motion="reduce"]) .hero-reperes__item{ gap:var(--space-3); }
:where(html.motion-reduced, html[data-motion="reduce"]) .hero-reperes{ padding-inline:max(var(--space-gutter), calc((100% - var(--container-max)) / 2)); }
@media (prefers-reduced-motion:reduce){
  html:not([data-motion="full"]) .hero-table{ transition:none; }
  html:not([data-motion="full"]) .hero-reperes__item{ gap:var(--space-3); }
  html:not([data-motion="full"]) .hero-reperes{ padding-inline:max(var(--space-gutter), calc((100% - var(--container-max)) / 2)); }
}
