/* --- General Setup & Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    height: 100vh;
    overflow: hidden; /* Prevents scrollbars from the animated background */
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* Needed for the pseudo-element */
}

/* --- Pre-loader --- */
.preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out 0.5s; /* Fades out the black screen */
}

.preloader-logo {
    max-width: 280px;
    animation: pulse 2s infinite ease-in-out;
    position: relative;
}

/* When loaded, fade out the preloader */
body.loaded .preloader {
    opacity: 0;
    pointer-events: none; /* Allows clicking through after it's invisible */
}

/* Background image with overlay and non-stretching zoom effect */
body::before {
    content: '';
    position: fixed; /* Use fixed to prevent layout shifts from scale */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://roardocumentary.com/assets/roar-banner.png');
    background-size: cover;
    background-position: center;
    z-index: -2; /* Behind the shine effect */
    transform: scale(1.1); /* Start slightly zoomed in */
    opacity: 0; /* Start invisible */
    transition: opacity 1s ease-in;
}


/* New shine effect pseudo-element */
body::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%; /* Start off-screen */
    width: 40%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%, /* Adjust opacity for subtlety */
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg); /* Creates the diagonal slant */
    z-index: -1;
    animation: shine 9s linear infinite;
    animation-delay: 2s; /* Small delay before starting */
}

/* When loaded, reveal the main background */
body.loaded::before {
    opacity: 1;
}

/* --- Animations --- */
@keyframes zoom-in {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shine {
    from { left: -100%; }
    to { left: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* --- Main Content Container --- */
.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

/* --- The Glass Island --- */
.glass-island {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px); /* For Safari */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    padding: 40px 50px;
    width: 90%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    text-align: center;
    /* Entry animation for the card */
    opacity: 0;
}

/* --- Loading State Adjustments --- */
/* When loaded, run the fade-up animations */
body.loaded .glass-island {
    /* Delay this to start after preloader fades */
    animation: fade-up 0.8s ease-out 1s forwards;
}

body.loaded .footer-island {
    /* Delay this to start after preloader fades */
    animation: fade-up 0.8s ease-out 1.2s forwards;
}


/* --- Logo and Title --- */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    max-width: 250px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    /* Staggered entry animation */
    opacity: 0; /* Start hidden, JS will make it visible after transition */
    animation: fade-up 0.6s ease-out 1.3s forwards;
}

/* --- Trailer Link --- */
.trailer-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 400;
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    /* Staggered entry animation */
    opacity: 0;
    animation: fade-up 0.6s ease-out 1.5s forwards;
}

.trailer-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.play-icon {
    width: 24px;
    height: 24px;
}

/* --- Call-to-Action Button --- */
.cta-button {
    display: inline-block;
    background: #da710a;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* Staggered entry animation */
    opacity: 0;
    animation: fade-up 0.6s ease-out 1.7s forwards;
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 6px 20px rgba(218, 113, 10, 0.4);
    background-color: #e77a13;
}

/* Added active state for better click feedback */
.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(218, 113, 10, 0.3);
}

/* --- Footer --- */
footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    padding: 0 20px;
    text-align: center;
    display: flex;
    justify-content: center;
}

.footer-island {
    padding: 15px 25px;
    max-width: 450px;
    width: auto;
}

footer p {
    font-size: 0.8rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    opacity: 1; /* Let parent control fade */
    /* This will now be controlled by the parent .footer-island animation */
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

/* --- Media Query for smaller screens --- */
@media (max-width: 480px) {
    .glass-island {
        padding: 30px 25px;
        gap: 25px;
    }

    .footer-island {
        max-width: 100%;
    }

    .trailer-link {
        font-size: 1rem;
    }
}
