/* 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-stage[data-clickable="true"] { cursor: pointer; }

.m31-controls {
  position: absolute;
  z-index: 4;
  right: max(clamp(12px, 2vw, 30px), env(safe-area-inset-right));
  bottom: clamp(12px, 2vw, 26px);
  display: flex;
  align-items: center;
  gap: 8px;
}
.m31-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(29 30 29 / 89%);
  color: #fff;
  line-height: 1.1;
  font-weight: 500;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.m31-controls button:hover {
  background: rgb(20 22 20 / 98%);
  transform: translateY(-1px);
}
.m31-controls button:active {
  transform: translateY(0);
}
.m31-controls button:focus-visible { outline: 2px solid #50b965; outline-offset: 3px; }
.m31-controls button svg { width: 19px; height: 19px; flex: none; }
.m31-controls button span {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  white-space: nowrap; clip-path: inset(50%);
}
.m31-controls .m31-replay[data-start="true"] {
  width: auto;
  padding: 0 18px 0 14px;
  gap: 7px;
  border-radius: 999px;
  background: rgb(29 30 29 / 92%);
  box-shadow: 0 8px 22px rgb(0 0 0 / 12%);
}
.m31-controls .m31-replay[data-start="true"] span {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  font-size: 13.5px;
  font-weight: 560;
  letter-spacing: -.015em;
}
.m31-controls .m31-replay[data-start="true"] .start-icon {
  color: var(--product-accent-hover, #70ca80);
}
.m31-stage[data-clickable="true"]:hover .m31-replay[data-start="true"],
.m31-controls .m31-replay[data-start="true"]:hover {
  background: rgb(20 22 20 / 98%);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgb(0 0 0 / 18%);
}
.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 .m31-replay[data-start="true"] { padding: 0 15px 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .m31-controls button { transition: none; }
  .m31-controls button:hover,
  .m31-stage[data-clickable="true"]:hover .m31-replay[data-start="true"] { transform: none; }
}
