/* FROM — banner: five stories, one photograph each, all graded in FROM ink and orange. */

.hero {
  --dur: 7s;
  position: relative;
  height: max(680px, min(100svh, 980px));
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
  color: #fff;
}

/* ---------- Photographs ---------- */

.hero__shots {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.shot {
  /* Framing per photo: --s zoom, --t sideways shift (moves the subject clear of the words), --flip mirrors. */
  --s: 1.1;
  --t: 0%;
  --flip: 1;
  --pos: 50% 40%;
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}

.shot.is-active {
  opacity: 1;
  z-index: 1;
}

/* Some photos come in a wide version and a tall one for phones (<picture>), so the screens in them stay in view. */
.shot picture {
  display: block;
  width: 100%;
  height: 100%;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos);
  filter: url(#grade);
  transform: scale(calc(var(--flip) * var(--s)), var(--s)) translateX(var(--t));
}

/* A slow push-in while a story is on screen. */
.shot.is-active img {
  animation: drift calc(var(--dur) + 1.2s) linear both;
}

.hero.is-paused .shot img {
  animation-play-state: paused;
}

@keyframes drift {
  from {
    transform: scale(calc(var(--flip) * (var(--s) + 0.07)), calc(var(--s) + 0.07)) translateX(var(--t));
  }
}

/* She and the laptop sit right of centre; on narrower screens the crop keeps them and drops the empty wall on the left. */
.shot--companies {
  --s: 1;
  --pos: 74% 45%;
}

/* Screens wider than the photo crop its top and bottom: keep her head in, and move her a little clear of the words. */
@media (min-width: 761px) and (min-aspect-ratio: 3/2) {
  .shot--companies {
    --s: 1.12;
    --t: 5%;
    --pos: 74% 12%;
  }
}

.shot--send {
  --s: 1.16;
  --t: 6.5%;
  --pos: 50% 50%;
}

.shot--track {
  --s: 1.2;
  --t: 8%;
  --pos: 50% 40%;
}

.shot--handover {
  --s: 1;
  --pos: 50% 30%;
}

.shot--ride {
  --s: 1.22;
  --t: 8.5%;
  --pos: 50% 18%;
}

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 13, 23, 0.45) 0%, rgba(7, 13, 23, 0) 20%),
    linear-gradient(90deg, rgba(7, 13, 23, 0.7) 0%, rgba(7, 13, 23, 0.36) 34%, rgba(7, 13, 23, 0) 58%),
    linear-gradient(0deg, rgba(7, 13, 23, 0.6) 0%, rgba(7, 13, 23, 0) 24%);
}

/* ---------- Words ---------- */

.hero__inner {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  padding-top: 112px;
  padding-bottom: 32px;
}

.hero__stories {
  display: grid;
  align-self: center;
}

.story {
  grid-area: 1 / 1;
  max-width: 720px;
  visibility: hidden;
  transition: visibility 0s 0.45s;
}

.story.is-active {
  visibility: visible;
  transition-delay: 0s;
}

.story__title {
  margin: 0;
  font-size: clamp(48px, 6.2vw, 112px);
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.05em;
}

.story__mark {
  display: inline-block;
  margin: 0 0 0.06em -0.1em;
  padding: 0.01em 0.12em 0.07em 0.1em;
  border-radius: 0.06em;
  background: var(--orange);
  color: var(--ink);
  white-space: nowrap;
}

.story__lede {
  max-width: 32ch;
  margin-top: 26px;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.btn--lg {
  height: 56px;
  padding: 0 28px;
  font-size: 17px;
}

.story__cta {
  margin-top: 32px;
}

/* Entrance and exit of each story. */
.story__mark,
.story__rest,
.story__lede,
.story__cta {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.3s, transform 0.4s var(--ease-out), clip-path 0.3s;
}

.story__rest {
  transform: none;
}

.story__mark {
  clip-path: inset(0 100% 0 0);
  transform: none;
}

.story.is-active :is(.story__mark, .story__rest, .story__lede, .story__cta) {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out), clip-path 0.9s var(--ease-out);
}

.story.is-active .story__mark {
  clip-path: inset(0 0 0 0);
  transition-delay: 0.25s;
}
.story.is-active .story__rest {
  transition-delay: 0.4s;
}
.story.is-active .story__lede {
  transition-delay: 0.55s;
}
.story.is-active .story__cta {
  transition-delay: 0.65s;
}

/* ---------- Story tabs, pause, stamp ---------- */

.hero__foot {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  flex: 1;
  max-width: 760px;
}

.tab {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0 8px;
  text-align: left;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.3s;
}

.tab:hover,
.tab[aria-selected="true"] {
  color: #fff;
}

.tab__label {
  display: flex;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.tab__label i {
  font-style: normal;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}

.tab__bar {
  position: relative;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.tab__bar span {
  position: absolute;
  inset: 0;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
}

.hero__pause {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin-bottom: 2px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  transition: border-color 0.2s;
}

.hero__pause:hover {
  border-color: #fff;
}

.hero__pause svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  fill: none;
}

.hero__pause .i-play {
  display: none;
  fill: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.hero.is-paused .hero__pause .i-pause {
  display: none;
}

.hero.is-paused .hero__pause .i-play {
  display: block;
}

.stamp {
  position: relative;
  flex: none;
  width: 124px;
  height: 124px;
  margin-left: auto;
}

.stamp > svg {
  width: 100%;
  height: 100%;
  animation: spin 26s linear infinite;
}

.stamp text {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  fill: #fff;
}

.stamp__mark {
  position: absolute;
  inset: 26%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
}

.stamp__mark svg {
  width: 48%;
  height: 48%;
  fill: #fff;
}

.hero.is-paused .stamp > svg {
  animation-play-state: paused;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Phone: photo on top, words at the bottom ---------- */

@media (max-width: 760px) {
  .hero {
    height: max(720px, 100svh);
  }

  .shot {
    --s: 1;
    --t: 0%;
  }

  .shot--companies {
    --pos: 50% 0%;
  }

  .shot--send {
    --pos: 50% 25%;
  }

  .shot--track {
    --pos: 20% 0%;
  }

  .shot--handover {
    --pos: 55% 0%;
  }

  .shot--ride {
    --pos: 30% 50%;
  }

  .hero__shade {
    background:
      linear-gradient(180deg, rgba(7, 13, 23, 0.45) 0%, rgba(7, 13, 23, 0) 18%),
      linear-gradient(0deg, rgba(7, 13, 23, 0.9) 0%, rgba(7, 13, 23, 0.72) 32%, rgba(7, 13, 23, 0) 60%);
  }

  .hero__inner {
    padding-top: 92px;
    padding-bottom: 20px;
  }

  .hero__stories {
    align-self: end;
    margin-bottom: 22px;
  }

  .story__title {
    font-size: clamp(40px, 12vw, 60px);
  }

  .story__lede {
    margin-top: 14px;
    font-size: 16px;
  }

  .story__cta {
    margin-top: 20px;
  }

  .btn--lg {
    height: 50px;
    padding: 0 22px;
    font-size: 16px;
  }

  /* Five tabs on a phone: each takes the width of its word, and the spare room is shared out. */
  .tabs {
    grid-template-columns: repeat(5, auto);
    gap: 10px;
  }

  .tab__label {
    font-size: 13px;
  }

  .tab__label i,
  .stamp {
    display: none;
  }

  .hero__pause {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 360px) {
  .tabs {
    gap: 8px;
  }

  .tab__label {
    font-size: 11.5px;
  }
}
