.landing-demo {
    --demo-bezel: #17171b;
    width: min(14rem, 31svh, 100%);
    aspect-ratio: 390 / 844;
    margin-inline: auto;
    padding: 5px;
    border: 1px solid #ffffff55;
    border-radius: clamp(1.5rem, 4.5svh, 2.1rem);
    background: var(--demo-bezel);
    box-shadow: 0 10px 27px #24163645;
    container-type: inline-size;
}

.landing-demo-screen {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: clamp(1.2rem, 4svh, 1.8rem);
    padding: 7.2cqw 6.2cqw;
    background: linear-gradient(90deg, #5872ff, #f868c9);
    color: #fff;
    text-align: left;
}

.landing-demo-screen::before,
.landing-demo-screen::after {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    content: '';
}

.landing-demo-screen::before {
    top: 2.75cqw;
    width: 32%;
    height: 8.2cqw;
    background: var(--demo-bezel);
    border-radius: 999px;
}

.landing-demo-screen::after {
    bottom: 2.7cqw;
    width: 33%;
    height: 1.3cqw;
    background: #ffffffc9;
    border-radius: 999px;
}

.landing-demo-centerpiece {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 49%;
}

.landing-demo-heading {
    margin-bottom: 5.1cqw;
    font-size: 8cqw;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.landing-demo-field,
.landing-demo-action {
    padding: 3.9cqw 5.1cqw;
    border-radius: 4.1cqw;
    font-size: 4.6cqw;
    line-height: 1.55;
}

.landing-demo-field {
    border: 1px solid #ffffff4d;
    background: #ffffff1a;
    color: #fff9;
}

.landing-demo-action {
    margin-top: 3.1cqw;
    background: #fff;
    color: #000;
    font-weight: 600;
    text-align: center;
}

.landing-demo-votes {
    margin-top: 4.1cqw;
    font-size: 4.3cqw;
    font-weight: 600;
}

.landing-demo-votes small {
    display: block;
    margin-top: 3.5cqw;
    color: #fff9;
    font-size: 3.6cqw;
    font-weight: 400;
    line-height: 1.4;
}

@media (max-width: 768px) {
    /* Safari can sample the page canvas before the welcome controls are visible. */
    html.app-viewport {
        --landing-edge: #a86ddf;
        background: var(--landing-edge);
    }

    body.djq-layout {
        background-color: var(--landing-edge);
    }

    body:has(#authModal[style*="display: block"] #homeChoices:not([style*="display: none"])) {
        padding-block: 0;
        background: var(--landing-edge);
    }

    #mainContainer:has(#authModal[style*="display: block"] #homeChoices:not([style*="display: none"])) {
        background: linear-gradient(to bottom, var(--landing-edge), transparent 3rem, transparent calc(100% - 3rem), var(--landing-edge)),
                    linear-gradient(90deg, #5872ff, #f868c9);
    }

    #authModal:has(#homeChoices:not([style*="display: none"])) {
        padding: 0 !important;

        /* Reserve the controls' actual heights and give the phone the remaining row. */
        & .dj-home-container {
            display: grid;
            height: 100svh;
            min-height: 0;
            grid-template-rows: auto minmax(8rem, 1fr) auto auto;
            justify-content: stretch;
            justify-items: center;
            align-items: center;
            gap: 0.5rem;
            padding: max(0.75rem, env(safe-area-inset-top)) 0 max(0.75rem, env(safe-area-inset-bottom));
        }

        & .dj-home-logo-wrap { display: none; }
        & .dj-home-content, & .dj-home-content > div, & #homeChoices, & .landing-demo-preview {
            display: contents;
        }

        & #homeChoices > *, & .landing-demo-switch { margin-block: 0; }
        & .landing-demo {
            width: auto;
            height: 100%;
            max-width: 100%;
            margin: 0;
        }

        & .partner-logos-mobile {
            margin: 0;
            padding: 0;
            border: 0;
            flex-wrap: nowrap !important;
        }

        & .partner-logos-mobile p {
            flex-basis: auto;
            width: auto;
            margin: 0;
        }

        & .partner-logo-wrap { width: 2.75rem; height: 2.75rem; }
    }
}

