/* Interim devices: upright, never tilted. Also the fallback when a render is missing. */
/* Shared screen look. Not scoped to a device parent: composite() moves screens out of it. */
.screen { display: block; overflow: hidden; background: #000; object-fit: cover; object-position: top; }

.phone {
  position: relative;
  width: 300px;
  height: 620px;
  box-sizing: border-box;
  border-radius: 48px;
  background: #0a0a0a;
  border: 3px solid #2a2a2a;
  box-shadow: 0 60px 120px rgba(0, 0, 0, .55), inset 0 0 0 6px #111;
}
.phone .notch {
  position: absolute;
  top: 24px;
  left: 50%;
  width: 100px;
  height: 28px;
  margin-left: -50px;
  background: #000;
  border-radius: 18px;
  z-index: 2;
}
.phone .screen {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  border-radius: 36px;
}

.laptop { position: relative; width: 980px; }
.laptop .lid {
  border-radius: 18px 18px 0 0;
  background: #111;
  padding: 14px 14px 0;
  box-shadow: 0 60px 120px rgba(0, 0, 0, .45);
}
.laptop .screen {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px 10px 0 0;
}
.laptop .base {
  height: 22px;
  margin: 0 -40px;
  background: linear-gradient(#2b2b2b, #161616);
  border-radius: 0 0 14px 14px;
}

/* Static chat shown on the Thursday phone until the real render lands */
.screen.chat { background: #17212b; padding: 64px 14px 14px; box-sizing: border-box; color: #e6e6e6; font-size: 13px; line-height: 1.35; }
.chat-title { text-align: center; font-weight: 600; font-size: 14px; margin-bottom: 18px; }
.bubble { padding: 10px 12px; margin: 8px 0; }
.bubble.in { background: #182533; border-radius: 14px 14px 14px 4px; margin-right: 36px; }
.bubble.out { background: #2b5278; border-radius: 14px 14px 4px 14px; margin-left: 36px; }

/* Composited chats lose the CSS phone's notch, so they draw their own. */
.is-rendered > .screen.chat::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 100px;
  height: 28px;
  margin-left: -50px;
  background: #000;
  border-radius: 18px;
}
/* Bubbles that arrive live rise into place. */
.bubble.is-new { animation: bubble-in .36s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .bubble.is-new { animation: none; } }

/* Rendered scenes (see renders/README.md). The render covers the scene box, bottom-anchored, and
   composite() maps each screen through the same cover transform. Both fallback devices hide. */
.scene.is-rendered > .phone,
.scene.is-rendered > .laptop,
.scene.is-rendered > .slot { display: none; }
.scene .render {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
}
/* Device-sized scenes keep the replaced device's width (set by composite) and the render's ratio. */
.scene.is-rendered[data-fit="device"] { display: block; aspect-ratio: var(--render-ratio); }
