/* ======================================
   Responsive Styles - Mobile & Tablet
   ====================================== */

/* ===== Tablet (768px - 1024px) ===== */
@media (max-width: 1024px) {
    :root {
        --text-hero: clamp(2.5rem, 6vw, 5rem);
        --text-h1: clamp(1.75rem, 4vw, 3.5rem);
        --text-h2: clamp(1.25rem, 3vw, 2.5rem);
    }

    .container {
        padding: 0 var(--space-4);
    }

    .section {
        padding: var(--space-16) 0;
    }

    .section-lg {
        padding: var(--space-20) 0;
    }

    /* Navigation */
    .nav-links {
        display: none;
    }

    .nav-menu-btn {
        display: block;
    }

    /* Grid adjustments */
    .grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Featured card */
    .featured-card {
        grid-template-columns: 1fr;
    }

    .featured-card-visual {
        aspect-ratio: 16 / 9;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: var(--space-6);
    }

    .footer-links {
        flex-wrap: wrap;
        gap: var(--space-4);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

/* ===== Mobile (< 768px) ===== */
@media (max-width: 767px) {
    :root {
        --text-hero: clamp(2rem, 10vw, 3.5rem);
        --text-h1: clamp(1.5rem, 6vw, 2.5rem);
        --text-h2: clamp(1.25rem, 4vw, 2rem);
        --text-h3: clamp(1rem, 3vw, 1.5rem);
    }

    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .section {
        padding: var(--space-12) 0;
    }

    /* Hide custom cursor on touch devices */
    .cursor,
    .cursor-dot {
        display: none !important;
    }

    /* Navigation */
    .nav {
        padding: var(--space-4);
    }

    .nav-logo {
        font-size: var(--text-small);
    }

    /* Mobile nav overlay links */
    .nav-mobile-link {
        font-size: var(--text-h2);
    }

    /* Grid adjustments */
    .grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    /* Hero section */
    .hero {
        min-height: 100vh;
        min-height: 100svh;
        padding: var(--space-20) 0 var(--space-16);
    }

    .hero-title {
        font-size: var(--text-hero);
    }

    /* Featured cards stack */
    .featured-card {
        padding: var(--space-4);
    }

    .featured-card-content {
        padding: var(--space-2);
    }

    .featured-card-title {
        font-size: var(--text-h3);
    }

    /* Category folders */
    .category-folder {
        padding: var(--space-6);
    }

    .category-folder-number {
        font-size: var(--text-h2);
    }

    .category-folder-name {
        font-size: var(--text-body);
    }

    /* Archive grid */
    .archive-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: var(--space-1);
    }

    /* Marquee */
    .marquee-item {
        font-size: var(--text-h3);
        padding: 0 var(--space-4);
    }

    /* Footer */
    .footer {
        padding: var(--space-12) 0;
    }

    .footer-links {
        flex-direction: column;
        gap: var(--space-3);
    }

    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-5);
        font-size: var(--text-small);
    }

    /* Project cards */
    .project-card-content {
        padding: var(--space-4);
    }

    .project-card-title {
        font-size: var(--text-body);
    }

    /* Scroll indicator */
    .scroll-indicator {
        bottom: var(--space-4);
    }

    /* Section headers */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    /* About page specifics */
    .about-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: var(--space-2);
    }

    .about-tabs::-webkit-scrollbar {
        display: none;
    }

    .about-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Experience timeline */
    .timeline-item {
        flex-direction: column;
        gap: var(--space-2);
    }

    .timeline-year {
        width: 100%;
    }

    /* Skillset grid */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Small Mobile (< 375px) ===== */
@media (max-width: 374px) {
    :root {
        --text-hero: 1.75rem;
        --text-h1: 1.5rem;
        --text-h2: 1.25rem;
    }

    .container {
        padding: 0 var(--space-3);
    }

    .nav {
        padding: var(--space-3);
    }

    .grid-6 {
        grid-template-columns: 1fr 1fr;
    }

    .archive-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .featured-card-tags {
        display: none;
    }
}

/* ===== Large Desktop (> 1400px) ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }

    :root {
        --text-hero: 8rem;
        --text-h1: 5rem;
        --text-h2: 3rem;
    }
}

/* ===== Ultra-wide (> 1920px) ===== */
@media (min-width: 1920px) {
    html {
        font-size: 18px;
    }

    .container {
        max-width: 1800px;
    }
}

/* ===== Landscape Mobile ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-16) 0;
    }

    .scroll-indicator {
        display: none;
    }

    .nav-mobile {
        padding: var(--space-4);
    }

    .nav-mobile-link {
        font-size: var(--text-h3);
    }
}

/* ===== High DPI Displays ===== */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    /* Sharper borders on retina */
    .project-card,
    .category-folder,
    .featured-card {
        border-width: 0.5px;
    }
}

/* ===== Touch Device Adjustments ===== */
@media (hover: none) and (pointer: coarse) {

    /* Remove hover effects that don't work on touch */
    .project-card:hover {
        transform: none;
    }

    .project-card:active {
        transform: scale(0.98);
    }

    .project-card-arrow {
        opacity: 1;
        transform: none;
    }

    /* Show images in archive on touch */
    .archive-item img {
        opacity: 0.8;
    }

    /* Disable magnetic effect */
    .magnetic {
        transform: none !important;
    }
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
        color: black;
    }

    .nav,
    .footer,
    .scroll-indicator,
    .cursor,
    .cursor-dot {
        display: none !important;
    }

    .project-card,
    .category-folder,
    .featured-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }

    a {
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}