/* ==========================================================================
   Responsive / mobile layout
   ========================================================================== */

/* Tablets */
@media (max-width: 900px) {
    .about-grid,
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-grid {
        gap: 2rem;
    }

    .hero-square {
        width: min(280px, 100%);
    }

    .founder-card {
        grid-template-columns: 130px 1fr;
        padding: 1.8rem;
    }

    .founder-avatar {
        width: 130px;
        height: 130px;
        font-size: 3.2rem;
    }
}

/* Phones */
@media (max-width: 640px) {
    .section {
        padding: 3.5rem 0;
    }

    /* Mobile nav */
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: rgba(10, 10, 10, 0.98);
        border-bottom: 2px solid var(--yellow);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }

    .nav-links.open {
        max-height: 480px;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a,
    .nav-links button {
        display: block;
        width: 100%;
        padding: 0.9rem 1.4rem;
        text-align: left;
        border-radius: 0;
        border: none;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Hero stacks: text first, yellow square below */
    .hero {
        min-height: auto;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        padding: 6.5rem 0 3.5rem;
        text-align: center;
    }

    .hero-tagline {
        margin-inline: auto;
        font-size: 1rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-square {
        width: min(240px, 80%);
        box-shadow: 8px 8px 0 var(--black-3);
    }

    /* Grids collapse to one column */
    .about-grid,
    .team-grid {
        grid-template-columns: 1fr;
    }

    .founder-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .awards-card {
        flex-direction: column;
        text-align: center;
        padding: 1.8rem;
    }

    .founder-avatar {
        margin: 0 auto;
    }

    .founder-bio {
        text-align: left;
    }

    /* Footer */
    .site-footer .container {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }

    /* Edit bar fits small screens */
    .edit-bar {
        width: 94%;
        justify-content: space-between;
        gap: 0.5rem;
        border-radius: 16px;
        flex-wrap: wrap;
    }

    /* Keep the FAB menu clear of the edit bar */
    body.editing .fab-wrapper.edit-ctrl {
        right: 3%;
        bottom: 7.5rem;
    }

    body.editing .section-panel.edit-ctrl {
        right: 3%;
        bottom: 14rem;
        width: 94vw;
    }
}
