/* General Styles */
body {
    background-color: black;
    margin: 0;
    overflow: hidden;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.hidden {
    display: none;
}

/* Fade-out and Fade-in Animations */
.fade-out {
    animation: fadeOut 0.5s ease-in-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Video Container */
#video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    touch-action: pan-y;
}

/* Video Player */
#video-player {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    transition: opacity 0.5s ease-in-out;
}

.video-exit {
    opacity: 0;
}

.video-enter {
    opacity: 1;
}

/* Main Logo (Top-Left) */
#logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 12%;
    max-width: 120px;
    height: auto;
    z-index: 10;
    pointer-events: none;
    border-radius: 20%;
}

/* Overlay Logo (Centered) */
#overlay-logo {
    width: 30%;
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
    animation: hopIn 1s ease-out;
}

@keyframes hopIn {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Introduction Overlay */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Intro Content (Text + Logo) */
#intro-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
}

/* Bottom-Centered Buttons Container */
#intro-bottom-buttons {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Tunnel Effect Styles */
.tunnel-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0; 
    left: 0;
    perspective: 1000px;
    overflow: hidden;
    z-index: 1;
}

.tunnel-wrapper .square {
    position: absolute;
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%) translateZ(-1000px) scale(0);
    opacity: 0;
    width: 200vmax;
    height: 200vmax;
    border: 2px solid white;
    box-shadow: 0px 60px 140px white;
    backface-visibility: hidden;
    border-radius: 15%;
    animation: move-animation 12s infinite linear;
}

@keyframes move-animation {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translateZ(-1000px) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) translateZ(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateZ(1000px) scale(1.5);
    }
}

/* Launch Container */
#launch-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    text-align: center;
}

/* Trending Label */
#trending-label {
    font-size: 14px;
    color: #ff6a00;
    margin-bottom: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* Root Variables */
:root {
    --glow-hue: 222deg;
    --shadow-hue: 180deg;
    --spring-easing: linear(
        0, 0.002, 0.01 0.9%, 0.038 1.8%, 0.156, 0.312 5.8%, 0.789 11.1%, 1.015 14.2%,
        1.096, 1.157, 1.199, 1.224 20.3%, 1.231, 1.231, 1.226, 1.214 24.6%,
        1.176 26.9%, 1.057 32.6%, 1.007 35.5%, 0.984, 0.968, 0.956, 0.949 42%,
        0.946 44.1%, 0.95 46.5%, 0.998 57.2%, 1.007, 1.011 63.3%, 1.012 68.3%,
        0.998 84%, 1
    );
    --spring-duration: 1.33s;
}

@property --shimmer {
    syntax: "<angle>";
    inherits: false;
    initial-value: 33deg;
}

@keyframes shimmer {
    0% {
        --shimmer: 0deg;
    }
    100% {
        --shimmer: 360deg;
    }
}

