/* Dashboard intro (public/assets/intro.js).
 *
 * The whole film is one WebGL canvas: the white curtain cut along the arrow and
 * the 3D logo. Besides it the DOM only holds a white backing until the first
 * frame and a thin preparing indicator. There is no skip button: the intro
 * cannot be skipped, the white only fades out early after an error (si-out).
 */

html.si-on,
html.si-on body { overflow: hidden !important; }

/* The header logo waits until the 3D logo has turned into it. */
html.si-on .brand-logo { opacity: 0; }
html.si-on.si-land .brand-logo { opacity: 1; transition: opacity .34s ease; }

/* While the film runs, the page's endless animations pause, so a weak laptop
   does not spend frames on them. They resume once the logo has landed
   (si-open). The one time header entrance keeps running, so the logo lands in
   a finished header. */
html.si-on:not(.si-open) .backdrop *,
html.si-on:not(.si-open) .site-header::after,
html.si-on:not(.si-open) .site-header *::after { animation-play-state: paused !important; }

#si {
    position: fixed; inset: 0;
    z-index: 2147483000;
    overflow: hidden;
    user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .5s ease;
}
#si.si-out { opacity: 0; }

#si .si-back {
    position: absolute; inset: 0;
    background: #ffffff;
}

#si canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    pointer-events: none;
    transition: opacity .36s ease;
}
#si.si-landed canvas { opacity: 0; }

/* A thin indicator, only when preparing the 3D takes longer than a second. */
#si .si-load {
    position: absolute; left: 50%; top: 50%;
    width: 112px; height: 2px; margin: -1px 0 0 -56px;
    border-radius: 2px;
    background: rgba(0, 103, 90, .1);
    overflow: hidden;
    opacity: 0;
    transition: opacity .5s ease;
    pointer-events: none;
}
#si .si-load::after {
    content: ""; position: absolute; inset: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, #1aafa9, transparent);
    animation: si-load 1.3s cubic-bezier(.65, 0, .35, 1) infinite;
}
#si.si-wait .si-load { opacity: 1; }
@keyframes si-load {
    from { transform: translateX(-100%); }
    to   { transform: translateX(250%); }
}
