html {
    font-family: Sec, Roboto, Roboto-Regular, -apple-system, BlinkMacSystemFont, HelveticaNeue, LucidaGrande, sans-serif, system-ui;
}

html,
body,
#preload-wrapper {
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
}

.hide {
    display: none;
}

/* PRELOAD INTRO */

#preload-intro.hide {
    display: none;
}

#preload-intro {
    width: 100%;
    height: 100%;
    overflow-y: hidden;
    overflow-x: hidden;
    background-color: #f1f1f3;
    color: #252525;
    display: flex;
    flex-direction: column;
    animation: customloading 2s ease-in-out 0s infinite reverse;
}

#preload-intro > div {
    filter: blur(6px);
}

#preload-intro .preload-intro-text {
    flex: 1;
    margin-block: 64px 72px;
    padding: 0 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#preload-intro .preload-intro-text .title {
    font-size: 34px;
    font-weight: 600;
    text-align: center;
}

#preload-intro .preload-intro-text .subtitle {
    font-size: 16px;
    padding-block-start: 16px;
    text-align: center;
}

#preload-intro .preload-intro-illustration {
    width: 100%;
    height: fit-content;
}

#preload-intro .preload-intro-illustration .cards {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex-grow: 1;
    margin-block-end: 48px;
}

#preload-intro .preload-intro-illustration .cards .card {
    height: 115px;
    background-color: #fcfcff;
    border-radius: 18px;
    flex: 1;
}

#preload-intro .preload-intro-progress {
    height: 2px;
    width: 100%;
    margin-inline: 16px;
    margin-block-start: 24px;
    filter: blur(4px);
}

#preload-intro .preload-intro-progress div {
    height: 2px;
    width: 2%;
    background-color: rgba(71, 71, 74);
}

#preload-intro .preload-intro-button {
    height: 36px;
    width: 100%;
    margin-block-start: 12px;
    display: flex;
    flex-direction: row;
    justify-content: end;
}

#preload-intro .preload-intro-button div {
    color: #010102;
    font-size: 15px;
    height: 36px;
    margin-inline: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (prefers-color-scheme: dark) {
    #preload-intro {
        background-color: #010102;
        color: #fafafa;
    }

    #preload-intro .preload-intro-progress div {
        background-color: rgba(222, 222, 225);
    }

    #preload-intro .preload-intro-illustration .cards .card {
        background-color: #17171a;
    }

    #preload-intro .preload-intro-button div {
        color: #fafaff;
    }
}
@media screen and (min-width: 589px) {
    #preload-intro .preload-intro-text {
        padding: 0 25%;
    }
}
@media screen and (min-width: 960px) {
    #preload-intro {
        padding-block: 20px;
    }
}

@keyframes customloading {
    50% {
        opacity: .5;
    }
}

/* PRELOAD PLUGIN */

.preload-plugin.hide {
    display: none;
}

.preload-plugin {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    background-color: #f1f1f3;
}

.preload-plugin .preload-plugin-header {
    height: 80px;
    width: 100%;
    padding-block-start: 16px;
    display: flex;
    flex-direction: row;
}

.preload-plugin .preload-plugin-header .icon {
    width: 24px;
    height: 24px;
    margin-inline-start: 24px;
    margin-inline-end: 16px;
    margin-block: 20px;
    background: grey;
    border-radius: 50%;
    filter: blur(5px);
}

.preload-plugin .preload-plugin-header > .text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    filter: blur(5px);
}

.preload-plugin .preload-plugin-header > .text > .title {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    color: #010102;
}

.preload-plugin .preload-plugin-header > .text > .subtitle {
    margin: 0;
    font-size: 12px;
    font-weight: normal;
    color: rgb(102, 102, 102);
}

.preload-plugin .preload-plugin-body {
    flex: 1;
    width: 100%;
    overflow: hidden;
}

.preload-plugin .preload-plugin-body .card {
    display: block;
    height: 240px;
    background-color: #fcfcff;
    margin: 0 10px 24px;
    border-radius: 18px;
    flex: 1;
    animation: customloading 2s ease-in-out 0s infinite reverse;
    filter: blur(5px);
}

.preload-plugin .preload-plugin-footer {
    height: 60px;
    width: 100%;
    padding: 10px;
    display: flex;
    flex-direction: row;
    background-color: #f1f1f3;
}

.preload-plugin .preload-plugin-footer > .tab {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 17px;
    color: #01010266;
    filter: blur(5px);
}

.preload-plugin .preload-plugin-footer > .active.tab {
    text-decoration: underline;
    color: #010102;
}

/* Tablet Handling */

