/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Oswald', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    background: #000;
    -webkit-tap-highlight-color: transparent;
}

/* Video Container */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    background: #000;
    pointer-events: none;
}

.background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Mobile Video Scaling - Zoom to center for 16:9 format */
@media (max-width: 768px) {
    /* For portrait orientation - ensure center of video is visible */
    @media (orientation: portrait) {
        .background-video {
            height: 100vh;
            /* Make video wider to maintain 16:9, then center it horizontally */
            width: 177.78vh;
            /* Center horizontally */
            left: 50%;
            transform: translateX(-50%);
            object-fit: cover;
            object-position: center center;
        }
    }
    
    /* For landscape orientation on mobile */
    @media (orientation: landscape) and (max-width: 768px) {
        .background-video {
            width: 100vw;
            height: 100vh;
            left: 0;
            transform: none;
            object-fit: cover;
            object-position: center center;
        }
    }
}

/* Dark Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
    pointer-events: none;
}

/* Header Logo - Fixed top left */
.header-logo {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    padding: 1.5rem;
    padding-top: calc(1.5rem + env(safe-area-inset-top));
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    background: transparent;
}

.logo-header {
    max-width: clamp(120px, 20vw, 180px);
    width: auto;
    height: auto;
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4)) 
            drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    opacity: 0.98;
}

/* Main Content */
.content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for better mobile support */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
    /* Ensure consistent positioning across browsers */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.content-inner {
    max-width: 1200px;
    width: 100%;
    opacity: 0;
    animation: fadeIn 1.5s ease-in-out 0.5s forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    /* Ensure consistent positioning */
    position: relative;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.description {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(0.65rem, 1.5vw, 0.95rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    max-width: clamp(300px, 50vw, 600px);
    width: auto;
    margin: 0 auto;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    opacity: 0.85;
    white-space: nowrap;
    box-sizing: border-box;
    text-align: center;
    display: block;
}

.subheading {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    font-weight: 300;
    letter-spacing: 0.3em;
    color: #ffffff;
    text-transform: uppercase;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7),
                 0 0 20px rgba(0, 0, 0, 0.5);
    opacity: 0.95;
}

.cursor {
    display: inline-block;
    animation: blink 1s infinite;
    margin-left: 0.1em;
}

#cursor-tagline {
    display: none;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.tagline {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    font-weight: 400;
    letter-spacing: 0.2em;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    opacity: 0.9;
    line-height: 1.4;
}

.mobile-break {
    display: none;
}

/* Mobile Typography Adjustments */
@media (max-width: 768px) {
    .logo-header {
        max-width: clamp(140px, 28vw, 200px);
    }
    
    .content {
        padding: 1.5rem;
        /* Remove safe-area padding that might cause differences between browsers */
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        align-items: center;
        justify-content: center;
        /* Ensure consistent viewport height on mobile */
        height: 100vh;
        height: 100dvh;
        min-height: -webkit-fill-available;
        /* Lift content slightly to match Safari positioning */
        transform: translateZ(0) translateY(-2vh);
        -webkit-transform: translateZ(0) translateY(-2vh);
        /* Ensure top: 0 for consistent positioning */
        top: 0;
    }
    
    .content-inner {
        gap: 2rem;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .description {
        max-width: clamp(280px, 85vw, 600px);
        width: auto;
        margin: 0 auto;
        letter-spacing: 0.12em;
        font-size: clamp(0.75rem, 3.5vw, 1.1rem);
        white-space: nowrap;
        text-align: center;
        display: block;
    }
    
    .subheading {
        font-size: clamp(1.5rem, 6vw, 3rem);
        letter-spacing: 0.25em;
        margin: 0 auto;
        text-align: center;
    }
    
    .tagline {
        font-size: clamp(1rem, 4vw, 1.8rem);
        letter-spacing: 0.15em;
        margin: 0 auto;
        line-height: 1.4;
        text-align: center;
    }
    
    .mobile-break {
        display: block;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .content-inner {
        animation: none;
        opacity: 1;
    }
    
    .background-video {
        animation: none;
    }
}

/* Loading State */
.video-container.loading {
    background: #000;
}

.video-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
