/* careers on a phone: the climb and the people */
/* the head and the stair share one box, so a phone can pin them as one screen. above a phone it has no box of its own and
   both stay on the section's grid */
.careers-climb { display: contents; }

@media (max-width: 900px) {
  /* without script, with reduced motion or on a phone lying down, the climb is a list: each step under its own tread */
  .careers-path { --rise: clamp(56px, 8.6svh, 96px); --tread: 40vw; display: block; align-content: normal; min-height: 0; padding: 104px var(--gutter) 96px; }
  .careers-path-head { margin-bottom: 48px; font-size: clamp(36px, 10.4vw, 56px); line-height: .98; }
  .careers-steps { display: grid; grid-template-columns: none; row-gap: 48px; }
  .careers-step { --at: 200ms; margin: 0; padding: 22px 0 0; gap: 14px; }
  .careers-step::before { left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); }
  .careers-step + .careers-step::after { display: none; }
  .careers-step h3 { font-size: clamp(30px, 8.6vw, 44px); line-height: 1; }
  .careers-step p { max-width: 34ch; font-size: 18px; line-height: 1.38; }
  /* the room: the eight clients in two rows of four, as large as a phone's width lets them stand */
  .careers-room { --logo: clamp(46px, 7vw, 64px); --cap: clamp(30px, 4.6vw, 40px); grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: start; gap: 22px 12px; width: 100%; margin-top: 18px; }
  .careers-room img { max-width: 100%; }

  /* the face runs edge to edge (a tablet caps it at the screen's height) with the name across the shirt, and the button that
     names who comes next stands under the name, in the thumb's reach. the story follows tight under the face */
  .careers-story { --face: min(100vw, 46.8svh); --face-h: calc(var(--face) * 1280 / 768); padding: 0 0 64px; }
  .careers-story-slide { height: auto; padding: 0; }
  .careers-story-face { position: relative; left: 50%; width: var(--face); height: auto; aspect-ratio: 768 / 1280; transform: translateX(-50%); }
  .careers-story-portrait img { object-position: 50% 100%; }
  .careers-story-name { bottom: 13cqh; font-size: min(24cqh, 37cqw); }
  .careers-story-nav { top: calc(var(--face-h) - 64px); right: calc((100vw - var(--face)) / 2 + var(--gutter)); left: auto; bottom: auto; z-index: 2; }
  .careers-story-nav .box { min-height: 48px; padding: 0 22px; font-size: 16px; background: var(--ink); }
  .careers-story-copy { position: static; width: auto; max-width: min(max(var(--face) - 2 * var(--gutter), 30rem), 100vw - 2 * var(--gutter)); margin: 28px auto 0; padding: 0; }
  .careers-story-body { gap: .6em; font-size: 18px; line-height: 1.4; }
  .careers-story-turn { margin-top: .7em; font-size: clamp(32px, 9vw, 44px); line-height: 1; }
  .careers-story-quote { margin-top: 48px; padding-top: 20px; }
  .careers-story-quote p { max-width: none; font-size: clamp(24px, 6.7vw, 32px); line-height: 1.16; letter-spacing: -.02em; }
  .careers-story-quote footer { margin-top: 16px; font-size: 16px; }
}
/* a phone lying down: the face is small, so the button stands under it rather than over the name */
@media (max-width: 900px) and (max-height: 559px) {
  .careers-story-nav { top: calc(var(--face-h) + 16px); right: calc((100vw - var(--face)) / 2); }
  .careers-story-copy { margin-top: 84px; }
}

/* with script and room to stand, the head and the stair pin as one screen and the scroll climbs it: each quarter of the run
   brings the next step onto the tread under the head while the stair steps down and to the left, and the treads still
   ahead rise to the right (careers.js sets --step and .is-at) */
@media (max-width: 900px) and (min-height: 560px) {
  .careers-path.is-climb { --rise: clamp(60px, 12svh, 160px); height: calc(100svh + 4 * 42svh); padding: 0; }
  .is-climb .careers-climb { position: sticky; top: 0; display: block; height: 100svh; padding: 92px var(--gutter) 0; overflow: clip; }
  .is-climb .careers-path-head { margin: 0; font-size: clamp(34px, min(10vw, 5.4svh), 72px); }
  /* the step on the tread stands two rises under the head, so the treads ahead climb into the space beside it */
  .is-climb .careers-steps { position: relative; display: block; margin: calc(2 * var(--rise) + clamp(40px, 9svh, 140px) + max(0px, 30svh - 270px)) calc(-1 * var(--gutter)) 0; }
  .is-climb .careers-step h3 { font-size: clamp(36px, min(11vw, 6.4svh), 88px); }
  .is-climb .careers-step p { max-width: none; font-size: clamp(18px, min(5.4vw, 2.6svh), 30px); }
  /* the top step is the summit: no tread ahead, its own runs out of both edges and its words stand at poster size */
  .is-climb .careers-step:last-child h3 { font-size: clamp(56px, min(17vw, 10svh), 140px); line-height: .9; letter-spacing: -.045em; }
  .is-climb .careers-step { --at: calc(var(--k) * 320ms); position: absolute; top: 0; left: 0; width: 100vw; padding: 22px var(--gutter) 0; transform: translate3d(calc((var(--k) - var(--step, 0)) * (var(--tread) + var(--gap))), calc((var(--step, 0) - var(--k)) * var(--rise)), 0); transition: transform .9s cubic-bezier(.32, .72, 0, 1); }
  .is-climb .careers-step::before { left: calc(-1 * var(--gap)); right: auto; width: calc(var(--tread) + var(--gap)); }
  .is-climb .careers-step:last-child::before { width: calc(100vw + var(--gap)); }
  .is-climb .careers-step + .careers-step::after { display: block; }
  /* only the step on the tread speaks; the others leave fast and the next one rises once the stair has settled */
  .is-climb .careers-step > * { opacity: 0; transform: translate3d(0, 20px, 0); transition: opacity .24s var(--ease), transform .4s var(--ease); }
  .is-climb .careers-step.is-at > * { opacity: 1; transform: none; transition: opacity .8s var(--ease) .42s, transform 1s var(--ease) .42s; }
  .is-climb .careers-step.is-at > :nth-child(2) { transition-delay: .52s; }
  .is-climb .careers-step.is-at > :nth-child(3) { transition-delay: .62s; }
}