@media (prefers-color-scheme: dark) {
    .preload-plugin {
        background-color: #010102;
    }

    .preload-plugin .preload-plugin-header > .text > .title {
        color: #fafafa;
    }

    .preload-plugin .preload-plugin-footer {
        background-color: #010102;
    }

    .preload-plugin .preload-plugin-footer > .tab {
        color: #fafafa66;
    }

    .preload-plugin .preload-plugin-footer > .active.tab {
        color: #fafafa;
    }

    .preload-plugin .preload-plugin-body .card {
        background-color: #17171a;
    }
}

/* PRELOAD TOUR */

#preload-tour {
    --tour-bg: #f1f1f3;
    --tour-text: #252525;
    --tour-logo-color: rgb(1, 1, 2);
    --tour-description-color: rgb(1, 1, 2);
    --tour-button-primary-bg: rgb(56, 122, 255);
    --tour-button-primary-text: #ffffff;
    --tour-button-secondary-bg: rgb(228, 228, 231);
    --tour-button-secondary-text: #252525;
    width: 100%;
    height: 100%;
    background-color: var(--tour-bg);
    color: var(--tour-text);
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    overflow-x: hidden;
}

.preload-tour-body.nav-padding {
    /* Derived from st-space-* value. --st-inset-* come from the native system
       bar insets, set by applySystemBarInsets() in logic.html. */
    padding-block-start: var(--st-inset-top, 24px);
    padding-block-end: var(--st-inset-bottom, 48px);
}

#preload-tour.hide {
    display: none;
}

#preload-tour > div {
    filter: blur(4px);
}

#preload-tour .preload-tour-header {
    padding: 16px 8px 12px;
}

#preload-tour .preload-tour-body {
    height: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
}

#preload-tour .preload-tour-content {
    flex: 1;
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    box-sizing: border-box;
    height: calc(100% - 160px);
    padding-block-start: 64px;
    padding: 0 32px;
    flex-direction: column;
    justify-content: center;
}

#preload-tour .preload-tour-content-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 12px 0;
}

#preload-tour .preload-tour-logo {
    width: 222px;
    height: auto;
    margin-block-end: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tour-logo-color);
}

#preload-tour .preload-tour-logo svg {
    width: 100%;
    height: auto;
    display: block;
}

#preload-tour .preload-tour-description {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    font-size: 15px;
    line-height: 21px;
    color: var(--tour-description-color);
    margin: 0;
}

#preload-tour .preload-tour-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 32px 40px;
    box-sizing: border-box;
}

#preload-tour .preload-tour-buttons .preload-tour-button-primary,
#preload-tour .preload-tour-buttons .preload-tour-button-secondary {
    width: fit-content;
    max-width: 80vw;
    min-width: 200px;
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 600;
    box-sizing: border-box;
}

#preload-tour .preload-tour-buttons .preload-tour-button-primary {
    background-color: var(--tour-button-primary-bg);
    color: var(--tour-button-primary-text);
}

#preload-tour .preload-tour-buttons .preload-tour-button-secondary {
    background-color: var(--tour-button-secondary-bg);
    color: var(--tour-button-secondary-text);
}

@media (orientation: landscape) and (max-height: 588px) {
    #preload-tour .preload-tour-body {
        flex-direction: row;
    }

    #preload-tour .preload-tour-content {
        height: 100%;
        margin-block-end: 32px;
    }

    .preload-tour-body.nav-padding {
        /* Derived from st-space-* value. The 42px camera side stays hard-coded:
           it is a display cutout, which getSystemBarInsets() does not report. */
        padding-inline: 42px var(--st-inset-navbar-side, 48px);
        padding-block: unset;
    }

    [data-orientation-type="landscape-secondary"] .preload-tour-body.nav-padding {
        /* Rotated the other way, so the navigation bar and the camera swap edges. */
        padding-inline: var(--st-inset-navbar-side, 48px) 42px;
    }

    #preload-tour .preload-tour-buttons {
        flex: 1;
        justify-content: center;
        height: 100%;
        max-width: 320px;
    }

    #preload-tour .preload-tour-content-header {
        padding: 0;
    }
}
@media (prefers-color-scheme: dark) {
    #preload-tour {
        --tour-bg: #010102;
        --tour-text: #fafafa;
        --tour-logo-color: #fafaff;
        --tour-description-color: #fafaff;
        --tour-button-secondary-bg: rgb(58, 58, 61);
        --tour-button-secondary-text: #fafafa;
    }
}
@media screen and (min-width: 589px) and (min-height: 589px) {
    #preload-tour .preload-tour-buttons {
        .preload-tour-button-primary,
        .preload-tour-button-secondary {
            min-width: 240px;
        }
        padding-block-end: 100px;

        @media (orientation: landscape) {
            padding-block-end: 40px;
        }
    }
}
