/* ==========================================================================
   Hero — asymmetric split, bleed right, the pinned before plate (the bold move).
   Above the fold: render-blocking.
   ========================================================================== */

.hero {
  position: relative;
  padding-top: var(--space-xl);
  /* No + --plate-overlap here: that padding cancelled the plate's negative margin and
     the declared grid break never rendered. The plate is meant to hang into the band. */
  padding-bottom: var(--section-gap);
}

.hero__inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  font-family: var(--font-data);
  font-size: var(--text-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero__dot {
  width: var(--tick-length-sm);
  height: var(--border-width-rule);
  background: var(--accent);
}

.hero__title { max-width: 16ch; }

.hero__title-accent { color: var(--text-accent-display); }

.hero__lead {
  margin-top: var(--space-lg);
  max-width: var(--measure-lead);
  font-size: var(--text-lead);
  line-height: var(--lh-lead);
  color: var(--text-secondary);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* ---- stage ---------------------------------------------------------------- */

.hero__stage {
  position: relative;
  margin-top: var(--space-xl);
  padding-left: var(--container-pad);
}

.plate--after { position: relative; }

.plate--after .ph { box-shadow: var(--shadow-card); }

.plate--after .string {
  position: absolute;
  left: var(--space-lg);
  right: var(--space-lg);
  top: calc(-1 * var(--space-lg));
}

/* The caption never sits on the pixels. At 390 the plate is narrow enough that the
   second line reached the photograph: measured 2.42:1 mean, 99.3% of samples under
   4.5:1. It now carries the paper knock-out the art direction requires of any label
   near an image, so no contrast-over-photography case exists on this page at all. */
.plate--after .string__figure {
  background: var(--surface-raised);
  border-radius: var(--radius-control);
  padding-block: var(--space-2xs);
}

@media (max-width: 899px) {
  .plate--after .string {
    position: static;
    margin-bottom: var(--space-sm);
  }
}

/* The hero has no entrance by design — the LCP plate is painted, not animated.
   Its caption is drawn by the visitor instead: the same --delta the plate rides. */
.string--scrub::before,
.string--scrub::after { transform: scaleX(var(--delta)); }

.string--scrub .string__figure { opacity: var(--delta); }

.plate--before {
  position: relative;
  z-index: var(--z-raised);
  width: var(--plate-before-w-start);
  margin-top: calc(-1 * var(--space-4xl));
  transform-origin: left bottom;
}

/* Below 900px there is no scrub, so the pair is a static composition — and the rule in
   docs/motion-spec.md is that the LCP element is the survey plate. It therefore leads and
   runs full width; the finished room follows at 78%, inset from the right. */
@media (max-width: 899px) {
  .hero__stage { display: grid; gap: var(--space-lg); }

  .plate--before {
    order: -1;
    width: 100%;
    margin-top: 0;
  }

  .plate--after {
    width: 78%;
    justify-self: end;
  }
}

@media (min-width: 900px) {
  .hero__stage {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
    gap: var(--grid-gap);
    max-width: var(--container-max);
    margin-inline: auto;
    padding-left: var(--container-pad);
    padding-right: 0;
  }

  /* The bleed is made by the stage carrying no right padding, not by a negative
     margin: at viewport widths under --container-max the container has no auto
     margin left to absorb one, and the plate would push the page sideways. */
  .plate--after {
    grid-row: 1;
    grid-column: 5 / -1;
  }

  .plate--before {
    grid-row: 1;
    grid-column: 3 / 10;
    align-self: end;
    width: 100%;
    margin-top: 0;
    margin-bottom: calc(-1 * var(--plate-overlap));
    transform:
      translate(calc(var(--delta) * -2%), calc(var(--delta) * 14%))
      scale(calc(1 - 0.42 * var(--delta)));
    transition: transform var(--dur-base) var(--ease-slide);
  }

  .js .plate--before { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .plate--before { transition: none; }
}
