html,
body,
#out {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    background: #121212;
}

#out {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

.smart4-loader {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #121212;
    pointer-events: none;
}

.smart4-loader__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
    width: min(1280px, 100vw, calc(100vh * 16 / 9));
    max-height: 720px;
    aspect-ratio: 16 / 9;
    padding: 16px 0;
}

.smart4-loader__art {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 0;
    flex: 1;
}

.smart4-loader__art img {
    display: block;
    width: min(600px, 92%);
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

.smart4-loader__progress {
    width: min(456px, 38%);
    height: 4px;
    flex: none;
    overflow: hidden;
    border-radius: 999px;
    background: #454545;
}

.smart4-loader__progress::after {
    content: "";
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: #1b5c9b;
    animation: smart4-progress 1.2s ease-in-out infinite;
}

.smart4-loader.splash-close {
    display: none;
}

.smart4-loader--failed .smart4-loader__progress {
    display: none;
}

.smart4-loader--failed::after {
    content: "The Smart4 web demo could not start. Please refresh the page.";
    position: absolute;
    bottom: 5vh;
    max-width: 90vw;
    color: #8b1d24;
    font: 600 1rem/1.4 system-ui, sans-serif;
    text-align: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes smart4-progress {
    from { transform: translateX(-110%); }
    to { transform: translateX(350%); }
}

@media (prefers-reduced-motion: reduce) {
    .smart4-loader__progress::after { animation-duration: 2.4s; }
}
