#nlyze-splash {
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

/* make the svg fill the viewport and avoid clipping; preserve aspect ratio to fit */
svg.logo {
    width: 90vw;
    height: 90vh;
    display: block;
    overflow: visible;
    position: fixed;
    /* move the logo down by 50% of the viewport */
    top: 10vh;
    left: 10vw;
    box-shadow: none;
}

/* main Lyze: hidden until the last 2 seconds (80%->100% of a 10s timeline) */
#lyze {
    opacity: 0;
    fill: #000;
    animation: lyzeReveal 10s linear forwards;
}

@keyframes lyzeReveal {
    0% {
        opacity: 0;
    }

    80% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* pink used for shield interior */
.pink {
    fill: #ff66b2;
}

/* shield growth: made ~50% faster (total ~3.33s) */
/* move the shield 5px right for its whole life and animate scale as before */
#shield {
    transform-box: fill-box;
    transform-origin: center;
    /* use a 3d translate to prefer compositor-only work where supported */
    transform: translate3d(5px, 0, 0) scale(0.1);
    /* speed increased by ~50% (1.5x) */
    animation: shieldGrow 3.333s linear forwards;
    /* performance hints to keep growth on compositor thread */
    will-change: transform;
    backface-visibility: hidden;
    /* isolate painting so other elements don't force repaints of the shield */
    contain: paint;
}

@keyframes shieldGrow {
    0% {
        /* use translate3d to encourage compositor handling */
        transform: translate3d(5px, 0, 0) scale(0.1);
    }

    70% {
        transform: translate3d(5px, 0, 0) scale(0.5);
    }

    100% {
        transform: translate3d(5px, 0, 0) scale(1);
    }
}

/* shield purple appears from transparent to full over shorter time (5s) */
#shield .st0 {
    opacity: 0;
    animation: shieldAppear 5s linear forwards;
    /* ensure transforms on the path are applied relative to its geometry and hint compositor */
    transform-box: fill-box;
    transform-origin: center;
    will-change: opacity, transform;
    backface-visibility: hidden;
}

/* shield interior rectangle: hint that transform/opacity may change so browsers can optimize */
#shieldInterior {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