@keyframes shine {
    0% {
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    55% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes text {
    0% {
        background-position: 100% center;
    }
    100% {
        background-position: -100% center;
    }
}

/* Styled Button */
.styled-button {
    position: relative;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 30px;
    font-size: 18px;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all var(--spring-duration) var(--spring-easing);
    isolation: isolate;
    box-shadow: 0 2px 3px 1px hsl(var(--glow-hue) 50% 20% / 50%),
        inset 0 -10px 20px -10px hsla(var(--shadow-hue), 10%, 90%, 95%);
    transform: scale(1);
}

.styled-button:hover:not(:active),
.styled-button.active {
    transition-duration: calc(var(--spring-duration) * 0.5);
    transform: scale(1.2);
    box-shadow: 0 4px 8px -2px hsl(var(--glow-hue) 50% 20% / 50%),
        inset 0 0 0 transparent;
}

.styled-button:active {
    transform: scale(1.1);
    transition-duration: calc(var(--spring-duration) * 0.5);
}

/* Shimmer & Glow */
.styled-button .shimmer {
    position: absolute;
    inset: -20px;
    border-radius: inherit;
    mask-image: conic-gradient(
        from var(--shimmer, 0deg),
        transparent 0%,
        transparent 10%,
        black 36%,
        black 45%,
        transparent 50%,
        transparent 60%,
        black 85%,
        black 95%,
        transparent 100%
    );
    mask-size: cover;
    mix-blend-mode: plus-lighter;
    animation: shimmer 1s linear infinite both;
}

.styled-button .shimmer::before,
.styled-button .shimmer::after {
    transition: all 0.5s ease;
    opacity: 0;
    content: "";
    border-radius: inherit;
    position: absolute;
    mix-blend-mode: color;
    inset: 20px;
    pointer-events: none;
}

.styled-button .shimmer::before {
    box-shadow: 0 0 3px 2px hsl(var(--glow-hue) 20% 95%),
        0 0 7px 4px hsl(var(--glow-hue) 20% 80%),
        0 0 13px 4px hsl(var(--glow-hue) 50% 70%),
        0 0 25px 5px hsl(var(--glow-hue) 100% 70%);
    z-index: -1;
}

.styled-button .shimmer::after {
    box-shadow: inset 0 0 0 1px hsl(var(--glow-hue) 70% 95%),
        inset 0 0 2px 1px hsl(var(--glow-hue) 100% 80%),
        inset 0 0 5px 2px hsl(var(--glow-hue) 100% 70%);
    z-index: 2;
}

.styled-button .text {
    color: white;
}

/* Shimmer effect for trending items */
.styled-button.trending .text {
    color: transparent;
    background-clip: text;
    background-color: var(--bg);
    background-image: linear-gradient(
        120deg,
        transparent,
        hsla(var(--glow-hue), 100%, 80%, 0.66) 40%,
        hsla(var(--glow-hue), 100%, 90%, 0.9) 50%,
        transparent 52%
    );
    background-repeat: no-repeat;
    background-size: 300% 300%;
    background-position: center 200%;
    animation: text 0.66s ease-in infinite;
}

.styled-button.trending .shimmer::before,
.styled-button.trending .shimmer::after {
    opacity: 1;
    animation: shine 1.2s ease-in infinite;
}

/* Loading Bar Container */
#loading-bar-container {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
        0 0 30px hsla(var(--glow-hue), 100%, 70%, 0.5);
}

#loading-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.7) 100%
    );
    border-radius: 30px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7),
        0 0 20px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    animation: loadingGlow 2s infinite;
}

@keyframes loadingGlow {
    0% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.7),
            0 0 20px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 1),
            0 0 30px rgba(255, 255, 255, 0.8);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.7),
            0 0 20px rgba(255, 255, 255, 0.5);
    }
}

#loading-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transform: skewX(-20deg);
    animation: loadingShimmer 2s infinite;
}

@keyframes loadingShimmer {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

/* Navigation Buttons */
#nav-buttons {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-button {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all var(--spring-duration) var(--spring-easing);
    isolation: isolate;
    box-shadow: 0 2px 3px 1px hsl(var(--glow-hue) 50% 20% / 50%),
        inset 0 -10px 20px -10px hsla(var(--shadow-hue), 10%, 90%, 95%);
    transform: scale(1);
}

.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.2);
    box-shadow: 0 4px 8px -2px hsl(var(--glow-hue) 50% 20% / 50%),
        inset 0 0 0 transparent;
}

.nav-button:active {
    transform: scale(1.1);
    transition-duration: calc(var(--spring-duration) * 0.5);
}

/* Responsive Styles */
@media (max-width: 600px) {
    #logo {
        width: 50px;
    }

    #overlay-logo {
        width: 50%;
        max-width: 150px;
    }

    #intro-content h1 {
        font-size: 24px;
    }

    #intro-content p {
        font-size: 14px;
    }

    #nav-buttons {
        gap: 15px;
    }

    .nav-button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .styled-button {
        bottom: 90px;
        font-size: 16px;
    }

    #start-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    #loading-bar-container {
        height: 10px;
    }

    #loading-bar::after {
        width: 40%;
    }

    #intro-bottom-buttons {
        flex-direction: column;
        gap: 20px;
    }
}
