/* ================================================================
   MARLIN STEM VIRTUAL ACADEMY
   Responsive safeguards

   Final stylesheet loaded after the base section/component styles.
   Keeps the site usable across small phones, tablets, laptops,
   desktops, landscape phones, and wide monitors.
================================================================ */

html {
    overflow-x: hidden;
}

body {
    min-width: 320px;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

.navbar,
.hero,
.section,
.footer,
.mobile-menu,
.chatbot-window {
    max-width: 100vw;
}

.hero__content,
.section,
.footer__grid,
.footer__bottom {
    overflow-wrap: anywhere;
}

.btn,
.hero__btn-primary,
.hero__btn-secondary,
.navbar__cta,
.form-submit,
.chat-chip,
.curriculum__tab,
.aitech-tab {
    min-width: 0;
}

@media (min-width: 1440px) {
    .navbar {
        padding-left:  max(4%, calc((100vw - 1360px) / 2));
        padding-right: max(4%, calc((100vw - 1360px) / 2));
    }

    .hero__content {
        padding-left:  max(5%, calc((100vw - 1360px) / 2));
        padding-right: max(5%, calc((100vw - 1360px) / 2));
    }
}

@media (max-width: 1180px) {
    .navbar {
        grid-template-columns: minmax(260px, auto) 1fr auto;
        gap: var(--space-4);
    }

    .navbar__links {
        gap: var(--space-5);
    }

    .navbar__cta {
        padding-inline: 16px;
    }
}

@media (max-width: 1024px) {
    .navbar__links {
        display: none;
    }

    .navbar__hamburger {
        display: flex;
    }

    .navbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .navbar__right {
        justify-content: flex-end;
    }

    .about,
    .reg-grid,
    .tech-section__header {
        grid-template-columns: 1fr;
    }

    .pricing-grid,
    .ai-pillars {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar {
        height: 64px;
        padding-inline: 16px;
    }

    .navbar > .navbar__logo {
        max-width: calc(100vw - 92px);
    }

    .navbar > .navbar__logo .navbar__logo-text {
        white-space: normal;
        line-height: 1.05;
    }

    .navbar__cta,
    .navbar__icon-btn {
        display: none;
    }

    .mobile-menu {
        top: 64px;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }

    .hero {
        min-height: auto;
        padding-bottom: 0;
    }

    .hero__content {
        padding: 96px 20px 36px;
        max-width: 100%;
    }

    .hero__heading {
        font-size: 38px;
        line-height: 1.12;
    }

    .hero__description {
        font-size: 15px;
        line-height: 1.65;
    }

    .hero__trust-badges {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
        margin-top: 28px !important;
        gap: 12px !important;
    }

    .hero__stats {
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 16px;
    }

    .hero__stat {
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    .curriculum__grid,
    .pricing-grid,
    .ai-pillars,
    .team-grid,
    .tech-grid,
    .how-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .team-card__photo {
        max-height: 360px;
    }

    .footer__socials {
        max-width: 320px;
    }
}

@media (max-width: 600px) {
    .section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .section__header,
    .curriculum__header,
    .team__header {
        gap: var(--space-4);
    }

    .hero__actions,
    .reg-perks {
        align-items: stretch;
    }

    .hero__btn-primary,
    .hero__btn-secondary,
    .form-submit {
        width: 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }

    .curriculum__tabs,
    .aitech-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .curriculum__tab,
    .aitech-tab {
        flex: 0 0 auto;
    }

    .reg-form-card,
    .pricing-card,
    .tech-card,
    .ai-pillar,
    .prog-card {
        border-radius: var(--radius);
    }

    .chatbot-window {
        left: 12px;
        right: 12px;
        width: auto;
        bottom: 88px;
        max-height: calc(100vh - 112px);
    }

    .chatbot-window__messages {
        max-height: min(52vh, 360px);
    }

    .chatbot-fab {
        right: 16px;
        bottom: 18px;
    }

    .wa-float {
        left: 16px;
        bottom: 18px;
    }
}

@media (max-width: 420px) {
    .navbar {
        padding-inline: 12px;
    }

    .navbar > .navbar__logo {
        gap: 8px;
        padding: 6px 8px 6px 6px;
    }

    .navbar > .navbar__logo .navbar__logo-badge {
        width: 40px;
        height: 40px;
    }

    .navbar > .navbar__logo .navbar__logo-text {
        max-width: 178px;
        font-size: 12px;
    }

    .hero__content {
        padding-inline: 16px;
        padding-top: 86px;
    }

    .hero__eyebrow {
        font-size: 11px;
        gap: 8px;
    }

    .hero__eyebrow-line {
        width: 28px;
    }

    .hero__heading {
        font-size: 32px;
    }

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

    .about-stats {
        grid-template-columns: 1fr !important;
    }

    .footer__logo {
        align-items: flex-start;
    }

    .footer__logo-text {
        max-width: 220px;
    }
}

@media (max-width: 360px) {
    .navbar > .navbar__logo .navbar__logo-text {
        max-width: 145px;
        font-size: 11px;
    }

    .hero__heading {
        font-size: 29px;
    }

    .hero__description {
        font-size: 14px;
    }

    .footer__social {
        width: 36px;
        height: 36px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .hero {
        min-height: auto;
    }

    .hero__content {
        padding-top: 82px;
        padding-bottom: 28px;
    }

    .hero__stats {
        position: relative;
    }

    .chatbot-window {
        top: 12px;
        bottom: 76px;
        max-height: none;
    }
}
