/* Anchr hero: a pinned, scroll-scrubbed Cycles film of the bottle. The original hero copy and the green strip below are
   untouched theme markup; this only lays out the film and the copy on top of it. */
.a-hero.xh-host { padding: 0 16px; overflow: visible; }
.xh { position: relative; height: 420vh; margin: 0 -16px; }
.xh__pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #fff; }
.xh__film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* the live hero's own copy (same words, same theme classes), re-ordered:
   trust, then the promise, what it is, the proof, the button, and how easy the routine is */
.xh__copy { position: absolute; z-index: 2; will-change: transform, opacity; }
.xh__copy .a-hero__h { margin: 0; letter-spacing: -.045em; line-height: .94; }
.xh__copy .xh__trust { margin: 0 0 22px; gap: 10px; font-size: 15px; line-height: 1.3; }
.xh__copy .xh__trust span { white-space: nowrap; }
.xh__copy .xh__trust .a-avatars img { box-shadow: 0 0 0 2px #fff; border-radius: 50%; }
.xh__copy .xh__subhead { margin: 18px 0 0; font-size: clamp(19px, 1.75vw, 26px); line-height: 1.25; font-weight: 500; color: #111; }
.xh__copy .xh__proof { margin: 12px 0 0; max-width: 30em; color: #3A3A3A; }
.xh__copy .xh__proof strong { color: #111; }
.xh__copy .a-hero__cta { margin-top: 30px; }
.xh__routine { margin: 14px 0 0; max-width: 30em; font-size: 14.5px; line-height: 1.45; color: #6B6B6B; }

/* wide screens: a left column beside the bottle; the routine line sits beside the button */
@media (min-aspect-ratio: 1/1) {
  .xh__copy { left: max(48px, calc((100vw - 1180px) / 2)); top: 50%; translate: 0 -50%; width: min(580px, 46vw); padding: 0; text-align: left;
    display: grid; grid-template-columns: auto 1fr; column-gap: 24px; align-items: center; }
  .xh__copy > * { grid-column: 1 / -1; justify-self: start; }
  .xh__copy .a-hero__h { font-size: clamp(54px, 6.6vw, 104px); }
  .xh__copy .xh__proof { font-size: clamp(16px, 1.3vw, 19px); text-align: left; }
  .xh__copy .a-hero__cta { grid-column: 1; min-width: 0; width: auto; padding: 20px 40px; }
  .xh__copy .xh__routine { grid-column: 2; margin-top: 30px; max-width: 17em; }
}
@media (min-aspect-ratio: 1/1) and (max-width: 1179px) {   /* narrower columns: the routine line goes under the button */
  .xh__copy .a-hero__cta, .xh__copy .xh__routine { grid-column: 1 / -1; }
  .xh__copy .xh__routine { margin-top: 14px; max-width: 30em; }
}
/* tall screens: the stack centred at the top, the bottle rising beneath it */
@media (max-aspect-ratio: 1/1) {
  .xh__copy { left: 0; right: 0; top: 0; padding: 26px 20px 0; text-align: center; }
  .xh__copy .xh__trust { justify-content: center; margin-bottom: 14px; }
  .xh__copy .xh__proof, .xh__copy .xh__routine { margin-inline: auto; }
  .xh__copy .xh__routine { max-width: 26em; }
}

/* the sentences of the sub-copy, one per beat of the film */
.xh__beat, .xh__end { position: absolute; z-index: 2; left: max(48px, calc((100vw - 1180px) / 2)); top: 50%; translate: 0 -50%; max-width: 520px; text-align: left; opacity: 0; pointer-events: none; will-change: transform, opacity; }
.xh__beat .xh__pill { margin: 0 0 18px; }
.xh__eb { margin: 0 0 10px; font-size: 22px; line-height: 1.3; color: #111; }
.xh__big { margin: 0; font-size: 60px; line-height: 1; font-weight: 800; letter-spacing: -2.4px; color: #000; text-wrap: balance; }
.xh__big strong { color: var(--a-green, #0D5640); font-weight: 800; }
.xh__end { display: grid; justify-items: start; gap: 26px; }
.xh__end.is-on { pointer-events: auto; }
.xh__cta.a-hero__cta { margin: 0; }

/* frames still arriving: a hairline at the foot of the scene */
.xh__load { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 2px; background: rgba(13, 86, 64, .08); transition: opacity .6s; }
.xh__load i { display: block; height: 100%; background: rgba(13, 86, 64, .5); transform-origin: left; transform: scaleX(0); transition: transform .3s; }
.xh__load.is-done { opacity: 0; }

@media (max-aspect-ratio: 1/1) and (min-width: 750px) { .xh__copy { padding-top: 48px; } }
/* sideways tablets and small laptops (4:3 film): the bottle sits nearer the copy, so the words scale with the screen */
@media (min-aspect-ratio: 1/1) and (max-aspect-ratio: 154/100) {
  .xh__beat, .xh__end { left: max(32px, 4vw); max-width: 33vw; }
  .xh__big { font-size: clamp(34px, 4.3vw, 60px); letter-spacing: -.04em; }
  .xh__eb { font-size: clamp(16px, 1.7vw, 22px); }
}
/* phones and upright tablets: the film is framed tall, so the words sit above or below the bottle, centred */
@media (max-aspect-ratio: 1/1) {
  .xh__beat, .xh__end { left: 20px; right: 20px; top: 92px; translate: none; max-width: none; text-align: center; justify-items: center; }
  .xh__end, .xh__beat[data-m="bottom"] { top: auto; bottom: 26px; }
  .xh__big { max-width: 16ch; margin-inline: auto; }
}
@media (max-width: 749px) {
  .xh { height: 380vh; }
  .xh__eb { font-size: 17px; }
  .xh__big { font-size: 38px; letter-spacing: -1.4px; }
  .xh__cta.a-hero__cta { width: 100%; }
  .xh__copy .a-hero__h { font-size: 50px; }
  .xh__copy .xh__subhead { margin-top: 12px; }
  .xh__copy .a-hero__cta { margin-top: 20px; }
  .xh__routine { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { .xh__copy, .xh__beat, .xh__end { transition: none; } }
