/*
|--------------------------------------------------------------------------
| AE UI - HOME
|--------------------------------------------------------------------------
*/


/*
|--------------------------------------------------------------------------
| PAGE
|--------------------------------------------------------------------------
*/

.home-page {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 100vh;

    padding: 70px 24px 90px;

    color: var(--ae-text);

    background:
        radial-gradient(
            circle at 20% 15%,
            rgba(227, 38, 46, 0.10),
            transparent 34%
        ),
        radial-gradient(
            circle at 82% 80%,
            rgba(40, 120, 208, 0.08),
            transparent 32%
        ),
        linear-gradient(
            145deg,
            var(--ae-bg-soft),
            var(--ae-bg)
        );

    overflow: hidden;
}


/*
|--------------------------------------------------------------------------
| SUBTLE GRID
|--------------------------------------------------------------------------
*/

.home-page::before {
    content: "";

    position: absolute;
    inset: 0;

    opacity: 0.42;

    background-image:
        linear-gradient(
            rgba(120, 128, 145, 0.10) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(120, 128, 145, 0.10) 1px,
            transparent 1px
        );

    background-size: 64px 64px;

    -webkit-mask-image:
        radial-gradient(
            circle at center,
            #000 12%,
            transparent 82%
        );

    mask-image:
        radial-gradient(
            circle at center,
            #000 12%,
            transparent 82%
        );

    pointer-events: none;
}


/*
|--------------------------------------------------------------------------
| BACKGROUND
|--------------------------------------------------------------------------
*/

.home-background {
    position: absolute;
    inset: 0;

    pointer-events: none;
}

.home-orb {
    position: absolute;

    border-radius: 50%;

    filter: blur(4px);

    animation:
        homeOrbMove
        12s
        ease-in-out
        infinite alternate;
}

.home-orb-one {
    top: -190px;
    left: -150px;

    width: 480px;
    height: 480px;

    background:
        radial-gradient(
            circle,
            rgba(227, 38, 46, 0.13),
            rgba(227, 38, 46, 0)
        );
}

.home-orb-two {
    right: -160px;
    bottom: -220px;

    width: 560px;
    height: 560px;

    background:
        radial-gradient(
            circle,
            rgba(40, 120, 208, 0.11),
            rgba(40, 120, 208, 0)
        );

    animation-delay: -4s;
}


/*
|--------------------------------------------------------------------------
| CONTENT
|--------------------------------------------------------------------------
*/

.home-content {
    position: relative;
    z-index: 5;

    width: 100%;
    max-width: 790px;

    text-align: center;
}


/*
|--------------------------------------------------------------------------
| BRAND
|--------------------------------------------------------------------------
*/

.home-brand {
    display: flex;
    flex-direction: column;
    align-items: center;

    opacity: 0;

    animation:
        homeLogoArrival
        900ms
        cubic-bezier(.2, .9, .24, 1)
        100ms
        forwards;
}

.home-logo {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 25px;
}

.home-logo img {
    position: relative;
    z-index: 2;

    display: block;

    width: min(300px, 72vw);
    height: auto;
}

.home-logo-glow {
    position: absolute;

    width: 70%;
    height: 75%;

    background:
        radial-gradient(
            ellipse,
            rgba(227, 38, 46, 0.18),
            rgba(227, 38, 46, 0)
        );

    filter: blur(20px);

    animation:
        homeLogoGlow
        3.5s
        ease-in-out
        infinite;
}


/*
|--------------------------------------------------------------------------
| LABEL
|--------------------------------------------------------------------------
*/

.home-system-label {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    min-height: 34px;

    padding: 8px 14px;

    color: var(--ae-text-soft);
    background: rgba(255, 255, 255, 0.62);

    border: 1px solid rgba(120, 128, 145, 0.18);
    border-radius: var(--ae-radius-round);

    box-shadow: var(--ae-shadow-xs);

    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);

    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-system-dot {
    position: relative;

    width: 8px;
    height: 8px;

    background: var(--ae-success);

    border-radius: 50%;

    box-shadow:
        0 0 0 4px rgba(31, 157, 102, 0.12);
}

.home-system-dot::after {
    content: "";

    position: absolute;
    inset: -5px;

    border: 1px solid rgba(31, 157, 102, 0.32);
    border-radius: 50%;

    animation:
        systemDotPulse
        2.2s
        ease-out
        infinite;
}