@keyframes shieldAppear {
    0% {
        opacity: 0;
    }

    70% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* shield interior: white -> black (by 70%) then fade out to transparent (opacity) by 100% */
.shield-fill {
    fill: #fff;
    opacity: 1;
    animation: fillToClear 10s linear forwards;
}

@keyframes fillToClear {
    0% {
        fill: #fff;
        opacity: 1;
        visibility: visible;
    }

    70% {
        fill: #000;
        opacity: 1;
        visibility: visible;
    }
    /* ensure final state is fully transparent and not accidentally visible */
    99.9% {
        fill: #000;
        opacity: 0.01;
    }

    100% {
        fill: rgba(0, 0, 0, 0);
        opacity: 0;
        visibility: hidden;
    }
}

/* small 'Lyze' copies that bug the shield during growth */
.lyze-bug {
    transform-box: fill-box;
    transform-origin: center;
    pointer-events: none;
    fill: rgba(0, 0, 0, 0.9);
    opacity: 1;
    animation: bugMove 0.9s ease-in-out infinite alternate, bugLife 10s linear forwards;
}

@keyframes bugMove {
    0% {
        transform: translate(0, 0) scale(0.06) rotate(0deg);
    }

    100% {
        transform: translate(-10px, -24px) scale(0.08) rotate(-18deg);
    }
}

@keyframes bugLife {
    0% {
        opacity: 1;
        visibility: visible;
    }

    80% {
        opacity: 1;
        visibility: visible;
    }

    99.9% {
        opacity: 0.01;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* offsets for variety */
.lyze-bug.bug2 {
    animation-delay: 0.12s, 0s;
    transform-origin: 40% 40%;
}

.lyze-bug.bug3 {
    animation-delay: 0.24s, 0s;
    transform-origin: 60% 60%;
}

.lyze-bug.bug4 {
    animation-delay: 0.36s, 0s;
    transform-origin: 30% 60%;
}

.lyze-bug.bug5 {
    animation-delay: 0.48s, 0s;
    transform-origin: 50% 20%;
}

.lyze-bug.bug6 {
    animation-delay: 0.6s, 0s;
    transform-origin: 20% 40%;
}

/* targeted convergence copies */
:root {
    --lyze-target-transform: translate(520px, -60px) scale(1) rotate(0deg);
    --lyze-final-rotation: 0deg;
    --lyze-spin-x: 0px;
    --lyze-spin-y: 0px;
    --lyze-final-clone-opacity: 0.08;
}

/* keep original fills on #lyze so final matches the source logo exactly */
/* recoloring of clones is done by JS setting style.fill on the cloned group */

.lyze-copy {
    transform-box: fill-box;
    transform-origin: center;
    pointer-events: none;
    opacity: 0;
    transform: var(--lyze-initial);
    animation: convergeGlobal 10s linear forwards, appear 0.2s linear forwards;
}

@keyframes convergeGlobal {
    0% {
        transform: var(--lyze-initial);
        opacity: 0;
        visibility: visible;
    }

    10% {
        opacity: 1;
    }

    79% {
        transform: var(--lyze-initial);
        opacity: 1;
    }

    100% {
        transform: var(--lyze-target-transform);
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes appear {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* spawn classes: start times (seconds) and durations such that they end around 8s */
/* appear between 1s and 8s; converge globally during 8s->10s via convergeGlobal animation */
.spawn1 {
    --lyze-initial: translate(200px, 170px) scale(0.06) rotate(-12deg);
    animation-delay: 0s, 1s;
    animation-duration: 10s, 0.2s;
}

.spawn2 {
    --lyze-initial: translate(260px, 210px) scale(0.055) rotate(18deg);
    animation-delay: 0s, 2s;
    animation-duration: 10s, 0.2s;
}

.spawn3 {
    --lyze-initial: translate(180px, 220px) scale(0.07) rotate(6deg);
    animation-delay: 0s, 3s;
    animation-duration: 10s, 0.2s;
}

.spawn4 {
    --lyze-initial: translate(220px, 120px) scale(0.05) rotate(-26deg);
    animation-delay: 0s, 4s;
    animation-duration: 10s, 0.2s;
}

.spawn5 {
    --lyze-initial: translate(300px, 190px) scale(0.05) rotate(12deg);
    animation-delay: 0s, 5s;
    animation-duration: 10s, 0.2s;
}

.spawn6 {
    --lyze-initial: translate(210px, 100px) scale(0.045) rotate(4deg);
    animation-delay: 0s, 6s;
    animation-duration: 10s, 0.2s;
}

.spawn7 {
    --lyze-initial: translate(240px, 140px) scale(0.05) rotate(-6deg);
    animation-delay: 0s, 7s;
    animation-duration: 10s, 0.2s;
}

.spawn8 {
    --lyze-initial: translate(230px, 180px) scale(0.06) rotate(8deg);
    animation-delay: 0s, 8s;
    animation-duration: 10s, 0.2s;
}

/* palette variants (use provided palette) */
.p1 { color: #594ae2; fill: #594ae2; }
.p2 { color: #4c3eb8; fill: #4c3eb8; }
.p3 { color: #403391; fill: #403391; }
.p4 { color: #33286b; fill: #33286b; }
.p5 { color: #251d47; fill: #251d47; }
.p6 { color: #6453FF; fill: #6453FF; }

/* random-copy helper style for JS-generated clones */
.lyze-copy-random {
    transform-box: fill-box;
    transform-origin: 0 0;
    pointer-events: none;
    opacity: 0;
    will-change: transform, opacity;
    transition: transform 2000ms cubic-bezier(.2, .8, .2, 1), opacity 2000ms linear;
}

/* when clones converge they not only move to the target transform but also rotate to the
   final Lyze orientation and translate a bit in that direction while fading so it's hard
   to visually confirm whether they actually reach the target */
.lyze-copy-random.converge {
    transform: var(--lyze-target-transform) rotate(var(--lyze-final-rotation, 0deg)) translate(var(--lyze-spin-x, 0px), var(--lyze-spin-y, 0px));
    opacity: var(--lyze-final-clone-opacity, 0.08);
}

/* countdown pill (hidden until final Lyze reveal) */
#countdown-pill {
    position: fixed;
    /* center at the top by default */
    left: 50%;
    top: 12px;
    transform: translate(-50%, 8px) scale(.98);
    width: auto;
    min-width: 240px;
    max-width: 90vw;
    height: 64px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 600ms ease, transform 400ms cubic-bezier(.2, .8, .2, 1);
    z-index: 9999;
}

#countdown-pill.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    pointer-events: auto;
}

/* prominent dark pill with large countdown text; main clock occupies ~80% width */
#countdown-pill .pill-inner {
    background: #0f1724;
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 12px 30px rgba(8, 10, 20, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    top: 10px;
}

#countdown-time {
    font-weight: 800;
    font-size: 1.8rem;
    color: #fff;
    font-family: 'Anaktoria', Georgia, 'Times New Roman', serif;
    width: 80%;
    text-align: center;
}

#countdown-pill .countdown-label {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 6px;
    font-family: 'Albert Sans', Georgia, serif;
}

/* access textbox at bottom - stacked label above input, anchored to left/bottom */
#access-form {
    position: fixed;
    bottom: 5px;
    /* 5px from bottom edge per request */
    left: 5px;
    /* 5px from left edge per request */
    right: auto;
    transform: none;
    display: flex;
    flex-direction: column;
    /* label above textbox */
    gap: 6px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.96);
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    z-index: 100010;
    touch-action: manipulation;
    max-width: 360px;
    min-width: 180px;
}

#access-form .access-label em {
    font-style: italic;
    color: #111;
    font-size: 1.125rem;
    text-align: left;
    display: block;
    line-height: 1.1;
    margin: 0;
}

#access-email {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1.5rem;
    min-width: 260px;
}

/* Responsive: on small screens make the access form stretch full-width and taller for easier interaction */
@media (max-width: 800px) {
    /* on small screens reduce the svg height so the scene doesn't dominate the viewport */
    svg.logo {
        height: 50vh;
        left: 5vw;
    }

    #access-form {
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: 100%;
        height: 100px;
        /* user requested */
        padding: 12px 16px;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    #access-form .access-label em {
        font-size: 1.1rem;
        text-align: center;
        line-height: 1.1;
    }

    #access-email {
        min-width: 0;
        width: 80%;
        font-size: 1.25rem;
    }
    /* mobile: keep the countdown at the top center but make it almost full-width for readability */
    #countdown-pill {
        left: 50% !important;
        right: auto !important;
        width: calc(100% - 24px) !important;
        top: 12px !important;
        bottom: auto !important;
        height: 72px !important;
        transform: translate(-50%, 0) scale(1) !important;
    }

    #countdown-pill .pill-inner {
        padding: 10px 12px;
    }

    #countdown-time {
        font-size: 1.4rem !important;
    }

    #lyze {
        transform-origin: 0px 0px;
        transform: translate(400px, 81px) scale(0.79601) translate(-369px, -81px);
    }
}