.landing-demo-preview [hidden] { display: none !important; }

#authModal .landing-create-button {
    display: block;
    width: fit-content;
    max-width: 100%;
    min-height: 48px;
    margin-inline: auto;
}

@media (hover: hover) and (pointer: fine) {
    #authModal .landing-create-button:hover {
        background-color: #f7f3ff;
        box-shadow: inset 0 0 0 2px #d9c9f5;
    }
}

@media (prefers-reduced-motion: no-preference) {
    #authModal .landing-create-button {
        transition: background-color 150ms ease, box-shadow 150ms ease;
    }
}

.landing-demo-request { height: 100%; }

.landing-demo-screen::before,
.landing-demo-screen::after {
    z-index: 4;
    pointer-events: none;
}

.landing-demo-field.is-focused {
    border-color: #fff;
    color: #fff;
    white-space: nowrap;
}
.landing-demo-field.is-focused::after {
    content: '';
    display: inline-block;
    height: 1em;
    border-right: 1px solid currentColor;
    margin-left: 1px;
    vertical-align: -0.1em;
}
.landing-demo-request.is-typing .landing-demo-votes { visibility: hidden; }

.landing-demo-keyboard {
    position: absolute;
    inset: auto 0 0;
    padding: 4cqw 2cqw 7cqw;
    background: #d1d4dc;
    color: #17171b;
    display: grid;
    gap: 1.7cqw;
}
.landing-demo-key-row {
    display: flex;
    justify-content: center;
    gap: 1cqw;
}
.landing-demo-key {
    display: grid;
    place-items: center;
    width: 8.5cqw;
    height: 11cqw;
    border-radius: 1.3cqw;
    background: #fff;
    box-shadow: 0 1px #858b9b;
    font-size: 4.9cqw;
}
.landing-demo-key.is-pressed {
    background: #6b7280;
    color: #fff;
    transform: translateY(-0.8cqw);
}
.landing-demo-key--space { width: 49cqw; }

