/* ============================================
   RESPONSIVE — karanbir-pelia.github.io
   ============================================ */

/* ---- Desktop: reserve space for the icon rail ---- */
@media (min-width: 901px) {
    body {
        padding-left: var(--rail-width);
        padding-bottom: 0;
    }
}

/* ---- Large desktop → standard desktop ---- */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Tablet and below: rail → bottom tab bar ---- */
@media (max-width: 900px) {
    #rail {
        display: none;
    }
    #tabbar {
        display: block;
    }

    section {
        padding: 4.5rem 1.5rem;
    }

    .hero__grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "intro"
            "title"
            "side"
            "subtitle"
            "cta"
            "socials";
        min-height: auto;
        align-content: start;
        padding: 1rem 0 1.5rem;
    }
    .hero__side {
        max-width: 360px;
        margin: 0.5rem auto 1.75rem;
    }

    .about__grid,
    .edu-grid,
    .contact__grid {
        grid-template-columns: 1fr;
    }

    .exp-card__head {
        flex-direction: column;
        align-items: flex-start;
    }
    .exp-meta {
        align-items: flex-start;
    }

    .back-to-top {
        bottom: calc(var(--tabbar-height) + 1.25rem);
    }
    .toast-container {
        bottom: calc(var(--tabbar-height) + 1.25rem);
    }
}

/* ---- Small tablet / large phone ---- */
@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .skill-cols {
        flex-direction: column;
        gap: 1.35rem;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .hero__cta,
    .hero__socials {
        justify-content: center;
    }
    .exp-card,
    .pub-card,
    .contact-item {
        padding: 1.35rem;
    }
    .pub-card {
        flex-direction: column;
        text-align: left;
    }
}

/* ---- Small phone ---- */
@media (max-width: 400px) {
    .metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero__title {
        font-size: clamp(2rem, 9vw, 2.4rem);
    }
    section {
        padding: 3.5rem 1.15rem;
    }
}
