:root {
    --ink: #17243b;
    --purple: #7556d8;
    --cream: #f7f6f2;
    --line: #e7e4df
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: Inter, Arial, sans-serif
}

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

.brand {
    display: flex;
    align-items: center;
    font: 700 24px Georgia;
}

.brand b {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 20px 5px 20px 5px;
    background: var(--purple);
    color: #fff;
    font-style: italic;
}

.brand span {
    color: #b8a4ff
}

.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr
}

.login-hero {
    padding: 44px 7vw;
    color: #fff;
    background: linear-gradient(145deg, #221947, #5e43a5);
    display: flex;
    flex-direction: column
}

.login-hero>div {
    margin: auto 0
}

.login-hero small,
.welcome small {
    color: #c9baf8;
    letter-spacing: 2px;
    font-weight: 800
}

.login-hero h1 {
    font: 400 clamp(50px, 6vw, 82px)/.98 Georgia;
    margin: 20px 0
}

.login-hero em {
    color: #cbbcff
}

.login-hero p {
    max-width: 480px;
    color: #ddd7ef;
    line-height: 1.7
}

.login-form {
    display: grid;
    place-items: center;
    padding: 30px
}

.login-form form {
    width: min(420px, 100%)
}

.login-form h2 {
    font: 400 38px Georgia;
    margin: 15px 0 7px
}

.login-form p {
    color: #7c8490
}

.login-form label {
    display: grid;
    gap: 8px;
    margin: 20px 0;
    font-size: 12px;
    font-weight: 700
}

.login-form input {
    height: 50px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 8px
}

.login-form button {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 8px;
    background: var(--purple);
    color: #fff;
    font-weight: 800
}

.error {
    padding: 10px;
    background: #fff0ed;
    color: #ad4d40;
    border-radius: 7px;
    font-size: 12px
}

.portal {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: 72px auto 60px
}

.topbar {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 220px minmax(240px, 520px) 1fr;
    align-items: center;
    padding: 0 28px;
    background: #fff;
    border-bottom: 1px solid var(--line)
}

.menu-button {
    display: none
}

.search {
    display: flex;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 8px
}

.search input {
    border: 0;
    outline: 0;
    width: 100%
}

.profile {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 9px
}

.profile i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ddd3c7;
    font-size: 10px;
    font-style: normal
}

.profile p {
    margin: 0
}

.profile strong,
.profile small {
    display: block
}

.profile small {
    color: #888;
    font-size: 9px
}

.profile a {
    color: var(--purple);
    font-size: 9px;
    font-weight: 800
}

.sidebar {
    padding: 28px 17px;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 28px
}

.sidebar nav {
    display: grid;
    gap: 4px
}

.sidebar small {
    padding: 0 11px 8px;
    color: #999;
    font-size: 8px;
    letter-spacing: 1.4px
}

.sidebar a {
    padding: 12px;
    border-radius: 7px;
    color: #657081;
    font-size: 12px
}

.sidebar a:hover,
.sidebar a.active {
    background: #f0ecfa;
    color: var(--purple);
    font-weight: 700
}

.content {
    padding: 42px clamp(22px, 4vw, 60px)
}

footer {
    grid-column: 1/-1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 35px;
    background: #fff;
    border-top: 1px solid var(--line);
    color: #888;
    font-size: 9px
}

.welcome h1 {
    font: 400 30px Georgia;
    margin: 10px 0
}

.welcome p {
    color: #828995
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 13px;
    margin: 30px 0
}

.stats article,
.cards article {
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px
}

.stats b,
.stats span {
    display: block
}

.stats b {
    font: 500 23px Georgia
}

.stats span {
    margin-top: 8px;
    color: #888;
    font-size: 9px;
    text-transform: uppercase
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px
}

.cards i {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: #eee9fa;
    color: var(--purple);
    font-style: normal;
    font-weight: 800
}

.cards h2 {
    font: 500 18px Georgia
}

.cards p {
    color: #858c95;
    font-size: 11px
}

.cards a {
    color: var(--purple);
    font-size: 10px;
    font-weight: 800
}

.viewer {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 620px;
    margin-top: 24px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff
}

.viewer aside {
    padding: 18px;
    overflow: auto
}

.viewer aside h2 {
    font: 500 17px Georgia
}

.viewer aside label {
    display: grid;
    gap: 8px;
    margin: 15px 0;
    font-size: 10px;
    font-weight: 800
}

.viewer aside input {
    width: 100%
}

.viewer aside button {
    padding: 9px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer
}

.viewer aside>button {
    width: 100%;
    margin: 5px 0
}

.viewer #scene {
    position: relative;
    min-height: 620px;
    background: #17152a
}

.viewer #scene canvas {
    width: 100% !important;
    height: 100% !important
}

.viewer-help {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 8px 12px;
    border-radius: 15px;
    background: #241f3dbb;
    color: #ddd;
    font-size: 9px
}

.move {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px
}

.row {
    display: flex;
    gap: 4px;
    margin: 10px 0
}

.row button {
    flex: 1;
    font-size: 8px
}

#objectList {
    display: grid;
    gap: 6px
}

#objectList button {
    display: flex;
    gap: 8px;
    align-items: center;
    text-align: left
}

#objectList button.active {
    background: #f0ecfa;
    border-color: #bbaee0
}

#objectList i {
    width: 10px;
    height: 10px;
    border-radius: 50%
}

@media(max-width:760px) {
    .login {
        grid-template-columns: 1fr
    }

    .login-hero {
        min-height: 320px
    }

    .portal {
        display: block;
        padding-top: 64px
    }

    .topbar {
        position: fixed;
        z-index: 10;
        top: 0;
        width: 100%;
        height: 64px;
        display: flex;
        padding: 0 16px
    }

    .menu-button {
        display: block
    }

    .search {
        display: none
    }

    .profile {
        margin-left: auto
    }

    .profile p {
        display: none
    }

    .sidebar {
        position: fixed;
        z-index: 9;
        top: 64px;
        left: 0;
        width: 250px;
        height: calc(100vh - 64px);
        transform: translateX(-105%);
        transition: .2s
    }

    .sidebar.open {
        transform: none
    }

    .stats {
        grid-template-columns: 1fr 1fr
    }

    .cards {
        grid-template-columns: 1fr
    }

    .viewer {
        grid-template-columns: 1fr
    }

    .viewer #scene {
        min-height: 480px
    }

    footer {
        padding: 20px
    }
}