/*
|--------------------------------------------------------------------------
| TITLE
|--------------------------------------------------------------------------
*/

.home-title {
    max-width: 760px;

    margin: 34px auto 22px;

    color: var(--ae-text);

    font-size: clamp(2.35rem, 6vw, 4.65rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.055em;

    opacity: 0;

    animation:
        homeFadeUp
        800ms
        cubic-bezier(.2, .8, .2, 1)
        430ms
        forwards;
}

.home-title span {
    display: block;

    color: var(--ae-primary);
}


/*
|--------------------------------------------------------------------------
| DESCRIPTION
|--------------------------------------------------------------------------
*/

.home-description {
    max-width: 650px;

    margin: 0 auto 34px;

    color: var(--ae-text-soft);

    font-size: clamp(1rem, 2vw, 1.13rem);
    line-height: 1.75;

    opacity: 0;

    animation:
        homeFadeUp
        800ms
        cubic-bezier(.2, .8, .2, 1)
        610ms
        forwards;
}


/*
|--------------------------------------------------------------------------
| LOGIN BUTTON
|--------------------------------------------------------------------------
*/

.home-actions {
    display: flex;
    justify-content: center;

    opacity: 0;

    animation:
        homeFadeUp
        800ms
        cubic-bezier(.2, .8, .2, 1)
        790ms
        forwards;
}

.home-login-button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    min-width: 220px;
    min-height: 56px;

    padding: 15px 24px;

    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--ae-primary),
            var(--ae-primary-hover)
        );

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;

    box-shadow:
        0 14px 34px rgba(227, 38, 46, 0.28);

    font-size: 1rem;
    font-weight: 750;

    overflow: hidden;

    transition:
        transform var(--ae-transition),
        box-shadow var(--ae-transition),
        filter var(--ae-transition);
}

.home-login-button::before {
    content: "";

    position: absolute;
    top: 0;
    left: -90%;

    width: 55%;
    height: 100%;

    background:
        linear-gradient(
            110deg,
            transparent,
            rgba(255, 255, 255, 0.22),
            transparent
        );

    transform: skewX(-18deg);

    transition: left 600ms ease;
}

.home-login-button:hover {
    color: #ffffff;

    transform: translateY(-3px);

    box-shadow:
        0 20px 42px rgba(227, 38, 46, 0.36);

    filter: brightness(1.03);
}

.home-login-button:hover::before {
    left: 135%;
}

.home-login-button:active {
    transform: translateY(-1px);
}

.home-login-button span,
.home-login-button svg {
    position: relative;
    z-index: 2;
}

.home-login-button svg {
    width: 21px;
    height: 21px;

    transition: transform var(--ae-transition);
}

.home-login-button:hover svg {
    transform: translateX(4px);
}


/*
|--------------------------------------------------------------------------
| SECURITY
|--------------------------------------------------------------------------
*/

.home-security {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin-top: 23px;

    color: var(--ae-text-muted);

    font-size: 0.8rem;
    font-weight: 600;

    opacity: 0;

    animation:
        homeFadeUp
        800ms
        cubic-bezier(.2, .8, .2, 1)
        930ms
        forwards;
}

.home-security svg {
    width: 17px;
    height: 17px;
}


/*
|--------------------------------------------------------------------------
| QR DECORATIONS
|--------------------------------------------------------------------------
*/

.home-qr {
    position: absolute;

    width: 190px;
    height: 190px;

    opacity: 0.075;

    animation:
        qrFloat
        9s
        ease-in-out
        infinite;
}

.home-qr-left {
    top: 10%;
    left: 5%;

    transform: rotate(-9deg);
}

.home-qr-right {
    right: 4%;
    bottom: 10%;

    transform: rotate(11deg) scale(0.82);

    animation-delay: -4s;
}

.qr-corner {
    position: absolute;

    width: 54px;
    height: 54px;

    border: 9px solid var(--ae-text);
}

.qr-corner::after {
    content: "";

    position: absolute;
    inset: 8px;

    background: var(--ae-text);
}

.qr-corner-top-left {
    top: 0;
    left: 0;
}

.qr-corner-top-right {
    top: 0;
    right: 0;
}

.qr-corner-bottom-left {
    bottom: 0;
    left: 0;
}

