/* ============================================
   RESET & BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background: #000000;
}

body {
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    background: #000000;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Body loaded state */
body.loaded {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   LOADING SCREENS
   ============================================ */

/* Critical loading (removed by JavaScript) */
#critical-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#critical-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

/* CSS loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   VIDEO BACKGROUND - MOBILE OPTIMIZED
   ============================================ */

.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    overflow: hidden;
    background: #000000;
}

#bgVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    background: #000000;
    
    /* Performance optimizations */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    
    /* Fade in */
    opacity: 0;
    transition: opacity 1s ease;
}

#bgVideo.loaded {
    opacity: 1;
}

/* Video fallback image */
.video-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000000;
    display: none;
}

/* Video overlay for text readability */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -2;
}

/* Grain overlay for texture */
.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.08;
    pointer-events: none;
    z-index: -1;
    mix-blend-mode: overlay;
}

/* ============================================
   HEADER WITH LOGO
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 20px;
    z-index: 100;
    background: transparent;
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
}

body.loaded .header {
    opacity: 1;
    transform: translateY(0);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-logo {
    max-width: 180px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 70px 20px 20px;
    position: relative;
    background: transparent;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease 0.6s, transform 0.8s ease 0.6s;
}

body.loaded .content {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   TAGLINE
   ============================================ */

.tagline-container {
    margin-bottom: 40px;
    text-align: center;
    padding: 0 20px;
}

.tagline {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    line-height: 1.3;
}

.sub-tagline {
    font-size: clamp(14px, 3vw, 18px);
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   SUBSCRIPTION SECTION
   ============================================ */

.subscription-container {
    width: 100%;
    max-width: 650px;
    padding: 0 20px;
}

.subscription-box {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.email-form {
    width: 100%;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    padding: 5px;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Email Input */
#emailInput {
    flex: 1;
    padding: 16px 22px;
    background: transparent;
    border: none;
    border-radius: 50px;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}

#emailInput::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

#emailInput:focus {
    background: rgba(255, 255, 255, 0.05);
}

/* Submit Button */
.submit-btn {
    padding: 16px 35px;
    background: #ffffff;
    border: none;
    border-radius: 50px;
    color: #000000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 120px;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.submit-btn:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: rgba(255, 255, 255, 0.7);
    color: rgba(0, 0, 0, 0.5);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading state for button */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   MESSAGE CONTAINER
   ============================================ */

.message-container {
    margin-top: 15px;
    min-height: 50px;
    text-align: center;
    width: 100%;
}

.message {
    font-size: 15px;
    padding: 14px 25px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
    animation: fadeIn 0.4s ease;
    max-width: 90%;
    word-wrap: break-word;
    line-height: 1.5;
    font-weight: 500;
    letter-spacing: 0.03em;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    margin: 10px auto;
}

.message.success {
    color: #43e97b;
    background: rgba(67, 233, 123, 0.15);
    border-color: rgba(67, 233, 123, 0.4);
    text-shadow: 0 0 10px rgba(67, 233, 123, 0.3);
}

.message.error {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.4);
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-15px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 25px 20px;
    text-align: center;
    background: transparent;
    opacity: 0;
    transition: opacity 0.8s ease 0.8s;
}

body.loaded .footer {
    opacity: 1;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.social-icon {
    color: #ffffff;
    font-size: 20px;
    transition: 0.3s;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.social-icon:hover {
    color: #f0f0f0;
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
}

.copyright {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
    padding: 0 10px;
}

/* ============================================
   MOBILE RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet - 768px and below */
@media (max-width: 768px) {
    .header {
        padding: 8px 15px;
    }
    
    .header-logo {
        max-width: 140px;
    }
    
    .content {
        padding: 60px 15px 15px;
    }
    
    .tagline-container {
        margin-bottom: 35px;
    }
    
    .subscription-container {
        padding: 0 15px;
    }
    
    .input-group {
        gap: 8px;
        padding: 4px;
    }
    
    #emailInput {
        padding: 14px 18px;
        font-size: 16px;
    }
    
    .submit-btn {
        padding: 14px 25px;
        font-size: 15px;
        min-width: 110px;
    }
    
    .message {
        font-size: 14px;
        padding: 12px 20px;
        max-width: 95%;
    }
    
    .footer {
        padding: 20px 15px;
        position: relative;
        margin-top: 40px;
    }
}

/* Small Mobile - 576px and below */
@media (max-width: 576px) {
    .header {
        padding: 6px 12px;
    }
    
    .header-logo {
        max-width: 110px;
    }
    
    .content {
        padding: 50px 12px 12px;
    }
    
    .tagline {
        font-size: 22px;
    }
    
    .sub-tagline {
        font-size: 15px;
    }
    
    .subscription-container {
        padding: 0 10px;
    }
    
    /* Mobile vertical layout */
    .input-group {
        flex-direction: column;
        gap: 10px;
        border-radius: 15px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.12);
    }
    
    #emailInput {
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        text-align: center;
        padding: 16px;
        width: 100%;
    }
    
    .submit-btn {
        width: 100%;
        border-radius: 10px;
        padding: 16px;
        font-size: 16px;
    }
    
    .message {
        font-size: 13px;
        padding: 10px 15px;
        border-radius: 10px;
    }
}

