/* =============================================
   Responsive Design - Mobile First Approach
   ============================================= */

/* =============================================
   Mobile Styles (< 768px) - Base Styles
   ============================================= */

/* These are the default styles, optimized for mobile */

/* =============================================
   Tablet Styles (768px - 1024px)
   ============================================= */

@media screen and (max-width: 1024px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    /* Navigation */
    .nav-menu {
        gap: var(--spacing-sm);
    }

    /* Hero */
    .hero-title {
        font-size: 3.5rem;
    }

    .hero-tagline {
        font-size: 1.25rem;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .about-image-wrapper {
        max-width: 400px;
        margin: 0 auto;
    }

    /* Blog */
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    /* Contact */
    .contact-links {
        gap: var(--spacing-sm);
    }
}

/* =============================================
   Mobile Styles (< 768px)
   ============================================= */

@media screen and (max-width: 768px) {
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 2.5rem;
        --spacing-xl: 3rem;
    }

    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: var(--spacing-md);
    }

    /* Navigation */
    .nav-container {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .nav-logo-img {
        height: 35px;
    }

    .nav-menu {
        gap: var(--spacing-sm);
    }

    .nav-link {
        font-size: 0.875rem;
    }

    .nav-social {
        gap: 0.75rem;
    }

    .nav-social-link svg {
        width: 18px;
        height: 18px;
    }

    /* Hero */
    .hero-section {
        height: 100vh;
        background-attachment: scroll; /* Fixed background doesn't work well on mobile */
    }

    .hero-content {
        padding: var(--spacing-sm);
    }

    .hero-title {
        font-size: 2.5rem;
        margin-bottom: var(--spacing-xs);
    }

    .hero-tagline {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }

    .scroll-indicator {
        bottom: var(--spacing-md);
    }

    .scroll-arrow {
        font-size: 1.5rem;
    }

    /* About */
    .about-section {
        padding: var(--spacing-lg) 0;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .about-image-wrapper {
        max-width: 300px;
        margin: 0 auto;
    }

    .bio-text p {
        font-size: 1rem;
        margin-bottom: var(--spacing-sm);
    }

    /* Blog */
    .blog-section {
        padding: var(--spacing-lg) 0;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .blog-card {
        padding: var(--spacing-sm);
    }

    .blog-card-title {
        font-size: 1.25rem;
    }

    .blog-card-excerpt {
        font-size: 0.875rem;
    }

    /* Contact */
    .contact-section {
        padding: var(--spacing-lg) 0;
    }

    .contact-description {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
    }

    .contact-links {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }

    .contact-link {
        justify-content: center;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-sm) 0;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
        font-size: 0.875rem;
    }
}

/* =============================================
   Small Mobile Styles (< 480px)
   ============================================= */

@media screen and (max-width: 480px) {
    :root {
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 2rem;
        --spacing-xl: 2.5rem;
    }

    html {
        font-size: 13px;
    }

    /* Hero */
    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 0.875rem;
    }

    /* Navigation */
    .nav-menu {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.75rem;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.75rem;
    }

    /* Blog Cards */
    .blog-card-title {
        font-size: 1.125rem;
    }
}

/* =============================================
   Desktop Large (> 1440px)
   ============================================= */

@media screen and (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 5rem;
    }

    .hero-tagline {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 3.5rem;
    }

    .bio-text p {
        font-size: 1.25rem;
    }
}

/* =============================================
   Landscape Orientation on Small Devices
   ============================================= */

@media screen and (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        height: auto;
        min-height: 100vh;
        padding: var(--spacing-xl) 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-tagline {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
    }

    .scroll-indicator {
        position: relative;
        bottom: 0;
        margin-top: var(--spacing-md);
    }
}

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

@media print {
    .nav-header,
    .scroll-indicator,
    .contact-links,
    .back-to-top {
        display: none;
    }

    .hero-section {
        height: auto;
        padding: var(--spacing-md) 0;
        background: white;
    }

    .hero-overlay {
        display: none;
    }

    body {
        color: black;
        background: white;
    }

    .section-title {
        page-break-after: avoid;
    }

    .blog-card,
    .about-grid {
        page-break-inside: avoid;
    }
}

/* =============================================
   High DPI / Retina Display Support
   ============================================= */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure images and icons remain crisp on high-DPI displays */
    .profile-image,
    .hero-section {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* =============================================
   Dark Mode Support (Optional)
   ============================================= */

@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode */
    /*
    :root {
        --color-white: #1a1a1a;
        --color-black: #ffffff;
        --color-gray-light: #2a2a2a;
        --color-gray-medium: #3a3a3a;
        --color-gray-dark: #e0e0e0;
    }

    .hero-overlay {
        background-color: rgba(0, 0, 0, 0.7);
    }

    .nav-header {
        background-color: rgba(26, 26, 26, 0.95);
        border-bottom-color: var(--color-gray-medium);
    }

    .blog-card {
        background-color: var(--color-gray-light);
    }
    */
}

/* =============================================
   Touch Device Optimizations
   ============================================= */

@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets for touch devices */
    .nav-link,
    .contact-link,
    .blog-card {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .blog-card:hover {
        transform: none;
    }

    .profile-image {
        transform: none !important;
    }

    /* Add active states instead */
    .blog-card:active {
        transform: scale(0.98);
    }

    .contact-link:active {
        transform: scale(0.95);
    }
}