.qr-pixel {
    position: absolute;

    width: 17px;
    height: 17px;

    background: var(--ae-text);
}

.qr-pixel-1 {
    top: 78px;
    left: 83px;
}

.qr-pixel-2 {
    top: 78px;
    left: 112px;
}

.qr-pixel-3 {
    top: 107px;
    left: 83px;
}

.qr-pixel-4 {
    right: 0;
    bottom: 38px;
}

.qr-pixel-5 {
    right: 29px;
    bottom: 0;
}

.qr-pixel-6 {
    right: 58px;
    bottom: 29px;
}


/*
|--------------------------------------------------------------------------
| NETWORK
|--------------------------------------------------------------------------
*/

.home-network {
    position: absolute;
    inset: 0;

    opacity: 0.35;
}

.network-point {
    position: absolute;

    width: 8px;
    height: 8px;

    background: var(--ae-primary);

    border: 2px solid var(--ae-bg);
    border-radius: 50%;

    box-shadow:
        0 0 0 4px rgba(227, 38, 46, 0.10);

    animation:
        networkPointPulse
        3s
        ease-in-out
        infinite;
}

.point-1 {
    top: 19%;
    left: 19%;
}

.point-2 {
    top: 30%;
    left: 29%;

    animation-delay: -0.5s;
}

.point-3 {
    top: 21%;
    right: 23%;

    animation-delay: -1s;
}

.point-4 {
    top: 39%;
    right: 12%;

    animation-delay: -1.5s;
}

.point-5 {
    bottom: 22%;
    left: 16%;

    animation-delay: -2s;
}

.point-6 {
    right: 24%;
    bottom: 19%;

    animation-delay: -2.5s;
}

.point-7 {
    bottom: 10%;
    left: 37%;

    animation-delay: -1.2s;
}

.network-line {
    position: absolute;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(227, 38, 46, 0.55),
            transparent
        );

    transform-origin: left center;

    animation:
        networkLineGlow
        5s
        ease-in-out
        infinite;
}

.line-1 {
    top: 20%;
    left: 19%;

    width: 175px;

    transform: rotate(26deg);
}

.line-2 {
    top: 31%;
    left: 29%;

    width: 210px;

    transform: rotate(-15deg);

    animation-delay: -1s;
}

.line-3 {
    top: 22%;
    right: 12%;

    width: 180px;

    transform: rotate(38deg);

    animation-delay: -2s;
}

.line-4 {
    bottom: 23%;
    left: 16%;

    width: 270px;

    transform: rotate(13deg);

    animation-delay: -3s;
}

.line-5 {
    right: 23%;
    bottom: 20%;

    width: 210px;

    transform: rotate(-25deg);

    animation-delay: -4s;
}

.line-6 {
    right: 12%;
    bottom: 33%;

    width: 190px;

    transform: rotate(64deg);

    animation-delay: -1.6s;
}


/*
|--------------------------------------------------------------------------
| FOOTER
|--------------------------------------------------------------------------
*/

.home-footer {
    position: absolute;
    z-index: 5;

    right: 24px;
    bottom: 22px;
    left: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    color: var(--ae-text-muted);

    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    opacity: 0;

    animation:
        homeFadeIn
        900ms
        ease
        1.15s
        forwards;
}

.home-footer-divider {
    width: 3px;
    height: 3px;

    background: var(--ae-primary);

    border-radius: 50%;
}


/*
|--------------------------------------------------------------------------
| DARK MODE
|--------------------------------------------------------------------------
*/

html[data-theme="dark"] .home-system-label {
    background: rgba(25, 28, 37, 0.72);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .home-qr {
    opacity: 0.06;
}

html[data-theme="dark"] .home-login-button {
    box-shadow:
        0 16px 40px rgba(227, 38, 46, 0.22);
}


/*
|--------------------------------------------------------------------------
| ANIMATIONS
|--------------------------------------------------------------------------
*/

@keyframes homeLogoArrival {
    0% {
        opacity: 0;

        transform:
            translateY(-65px)
            scale(0.92);

        filter: blur(8px);
    }

    65% {
        opacity: 1;

        transform:
            translateY(8px)
            scale(1.015);

        filter: blur(0);
    }

    100% {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);

        filter: blur(0);
    }
}

