/* Responsive Design - Apple-inspired Mobile First Approach */

/* Base styles are mobile-first (320px and up) */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        padding: 0 var(--spacing-lg);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    :root {
        --font-size-5xl: 4rem;
        --font-size-4xl: 3rem;
        --font-size-3xl: 2.25rem;
        --font-size-2xl: 1.75rem;
    }
    
    .container {
        padding: 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    .profile-image {
        width: 320px;
        height: 320px;
    }
    
    .skills-list,
    .achievements-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-card {
        width: 480px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    :root {
        --font-size-5xl: 4.5rem;
    }
    
    .hero-title {
        font-size: var(--font-size-5xl);
    }
    
    .profile-image {
        width: 350px;
        height: 350px;
    }
    
    .project-card {
        width: 520px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .hero {
        padding: var(--spacing-4xl) 0 var(--spacing-4xl);
    }
}

/* Mobile-specific styles (up to 767px) */
@media (max-width: 767px) {
    .nav-menu {
        position: fixed;
        top: 44px;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: saturate(180%) blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        flex-direction: column;
        padding: var(--spacing-md);
        gap: 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        box-shadow: var(--shadow-md);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding: var(--spacing-md) 0;
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        padding: var(--spacing-xs) 0;
        font-size: var(--font-size-base);
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    
    .nav-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .hero {
        padding: var(--spacing-3xl) 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .hero-text {
        text-align: center;
        order: 2;
    }
    
    .hero-image {
        order: 1;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-description {
        font-size: var(--font-size-lg);
    }
    
    .profile-image {
        width: 240px;
        height: 240px;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 320px;
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .about-summary {
        font-size: var(--font-size-lg);
    }
    
    .skills-title,
    .achievements-title {
        font-size: var(--font-size-xl);
    }
    
    .skills-list,
    .achievements-list {
        grid-template-columns: 1fr;
    }
    
    .project-card {
        width: 340px;
        padding: var(--spacing-lg);
    }
    
    .projects-grid {
        margin: 0 calc(-1 * var(--spacing-md));
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
    
    .social-links {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }
    
    .social-link {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
}

/* Small mobile devices (up to 480px) */
@media (max-width: 480px) {
    :root {
        --font-size-3xl: 2rem;
        --font-size-2xl: 1.5rem;
        --font-size-xl: 1.25rem;
        --spacing-4xl: 3rem;
        --spacing-3xl: 2rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .hero {
        padding: var(--spacing-2xl) 0;
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
    
    .hero-description {
        font-size: var(--font-size-base);
    }
    
    .profile-image {
        width: 200px;
        height: 200px;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .about-summary {
        font-size: var(--font-size-base);
    }
    
    .project-card {
        padding: var(--spacing-lg);
        width: 300px;
    }
    
    section {
        padding: var(--spacing-3xl) 0;
    }
}

/* Reduced motion preferences */
@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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .nav-toggle,
    .back-to-top {
        display: none;
    }
    
    .header {
        position: static;
        background: white;
        border-bottom: 1px solid #000;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .hero {
        background: none;
        padding: var(--spacing-lg) 0;
    }
    
    .project-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: var(--spacing-xl) 0;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
}