/* ==========================================================================
   Base Styles
   ========================================================================== */

/* Body */
body {
    font-family: var(--font-sans);
    background: var(--gradient-body);
    color: var(--text-secondary);
    min-height: 100vh;
    position: relative;
}

/* Grid overlay effect */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(var(--cyber-blue-rgb), 0.03) 0%, transparent 50%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(var(--cyber-blue-rgb), 0.02) 2px, rgba(var(--cyber-blue-rgb), 0.02) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(var(--cyber-blue-rgb), 0.02) 2px, rgba(var(--cyber-blue-rgb), 0.02) 4px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    pointer-events: none;
    z-index: var(--z-base);
}

/* Scanlines effect */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(var(--cyber-blue-rgb), 0.01) 0px,
        rgba(var(--cyber-blue-rgb), 0.01) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: var(--z-scanlines);
    opacity: 0.3;
}

/* ==========================================================================
   Section Backgrounds
   ========================================================================== */

.cyber-section {
    background: var(--gradient-body);
    position: relative;
}

.cyber-section-alt {
    background: linear-gradient(180deg, #0F1A2E 0%, var(--cyber-dark) 100%);
}

/* ==========================================================================
   Typography Utilities
   ========================================================================== */

.glow-text {
    animation: subtle-glow 3s ease-in-out infinite;
}

.font-mono {
    font-family: var(--font-mono);
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

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

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--cyber-blue);
    outline-offset: 2px;
}

/* ==========================================================================
   Mobile Responsive Utilities
   ========================================================================== */

/* Prevent horizontal overflow on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Adjust section padding on mobile */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Reduce grid gaps on mobile */
    .grid {
        gap: 1rem;
    }

    /* Text size adjustments */
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    /* Reduce decorative elements on mobile for performance */
    body::after,
    body::before {
        opacity: 0.15;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    /* Even smaller text on very small screens */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    /* Reduce padding further */
    section {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--cyber-blue);
    color: var(--cyber-dark);
    padding: 8px;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}
