/* A line from the actual prompt leads from the hero into the first device. */
.device-intro {
  background: #f2f2ee;
  color: var(--warm-ink);
  padding: clamp(48px, 6.5vw, 104px) max(24px, calc((100% - 1120px) / 2)) clamp(28px, 3vw, 48px);
}
.device-intro h2 {
  margin: 0;
  font-size: clamp(27px, 3.1vw, 46px);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.23;
  text-wrap: balance;
}
.device-intro p {
  max-width: 44em;
  margin: 13px 0 0;
  color: var(--warm-muted);
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.6;
  text-wrap: pretty;
}
.memory31 {
  position: relative;
  margin: 0;
  width: 100%;
  color: var(--warm-ink);
}

.m31-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--warm-paper);
}

@media (max-width: 860px) {
  /* The intro link lands before the square stage reaches its playback position. */
  .device-intro {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(50svh - 50vw + 76px);
  }
  .m31-stage { aspect-ratio: 1; }
}

.m31-stage moai-device-story, .m31-ending {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.m31-ending {
  display: block;
  object-fit: contain;
  visibility: hidden;
  pointer-events: none;
}

.m31-stage[data-presented] .m31-ending { visibility: visible; }

.m31-stage[data-presented] moai-device-story { visibility: hidden; }

.m31-controls {
  position: absolute;
  z-index: 4;
  right: clamp(12px, 2vw, 30px);
  bottom: clamp(12px, 2vw, 26px);
  display: flex;
  gap: 8px;
}
.m31-controls button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 15px;
  border: 0;
  border-radius: 24px;
  background: rgba(26,26,26,.88);
  color: #fff;
  line-height: 1.1;
  font-weight: 500;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.m31-controls button:focus-visible { outline: 2px solid #50b965; outline-offset: 3px; }
.m31-sound[data-audible="false"] .sound-on, .m31-sound[data-audible="true"] .sound-off { display: none; }
.m31-replay[data-start="true"] .replay-icon,
.m31-replay[data-start="false"] .start-icon { display: none; }
.m31-replay .start-icon { fill: currentColor; stroke: none; }
@media (max-width: 400px) {
  .m31-controls { gap: 6px; }
  .m31-controls button { padding-inline: 11px; }
}
.m31-controls { right: max(12px, env(safe-area-inset-right)); gap: 6px; }
.m31-controls button {
  width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%;
  justify-content: center; background: rgb(29 30 29 / 89%);
}
.m31-controls button svg { width: 19px; height: 19px; }
.m31-controls button span {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  white-space: nowrap; clip-path: inset(50%);
}
