/* ==========================================================================
   Responsive Styles - Media Queries
   ========================================================================== */

/* ==========================================================================
   Extra Small Devices (Phones, < 576px)
   ========================================================================== */

@media (max-width: 575.98px) {
    /* Hero */
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }
    
    .stat-item:not(:last-child)::after {
        display: none;
    }
    
    .hero-cta .btn {
        width: 100%;
    }
    
    /* Section Titles */
    .section-title {
        font-size: var(--text-3xl);
    }
    
    /* Portfolio */
    .portfolio-filter {
        gap: var(--space-2);
    }
    
    .filter-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-xs);
    }
    
    /* About */
    .about-image .accent-image {
        width: 150px;
        right: -15px;
        bottom: -20px;
    }
    
    .experience-badge {
        width: 90px;
        height: 90px;
        top: -10px;
        left: -10px;
    }
    
    .experience-badge .number {
        font-size: var(--text-2xl);
    }
    
    .awards-grid {
        grid-template-columns: 1fr;
    }
    
    /* Process */
    .timeline-line {
        left: 20px;
    }
    
    .step-marker {
        width: 40px;
        height: 40px;
    }
    
    .step-number {
        font-size: var(--text-base);
    }
    
    .step-content {
        max-width: calc(100% - 60px);
    }
    
    /* Footer */
    .footer-links {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Small Devices (Landscape Phones, 576px - 767px)
   ========================================================================== */

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Hero */
    .hero-title {
        font-size: var(--text-5xl);
    }
    
    .hero-stats {
        gap: var(--space-6);
    }
    
    /* Awards */
    .awards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Medium Devices (Tablets, 768px - 1023px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1023.98px) {
    /* Hero */
    .hero-content {
        padding-top: var(--space-24);
    }
    
    .hero-title {
        font-size: var(--text-5xl);
    }
    
    /* Portfolio */
    .portfolio-item.large {
        grid-column: span 1;
    }
    
    /* About */
    .about-grid {
        gap: var(--space-10);
    }
    
    /* Testimonials */
    .testimonial-card {
        padding: var(--space-6);
    }
}

/* ==========================================================================
   Large Devices (Desktops, 1024px - 1279px)
   ========================================================================== */

@media (min-width: 1024px) and (max-width: 1279.98px) {
    /* Navigation */
    .nav-menu {
        gap: var(--space-6);
    }
    
    /* Hero */
    .hero-title {
        font-size: var(--text-5xl);
    }
    
    /* Services */
    .service-card {
        padding: var(--space-6);
    }
}

/* ==========================================================================
   Extra Large Devices (Large Desktops, >= 1280px)
   ========================================================================== */

@media (min-width: 1280px) {
    /* Container */
    .container {
        max-width: var(--container-xl);
    }
    
    /* Hero */
    .hero-content {
        gap: var(--space-16);
    }
    
    /* Portfolio */
    .portfolio-grid {
        gap: var(--space-8);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    thead {
        display: table-header-group;
    }
    
    tr,
    img {
        page-break-inside: avoid;
    }
    
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
    
    /* Hide non-essential elements */
    nav,
    .hero-social,
    .scroll-indicator,
    .back-to-top,
    .video-modal,
    #preloader,
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
    :root {
        --color-primary: #ff4500;
        --color-border: #000000;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .nav-link::before {
        height: 3px;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@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;
    }
    
    .marquee-track {
        animation: none;
    }
    
    .film-reel {
        animation: none;
    }
    
    .float-item {
        animation: none;
    }
}

/* ==========================================================================
   Dark Mode Adjustments
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg-primary: #0d0d0d;
        --color-bg-secondary: #1a1a1a;
        --color-text-primary: #ffffff;
        --color-text-secondary: #a0a0a0;
        --color-border: #2a2a2a;
    }
}

/* ==========================================================================
   Touch Device Adjustments
   ========================================================================== */

@media (hover: none) {
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none;
    }
    
    .project-card .image-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
    }
    
    .btn::before {
        display: none;
    }
}

/* ==========================================================================
   Landscape Orientation Adjustments
   ========================================================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: var(--space-16) 0;
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .mobile-nav-content {
        padding: var(--space-8);
    }
    
    .mobile-link {
        font-size: var(--text-2xl);
    }
}

/* ==========================================================================
   Safe Area Insets (for notched devices)
   ========================================================================== */

@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(var(--space-6), env(safe-area-inset-left));
        padding-right: max(var(--space-6), env(safe-area-inset-right));
    }
    
    .footer {
        padding-bottom: max(var(--space-6), env(safe-area-inset-bottom));
    }
    
    .mobile-nav {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* ==========================================================================
   Container Queries (if supported)
   ========================================================================== */

@supports (container-type: inline-size) {
    .portfolio-grid {
        container-type: inline-size;
    }
    
    @container (max-width: 600px) {
        .portfolio-item {
            grid-column: span 1 !important;
        }
    }
}

/* ==========================================================================
   HiDPI / Retina Display Adjustments
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .hero-image,
    .project-card img,
    .about-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}