/* Scrolling app showcase, shared by the product pages. Loaded after the page's
   own styles. Pages whose nav is not sticky set --stick-top: 0px. */

.showcase { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.showcase .steps { min-width: 0; }
.showcase .step { min-width: 0; }

/* Captions: each beat is tall enough to hold the trigger line on its own. */
.beats { display: grid; margin-top: 8px; }
.beat { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; max-width: 46ch; }
.beat h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; }
.beat p { color: var(--text-secondary); }

/* Product name pins under the nav while its captions scroll. */
.stick-title { display: none; }
.step.has-beats .stick-title {
    display: block;
    position: sticky;
    top: var(--stick-top, 68px);
    z-index: 5;
    background: var(--bg-deep, var(--bg, #fff));
    margin: 0;
    padding: 10px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--hairline, var(--border, rgba(127, 127, 127, 0.3)));
}

/* The pinned stage on wide screens. */
.stage {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stage .visual {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    transition: opacity 0.55s ease, transform 0.55s ease;
    pointer-events: none;
}
.stage .visual.on { opacity: 1; transform: none; pointer-events: auto; }
.steps .visual { display: none; }

/* Phone frame */
.phone {
    width: min(290px, 72vw);
    padding: 10px;
    border-radius: 44px;
    background: #05080d;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 90px -30px rgba(0, 0, 0, 0.7);
}
html[data-theme="light"] .phone { box-shadow: 0 0 0 1px rgba(19, 26, 38, 0.2), 0 40px 90px -30px rgba(19, 26, 38, 0.45); }
.phone .screen { position: relative; aspect-ratio: 506 / 1100; border-radius: 35px; overflow: hidden; background: #000; }
.phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s ease; }
.phone .screen img.on { opacity: 1; }

/* Landscape games get a wide frame */
.phone.landscape { width: min(560px, 100%); border-radius: 34px; }
.phone.landscape .screen { aspect-ratio: 1200 / 554; border-radius: 26px; }

/* Mobile: one pinned card with the phone, the live caption and progress dots. */
.live-caption { display: none; }
@media (max-width: 900px) {
    .showcase { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .stage { display: none; }
    .step.has-beats { padding-top: 12px; }
    .step.has-beats .stick-title {
        top: var(--stick-top, 60px);
        margin-inline: calc(-1 * var(--gutter, 24px));
        padding-inline: var(--gutter, 24px);
    }
    .has-beats .visual {
        position: sticky;
        top: calc(var(--stick-top, 60px) + 43px);
        z-index: 4;
        display: grid;
        grid-template-columns: 42% minmax(0, 1fr);
        gap: 16px;
        align-items: center;
        justify-items: start;
        padding: 14px 0;
        background: var(--bg-deep, var(--bg, #fff));
    }
    .has-beats .visual:has(.phone.landscape) { grid-template-columns: minmax(0, 1fr); }
    .has-beats .phone { width: 100%; padding: 7px; border-radius: 34px; }
    .has-beats .phone .screen { border-radius: 28px; }
    .has-beats .phone.landscape { width: 100%; padding: 7px; border-radius: 26px; }
    .has-beats .phone.landscape .screen { border-radius: 20px; }
    .live-caption { display: grid; gap: 12px; min-width: 0; }
    .live-text h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
    .live-text p { font-size: 0.9rem; line-height: 1.5; color: var(--text-secondary); }
    .dots { display: flex; gap: 6px; }
    .dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--hairline, rgba(127, 127, 127, 0.4)); transition: background 0.25s; }
    .dots span.on { background: var(--blue-bright, var(--accent, #3b9eff)); }
    .beat { min-height: 52vh; justify-content: flex-end; padding-bottom: 8vh; }
    /* With JS, the beats become invisible scroll spacers; their text lives in the card. */
    .js .beat { min-height: 60vh; padding: 0; }
    .js .beat > * { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .stage .visual { transition: opacity 0.2s; transform: none; }
    .phone .screen img { transition: none; }
}
