:root {
    color-scheme: light;
}

body.mobile-demo-preview {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    background: #ffffff;
    color: #14213d;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mobile-demo-shell {
    display: grid;
    grid-template-rows: 78px minmax(0, 1fr);
    min-height: 100vh;
    background: #ffffff;
}

.mobile-demo-toolbar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px clamp(24px, 3vw, 48px);
}

.mobile-demo-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    color: #111827;
    text-decoration: none;
}

.mobile-demo-brand img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 2px;
    object-fit: cover;
}

.mobile-demo-brand > span {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.mobile-demo-brand > span span {
    color: #ff3636;
}

.mobile-demo-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.mobile-demo-actions a {
    color: #25375b;
    text-decoration: none;
    transition: color 160ms ease;
}

.mobile-demo-actions a:hover,
.mobile-demo-actions a:focus-visible {
    color: #ef3434;
}

.mobile-demo-actions a:focus-visible,
.mobile-demo-brand:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(239, 52, 52, 0.24);
    outline-offset: 4px;
}

.mobile-demo-actions span {
    width: 1px;
    height: 22px;
    background: #cbd2dd;
}

.mobile-demo-stage {
    display: grid;
    min-height: 0;
    place-items: center;
    padding: 4px 24px 28px;
}

.mobile-demo-device-fit {
    position: relative;
    width: 414px;
    height: 868px;
}

.mobile-demo-device {
    --device-scale: 1;
    position: relative;
    box-sizing: border-box;
    width: 414px;
    height: 868px;
    padding: 10px;
    border: 2px solid #111318;
    border-radius: 48px;
    background: linear-gradient(105deg, #090a0c 0%, #34373b 47%, #0a0b0d 100%);
    box-shadow:
        0 26px 52px rgba(15, 23, 42, 0.16),
        0 8px 16px rgba(15, 23, 42, 0.1),
        inset 0 0 0 2px rgba(255, 255, 255, 0.14),
        inset 0 0 0 5px rgba(0, 0, 0, 0.9);
    transform: scale(var(--device-scale));
    transform-origin: top left;
}

.mobile-demo-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid #050607;
    border-radius: 38px;
    background: #080d1a;
}

.mobile-demo-screen iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #080d1a;
}

.mobile-demo-camera {
    position: absolute;
    top: 12px;
    left: 50%;
    z-index: 4;
    width: 17px;
    height: 17px;
    border: 3px solid #0b0d10;
    border-radius: 50%;
    background: radial-gradient(circle at 58% 38%, #52647f 0 8%, #0b111a 28%, #020304 68%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    pointer-events: none;
    transform: translateX(-50%);
}

.mobile-demo-side-button {
    position: absolute;
    right: -6px;
    width: 4px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, #15171a, #5c6066 54%, #15171a);
    box-shadow: 1px 0 1px rgba(0, 0, 0, 0.45);
}

.mobile-demo-side-button-volume {
    top: 18%;
    height: 88px;
}

.mobile-demo-side-button-power {
    top: 31%;
    height: 56px;
}

@media (min-width: 721px) and (max-height: 980px) {
    .mobile-demo-device-fit {
        width: 393px;
        height: 825px;
    }

    .mobile-demo-device {
        --device-scale: 0.95;
    }
}

@media (min-width: 721px) and (max-height: 900px) {
    .mobile-demo-device-fit {
        width: 352px;
        height: 738px;
    }

    .mobile-demo-device {
        --device-scale: 0.85;
    }
}

@media (min-width: 721px) and (max-height: 820px) {
    .mobile-demo-device-fit {
        width: 311px;
        height: 651px;
    }

    .mobile-demo-device {
        --device-scale: 0.75;
    }
}

@media (max-width: 720px) {
    body.mobile-demo-preview {
        overflow: auto;
    }

    .mobile-demo-shell {
        grid-template-rows: 68px minmax(0, 1fr);
    }

    .mobile-demo-toolbar {
        padding: 14px 18px;
    }

    .mobile-demo-brand {
        gap: 8px;
    }

    .mobile-demo-brand img {
        width: 34px;
        height: 34px;
    }

    .mobile-demo-brand > span {
        font-size: 18px;
    }

    .mobile-demo-actions {
        gap: 10px;
        font-size: 12px;
    }

    .mobile-demo-actions span {
        height: 18px;
    }

    .mobile-demo-stage {
        padding: 0 12px 18px;
    }

    .mobile-demo-device {
        border-radius: 42px;
    }

    .mobile-demo-screen {
        border-radius: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-demo-actions a {
        transition: none;
    }
}
