@import url("https://fonts.cdnfonts.com/css/gilroy-bold");

:root {
    font-family: Gilroy-Medium, system-ui, Avenir, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    font-weight: 400;

    color-scheme: light dark;
    color: rgba(255, 255, 255, 0.87);
    background-color: #242424;

    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    --progress: 0%;
    --blue-color: #4cb2ff;
}

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

#canvas-main {
    position: absolute;
    inset: 0;
}

/* LOADER */

#loader {
    max-width: 100vw;
    position: fixed;
    inset: 0;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    font-size: 1.5rem;
    z-index: 10;
    background:
        repeating-radial-gradient(
            circle,
            transparent,
            transparent 5.9px,
            rgba(255, 255, 255, 0.09) 5.9px,
            rgba(255, 255, 255, 0.09) 7.7px
        ),
        repeating-radial-gradient(
            circle,
            transparent,
            transparent 5.9px,
            rgba(255, 255, 255, 0.09) 5.9px,
            rgba(255, 255, 255, 0.09) 7.7px
        ), #000;
    background-size: 34px 34px;
}

/* light from top with animation */

#loader:after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 11;
    background: url("./images/loader-bg.webp") no-repeat center center;
    background-size: cover;
    pointer-events: none;
}

#loader .person {
    width: 98px;
    height: 118px;
    background: url("./images/person.png") no-repeat 46px 0;
    -webkit-animation:
        900ms play steps(8) infinite,
        15s step linear infinite;
    animation:
        900ms play steps(8) infinite,
        15s step linear infinite;
    -webkit-filter: invert(100%);
    filter: invert(100%);
    position: absolute;
    bottom: 0;
    left: 0;
    will-change: transform;
}

@-webkit-keyframes play {
    100% {
        background-position: -751px;
    }
}

@keyframes play {
    100% {
        background-position: -751px;
    }
}

@-webkit-keyframes step {
    0%,
    100% {
        bottom: 0;
        left: -100px;
        transform: rotateY(0deg);
    }

    49.99% {
        top: unset;
        bottom: 0;
        transform: rotateY(0deg);
    }

    50% {
        left: calc(100vw);
        transform: rotateY(180deg);
    }

    99.99% {
        transform: rotateY(180deg);
    }
}

@keyframes step {
    0%,
    100% {
        bottom: 0;
        left: -100px;
        transform: rotateY(0deg);
    }

    49.99% {
        top: unset;
        bottom: 0;
        transform: rotateY(0deg);
    }

    50% {
        left: calc(100vw);
        transform: rotateY(180deg);
    }

    99.99% {
        transform: rotateY(180deg);
    }
}

#loader-message {
    position: relative;
}

#loader-message:after {
    content: "";
    display: block;
    position: absolute;
    background-color: white;
    width: var(--progress);
    height: 2px;
    bottom: -0.5rem;
}

footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

button {
    background-color: transparent;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
}

#tooltip {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transition:
        opacity 500ms ease,
        left 100ms ease,
        top 100ms ease;
    -o-transition:
        opacity 500ms ease,
        left 100ms ease,
        top 100ms ease;
    transition:
        opacity 500ms ease,
        left 100ms ease,
        top 100ms ease;
    opacity: 0;
    visibility: hidden;
}

#tooltip.active {
    opacity: 1;
    visibility: visible;
}

#tooltip iframe {
    max-width: 90vw;
    max-height: 50vh;
}

.controls button {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    color: var(--blue-color);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    transform-origin: top left;
    border: none;
    cursor: pointer;
}

.controls button svg {
    pointer-events: none;
}

.controls .button-previous {
    right: auto;
    left: 50px;
    -ms-transform: translateY(-50%) scaleX(-1);
    transform: translateY(-50%) scaleX(-1);
}

#info-panel {
    position: absolute;
    bottom: 5px;
    left: 5px;
    width: 400px;
    max-width: calc(100vw - 10px);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 1rem;
    border-radius: 0.5rem;
    color: var(--blue-color);
    font-size: 0.875rem;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 1rem;
    border-width: 3px;
    border-style: solid;
    border-image-source: linear-gradient(
        to left,
        var(--blue-color) 0%,
        rgba(0, 0, 0, 0) 100%
    );
    border-image-slice: 1;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-select: none;
}

#info-panel h2 {
    margin-bottom: 0.5rem;
}