/* Extra Small Mobile - 400px and below */
@media (max-width: 400px) {
    .header {
        padding: 5px 10px;
    }
    
    .header-logo {
        max-width: 90px;
    }
    
    .content {
        padding: 45px 10px 10px;
    }
    
    .tagline {
        font-size: 20px;
    }
    
    .sub-tagline {
        font-size: 14px;
    }
    
    .input-group {
        padding: 12px;
    }
    
    #emailInput {
        padding: 14px;
    }
    
    .submit-btn {
        padding: 14px;
    }
    
    .message {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* ============================================
   LANDSCAPE MODE
   ============================================ */

@media (max-height: 600px) and (orientation: landscape) {
    .header {
        padding: 5px 10px;
    }
    
    .header-logo {
        max-width: 80px;
    }
    
    .content {
        padding: 40px 10px 10px;
        justify-content: flex-start;
        min-height: auto;
    }
    
    .tagline-container {
        margin-bottom: 20px;
    }
    
    .tagline {
        font-size: 18px;
    }
    
    .sub-tagline {
        font-size: 13px;
    }
    
    .input-group {
        flex-direction: row;
        padding: 3px;
        border-radius: 30px;
    }
    
    #emailInput {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .submit-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .footer {
        position: relative;
        margin-top: 20px;
        padding: 15px 10px;
    }
    
    .message-container {
        min-height: 40px;
    }
    
    .message {
        font-size: 13px;
        padding: 8px 15px;
    }
}

/* ============================================
   iOS SAFARI SPECIFIC FIXES
   ============================================ */

@supports (-webkit-touch-callout: none) {
    /* iOS specific fixes */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    #emailInput {
        font-size: 16px;
    }
    
    .submit-btn {
        -webkit-appearance: none;
        border-radius: 50px;
    }
    
    /* Fix for video autoplay */
    #bgVideo {
        -webkit-playsinline: true;
        playsinline: true;
    }
}

/* ============================================
   REDUCED MOTION PREFERENCE
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .content, .header, .footer {
        transition: none;
        opacity: 1;
        transform: none;
    }
    
    #bgVideo {
        transition: none;
    }
    
    .message {
        animation: none;
    }
}

/* ============================================
   REDUCED DATA PREFERENCE
   ============================================ */

@media (prefers-reduced-data: reduce) {
    #bgVideo {
        display: none;
    }
    
    .video-fallback {
        display: block;
    }
    
    .video-container {
        background: linear-gradient(135deg, #0a0a1a 0%, #1a032b 100%);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus styles for keyboard navigation */
#emailInput:focus-visible,
.submit-btn:focus-visible,
.social-icon:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}