@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: #8a1c1c;
    color: #fff;
}

/* Focus Rings */
*:focus-visible {
    outline: 2px solid #8a1c1c;
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/*                               SCROLL CONTAINER                             */
/* -------------------------------------------------------------------------- */

/* Container for the scroll sequence (height determines scroll length) */
.scroll-container {
    height: 250vh;
    /* Adjust length of scroll sequence */
    position: relative;
    z-index: 10;
}

/* Sticky wrapper: Fixes content to viewport while scrolling through container */
.sticky-wrapper {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    /* Center canvas */
    justify-content: center;
    align-items: center;
    background-color: #000;
    /* Fallback background */
}

/* The Canvas Element */
#hero-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensure it covers the screen */
    z-index: 10;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    color: white;
    text-align: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-arrow {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}


/* -------------------------------------------------------------------------- */
/*                             TRANSITION & VIDEO                             */
/* -------------------------------------------------------------------------- */

/* Main Header/Video Wrapper that fades in */
#main-header-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    /* On top of canvas eventually */
    opacity: 0;
    /* Hidden initially */
    transition: opacity 1s ease-in-out;
    pointer-events: none;
    /* Let clicks pass through when hidden */
}

#main-header-wrapper.active {
    opacity: 1;
    pointer-events: auto;
}

/* Reveal Animations for Titles */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

/* YouTube Background Fixes / Video Background */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.video-foreground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Desktop */
@media (min-aspect-ratio: 16/9) {
    .video-foreground iframe {
        height: 300%;
        top: -100%;
    }
}

/* Mobile: Zoom */
@media (max-aspect-ratio: 16/9) {
    .video-foreground iframe {
        width: 300%;
        left: -100%;
        height: 100%;
        transform: scale(3);
        transform-origin: center center;
    }
}

/* Fallback Image Layer (Cover the video until playing) */
#video-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center right;
    z-index: 5;
    /* Higher than video, lower than text */
    transition: opacity 1.5s ease-out;
    /* Smooth fade out */
    opacity: 1;
}

/* Sticky Parallax helper */
.sticky-parallax {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
}

/* Cookie Banner */
#cookie-banner {
    transition: transform 0.5s ease-in-out;
}