

:root {
    --dark: #0b0d12;

    --text: #ffffff;
    --muted: #8b919d;

    --line: #252932;
    --line-light: #30343d;

    --accent: #635bff;
    --accent-dark: #5148e8;

    --topbar-h: 52px;
}




* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: "DM Sans", sans-serif;
    color: var(--text);
    background: var(--dark);

    overflow: hidden;
    overscroll-behavior: none;

    -webkit-tap-highlight-color: transparent;
}

button,
a {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}




.project-page {
    width: 100%;
    height: 100vh;
    height: 100dvh;

    display: flex;
    flex-direction: column;

    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(99, 91, 255, .055),
            transparent 30%
        ),
        var(--dark);

    overflow: hidden;
}




.topbar {
    flex: 0 0 auto;
    height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding:
        env(safe-area-inset-top, 0px)
        max(12px, env(safe-area-inset-right, 0px))
        0
        max(12px, env(safe-area-inset-left, 0px));
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}




.back-link {
    min-width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: flex-start;

    color: #d9dce3;

    transition:
        color .2s ease,
        transform .2s ease;
}

.back-link:hover {
    color: #fff;
    transform: translateX(-3px);
}

.back-link:active {
    transform: translateX(-5px);
}




.start-project {
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 0 12px;

    border-radius: 9px;

    color: #fff;
    background: var(--accent);

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;

    box-shadow: 0 8px 22px rgba(99, 91, 255, .17);

    transition:
        transform .25s ease,
        background .25s ease,
        box-shadow .25s ease;
}

.start-project:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(99, 91, 255, .25);
}

.button-arrow {
    font-size: 15px;
}




.preview-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.preview-control {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--line);
    border-radius: 8px;

    color: var(--muted);
    background: #101319;

    font-size: 15px;
    line-height: 1;

    cursor: pointer;

    transition:
        color .2s ease,
        border-color .2s ease,
        background .2s ease,
        transform .2s ease;
}

.preview-control:hover {
    color: #fff;
    border-color: var(--line-light);
    background: #171a21;
    transform: translateY(-1px);
}

.open-preview {
    display: none;
}




.preview-area {
    flex: 1;
    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;

    padding:
        0
        max(10px, env(safe-area-inset-right, 0px))
        max(10px, env(safe-area-inset-bottom, 0px))
        max(10px, env(safe-area-inset-left, 0px));
}




.browser {
    min-width: 0;
    min-height: 0;

    flex: 1;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid #292d36;
    border-radius: 16px;

    background: #0e1015;
}

.browser-screen {
    position: relative;

    min-width: 0;
    min-height: 0;

    flex: 1;

    background: #0e1015;

    overflow: hidden;
}

.browser-screen iframe {
    width: 100%;
    height: 100%;

    display: block;

    border: 0;

    background: #fff;

    opacity: 0;

    transition: opacity .35s ease;
}

.browser-screen iframe.loaded {
    opacity: 1;
}




.browser:fullscreen {
    border: 0;
    border-radius: 0;
    background: #fff;
}

.browser:fullscreen .browser-screen {
    height: 100%;
}




.loading-screen {
    position: absolute;
    inset: 0;
    z-index: 5;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;

    color: #858b96;
    background: #101319;

    font-size: 11px;
    font-weight: 600;

    transition:
        opacity .35s ease,
        visibility .35s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 23px;
    height: 23px;

    border: 2px solid #2a2e37;
    border-top-color: var(--accent);

    border-radius: 50%;

    animation: spinner .75s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}




@media (max-height: 500px) and (orientation: landscape) {

    :root {
        --topbar-h: 42px;
    }

    .topbar {
        height: var(--topbar-h);
        padding-top: 0;
    }

    .back-link {
        height: 32px;
    }

    .preview-control,
    .start-project {
        height: 30px;
    }

    .preview-control {
        width: 30px;
    }

    .preview-area {
        padding:
            0
            max(8px, env(safe-area-inset-right, 0px))
            8px
            max(8px, env(safe-area-inset-left, 0px));
    }

    .browser {
        border-radius: 12px;
    }

}
