:root {
    color-scheme: dark;

    --background-navy: #08142a;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    min-width: 320px;
    margin: 0;
    overflow: hidden;
    background: var(--background-navy);
}

.page {
    min-height: 100dvh;
}

.page-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.animated-background {
    position: fixed;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(
            ellipse 80% 75% at 78% 65%,
            #15264d 0%,
            transparent 70%
        ),
        linear-gradient(145deg, #081329, #0a1833 58%, #101a3b);
}

.animated-background-flow-illustration {
    display: block;
    width: 180%;
    max-width: none;
    height: 100%;
    transform: translateX(-34%);
}

.animated-background-flow {
    transform-origin: 50% 80%;
    animation: background-drift 16s ease-in-out infinite alternate;
}

.animated-background-glow {
    animation: background-pulse 9s ease-in-out infinite alternate;
}

.animated-background-tux-frame {
    position: absolute;
    top: clamp(105px, 18dvh, 155px);
    right: clamp(14px, 5vw, 30px);
    width: clamp(92px, 27vw, 140px);
    max-height: calc(100dvh - 125px);
    aspect-ratio: 230 / 300;
    animation: tux-travel 6s ease-in-out infinite;
    will-change: transform;
}

.animated-background-tux-frame svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.animated-background-tux {
    transform-origin: 50% 55%;
    animation: tux-sway 6s ease-in-out infinite;
}

@keyframes background-drift {
    to {
        transform: translate3d(0, -16px, 0) scale(1.025);
    }
}

@keyframes background-pulse {
    to {
        opacity: 0.7;
    }
}

@keyframes tux-travel {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    25% {
        transform: translate3d(-10px, 12px, 0);
    }

    50% {
        transform: translate3d(-18px, -5px, 0);
    }

    75% {
        transform: translate3d(-6px, -12px, 0);
    }
}

@keyframes tux-sway {
    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

@media (width >= 701px) {
    .animated-background-flow-illustration {
        width: 100%;
        transform: none;
    }

    .animated-background-tux-frame {
        top: clamp(112px, 22dvh, 215px);
        right: clamp(20px, 9vw, 160px);
        width: clamp(128px, 17vw, 228px);
        max-height: calc(100dvh - 140px);
    }

    @keyframes tux-travel {
        0%,
        100% {
            transform: translate3d(0, 0, 0);
        }

        25% {
            transform: translate3d(-20px, 20px, 0);
        }

        50% {
            transform: translate3d(-36px, -6px, 0);
        }

        75% {
            transform: translate3d(-12px, -22px, 0);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .animated-background-flow,
    .animated-background-glow,
    .animated-background-tux-frame,
    .animated-background-tux {
        animation: none;
    }
}
