/* Mobile-first responsive design */

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 1rem;
        min-height: 90vh;
    }
    
    .terminal-window {
        margin-bottom: 2rem;
    }
    
    .terminal-body {
        padding: 1rem;
    }
    
    .name {
        font-size: 1.8rem;
    }
    
    .title {
        font-size: 1rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .tech-stack {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .tech-item {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .social-links {
        gap: 0.8rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    section {
        padding: 3rem 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .profile-section {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .profile-image {
        width: 150px;
        height: 150px;
    }
    
    .profile-info h3 {
        font-size: 1.5rem;
    }
    
    .profile-title {
        font-size: 1rem;
    }
    
    .about-card {
        padding: 1.5rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.8rem;
    }
    
    .skill-item {
        padding: 1rem 0.5rem;
    }
    
    .skill-item i {
        font-size: 1.5rem;
    }
    
    .skill-item span {
        font-size: 0.8rem;
    }
    
    .projects-container {
        grid-template-columns: 1fr;
    }
    
    .project-card {
        margin-bottom: 1rem;
    }
    
    .project-content {
        padding: 1.5rem;
    }
    
    .achievements-container {
        grid-template-columns: 1fr;
    }
    
    .achievement-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .achievement-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info {
        gap: 1rem;
    }
    
    .contact-item {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* Small devices (portrait tablets and large phones, 600px to 768px) */
@media only screen and (min-width: 600px) and (max-width: 768px) {
    .about-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .projects-container {
        grid-template-columns: 1fr;
    }
    
    .achievements-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
}

/* Medium devices (landscape tablets, 768px to 992px) */
@media only screen and (min-width: 768px) and (max-width: 992px) {
    .hamburger {
        display: none;
    }
    
    .nav-menu {
        position: static;
        flex-direction: row;
        background: none;
        box-shadow: none;
        width: auto;
        padding: 0;
    }
    
    .about-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .projects-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Large devices (laptops/desktops, 992px to 1200px) */
@media only screen and (min-width: 992px) and (max-width: 1200px) {
    .projects-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {
    .projects-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .achievements-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Landscape orientation adjustments */
@media only screen and (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 1rem;
    }
    
    .terminal-window {
        margin-bottom: 1rem;
    }
    
    .hero-actions {
        margin-bottom: 1rem;
    }
    
    .scroll-indicator {
        bottom: 1rem;
    }
}

/* High DPI displays */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
       only screen and (min-resolution: 192dpi) {
    .project-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: optimize-contrast;
    }
}

/* Reduced motion for accessibility */
@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;
    }
    
    .typing-animation {
        animation: none;
        border: none;
    }
    
    .floating-code::before {
        animation: none;
    }
    
    .tech-grid {
        animation: none;
    }
}

/* Print styles */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .animated-bg,
    .cursor-dot,
    .cursor-outline,
    .navbar,
    .scroll-indicator,
    footer {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }
    
    .terminal-window {
        border: 2px solid black;
    }
    
    .hero-actions,
    .social-links {
        display: none;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .cursor-dot,
    .cursor-outline {
        display: none;
    }
    
    .nav-link:hover::after {
        width: 0;
    }
    
    .social-link:hover,
    .project-card:hover,
    .skill-item:hover,
    .about-card:hover,
    .achievement-card:hover {
        transform: none;
        box-shadow: 0 5px 15px var(--shadow-color);
    }
    
    /* Increase touch targets */
    .nav-link,
    .social-link,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        min-width: 44px;
    }
}
