/* ==========================================================================
   ADVANCED RESPONSIVE DESIGN
   ========================================================================== */

/* Enhanced Mobile Navigation */
@media (max-width: 768px) {
    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100vw;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right var(--transition-normal);
        z-index: 999;
    }
    
    .nav__menu.active {
        right: 0;
    }
    
    .nav__list {
        flex-direction: column;
        gap: var(--space-2xl);
        text-align: center;
    }
    
    .nav__link {
        font-size: 1.5rem;
        font-weight: 600;
        padding: var(--space-md) 0;
    }
    
    .nav__toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
        z-index: 1001;
        position: relative;
    }
    
    .nav__toggle span {
        width: 24px;
        height: 3px;
        background: var(--accent-primary);
        border-radius: 2px;
        transition: all var(--transition-normal);
    }
    
    .nav__toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .nav__toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav__toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

/* Mobile Hero Adjustments */
@media (max-width: 768px) {
    .hero-advanced {
        min-height: 90vh;
        padding: 100px 0 var(--space-2xl);
    }
    
    .hero-content {
        padding: var(--space-lg) var(--space-md);
        text-align: center;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
        margin-bottom: var(--space-lg);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.25rem);
        margin-bottom: var(--space-xl);
    }
    
    .hero-actions {
        flex-direction: column;
        gap: var(--space-md);
        align-items: center;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
        margin-top: var(--space-xl);
    }
    
    .hero-stat {
        padding: var(--space-md);
    }
    
    .hero-stat-number {
        font-size: 2rem;
        margin-bottom: var(--space-xs);
    }
    
    .hero-stat-label {
        font-size: 0.75rem;
    }
    
    .hero-hologram {
        display: none;
    }
    
    .particles-container {
        opacity: 0.3;
    }
    
    .matrix-rain {
        opacity: 0.1;
    }
    
    .geometric-shape {
        opacity: 0.3;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-sm);
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .hero-content {
        padding: var(--space-md) var(--space-sm);
    }
    
    .text-display {
        font-size: clamp(2rem, 12vw, 3rem);
    }
    
    .text-heading {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }
    
    .card {
        padding: var(--space-lg);
    }
    
    .btn {
        padding: var(--space-sm) var(--space-lg);
        font-size: 0.875rem;
    }
    
    .btn--large {
        padding: var(--space-md) var(--space-xl);
        font-size: 1rem;
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-hologram {
        width: 250px;
        height: 250px;
        right: 5%;
    }
    
    .hero-content {
        max-width: 700px;
    }
    
    .grid--auto {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 var(--space-lg);
    }
}

/* Large Desktop Adjustments */
@media (min-width: 1440px) {
    .container {
        max-width: 1600px;
        padding: 0 var(--space-2xl);
    }
    
    .hero-content {
        max-width: 1200px;
    }
    
    .hero-title {
        font-size: clamp(4rem, 6vw, 8rem);
    }
    
    .hero-hologram {
        width: 500px;
        height: 500px;
        right: 8%;
    }
    
    .section {
        padding: var(--space-4xl) 0 var(--space-4xl);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(18, 18, 18, 0.8);
        --glass-border: rgba(255, 255, 255, 0.12);
    }
    
    .card {
        background: rgba(18, 18, 18, 0.9);
        border-color: rgba(255, 255, 255, 0.08);
    }
    
    .card:hover {
        border-color: var(--accent-primary);
    }
}

/* Reduced Motion Support */
@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;
    }
    
    .particles-container,
    .matrix-rain,
    .hero-geometry {
        display: none;
    }
    
    .hero-hologram {
        animation: none;
        transform: none;
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.9);
        --glass-border: rgba(255, 255, 255, 0.3);
        --text-secondary: #CCCCCC;
    }
    
    .card {
        border-width: 2px;
    }
    
    .btn {
        border-width: 3px;
    }
    
    .tag {
        border-width: 2px;
    }
}

/* Print Styles */
@media print {
    .header,
    .particles-container,
    .matrix-rain,
    .hero-geometry,
    .hero-hologram,
    .scroll-indicator,
    .btn {
        display: none !important;
    }
    
    .hero-advanced {
        min-height: auto;
        page-break-after: always;
    }
    
    .section {
        padding: var(--space-lg) 0;
        page-break-inside: avoid;
    }
    
    .card {
        border: 1px solid #000;
        background: #fff;
        color: #000;
        break-inside: avoid;
    }
    
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Focus Management for Accessibility */
@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .btn:hover {
        transform: none;
    }
    
    .card:focus,
    .btn:focus {
        transform: scale(1.02);
        outline: 3px solid var(--accent-primary);
        outline-offset: 4px;
    }
}

/* Enhanced Touch Targets */
@media (hover: none) {
    .btn,
    .nav__link,
    .card {
        min-height: 44px;
        min-width: 44px;
    }
    
    .tag {
        min-height: 32px;
        padding: var(--space-sm) var(--space-md);
    }
    
    .hero-stat {
        min-height: 120px;
    }
}

/* Orientation Changes */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-advanced {
        min-height: 100vh;
        padding: var(--space-2xl) 0;
    }
    
    .hero-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
        align-items: center;
    }
    
    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Ultra-wide Screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }
    
    .hero-content {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: var(--space-4xl);
        align-items: center;
    }
    
    .hero-hologram {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        grid-column: 2;
    }
}

/* Performance Optimizations for Low-end Devices */
@media (max-width: 768px) {
    .card::before,
    .card::after {
        display: none;
    }
    
    .particles-container .particle:nth-child(n+10) {
        display: none;
    }
    
    .matrix-rain .matrix-column:nth-child(n+5) {
        display: none;
    }
    
    .geometric-shape:nth-child(n+3) {
        display: none;
    }
}
