/* ===================================
   RESPONSIVE DESIGN & MEDIA QUERIES
   Author: Hardik
   =================================== */

/* ===== TABLET & BELOW (768px) ===== */
@media (max-width: 768px) {
    /* Layout */
    .wrap {
        padding: 0 var(--space-lg);
    }
    
    /* Navigation */
    .nav-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        right: 0;
        width: 240px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-xl);
        padding: var(--space-lg);
        flex-direction: column;
        gap: var(--space-md);
        transform: translateX(calc(100% + var(--space-lg)));
        transition: transform var(--transition-base);
        backdrop-filter: blur(var(--backdrop-blur-strong));
        -webkit-backdrop-filter: blur(var(--backdrop-blur-strong));
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-links a {
        font-size: var(--fs-base);
        padding: var(--space-sm) 0;
    }
    
    /* Hero */
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
        letter-spacing: -2px;
    }
    
    .hero-3d {
        opacity: 0.3;
        width: 85%;
        right: -20%;
    }
    
    .hero-subtitle {
        font-size: var(--fs-base);
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-xl);
    }
    
    .hero-buttons {
        width: 100%;
    }
    
    .hero-buttons .btn {
        flex: 1;
        min-width: 140px;
    }
    
    /* About Section */
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    /* Big Text */
    .big-text {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }
    
    /* Timeline */
    .timeline {
        padding-left: var(--space-xl);
    }
    
    .timeline-dot {
        left: calc(-1 * var(--space-xl) - 5px);
    }
    
    /* Skills Section */
    .orb-container {
        width: min(85vw, 400px);
        height: min(85vw, 400px);
    }
    
    /* Projects */
    .projects-title-bg {
        font-size: clamp(6rem, 20vw, 12rem);
    }
    
    .project-card {
        width: min(85vw, 350px);
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Form */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .contact-buttons {
        flex-direction: column;
    }
    
    .contact-buttons .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-links {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    /* Dock */
    .dock {
        right: var(--space-sm);
        left: var(--space-sm);
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .dock-terminal {
        width: 100%;
        text-align: center;
    }
}

/* ===== MOBILE (640px) ===== */
@media (max-width: 640px) {
    /* Typography */
    :root {
        --fs-hero: clamp(2rem, 10vw, 3.5rem);
    }
    
    /* Spacing */
    section {
        padding: clamp(2rem, 5vw, 3rem) 0;
    }
    
    /* Hero */
    .hero {
        min-height: 90vh;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-item {
        min-width: 100px;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Skills Bars */
    .skill-info {
        font-size: var(--fs-sm);
    }
    
    /* Project Cards */
    .project-number {
        font-size: 3rem;
    }
    
    .project-card h3 {
        font-size: var(--fs-xl);
    }
    
    /* Testimonials */
    .testimonial-card {
        padding: var(--space-xl);
    }
    
    .testimonial-text {
        font-size: var(--fs-base);
    }
    
    /* Terminal */
    .terminal-bar {
        font-size: 0.625rem;
    }
    
    .terminal-content {
        padding: var(--space-md);
        font-size: 0.75rem;
    }
    
    /* Boot Screen */
    .boot-wrapper {
        width: 95vw;
    }
    
    .boot-text {
        font-size: var(--fs-sm);
        min-height: 200px;
    }
}

/* ===== LARGE SCREENS (1024px+) ===== */
@media (min-width: 1024px) {
    .wrap {
        max-width: 1200px;
    }
    
    .hero-stats {
        gap: var(--space-4xl);
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== EXTRA LARGE SCREENS (1280px+) ===== */
@media (min-width: 1280px) {
    .wrap {
        max-width: 1280px;
    }
    
    .hero-3d {
        width: 500px;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-3xl) 0;
    }
    
    .hero-3d {
        display: none;
    }
    
    .boot-screen {
        padding: var(--space-md);
    }
    
    .boot-text {
        min-height: 150px;
    }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work well on touch */
    .card:hover::before {
        opacity: 0;
    }
    
    .tech-chips span:hover {
        transform: none;
    }
    
    /* Make interactive elements larger */
    .btn {
        min-height: 48px;
    }
    
    .dock button {
        width: 36px;
        height: 36px;
    }
    
    /* Disable cursor trail on touch devices */
    #cursor-trail {
        display: none;
    }
    
    /* Disable magnetic effects */
    .magnetic {
        translate: 0 0 !important;
    }
}

/* ===== HIGH DPI SCREENS ===== */
@media (min-resolution: 2dppx) {
    /* Improve text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .dock,
    .boot-screen,
    .terminal-overlay,
    .nav-toggle,
    #cursor-trail,
    #glow,
    #bg,
    .scroll-progress {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .wrap {
        max-width: 100%;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    .hero-3d {
        display: none;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* ===== DARK MODE (System Preference) ===== */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but can add adjustments here */
}

/* ===== LIGHT MODE (if implemented later) ===== */
@media (prefers-color-scheme: light) {
    /* Light mode can be implemented here in the future */
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.4);
        --bg-card: rgba(255, 255, 255, 0.15);
    }
    
    .btn {
        border-width: 2px;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ===== SMALL HEIGHT DEVICES ===== */
@media (max-height: 700px) {
    .hero {
        min-height: auto;
        padding: var(--space-2xl) 0;
    }
    
    section {
        padding: var(--space-2xl) 0;
    }
}

/* ===== CONTAINER QUERIES (Modern Browsers) ===== */
@supports (container-type: inline-size) {
    .project-card {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .project-number {
            font-size: 2.5rem;
        }
        
        .project-card h3 {
            font-size: var(--fs-lg);
        }
    }
}

/* ===== REDUCED DATA MODE ===== */
@media (prefers-reduced-data: reduce) {
    /* Disable heavy animations and effects */
    #bg,
    #glow,
    .hero-3d {
        display: none;
    }
    
    .boot-screen {
        display: none !important;
    }
}

/* ===== ASPECT RATIO ADJUSTMENTS ===== */
@media (min-aspect-ratio: 16/9) {
    .hero-3d {
        width: 40%;
    }
}

@media (max-aspect-ratio: 1/1) {
    .hero-3d {
        position: static;
        transform: none;
        margin: var(--space-xl) auto;
        width: 70%;
    }
}
