/* =================================================================
   APEX Cetacea - Landing Page Styles
   Mobile-First Responsive Design
   ================================================================= */

/* CSS Custom Properties (Variables) */
:root {
    --primary-color: #0a1929;
    --secondary-color: #1e3a5f;
    --accent-color: #4fc3f7;
    --text-color: #ffffff;
    --overlay-bg: rgba(10, 25, 41, 0.7);
    --transition-speed: 0.3s;
    --spacing-unit: 1rem;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--primary-color);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Accessibility - Visually Hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =================================================================
   Loading Screen
   ================================================================= */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
}

.loading-logo {
    width: 200px;
    height: auto;
    max-width: 80vw;
    animation: fadeInScale 1s ease-out;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4))
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.3))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.2));
}

/* Loading Spinner Animation */
.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: rgba(79, 195, 247, 0.6);
    animation-delay: -0.5s;
    animation-duration: 2s;
}

.spinner-ring:nth-child(3) {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border-top-color: rgba(79, 195, 247, 0.3);
    animation-delay: -1s;
    animation-duration: 2.5s;
}

.loading-text {
    font-size: 1rem;
    color: var(--accent-color);
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
}

/* =================================================================
   Main Content
   ================================================================= */

.main-content {
    opacity: 0;
    transition: opacity 0.8s ease-in 0.3s;
    width: 100%;
    margin: 0;
    padding: 0;
}

.main-content.visible {
    opacity: 1;
}

/* Header with Logo */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-unit);
    z-index: 100;
    background: linear-gradient(to bottom, var(--overlay-bg) 0%, transparent 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-logo {
    width: 150px;
    height: auto;
    max-width: 60vw;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4))
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.3))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.2))
            drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition-speed) ease;
}

.main-logo:hover {
    transform: scale(1.05);
}

/* =================================================================
   Video Section
   ================================================================= */

.video-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background-color: #000000;
}

.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 1s ease-in;
    display: block;
}

.background-video.loaded {
    opacity: 1;
}

/* Video Controls Overlay */
.video-overlay {
    position: absolute;
    bottom: calc(var(--spacing-unit) * 2);
    right: calc(var(--spacing-unit) * 2);
    z-index: 10;
}

.video-toggle {
    background: var(--overlay-bg);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.video-toggle:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.video-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

.video-toggle .play-icon,
.video-toggle .pause-icon {
    font-size: 1.25rem;
    color: var(--text-color);
    display: none;
}

.video-toggle.paused .play-icon {
    display: block;
}

.video-toggle.playing .pause-icon {
    display: block;
}

/* =================================================================
   Content Section (Optional)
   ================================================================= */

.content-section {
    min-height: 50vh;
    padding: calc(var(--spacing-unit) * 4) var(--spacing-unit);
    background: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* =================================================================
   Animations
   ================================================================= */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =================================================================
   Responsive Design - Mobile Specific
   ================================================================= */

@media screen and (max-width: 767px) {
    /* Mobile optimization */
    .video-section {
        height: 100vh;
        height: 100dvh;
    }

    /* Smaller logo on mobile */
    .loading-logo {
        width: 160px;
    }

    .main-logo {
        width: 120px;
    }

    /* Adjust video controls for mobile */
    .video-toggle {
        width: 50px;
        height: 50px;
        font-size: 0.875rem;
    }

    .video-overlay {
        bottom: var(--spacing-unit);
        right: var(--spacing-unit);
    }
}

/* =================================================================
   Responsive Design - Tablets
   ================================================================= */

@media screen and (min-width: 768px) {
    .loading-logo {
        width: 250px;
    }

    .main-logo {
        width: 180px;
    }

    .header {
        padding: calc(var(--spacing-unit) * 1.5);
    }

    .loading-spinner {
        width: 100px;
        height: 100px;
    }

    .video-toggle {
        width: 70px;
        height: 70px;
    }
}

/* =================================================================
   Responsive Design - Desktop
   ================================================================= */

@media screen and (min-width: 1024px) {
    .loading-logo {
        width: 300px;
    }

    .main-logo {
        width: 220px;
    }

    .header {
        padding: calc(var(--spacing-unit) * 2);
    }

    .loading-text {
        font-size: 1.125rem;
    }

    .video-toggle {
        width: 80px;
        height: 80px;
    }
}

/* =================================================================
   Orientation Support
   ================================================================= */

@media screen and (orientation: portrait) {
    .video-section {
        height: 100vh;
        height: 100dvh;
    }
}

@media screen and (orientation: landscape) {
    .video-section {
        height: 100vh;
        height: 100dvh;
    }
}

/* =================================================================
   Reduced Motion Support (Accessibility)
   ================================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loading-logo,
    .spinner-ring {
        animation: none;
    }
}

/* =================================================================
   Print Styles
   ================================================================= */

@media print {
    .loading-screen,
    .video-section,
    .video-toggle {
        display: none;
    }

    .main-content {
        opacity: 1;
    }
}
