/* Main Layout and Global Styles */

body {
    background:
        radial-gradient(ellipse at 20% 90%, rgba(184, 41, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 10%, rgba(0, 245, 255, 0.04) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(21, 25, 50, 0.5) 0%, transparent 70%),
        var(--color-bg-primary);
    overflow-x: hidden;
    position: relative;
}


/* Animated Glowing Scanline - One-time on load */
body::after {
    content: '';
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 245, 255, 0.1) 30%,
        rgba(0, 245, 255, 0.2) 50%,
        rgba(0, 245, 255, 0.1) 70%,
        transparent
    );
    box-shadow: 0 0 50px rgba(0, 245, 255, 0.3);
    animation: scanlineOnce 3s ease-out forwards;
}

/* Canvas Background */
#geometric-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    animation: particleFadeIn 1s ease;
}

/* Main Content Wrapper */
main {
    position: relative;
    z-index: var(--z-base);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection Styling */
::selection {
    background-color: var(--color-accent-cyan);
    color: var(--color-bg-primary);
}

::-moz-selection {
    background-color: var(--color-accent-cyan);
    color: var(--color-bg-primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-accent-cyan), var(--color-accent-purple));
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-accent-cyan), var(--color-accent-purple));
    box-shadow: 0 0 10px var(--glow-cyan);
}

/* Focus Styles for Accessibility */
*:focus-visible {
    outline: 2px solid var(--color-accent-cyan);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

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

/* Loading State */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Disabled State */
.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Container Utilities */
@media (max-width: 1536px) {
    .container {
        max-width: var(--container-lg);
    }
}

@media (max-width: 1280px) {
    .container {
        max-width: var(--container-md);
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: var(--container-sm);
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }
}

/* Performance Optimizations */
.hero-section,
.features-section,
.tech-section {
    will-change: transform, opacity;
}

.cta-button,
.feature-card {
    will-change: transform;
}

/* Print Styles */
@media print {
    #geometric-bg,
    .scroll-indicator {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .site-header {
        position: relative;
        background: white;
        border-bottom: 1px solid black;
    }

    .logo {
        color: black;
        text-shadow: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .feature-card,
    .stat-item {
        border-width: 2px;
    }

    .cta-button {
        border: 2px solid var(--color-text-primary);
    }
}

/* Dark Mode Support (already dark, but for completeness) */
@media (prefers-color-scheme: light) {
    /* Keep dark theme even in light mode preference for this futuristic design */
}

/* Landscape Mobile Adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: var(--space-2xl) var(--space-xl);
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
        margin-bottom: var(--space-lg);
    }

    .scroll-indicator {
        display: none;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .cta-button,
    .feature-card {
        transform: none;
    }

    .cta-button:active {
        transform: scale(0.98);
    }

    .feature-card:active {
        transform: scale(0.98);
    }
}
