/* The hero: one sentence over a paper-cut race. "Votre PME a grandi / plus vite que sa
   gestion." is set as one centred block in the empty paper sky; below it the scene shows the
   business (a fern paper van) pulling away while its management (a manager with a ledger and a
   briefcase) runs far behind. The dove flies over the scene, between the two. The lede and the
   actions form one caption strip on the paper at the foot of the scene.

   Wide plate (assets/img/hero/race-*.webp): its sky is keyed to transparency, so the page's
   paper shows through; drawn full width and anchored to the bottom, wider windows crop only
   empty sky. Phones get their own composition (race-phone-*.webp) so the figures stay legible.
   Masks read alpha only: the colour in each gradient is just "opaque".

   The dove flies above the manager, facing the van (mirrored from the logo): it leads the
   management after the business. Positions are shares of the plate, read off the picture:
   the manager's head is at 10.5 % of its width and 42 % of its height (wide plate). */

.hero__dove-mark {
  display: none;
}

.hero__scene {
  position: relative;
  margin: 0;
}

.hero__scene-art {
  display: block;
  width: 100%;
  height: auto;
}

.hero__line--b {
  margin-top: 0.08em;
}

/* "Nous pouvons vous aider." is a headline on ALIAZ Conseil's own page: it reads as one here. */
.hero__lede {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-text);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

/* Secondary text colour is too faint near the hills: the link takes the ink. */
.hero__actions .button--ghost {
  color: var(--color-text);
}

/* ─── Live experience: a sticky stage over the fixed scene layer ─── */

.hero-backdrop {
  display: none;
}

html[data-mode="experience"] {
  /* Where the wide plate's bottom edge sits above the bottom of the screen. */
  --plate-bottom: 0px;
}

html[data-mode="experience"] .hero-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

html[data-mode="experience"] .hero-backdrop .hero__scene {
  position: absolute;
  right: 0;
  bottom: var(--plate-bottom);
  left: 0;
  transform-origin: 50% 100%;
}

/* The foreground hill eases into the page, so the strip's text and buttons sit on paper. */
html[data-mode="experience"] .hero__scene-art {
  mask-image: linear-gradient(to bottom, var(--color-text) 80%, transparent);
}

/* Until the experience moves it under the canvas, the scene stays out of sight. */
html[data-mode="experience"] .hero__stage .hero__scene {
  display: none;
}

html[data-mode="experience"] .hero {
  height: 280vh;
}

html[data-mode="experience"] .hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  container-type: inline-size;
}

/* The live dove's place (LiveDoveDirector reads it; the scene draws the dove there): its height,
   centred a little ahead of the manager, its lower edge just clear of his head and his papers.
   The plate is as wide as the stage (100cqw) and 2688 × 1536. */
html[data-mode="experience"] .hero__dove-mark {
  --plate-height: calc(100cqw * 1536 / 2688);
  --mark-height: min(26vh, 16cqw);
  position: absolute;
  bottom: calc(var(--plate-bottom) + var(--plate-height) * 0.615);
  left: max(11.5cqw, calc(var(--mark-height) * 0.556 + var(--gutter)));
  display: block;
  height: var(--mark-height);
  aspect-ratio: 651 / 586;
  pointer-events: none;
  translate: -50% 0;
}

/* One block, centred in the sky above the dove (the dove's top is at 27 % of the height), clear
   of the header bar that arrives with the first scroll. */
html[data-mode="experience"] .hero__title {
  position: absolute;
  top: calc(var(--header-height) + clamp(var(--space-2), 2vh, var(--space-6)));
  left: 50%;
  width: min(100% - 2 * var(--gutter), 64rem);
  font-size: min(clamp(2.75rem, 4.9vw, 5.5rem), 8vh);
  text-align: center;
  transform: translateX(-50%);
}

/* Wide windows: the dove hangs in the left of the sky at the title's height, so the title keeps
   to the middle 60 % and a longer line (the English one) wraps, balanced, instead of meeting
   the wing. */
@media (min-width: 821px) {
  html[data-mode="experience"] .hero__title {
    width: min(100% - 2 * var(--gutter), 64rem, 60vw);
  }
}

/* The caption strip: lede on the left, actions on the right, at the foot of the scene. The
   page-coloured label halo (experience.css) is for copy over bare paper and the shards; the strip
   never meets them, and over the hill's edge the halo would outline every glyph. */
html[data-mode="experience"] .hero__aside {
  position: absolute;
  right: var(--gutter);
  bottom: 3.5vh;
  left: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5) var(--space-7);
  -webkit-text-stroke: 0;
}

html[data-mode="experience"] .hero__lede {
  max-width: 40rem;
  font-size: var(--type-subtitle);
  line-height: 1.3;
}

html[data-mode="experience"] .hero__actions {
  flex: none;
}

/* Narrow or squarer windows (up to 3:2): the plate is short, so it stands on a band of paper
   that holds the strip, instead of the strip standing on the hills. */
@media (max-width: 1023px), (max-aspect-ratio: 3 / 2) {
  html[data-mode="experience"] {
    --plate-bottom: 19vh;
  }

  html[data-mode="experience"] .hero__scene-art {
    mask-image: linear-gradient(to bottom, var(--color-text) 72%, transparent);
  }

  html[data-mode="experience"] .hero__lede {
    max-width: 32rem;
  }
}

/* ─── Static mode: the same order in the flow, the static dove picture over the scene ─── */

html[data-mode="static"] .hero__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: var(--space-5);
  max-width: calc(var(--size-content) + 2 * var(--gutter));
  margin-inline: auto;
  padding: calc(var(--header-height) + var(--space-6)) var(--gutter) var(--space-7);
  text-align: center;
}

html[data-mode="static"] .hero__scene {
  /* Full bleed: the hills run to both edges of the screen. */
  justify-self: start;
  width: 100vw;
  max-width: none;
  margin: var(--space-2) calc(50% - 50vw) 0;
}

/* In the flow the picture would start and end on hard edges: both ease into the page. */
html[data-mode="static"] .hero__scene-art {
  mask-image: linear-gradient(to bottom, transparent, var(--color-text) 16%, var(--color-text) 80%, transparent);
}

/* Phone plate: the dove flies in the open sky above the manager (head at 25 % across, 47 % down),
   clear of the van's speed lines. The picture is the mirrored dove, its shadow still down-right. */
html[data-mode="static"] .hero__dove {
  position: absolute;
  bottom: 54%;
  left: 24%;
  width: 30%;
  translate: -50% 0;
}

html[data-mode="static"] .hero__aside {
  display: grid;
  justify-items: center;
  gap: var(--space-5);
  max-width: 38rem;
}

html[data-mode="static"] .hero__actions {
  justify-content: center;
}

/* Wide plate (static mode on a large screen). */
@media (min-width: 821px) {
  html[data-mode="static"] .hero__scene {
    margin-top: 0;
  }

  html[data-mode="static"] .hero__scene-art {
    mask-image: linear-gradient(to bottom, var(--color-text) 80%, transparent);
  }

  /* As in the live hero: above the manager, the picture's padding below the dove included. */
  html[data-mode="static"] .hero__dove {
    bottom: 59%;
    left: 11.5%;
    width: 19.5%;
  }
}
