/* PNG hardware stays separate from the live interfaces inside its screen apertures. */
.device-scene {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 36px;
  position: relative;
  max-width: min(100%, max(980px, calc((100svh - 330px) * 2.2)));
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.monitor-device,
.laptop-device {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  inset: auto;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.monitor-device { grid-column: 2; grid-row: 1; }
.laptop-device { grid-column: 1; grid-row: 1; }

.monitor-frame,
.laptop-frame {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

/* Bounds measured on each original PNG; never stretch the hardware or aperture. */
.laptop-frame {
  aspect-ratio: 1536 / 1024;
  --screen-left: 10.416667%;
  --screen-top: 11.328125%;
  --screen-width: 79.231771%;
  --screen-height: 72.656250%;
}

.monitor-frame {
  aspect-ratio: 1374 / 1145;
  --screen-left: 3.347889%;
  --screen-top: 9.082969%;
  --screen-width: 93.377001%;
  --screen-height: 60.698690%;
}

.device-hardware {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.laptop-frame .codex-preview {
  position: absolute;
  z-index: 1;
  inset: auto;
  left: var(--screen-left);
  top: var(--screen-top);
  width: var(--screen-width);
  height: var(--screen-height);
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Captions are ordinary flow content, so neither device can cover them. */
.device-caption {
  order: 10;
  position: static;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  align-self: center;
  column-gap: 8px;
  min-height: 35px;
  margin-top: 20px;
  text-align: left;
  font-size: 11px;
  line-height: 1.4;
  color: #687281;
}

.device-caption-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border: 1px solid #dbe3ed;
  border-radius: 50%;
  background: #fff;
  color: #3b536e;
  font-size: 10px;
  font-weight: 650;
}

.device-caption strong {
  color: #344153;
  font-size: 12px;
  font-weight: 600;
}

.device-caption > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.device-caption > div > span {
  display: block;
}

/* Devices retain their real PNG proportions when the layout stacks. */
@media (max-width: 900px) {
  .device-scene {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
    justify-items: center;
    gap: 32px;
  }
  .monitor-device, .laptop-device { grid-column: 1; width: min(680px, 100%); }
  .laptop-device { grid-row: 1; }
  .monitor-device { grid-row: 2; }
  .device-caption { margin-top: 8px; }
}
