/* Company landing: Instagram career posts on a tilted belt that keeps moving
   toward the viewer, its far end rising into the distance. The script places
   the cards each frame; without it they rest evenly spaced on the belt. */
.career-post-belt {
  position: absolute;
  inset: 0;
  container-type: size;
  overflow: hidden;
  /* Clips without a scroll box, so focusing a card cannot scroll the belt. */
  overflow: clip;
  /* Cards leaving at the near end fade out instead of stopping at the panel's
     left and lower edges; the far end runs off past the right edge. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%), linear-gradient(0deg, transparent, #000 18%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 30%), linear-gradient(0deg, transparent, #000 18%);
  mask-composite: intersect;
}

.career-post-belt__plane {
  /* Sized by the panel's height, and on narrow screens by its width; large
     enough that a post's own text reads on the card. */
  --belt-card-width: clamp(210px, min(60cqh, 93cqw), 495px);
  --belt-card-height: calc(var(--belt-card-width) * 462 / 326);
  --belt-pitch: calc(var(--belt-card-width) * 1.12);
  position: absolute;
  left: 56%;
  top: 50%;
  width: 0;
  height: 0;
  transform: perspective(170cqh) rotateX(42deg) rotateZ(-20deg);
  transform-origin: 0 0;
}

/* Tall, narrow panels (phones): smaller cards on a steeper belt, so more
   posts show at once and the belt spans more of the height. */
@container (max-aspect-ratio: 4/5) {
  .career-post-belt__plane {
    --belt-card-width: clamp(120px, 50cqw, 240px);
    left: 54%;
    top: 44%;
    transform: perspective(170cqh) rotateX(42deg) rotateZ(-30deg);
  }
}

/* The slot the script moves along the belt. */
.career-post-belt__card {
  position: absolute;
  left: 0;
  top: calc(var(--belt-card-height) / -2);
  width: var(--belt-card-width);
  height: var(--belt-card-height);
  transform: translate3d(calc((var(--belt-index) - var(--belt-count) / 2) * var(--belt-pitch)), 0, 0);
  will-change: transform;
}

/* What the viewer sees. Under the pointer it tilts as if pressed where the
   pointer rests, then settles back. */
.career-post-belt__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: calc(var(--belt-card-width) * 0.07);
  background: #fff;
  box-shadow: 0 0 0 1px rgb(15 23 42 / 6%), 0 22px 44px -22px rgb(15 23 42 / 60%);
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateZ(var(--tilt-z, 0px));
  transition: transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 600ms ease;
}

.career-post-belt__card.is-pressed .career-post-belt__face {
  --tilt-z: -18px;
  box-shadow: 0 0 0 1px rgb(15 23 42 / 8%), 0 12px 28px -18px rgb(15 23 42 / 70%);
  transition-duration: 180ms;
}

.career-post-belt__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 14% 12%;
  background: radial-gradient(circle at 18% 112%, #fdc468 0%, #df4996 46%, #4f5bd5 100%);
  color: #fff;
}

.career-post-belt__mark {
  position: absolute;
  top: 10%;
  left: 12%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid rgb(255 255 255 / 85%);
  border-radius: 9px;
  font-size: 11px;
  font-weight: var(--company-weight-figure, 700);
}

.career-post-belt__source {
  font-size: 10px;
  font-weight: var(--company-weight-strong, 600);
  letter-spacing: 0.12em;
  opacity: 0.8;
  text-transform: uppercase;
}

.career-post-belt__heading {
  font-size: 15px;
  font-weight: var(--company-weight-strong, 600);
  line-height: 1.25;
}

.career-post-belt__embed {
  position: absolute;
  inset: 0;
}

/* Instagram's narrowest embed, scaled to the card and cut below the photo. */
.career-post-belt__embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 326px;
  height: 616px;
  border: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transform: scale(var(--belt-embed-scale, 0.6));
  transform-origin: 0 0;
  transition: opacity 500ms ease;
}

.career-post-belt__card.is-loaded .career-post-belt__embed iframe {
  opacity: 1;
}

.career-post-belt__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.career-post-belt__link:focus-visible {
  outline: 3px solid #ef4444;
  outline-offset: -3px;
}

.career-post-belt__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: rgb(255 255 255 / 70%);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .career-post-belt__face {
    transition: none;
  }
}

/* The panel's perspective served the 3D carousel this belt replaces. Left in
   place, Chrome hit-tests the cards away from where it paints them, so a click
   near a card's edge would land on its neighbour or on nothing. */
#solutions[data-company-solutions] #offer-panel-jobs {
  perspective: none;
}

/* Desktop solution scene: the belt runs on under the copy on the left, faint
   and softly blurred there, so the posts stream in from the copy's side. */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  #solutions[data-company-solutions] #what-we-offer[data-company-jobs-scene="true"] [data-offer-stage] {
    overflow: visible;
  }

  #solutions[data-company-solutions] #what-we-offer[data-company-jobs-scene="true"] #offer-panel-jobs {
    width: 100vw;
  }

  #solutions[data-company-solutions] #what-we-offer[data-company-jobs-scene="true"] :is(.landing-offer-detail-column, [data-offer-card-window]) {
    position: relative;
    z-index: 2;
  }

  /* An opacity hint would confine the frost below to the column itself. */
  #solutions[data-company-solutions] #what-we-offer[data-company-jobs-scene="true"] .landing-offer-detail-column {
    will-change: transform;
  }

  #solutions[data-company-solutions] #what-we-offer[data-company-jobs-scene="true"] .career-post-belt {
    -webkit-mask-image: linear-gradient(90deg, transparent 2%, rgb(0 0 0 / 22%) 12%, rgb(0 0 0 / 24%) 40%, #000 56%),
      linear-gradient(0deg, transparent, #000 16%);
    mask-image: linear-gradient(90deg, transparent 2%, rgb(0 0 0 / 22%) 12%, rgb(0 0 0 / 24%) 40%, #000 56%),
      linear-gradient(0deg, transparent, #000 16%);
  }

  #solutions[data-company-solutions] #what-we-offer[data-company-jobs-scene="true"] .career-post-belt__plane {
    left: 62%;
    top: 50%;
  }

  /* Frosts the posts passing behind the jobs copy so it stays easy to read. */
  #solutions[data-company-solutions] #what-we-offer[data-company-jobs-scene="true"] [data-offer-detail="jobs"] {
    position: relative;
  }

  #solutions[data-company-solutions] #what-we-offer[data-company-jobs-scene="true"] [data-offer-detail="jobs"]::before {
    content: "";
    position: absolute;
    inset: -56px -72px;
    z-index: -1;
    background: radial-gradient(closest-side, rgb(255 255 255 / 55%), rgb(255 255 255 / 0%));
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
    mask-image: radial-gradient(closest-side, #000 55%, transparent);
    pointer-events: none;
  }
}