/* inner 'n' outline: start visible (black), stay during growth (7s), then fade out over final 3s */
/* match the 10s timeline so it is fully transparent at the end */
/* ensure both overall opacity and stroke-opacity go to 0 so the outline is fully gone */
#innerN {
    stroke: #000;
    opacity: 1;
    stroke-opacity: 1;
    animation: innerNFade 10s linear forwards;
}

@keyframes innerNFade {
    0% {
        opacity: 1;
        stroke-opacity: 1;
        stroke: #000;
        stroke-width: 8;
        visibility: visible;
    }

    70% {
        opacity: 1;
        stroke-opacity: 1;
        stroke: #000;
        stroke-width: 8;
        visibility: visible;
    }

    99.9% {
        opacity: 0.01;
        stroke-opacity: 0.01;
    }

    100% {
        opacity: 0;
        stroke-opacity: 0;
        stroke: rgba(0, 0, 0, 0);
        stroke-width: 0;
        visibility: hidden;
    }
}

/* Final Lyze tail (the last path) entrance: wait until main reveal finishes and pop in 0.5s later */
#lyze path:last-of-type {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    will-change: transform, opacity, filter;
    /* delay to appear 0.5s after the 10s lyze reveal */
    animation: lastLyzeEntrance 700ms cubic-bezier(.2,.8,.2,1) 10.5s forwards;
}

@keyframes lastLyzeEntrance {
    0% {
        opacity: 0;
        transform: scale(0.6) rotate(-90deg);
        filter: drop-shadow(0 0 0 rgba(0,0,0,0));
    }

    60% {
        opacity: 1;
        transform: scale(1.15) rotate(200deg);
        filter: drop-shadow(0 0 10px rgba(255,255,255,0.9));
    }

    80% {
        transform: scale(0.95) rotate(300deg);
        filter: drop-shadow(0 0 4px rgba(255,255,255,0.6));
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(360deg);
        filter: none;
    }
}

/* minimal reset - no JS required for final render */
/* canonical final swap helpers (non-mutating):
   - use the inlined canonical svg `#REAL_LOGO` and cross-fade by toggling classes
   - canonical reveal transition is 520ms; animated hide uses a longer transition (user tweak)
*/
svg.canonical-logo {
    position: fixed;
    top: 33vh;
    left: 5vw;
    width: 33vw;
    height: 33vh;
    display: block;
    overflow: visible;
    pointer-events: none;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 520ms ease, visibility 0s linear 520ms;
    box-shadow: none !important;
}

svg.canonical-logo.canonical-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 1520ms ease, visibility 1s linear 1s !important;
}

/* hide the animated svg via class only (no mutation) */
svg.logo.animation-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 1520ms ease, visibility 0s linear 1520ms;
    pointer-events: none;
}

/* scatter-parent: keep hidden until final REAL_LOGO swap starts, then fade in */
.scatter-parent {
    opacity: 0;
    visibility: visible; /* allow layout to reserve space but keep invisible */
    pointer-events: none;
    transition: opacity 1500ms ease;
}

.scatter-parent.scatter-parent-visible {
    position: fixed;
    top: 0vh;
    right: 0vw;
    width: 33vw;
    height: 100vh;
    opacity: 1;
    pointer-events: auto;
}

.scatter-parent p.fluent-typography {
    padding: 0 12px 24px 12px;
}

.scatter-parent-splash {
    overflow-x: hidden !important;
}