.landing-demo-tip,
.landing-demo-payment {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    padding: 8cqw 6.2cqw;
    text-align: center;
    font-size: 4.4cqw;
}
.landing-demo-tip { background: linear-gradient(90deg, #5872ff, #f868c9); }
.landing-demo-sheet-title {
    font-size: 7cqw;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 2.5cqw;
}
.landing-demo-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2cqw;
    margin: 5cqw 0 4cqw;
}
.landing-demo-amounts span {
    padding: 3cqw 0;
    border: 1px solid #ffffff80;
    border-radius: 2cqw;
}
.landing-demo-tip.is-selected .landing-demo-amounts span:last-child {
    color: #17171b;
    background: #fff;
}
.landing-demo-tip-amount {
    display: flex;
    justify-content: space-between;
    opacity: 0;
}
.landing-demo-tip.is-selected .landing-demo-tip-amount { opacity: 1; }
.landing-demo-pay {
    margin-top: 4cqw;
    padding: 3cqw;
    border-radius: 3cqw;
    background: #111;
    color: #fff;
    font-weight: 600;
}
.landing-demo-payment { background: #111827b8; }
.landing-demo-wallet {
    padding: 7cqw 5cqw;
    border-radius: 5cqw;
    background: #fff;
    color: #17171b;
}
.landing-demo-wallet-status {
    margin: 3cqw 0;
    color: #176234;
    font-weight: 700;
}
.landing-demo-wallet small { color: #4b5563; }
.landing-demo-action.is-pressed,
.landing-demo-pay.is-pressed {
    transform: scale(0.96);
    opacity: 0.82;
}

.landing-demo-search { position: relative; }

.landing-demo-field {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.landing-demo-field.has-song { color: #fff; }

.landing-demo-suggestion {
    position: absolute;
    z-index: 2;
    inset: calc(100% + 1cqw) 0 auto;
    max-height: 30cqw;
    overflow-y: auto;
    border: 1px solid #ffffff55;
    border-radius: 3cqw;
    background: #252038;
    box-shadow: 0 2cqw 5cqw #20152a66;
    font-size: 4.15cqw;
    animation: landing-demo-suggestion-in 180ms ease-out both;
}

.landing-demo-suggestion-row {
    display: flex;
    align-items: center;
    gap: 2.5cqw;
    min-height: 13cqw;
    padding: 2cqw 2.5cqw;
}

.landing-demo-suggestion-row + .landing-demo-suggestion-row {
    border-top: 1px solid #ffffff24;
}

.landing-demo-suggestion-row > div { min-width: 0; }

.landing-demo-suggestion-title,
.landing-demo-suggestion-artist {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes landing-demo-suggestion-in {
    from { opacity: 0; translate: 0 -1.5cqw; }
    to { opacity: 1; translate: 0 0; }
}

.landing-demo-suggestion-row.is-pressed {
    background: #4b3b64;
    transform: scale(0.97);
}

.landing-demo-track-icon {
    flex: 0 0 9cqw;
    display: grid;
    height: 9cqw;
    place-items: center;
    background: #ffffff20;
    border-radius: 2cqw;
}

.landing-demo-suggestion-title,
.landing-demo-suggestion-artist {
    display: block;
    line-height: 1.2;
}

.landing-demo-suggestion-artist {
    margin-top: 0.5cqw;
    color: #ffffffb8;
    font-size: 3.6cqw;
}

.landing-demo-vote-list {
    display: grid;
    gap: 1.7cqw;
    margin-top: 2.2cqw;
    list-style: none;
}

.landing-demo-vote-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1cqw;
    padding: 1.8cqw 2.3cqw;
    border: 1px solid #ffffff30;
    border-radius: 2.5cqw;
    background: #ffffff24;
    font-size: 3.9cqw;
    line-height: 1.2;
}

.landing-demo-vote-list small {
    margin-top: 0.5cqw;
    font-size: 3.3cqw;
    line-height: 1.2;
}

.landing-demo-vote-count {
    white-space: nowrap;
    color: #fffd;
}

@property --demo-switch-progress {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
}

.landing-demo-switch {
    --demo-switch-position: 0;
    --demo-switch-progress: var(--demo-switch-drag, var(--demo-switch-position));
    --demo-switch-dj-weight: calc((1 - var(--demo-switch-progress)) * 100%);
    position: relative;
    isolation: isolate;
    display: inline-grid;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 0.55rem;
    padding: 3px;
    border: 1px solid #ffffff65;
    border-radius: 999px;
    background: #2b1b5352;
    background: color-mix(in srgb, #243b7370 var(--demo-switch-dj-weight), #701e566f);
    box-shadow: inset 0 1px 4px #26184542, 0 3px 12px #2a195e24;
    touch-action: pan-y;
    user-select: none;
    cursor: grab;
}

.landing-demo-switch:has([data-demo-view="guest"][aria-pressed="true"]) {
    --demo-switch-position: 1;
}

.landing-demo-switch::before {
    position: absolute;
    z-index: -1;
    inset: 3px auto 3px 3px;
    width: calc(50% - 3px);
    border-radius: 999px;
    background: #e6d9ff;
    background: color-mix(in srgb, #c4dbff var(--demo-switch-dj-weight), #ffd1ed);
    box-shadow: 0 2px 6px #27174850, inset 0 0 0 1px #fff;
    transform: translateX(calc(var(--demo-switch-progress) * 100%));
    content: '';
}

#authModal .landing-demo-switch button {
    min-width: 3.85rem;
    min-height: 30px;
    padding: 0.15rem 0.65rem !important;
    border-radius: 999px;
    color: #fff;
    font-size: 0.8rem !important;
    font-weight: 650;
    cursor: inherit;
}

#authModal .landing-demo-switch button[aria-pressed="true"] { color: #2b1c48; }
#authModal .landing-demo-switch button:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.landing-demo-switch.is-dragging { cursor: grabbing; }

@media (prefers-reduced-motion: no-preference) {
    .landing-demo-switch:not(.is-dragging) {
        transition: --demo-switch-progress 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
    }
}

.landing-demo-guest { height: 100%; }

.landing-demo-dj {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #f3f4f6;
    color: #374151;
    font-size: 5cqw;
}

.landing-demo-success { position: absolute; inset: 0; background: #211531; }

.landing-demo-dj iframe,
.landing-demo-success iframe {
    position: absolute;
    inset: 0;
    width: 390px;
    max-width: none;
    border: 0;
    transform: scale(var(--demo-frame-scale, 1));
    transform-origin: top left;
    pointer-events: none;
}

.landing-demo:has(.landing-demo-dj:not([hidden])) .landing-demo-screen::after {
    background: #111827;
}

@media (prefers-color-scheme: dark) {
    .landing-demo-dj { background: #111827; color: #e5e7eb; }
    .landing-demo:has(.landing-demo-dj:not([hidden])) .landing-demo-screen::after { background: #ffffffc9; }
}

.landing-demo { position: relative; }

.landing-demo.is-confirming-payment::after {
    position: absolute;
    top: 26%;
    right: -3px;
    width: 3px;
    height: 12%;
    border-radius: 0 3px 3px 0;
    background: #d2c2ff;
    content: '';
}

.landing-demo.is-pressing-side::after {
    right: -1px;
    background: #fff;
}

.landing-demo-payment {
    align-content: end;
    padding: 0;
}

.landing-demo-wallet {
    padding: 6cqw 6cqw 9cqw;
    border-radius: 6cqw 6cqw 0 0;
    text-align: left;
}

.landing-demo-screen:has(.landing-demo-payment:not([hidden]))::after {
    background: #111827;
}

.landing-demo-wallet-card,
.landing-demo-payment-amount {
    display: flex;
    align-items: center;
    gap: 3cqw;
    padding: 3cqw 0;
    border-bottom: 1px solid #e5e7eb;
}

.landing-demo-wallet-card > span:first-child {
    display: grid;
    place-items: center;
    width: 14cqw;
    height: 9cqw;
    border-radius: 1.6cqw;
    color: #fff;
    background: #6552a4;
}

.landing-demo-wallet-card small { display: block; }

.landing-demo-payment-amount { justify-content: space-between; }
.landing-demo-wallet-status {
    color: #241847;
    text-align: center;
}
.landing-demo-payment.is-paid .landing-demo-wallet-status { color: #176234; }
.landing-demo-wallet > small { display: block; text-align: center; }

/* Finishes shared by the phone scenes. */
.landing-demo {
    background: linear-gradient(140deg, #393340, var(--demo-bezel) 28% 72%, #393340);
    box-shadow: 0 12px 30px #24163653, inset 0 0 0 1px #85808b55;
}
.landing-demo-screen { box-shadow: inset 0 0 0 1px #ffffff40; }
.landing-demo-track-icon {
    background: linear-gradient(145deg, #ac8bff55, #ec83ce45);
    box-shadow: inset 0 0 0 1px #ffffff28;
}
.landing-demo-vote-count {
    padding: 1cqw 1.7cqw;
    border-radius: 999px;
    background: #ffffff19;
}
.landing-demo-keyboard { box-shadow: 0 -2cqw 7cqw #30234f38; }
.landing-demo-key { box-shadow: 0 1px #858b9b, inset 0 1px #fff; }
.landing-demo-tip.is-selected .landing-demo-amounts span:last-child {
    box-shadow: 0 1.5cqw 4cqw #3d237755;
}
.landing-demo-pay { box-shadow: inset 0 1px #ffffff35, 0 1.7cqw 4cqw #2b144244; }
.landing-demo-wallet { box-shadow: 0 -2cqw 10cqw #17112b33, inset 0 1px #fff; }

.landing-demo-camera {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) 25%;
    overflow: hidden;
    background: #111019;
    color: #fff;
}

.landing-demo-viewfinder {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 15% 12%, #f5a46692 0, transparent 40%),
        radial-gradient(ellipse at 88% 38%, #ba5b8f80 0, transparent 40%),
        linear-gradient(145deg, #302643, #171523 62%);
}

.landing-demo-camera-mode {
    position: absolute;
    top: 15cqw;
    left: 5cqw;
    padding: 1.1cqw 2.8cqw;
    border: 1px solid #ffffff4d;
    border-radius: 999px;
    background: #211a31b3;
    font-size: 4cqw;
    font-weight: 600;
}

.landing-demo-camera-target {
    position: relative;
    display: grid;
    place-items: center;
    width: 64cqw;
    aspect-ratio: 1;
}

.landing-demo-camera-sign {
    display: grid;
    justify-items: center;
    gap: 2.5cqw;
    width: 82%;
    padding: 3.4cqw;
    border-radius: 3cqw;
    background: #fff;
    color: #211a31;
    box-shadow: 0 4cqw 10cqw #1010198c;
    font-size: 4.5cqw;
    font-weight: 750;
    transform: rotate(-5deg) scale(0.95);
}

.landing-demo-camera-sign img { width: 35cqw; height: 35cqw; }

.landing-demo-scan-guides {
    position: absolute;
    inset: 0;
    --scan-color: #ffffffab;
    --scan-corner: linear-gradient(var(--scan-color), var(--scan-color));
    background:
        var(--scan-corner) left top / 9cqw 0.8cqw,
        var(--scan-corner) left top / 0.8cqw 9cqw,
        var(--scan-corner) right top / 9cqw 0.8cqw,
        var(--scan-corner) right top / 0.8cqw 9cqw,
        var(--scan-corner) left bottom / 9cqw 0.8cqw,
        var(--scan-corner) left bottom / 0.8cqw 9cqw,
        var(--scan-corner) right bottom / 9cqw 0.8cqw,
        var(--scan-corner) right bottom / 0.8cqw 9cqw;
    background-repeat: no-repeat;
}

.landing-demo-camera.has-scan .landing-demo-scan-guides { --scan-color: #ccf99a; }

.landing-demo-camera-link {
    position: absolute;
    bottom: 7cqw;
    display: flex;
    align-items: center;
    gap: 2.5cqw;
    padding: 2.5cqw 5cqw;
    border: 1px solid #f3e7ff;
    border-radius: 999px;
    background: #e9dcff;
    color: #2d1b4f;
    box-shadow: 0 2cqw 6cqw #0d091966;
    font-size: 4.6cqw;
}

.landing-demo-camera-link.is-pressed { transform: scale(0.92); background: #d4beff; }

.landing-demo-camera-controls {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3cqw;
    color: #d9c9fc;
    font-size: 3.8cqw;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.landing-demo-camera-shutter {
    width: 14cqw;
    height: 14cqw;
    border: 1.1cqw solid #fff;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 57%, transparent 59%);
}

@media (prefers-reduced-motion: no-preference) {
    .landing-demo-camera.is-scanning .landing-demo-camera-sign {
        animation: landing-demo-camera-focus 800ms ease-out both;
    }
    .landing-demo-camera-link:not([hidden]) { animation: landing-demo-suggestion-in 180ms ease-out both; }

    @keyframes landing-demo-camera-focus {
        from { transform: translate(-3cqw, 2cqw) rotate(-10deg) scale(0.8); filter: blur(1.3px); }
        to { transform: rotate(-5deg) scale(0.95); filter: blur(0); }
    }
}
