/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

/* Default layout (wide screens, aspect ratio >= 4:3) */
.background-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-image: url('../redirection_base.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end; /* Align to bottom */
    justify-content: flex-end; /* Align to right */
    padding-right: 6vw; /* Slightly to the right */
}

/* Animated frame - pixel perfect rendering */
.animated-frame {
    width: 55vh;
    height: auto;
    image-rendering: -moz-crisp-edges;     /* Firefox */
    image-rendering: -webkit-crisp-edges;  /* Webkit */
    image-rendering: pixelated;            /* Standard */
    image-rendering: crisp-edges;          /* Fallback */
    position: relative;
    z-index: 1;
}

/* Intermediate width range */
@media (min-aspect-ratio: 1/1) and (max-aspect-ratio: 4/3) {
    .background-container {
        background-image: url('../redirection_base_intermediate.webp');
    }
}

@media (max-aspect-ratio: 1/1) {
    .background-container {
        background-image: url('../redirection_base_mobile.webp');
        justify-content: center; /* Center horizontally */
        padding-right: 0; /* Remove right padding */
    }
    .animated-frame {
        width: 60vw; /* Smaller for mobile */
    }
}

@media (max-aspect-ratio: 10/16) {
    .animated-frame {
        width: 80vw; /* Even smaller for very tall screens */
    }
}