@media (max-width: 1024px) {
    .site-header__inner {
        padding: 0 20px;
        gap: 12px;
    }

    .nav__list {
        gap: 18px;
    }

    .exam-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .exam-content {
        margin: auto;
        text-align: center;
        padding-left: 0;
    }

    .exam-image {
        height: auto;
        object-fit: contain;
    }

    #exam-prep .section-label::after {
        width: 100%;
    }

    .exam-image-wrapper {
        justify-content: center;
    }

    .learning-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    #study-environment .section-wrapper,
    #study-environment .study-env-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    #study-environment .content,
    #study-environment .study-env-content {
        margin: 0 auto;
    }

    .exam-content,
    .learning-content {
        order: 2;
    }

    .exam-image-wrapper,
    .learning-image {
        order: 1;
    }

    .learning-image img {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .site-header {
        position: sticky;
    }

    .site-header__inner {
        height: auto;
        min-height: 64px;
        padding: 12px 20px;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-primary);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
        transform-origin: top;
        max-height: 0;
        overflow: hidden;
        transition: max-height 200ms ease;
    }

    .nav.is-open {
        max-height: 320px;
    }

    .nav__list {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 20px 16px;
        gap: 8px;
    }

    .nav__link {
        width: 100%;
        padding: 10px 4px;
    }

    .nav__cta {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .hero-overlay-card {
        position: static;
        margin-top: 12px;
        width: 100%;
    }

    .hero__actions {
        width: 100%;
        gap: 0.75rem;
    }

    .hero__actions .btn {
        width: 100%;
        text-align: center;
    }

    .section,
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    p,
    h1,
    h2,
    h3,
    summary {
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .exam-container,
    .learning-container {
        gap: 30px;
    }

    .exam-content h2,
    .learning-content h2 {
        font-size: 1.6rem;
    }

    .learning-image img {
        max-width: 100%;
    }

    #trust .feature-card {
        padding: 18px;
    }
}

@media (max-width: 900px) {
    .hero {
        text-align: center;
        justify-items: center;
    }

    .hero__actions {
        justify-content: center;
    }

    .hero .stack-lg {
        align-items: center;
    }

    .section__header,
    .exam-prep-content,
    .course-programs-content,
    .study-env-content,
    .live-classes-content {
        text-align: center;
        align-items: center;
    }

    .feature-line,
    .feature-subtext {
        margin-left: 0;
    }

    .course-flex,
    .course-grid,
    .level-grid {
        text-align: center;
        justify-items: center;
    }

    .course-copy,
    .course-card,
    .level-card {
        align-items: center;
        text-align: center;
    }

    .cta-line {
        justify-content: center;
    }

    .course-flex--reverse {
        direction: ltr;
    }
}

@media (max-width: 640px) {
    .container {
        padding-inline: 1.25rem;
    }

    .section {
        padding: 3rem 1rem 2rem;
    }

    .section--stats .stats-bar {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 1.5rem 2rem;
    }

    .section--stats .stat {
        min-width: auto;
    }

    #testimonials .section__header {
        text-align: center !important;
    }

    .course-illustration {
        max-width: 100%;
    }

    .exam-container {
        gap: 28px;
    }

    .exam-image,
    .learning-image img {
        max-width: 100%;
    }

    .exam-desc {
        line-height: 1.4;
        margin-bottom: 14px;
    }

    .exam-points {
        gap: 12px;
    }

    .exam-text strong {
        font-size: 0.9rem;
    }

    .exam-text .sub-text {
        font-size: 0.85rem;
    }

    #live-classes .live-points,
    #study-environment .env-points {
        gap: 10px;
    }

    #live-classes .live-text strong,
    #study-environment .env-text strong {
        font-size: 0.9rem;
    }

    #live-classes .live-text .sub-text,
    #study-environment .env-text .sub-text {
        font-size: 0.85rem;
    }

    #course-programs .text strong {
        font-size: 0.9rem;
    }

    #course-programs .sub-text {
        font-size: 0.82rem;
    }

    #course-programs .points {
        gap: 6px;
    }

    #course-programs .primary-btn {
        width: 100%;
        text-align: center;
    }

    .exam-cta {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {

    .exam-image,
    .learning-image img {
        max-width: 100%;
    }

    .badge-text,
    .badge span {
        white-space: normal;
        text-align: center;
    }
}

/* Mobile (portrait) */
@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .container,
    .wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .card-grid,
    .features-grid,
    .courses-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .hero .row {
        flex-direction: column-reverse;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn {
        padding: 0.75rem 1rem;
    }
}

/* Large desktop */
@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}