/* =================================================================
   CSS RESET & BASE STYLES WITH PERFORMANCE OPTIMIZATIONS
================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Prevent horizontal scrolling */
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Prevent layout shifts */
    contain: layout style paint;
}

/* Hardware acceleration for animated elements */
.brand-title,
.brand-tagline,
.status-indicator,
.coming-soon-title,
.coming-soon-description,
.progress-container,
.loading-dots,
.email-signup,
.feature-card,
.footer-brand,
.social-links,
.footer-cta {
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* =================================================================
   CUSTOM PROPERTIES (CSS VARIABLES)
================================================================= */

:root {
    /* Colors */
    --primary-bg: #0a0a0a;
    --secondary-bg: #111111;
    --accent-color: #00d4ff;
    --accent-secondary: #ff6b6b;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-secondary: linear-gradient(135deg, #ff6b6b 0%, #cc5555 100%);
    --gradient-bg: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    
    /* Typography with improved fallbacks */
    --font-heading: 'Orbitron', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --section-padding: 6rem 2rem;
    --container-max-width: 1200px;
    
    /* Animations */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-index layers */
    --z-background: -10;
    --z-particles: -5;
    --z-content: 1;
    --z-nav: 100;
    --z-overlay: 1000;
}

/* =================================================================
   3D BACKGROUND CANVAS
================================================================= */

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    opacity: 0.6;
    /* Enhanced performance optimizations for zoom levels */
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    pointer-events: none;
    /* Optimize rendering during zoom */
    image-rendering: optimizeSpeed;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Prevent unnecessary repaints during zoom */
    contain: layout style paint;
}

/* =================================================================
   PARTICLE SYSTEM
================================================================= */

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-particles);
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0.7;
    animation: float 8s infinite linear;
    /* Performance optimizations */
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

@keyframes float {
    0% {
        transform: translate3d(0, 100vh, 0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translate3d(0, -10vh, 0) scale(1);
        opacity: 0;
    }
}

/* =================================================================
   LAYOUT & STRUCTURE
================================================================= */

.main-container {
    position: relative;
    z-index: var(--z-content);
    min-height: 100vh;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* =================================================================
   NAVIGATION
================================================================= */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: var(--z-nav);
    transition: var(--transition-smooth);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
}

.logo-text {
    color: var(--text-primary);
}

.logo-accent {
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-color);
}

/* =================================================================
   HERO SECTION
================================================================= */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--section-padding);
    background: var(--gradient-bg);
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Brand Styling */
.hero-brand {
    margin-bottom: 4rem;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 1rem;
    /* Start visible, animate from this state */
    opacity: 0.3;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* Prevent font swap issues */
    font-feature-settings: "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure consistent baseline and prevent layout shifts */
    font-variant-numeric: tabular-nums;
}

.brand-jds {
    color: var(--text-primary);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.brand-devs {
    color: var(--accent-color);
    text-shadow: 0 0 30px var(--accent-color);
}

.brand-tagline {
    font-family: var(--font-body);
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    /* Start slightly visible, animate to full visibility */
    opacity: 0.4;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Status Section */
.hero-status {
    margin-bottom: 4rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
}

.status-dot {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 20px var(--accent-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.status-text {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.coming-soon-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(30px);
}

.coming-soon-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
    opacity: 0;
    transform: translateY(30px);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(30px);
}

.progress-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    width: 0%;
    transition: width 2s ease-out;
}

.progress-glow {
    position: absolute;
    top: -2px;
    left: 0;
    height: 8px;
    width: 20px;
    background: var(--accent-color);
    border-radius: 4px;
    filter: blur(4px);
    opacity: 0.8;
    transform: translateX(-10px);
}

.progress-percentage {
    text-align: right;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--accent-color);
}

/* Loading Dots */
.loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(30px);
}

.loading-dots span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dots {
    display: flex;
    gap: 0.3rem;
}

.dots span {
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: dot-loading 1.5s infinite;
}

.dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-loading {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* =================================================================
   EMAIL SIGNUP
================================================================= */

.email-signup {
    max-width: 500px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
}

.signup-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.input-group {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-radius: 50px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

#email-input {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

#email-input::placeholder {
    color: var(--text-muted);
}

.notify-btn {
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.notify-btn:hover {
    transform: translateX(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
}

.btn-icon {
    transition: var(--transition-smooth);
}

.notify-btn:hover .btn-icon {
    transform: translateX(2px);
}

.signup-disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

/* =================================================================
   SCROLL INDICATOR
================================================================= */

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1s ease-out 3s forwards;
}

.scroll-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.scroll-arrow {
    animation: bounce 2s infinite;
}

.scroll-arrow i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* =================================================================
   FEATURES PREVIEW SECTION
================================================================= */

.features-preview {
    padding: var(--section-padding);
    background: var(--secondary-bg);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(50px);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    text-align: center;
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(50px);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.feature-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =================================================================
   FOOTER
================================================================= */

.footer {
    background: var(--primary-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    align-items: center;
    text-align: center;
}

.footer-brand {
    opacity: 0;
    transform: translateY(30px);
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-color);
}

.footer-tagline {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 300;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(30px);
}

.social-link {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    font-size: 1.2rem;
}

.social-link:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

.footer-cta {
    opacity: 0;
    transform: translateY(30px);
}

.footer-cta p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.cta-btn {
    padding: 0.8rem 2rem;
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.cta-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =================================================================
   RESPONSIVE DESIGN
================================================================= */

@media (max-width: 768px) {
    :root {
        --section-padding: 4rem 1rem;
    }
    
    .nav {
        padding: 1rem;
    }
    
    .nav-logo {
        font-size: 1.3rem;
    }
    
    .hero {
        padding: 6rem 1rem 2rem; /* Increased top padding to account for fixed nav */
        min-height: 100vh;
        padding-top: calc(80px + 2rem); /* Nav height + extra space */
        padding-bottom: 4rem; /* Extra bottom padding for mobile */
    }
    
    .hero-brand {
        margin-bottom: 2.5rem; /* Reduced margin for better mobile spacing */
    }
    
    .brand-title {
        margin-bottom: 0.5rem; /* Reduced margin to prevent overlap */
    }
    
    .brand-tagline {
        margin-bottom: 1rem; /* Add margin to create separation */
    }
    
    .hero-status {
        margin-bottom: 3rem;
    }
    
    .email-signup {
        margin-bottom: 3rem; /* Add extra margin at bottom for mobile */
    }
    
    .signup-disclaimer {
        margin-bottom: 2rem; /* Add space below disclaimer text */
    }
    
    .scroll-indicator {
        display: none; /* Hide scroll indicator on mobile to prevent overlap */
    }
    
    .input-group {
        flex-direction: column;
        border-radius: 15px;
    }
    
    .notify-btn {
        border-radius: 15px;
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding-top: calc(70px + 1.5rem); /* Adjust for smaller nav on small screens */
    }
    
    .brand-title {
        font-size: 2.5rem; /* Smaller on very small screens */
        margin-bottom: 0.3rem;
    }
    
    .brand-tagline {
        font-size: 0.9rem; /* Slightly smaller tagline */
        margin-bottom: 1.5rem;
    }
    
    .coming-soon-title {
        font-size: 2rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .footer {
        padding: 2rem 1rem 1rem;
    }
}

/* =================================================================
   ACCESSIBILITY & PERFORMANCE OPTIMIZATIONS
================================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Disable 3D transforms for reduced motion */
    .particle,
    #bg-canvas {
        display: none !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus,
a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: #cccccc;
        --text-muted: #999999;
    }
}

/* Performance optimizations for animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translate3d(0, 0, 0) scale(1.2);
    }
}

@keyframes dot-loading {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translate3d(0, 0, 0) scale(0.8);
    }
    30% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1.2);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40% {
        transform: translate3d(0, -5px, 0);
    }
    60% {
        transform: translate3d(0, -3px, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(-50%, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(-50%, 0, 0);
    }
}

/* =================================================================
   PERFORMANCE OPTIMIZATIONS FOR ZOOM LEVELS
================================================================= */

/* Optimize performance when viewport is very large (zoomed out) */
@media (min-width: 2400px), (min-height: 1400px) {
    /* Reduce expensive effects when zoomed out */
    #bg-canvas {
        opacity: 0.3; /* Reduce opacity to make rendering faster */
        filter: blur(1px); /* Slight blur can hide lower quality rendering */
    }
    
    /* Reduce animations when zoomed out */
    .brand-title,
    .brand-tagline,
    .status-indicator,
    .progress-container {
        animation-duration: 0.5s; /* Faster animations */
    }
    
    /* Simplify particle effects */
    #particles {
        opacity: 0.5;
    }
    
    /* Disable some expensive effects */
    .brand-jds,
    .brand-devs {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); /* Reduced glow */
    }
}

/* Extra performance mode for extremely large viewports */
@media (min-width: 3200px), (min-height: 2000px) {
    #bg-canvas {
        opacity: 0.2;
        filter: blur(2px);
    }
    
    #particles {
        display: none; /* Hide CSS particles completely */
    }
    
    /* Minimal effects only */
    .brand-jds,
    .brand-devs {
        text-shadow: none;
    }
    
    .status-dot {
        animation: none; /* Disable pulsing */
        background: var(--accent-color);
    }
}
