/**
 * File: /styles/responsive.css
 * Responsive Design
 */

/* Tablet and below */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
        --container-padding: 20px;
    }

    /* RETHINK Bottom Grid - Stack to 1 column */
    .rethink-bottom-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-2xl);
    }

    /* Engineering Approach - Keep 2x2 grid on tablet */
    .approach-grid {
        grid-template-columns: 1fr 1fr;
    }

    .opensource-card,
    .contact-container,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    /* Open Source Grid - 2 columns on tablet */
    .opensource-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rethink-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .publication-item {
        flex-direction: column;
        align-items: flex-start;
        border-left: none;
        border-top: 3px solid var(--gray-200);
        padding: var(--space-md);
    }

    .publication-item:hover {
        padding-left: var(--space-md);
        padding-top: calc(var(--space-md) + 4px);
        border-top-color: var(--primary);
    }

    .opensource-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
        --header-height: 64px;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-white);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-lg);
        gap: var(--space-md);
        transform: translateY(-100%);
        transition: transform var(--transition-base);
        box-shadow: var(--shadow-lg);
        z-index: var(--z-dropdown);
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .hero {
        min-height: 80vh;
        padding: calc(var(--header-height) + 40px) 0 40px;
    }

    .hero-background {
        height: 300px;
    }

    .hero-description {
        font-size: var(--text-lg);
    }

    /* RETHINK Grid - 1 column on mobile */
    .rethink-grid {
        grid-template-columns: 1fr !important;
    }

    /* RETHINK Bottom Grid - 1 column on mobile */
    .rethink-bottom-grid {
        grid-template-columns: 1fr !important;
    }

    /* Engineering Approach - 1 column on mobile */
    .approach-grid {
        grid-template-columns: 1fr !important;
    }

    /* Markets - Single column layout on mobile */
    .markets-grid {
        grid-template-columns: 1fr;
    }

    .market-card {
        grid-template-columns: 1fr;
        text-align: left;
    }

    /* Open Source Grid - Single column on mobile */
    .opensource-grid {
        grid-template-columns: 1fr !important;
    }

    .opensource-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    :root {
        --section-padding: 40px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .rethink-card {
        padding: var(--space-lg);
    }

    .approach-card {
        padding: var(--space-md);
    }

    .opensource-card {
        padding: var(--space-xl);
    }

    .legal-grid {
        grid-template-columns: 1fr;
    }

    .publication-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .publication-link-btn {
        width: 100%;
        justify-content: flex-start;
    }
}