/* The photo collage: a five-slot composition, with motion inside two photographic frames. */
.collage {
  --collage-unit: calc(clamp(992px, 100vw, 3840px) / 120);
  position: relative;
  isolation: isolate;
  overflow: clip;
  color: var(--ivory);
  background: #11102b;
}
.collage-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-flow: column;
}
.collage-scene {
  position: relative;
  width: 100%;
  height: max(100svh, 66.5vw);
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--collage-unit);
}
.trust-title {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 11em;
  margin-inline: auto;
  font: 700 6.5em/0.98 var(--sans);
  letter-spacing: -0.055em;
  text-align: center;
  text-transform: uppercase;
}
.collage-photo {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 0.5em;
  width: 24em;
  aspect-ratio: var(--media-aspect, 4 / 5);
  margin: 0;
  left: 6em;
  background: #0d1015;
}
.collage-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.collage-photo.is-01 {
  width: 28em;
  top: 10em;
  left: 14em;
}
.collage-photo.is-02 {
  width: 30em;
  top: 6em;
  left: auto;
  right: 16em;
}
.collage-photo.is-03 {
  width: 20em;
  bottom: 12em;
  left: auto;
  right: 8em;
}
.collage-photo.is-04 {
  width: 30em;
  bottom: 6em;
  left: 38%;
}
.collage-photo.is-05 {
  width: 20em;
  bottom: 12em;
  left: 8em;
}
.collage-photo.is-video-crop img {
  object-position: center top;
}
/* The screenshot's captured player controls sit below its16:9 video frame. */
.collage-photo.is-video-crop img {
  height: auto;
  min-height: 100%;
}

@media (min-width: 992px) {
  [data-scene='1'] .trust-title {
    font-size: 6.1em;
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  .collage {
    --collage-unit: calc(clamp(768px, 100vw, 991px) * 16 / 991);
  }
  .collage-scene {
    height: max(110svh, 1180px);
  }
  .trust-title {
    font-size: 4.5em;
    max-width: 9em;
  }
  .collage-photo.is-01 {
    width: 27vw;
    top: 8em;
    left: 5vw;
  }
  .collage-photo.is-02 {
    width: 32vw;
    top: 13em;
    right: 5vw;
  }
  .collage-photo.is-03 {
    width: 22vw;
    bottom: 16em;
    right: 5vw;
  }
  .collage-photo.is-04 {
    width: 32vw;
    bottom: 3em;
    left: 34%;
  }
  .collage-photo.is-05 {
    width: 22vw;
    bottom: 18em;
    left: 5vw;
  }
}
.collage-photo .photo-frame {
  display: block;
  width: 100%;
  height: 100%;
}
/* A stationary frame crops the photograph as it moves inside. */
.collage [data-parallax-image] {
  position: relative;
  overflow: hidden;
}
.collage [data-parallax-image] > :is(img, picture) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform-origin: center bottom;
}
.collage [data-parallax-image] > picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.trust-title {
  pointer-events: none;
}
@media (max-width: 767px), (hover: none) and (pointer: coarse) and (max-height: 550px) {
  .collage {
    --collage-unit: 12px;
  }
  .collage .progressive-blur {
    height: 28px;
  }
  .collage-scene {
    display: grid;
    grid-template-columns: minmax(0, 0.89fr) minmax(0, 1.11fr);
    grid-template-areas: 'lead lead' 'interview interview' 'portrait detail' 'portrait last';
    align-items: center;
    gap: clamp(10px, 3vw, 18px);
    height: auto;
    padding: clamp(18px, 5vw, 34px) var(--gutter) clamp(18px, 6vw, 40px);
  }
  .collage-scene[data-scene='1'] {
    grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr);
    grid-template-areas: 'lead lead' 'headline headline' 'interview portrait' 'detail portrait' 'last last';
  }
  .collage-scene .trust-title {
    grid-area: headline;
    margin: clamp(12px, 4vw, 25px) auto;
    max-width: 12em;
    font-size: clamp(30px, 8.5vw, 55px);
    text-wrap: balance;
  }
  .collage-scene .collage-photo {
    position: relative;
    inset: auto;
    width: 100%;
    min-width: 0;
    border-radius: 3px;
  }
  .collage-photo.is-01 {
    grid-area: lead;
  }
  .collage-photo.is-02 {
    grid-area: interview;
  }
  .collage-photo.is-03 {
    grid-area: portrait;
  }
  .collage-photo.is-04 {
    grid-area: detail;
  }
  .collage-photo.is-05 {
    grid-area: last;
  }
  [data-scene='2'] .collage-photo.is-02 {
    width: 92%;
    justify-self: end;
  }
  [data-scene='2'] .collage-photo.is-04 {
    align-self: end;
  }
  [data-scene='2'] .collage-photo.is-05 {
    align-self: start;
  }
  [data-scene='1'] .collage-photo.is-05 {
    width: 51%;
    justify-self: end;
  }
}

.pullback-camera {
  display: contents;
}

/* The static contact sheet is also the end state of the desktop pullback. */
@media (min-width: 768px) and (min-height: 551px), (min-width: 768px) and (hover: hover) {
  [data-scene='2'].collage-scene {
    --camera-height: min(100svh, 88vw);
    display: block;
    height: var(--camera-height);
    padding: 0;
  }

  [data-scene='2'] .pullback-camera {
    container-type: size;
    position: relative;
    display: block;
    width: 100%;
    height: var(--camera-height);
    overflow: clip;
    isolation: isolate;
  }

  .pullback-camera .collage-photo.is-01 {
    inset: 4.5% auto auto 4%;
    width: min(37cqw, 50cqh);
  }

  .pullback-camera .collage-photo.is-02 {
    inset: 37% auto auto calc(45% - min(23.5cqw, 32.2cqh));
    width: min(47cqw, 64.4cqh);
  }

  .pullback-camera .collage-photo.is-03 {
    inset: 6% 4% auto auto;
    width: min(22cqw, 38cqh);
  }

  .pullback-camera .collage-photo.is-04 {
    inset: auto 7% 4% auto;
    width: min(22cqw, 30cqh);
  }

  .pullback-camera .collage-photo.is-05 {
    inset: auto auto 3.8% 12%;
    width: min(34cqw, 40cqh);
  }

  [data-scene='2'][data-pullback='wide'] {
    height: calc(var(--camera-height) + 46svh);
  }
  [data-pullback='wide'] .pullback-camera {
    position: sticky;
    top: 0;
  }

  [data-pullback='wide'] .pullback-camera .is-01 {
    z-index: 2;
    inset: 0 auto auto 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    transform-origin: top left;
    border-radius: 4px;
  }

  [data-pullback='wide'] .pullback-camera .is-01 img {
    inset: 50% auto auto 50%;
    width: 100%;
    height: auto;
    transform-origin: center;
    transform: translate3d(-50%, -50%, 0);
  }
  /* Until the scene's script starts, the first photograph fills the frame as it will once the
     script has it (the photograph is 1.6 wide to 1 high). On a slow connection it was drawn
     letterboxed on a tall screen, and grew when the script arrived. */
  [data-collage]:not([data-scene-motion]) [data-pullback='wide'] .pullback-camera .is-01 img {
    width: max(100%, calc(100cqh * 1.6));
  }
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) and (max-height: 550px) {
  [data-pullback='phone'] .pullback-camera .is-01 {
    width: calc(100% + var(--gutter) * 2);
    max-width: none;
    justify-self: center;
    transform-origin: center 58%;
    border-radius: 0;
  }
}
