/* The hero stays in document flow. Its photo fills its grid column, and each
 * stage uses the same frame geometry. */

.hero__heading-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.hero__title-fixed { display: contents; }

.hero__photo {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 696 / 757;
  min-height: 757px;
  height: auto;
  margin: 0;
  overflow: hidden;
}

.hero__photo picture {
  position: absolute;
  inset: 0;
}

.hero__photo-stage {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(0.83, 0, 0.17, 1);
}

.hero__photo-stage--1 { object-position: 50% 50%; }
.hero__photo-stage[data-hero-stage="2"] { object-position: 60% 50%; }
.hero__photo-stage[data-hero-stage="3"] { object-position: 80% 50%; }
.hero__photo-stage.is-active { opacity: 1; }

/* The caption labels the owner throughout the cycle. */
.chip--caption {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 16px;
  background: var(--color-ink);
  color: var(--color-sand);
  padding: 8px 14px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.hero__title-visual { display: flex; flex-direction: column; align-items: flex-start; }
.hero__fixed-line { display: block; height: 1lh; white-space: nowrap; }
.hero__fixed-line::after,
.hero__word:not(.hero__word-ruler)::after { content: attr(data-word); }
.hero__word-stage {
  display: block;
  position: relative;
  width: 100%;
  height: 1lh;
  padding: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}
.hero__word { display: inline-block; white-space: pre; }
.hero__word-ruler { position: absolute; visibility: hidden; left: 0; top: 0; }
.hero__word-motion { position: absolute; inset: 0; }
.hero__word-row { position: absolute; inset: 0 auto auto 0; display: flex; white-space: pre; }
.hero__letter {
  position: relative;
  display: inline-block;
  height: 1lh;
  white-space: pre;
  will-change: transform;
}
.hero__letter::after { content: attr(data-letter); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero__intro { display: contents; }
  .hero__heading-group {
    grid-column: 1;
    grid-row: 1;
    z-index: 2;
    align-self: end;
    width: 100%;
    gap: 0;
    padding: 0;
    pointer-events: none;
  }
  .hero__heading-group .mark { display: none; }
  .hero__title {
    width: 100%;
    max-width: none;
    padding: 0;
    line-height: 1;
  }
  html:not([data-hero-cycle-ready]) .hero__title {
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
    padding: 8px 24px 4px 24px;
    background: var(--color-ochre);
    font-size: min(7.18vw, 34px);
    line-height: 1.07;
    white-space: nowrap;
  }
  .hero__title-fixed {
    display: block;
    box-sizing: border-box;
    width: fit-content;
    padding: 8px 24px 4px 24px;
    background: var(--color-ochre);
    font-size: min(7.18vw, 34px);
    line-height: 1.07;
    white-space: nowrap;
  }
  .hero__fixed-line { display: inline; height: auto; }
  .hero__fixed-line + .hero__fixed-line::before { content: "\00a0"; }
  .hero__word-stage {
    box-sizing: content-box;
    width: fit-content;
    padding: 2px 13px 0 24px;
    background: var(--color-ochre);
    font-size: min(16.41vw, 79px);
    line-height: 0.94;
  }
  .hero__word-motion { left: 24px; right: 13px; top: 2px; }
  .hero__photo {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    height: 128.205128vw;
    aspect-ratio: auto;
  }
  .hero__actions {
    grid-column: 1;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 12px;
    box-sizing: border-box;
    width: 100%;
    padding: 16px 24px 32px;
  }
  .hero__actions .button { min-width: 0; width: 100%; padding-inline: 10px; }
  .hero__details { grid-column: 1 / -1; margin-top: 0; text-align: center; }
  .hero__lead { grid-column: 1; grid-row: 2; box-sizing: border-box; max-width: none; padding: 20px 24px 0; }
  .hero__photo-stage[data-hero-stage="2"],
  .hero__photo-stage[data-hero-stage="3"] { object-position: 50% 50%; }
  .chip--caption {
    box-sizing: border-box;
    top: 8px;
    right: auto;
    bottom: auto;
    left: 8px;
    padding: 5px 10px;
    font-size: 13px;
    line-height: 18px;
    white-space: nowrap;
  }
}

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