.ecosystem-hero .hero-device-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  align-items: start;
  container-type: inline-size;
}

.hero-photo-device {
  position: relative;
  filter: drop-shadow(0 15px 22px #0008);
}

.hero-photo-device img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-photo-laptop {
  grid-area: 1 / 1;
  width: 92%;
  margin-inline-start: 1%;
}

.hero-photo-phone {
  grid-area: 2 / 1;
  z-index: 1;
  width: min(22.5%, 154px);
  margin: calc(-1 * clamp(46px, 12cqw, 85px)) 0 0 1%;
  transform: rotate(-5deg);
  transform-origin: center 90%;
}

.hero-photo-tablet {
  grid-area: 2 / 1;
  justify-self: end;
  z-index: 1;
  width: min(73%, 465px);
  margin: calc(-1 * clamp(62px, 16cqw, 108px)) -2% 0 0;
  container-type: inline-size;
}

.hero-tablet-screen {
  position: absolute;
  inset: 5.05% 3.24% 4.925% 3.403%;
  /* Display opening and graph placement in the composited tablet images. */
  --graph-top: 18.7%;
  --graph-bottom: 2.3%;
}

.hero-tablet-message,
.hero-tablet-peaks {
  position: absolute;
  top: 0;
  height: var(--graph-top);
  display: flex;
  align-items: center;
  padding: 0 2.3%;
}

.hero-tablet-message {
  left: 0;
  right: 29%;
  gap: 2cqw;
}

.hero-tablet-check {
  position: relative;
  display: grid;
  flex: 0 0 clamp(14px, 5.3cqw, 22px);
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid #b82741;
  border-radius: 50%;
  background: #3a1822;
  color: #f3f3f5;
  font-size: clamp(9px, 2.9cqw, 12px);
  line-height: 1;
}

.hero-tablet-message strong,
.hero-tablet-message small {
  display: block;
}

.hero-tablet-message strong {
  color: #f3f3f5;
  font-size: clamp(10px, 3.85cqw, 16px);
  line-height: 1.15;
}

.hero-tablet-message small {
  margin-top: 2px;
  color: #b8bbc6;
  font: 500 clamp(7px, 2.65cqw, 11px)/1.2 var(--mono);
}

.hero-tablet-chart {
  position: absolute;
  inset: var(--graph-top) 1.5% var(--graph-bottom);
  border-radius: 3px;
  cursor: zoom-in;
}

.hero-tablet-chart:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.hero-tablet-peaks {
  right: 0;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 2px;
  color: #f3f3f5;
  font: 600 clamp(8px, 2.65cqw, 11px)/1.2 var(--mono);
  white-space: nowrap;
}

.hero-tablet-peaks small {
  color: #b8bbc6;
  font: inherit;
  font-size: .75em;
}

.hero-device-stage .ecosystem-device-caption {
  position: static;
  grid-area: 3 / 1;
  justify-self: end;
  margin: 12px -2% 0 0;
}

@media (max-width: 650px) {
  .ecosystem-hero .hero-device-stage {
    grid-template-columns: clamp(65px, 20vw, 110px) minmax(0, 1fr);
    gap: 8px 10px;
    padding: 9px 0 0;
  }

  .hero-photo-laptop {
    grid-area: 1 / 1 / 2 / -1;
    justify-self: center;
    width: 96%;
    margin: 0;
  }

  .hero-photo-phone {
    grid-area: 2 / 1;
    width: 100%;
    margin: -17px 0 0;
    transform: rotate(-3deg);
  }

  .hero-photo-tablet {
    grid-area: 2 / 2;
    width: 100%;
    margin: -28px 0 0;
  }

  .hero-tablet-screen {
    --graph-top: 20.7%;
    --graph-bottom: 11.5%;
  }

  .hero-tablet-message { right: 0; }

  .hero-tablet-message strong {
    font-size: clamp(9px, 4.1cqw, 14px);
  }

  .hero-tablet-peaks {
    inset: auto 0 0;
    height: var(--graph-bottom);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .hero-device-stage .ecosystem-device-caption {
    grid-area: 3 / 1 / 4 / -1;
    margin: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-photo-phone {
    --arrival-x: -9px;
    --arrival-delay: 125ms;
  }

  .hero-photo-tablet {
    --arrival-x: 11px;
    --arrival-delay: 220ms;
  }

  .hero-photo-device.hero-photo-arrived {
    animation: hero-device-arrival 620ms cubic-bezier(.2, .74, .25, 1)
      var(--arrival-delay, 0ms) backwards;
  }

  .hero-tablet-check::after {
    position: absolute;
    inset: -1px;
    border: 1px solid #eb1840;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    content: "";
  }

  .hero-photo-arrived .hero-tablet-check::after {
    animation: hero-graph-ready 490ms ease-out 790ms;
  }

  @keyframes hero-device-arrival {
    from {
      opacity: .24;
      translate: var(--arrival-x, 0px) 16px;
      scale: .982;
    }
    to {
      opacity: 1;
      translate: 0 0;
      scale: 1;
    }
  }

  @keyframes hero-graph-ready {
    from { opacity: .88; scale: .92; }
    to { opacity: 0; scale: 1.75; }
  }
}

@media (max-width: 650px) and (prefers-reduced-motion: no-preference) {
  .hero-photo-phone { --arrival-x: -4px; --arrival-delay: 25ms; }
  .hero-photo-tablet { --arrival-x: 5px; --arrival-delay: 90ms; }
  .hero-photo-arrived .hero-tablet-check::after { animation-delay: 650ms; }
}