@keyframes homeFadeUp {
    from {
        opacity: 0;

        transform: translateY(24px);
    }

    to {
        opacity: 1;

        transform: translateY(0);
    }
}

@keyframes homeFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes homeLogoGlow {
    0%,
    100% {
        opacity: 0.55;

        transform: scale(0.92);
    }

    50% {
        opacity: 1;

        transform: scale(1.08);
    }
}

@keyframes systemDotPulse {
    0% {
        opacity: 0.8;

        transform: scale(0.6);
    }

    70%,
    100% {
        opacity: 0;

        transform: scale(1.55);
    }
}

@keyframes networkPointPulse {
    0%,
    100% {
        opacity: 0.45;

        transform: scale(0.85);
    }

    50% {
        opacity: 1;

        transform: scale(1.2);
    }
}

@keyframes networkLineGlow {
    0%,
    100% {
        opacity: 0.08;
    }

    50% {
        opacity: 0.72;
    }
}

@keyframes qrFloat {
    0%,
    100% {
        margin-top: 0;

        opacity: 0.055;
    }

    50% {
        margin-top: -18px;

        opacity: 0.095;
    }
}

@keyframes homeOrbMove {
    from {
        transform:
            translate3d(-10px, -10px, 0)
            scale(0.96);
    }

    to {
        transform:
            translate3d(22px, 18px, 0)
            scale(1.05);
    }
}


/*
|--------------------------------------------------------------------------
| TABLET
|--------------------------------------------------------------------------
*/

@media (max-width: 991.98px) {
    .home-qr {
        width: 150px;
        height: 150px;
    }

    .home-qr-left {
        left: -25px;
    }

    .home-qr-right {
        right: -30px;
    }

    .home-network {
        opacity: 0.22;
    }
}


/*
|--------------------------------------------------------------------------
| MOBILE
|--------------------------------------------------------------------------
*/

@media (max-width: 575.98px) {
    .home-page {
        align-items: flex-start;

        min-height: 100svh;

        padding:
            max(60px, env(safe-area-inset-top))
            20px
            90px;
    }

    .home-content {
        margin: auto 0;
    }

    .home-logo img {
        width: min(225px, 74vw);
    }

    .home-system-label {
        min-height: 31px;

        padding: 7px 12px;

        font-size: 0.7rem;
    }

    .home-title {
        margin-top: 28px;

        font-size: clamp(2.2rem, 12vw, 3.2rem);
    }

    .home-description {
        margin-bottom: 30px;

        font-size: 0.96rem;
        line-height: 1.65;
    }

    .home-login-button {
        width: 100%;
        max-width: 310px;
    }

    .home-security {
        font-size: 0.73rem;
    }

    .home-qr {
        width: 115px;
        height: 115px;

        opacity: 0.04;
    }

    .home-qr-left {
        top: 4%;
        left: -45px;
    }

    .home-qr-right {
        right: -42px;
        bottom: 8%;
    }

    .qr-corner {
        width: 38px;
        height: 38px;

        border-width: 6px;
    }

    .qr-corner::after {
        inset: 6px;
    }

    .qr-pixel {
        width: 11px;
        height: 11px;
    }

    .qr-pixel-1 {
        top: 48px;
        left: 49px;
    }

    .qr-pixel-2 {
        top: 48px;
        left: 68px;
    }

    .qr-pixel-3 {
        top: 67px;
        left: 49px;
    }

    .qr-pixel-4 {
        right: 0;
        bottom: 24px;
    }

    .qr-pixel-5 {
        right: 18px;
        bottom: 0;
    }

    .qr-pixel-6 {
        right: 36px;
        bottom: 18px;
    }

    .home-network {
        opacity: 0.12;
    }

    .home-footer {
        bottom: 16px;

        font-size: 0.61rem;
    }
}


/*
|--------------------------------------------------------------------------
| REDUCED MOTION
|--------------------------------------------------------------------------
*/

@media (prefers-reduced-motion: reduce) {
    .home-brand,
    .home-title,
    .home-description,
    .home-actions,
    .home-security,
    .home-footer {
        opacity: 1;

        animation: none;

        transform: none;
    }

    .home-orb,
    .home-qr,
    .network-point,
    .network-line,
    .home-logo-glow,
    .home-system-dot::after {
        animation: none;
    }
}