/* =========================================
   RESPONSIVE DESIGN ADAPTATIONS
   ========================================= */

/* Tablet & Smaller Desktop (max-width: 991px) */
@media (max-width: 991.98px) {
    .hero-video-box { width: 90%; max-width: 90%; border-radius: 14px; }
    
    /* 3 Images on Tablet */
    .life-carousel-slide { flex: 0 0 33.3333%; }
    
    .campus-card { width: calc(45% - 12px); }
    .karachi-section { --karachi-img-h: 340px; padding: 40px 0 64px; }
    .karachi-img-wrapper { width: 82%; }
    .karachi-dark-box { padding-left: 32px; padding-right: 32px; padding-bottom: 56px; border-radius: 32px; }
    .karachi-content { padding-top: 24px; }
    .footer-watermark h1 { font-size: 28vw; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px 24px;
        max-width: 560px;
    }
    .stat-item:not(:last-child)::after { display: none; }
    .stat-item {
        padding-bottom: 0;
        border-bottom: none;
    }
    .stat-item:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }

    .clientele-section { padding: 56px 0 48px; }
    .clientele-logo-card { width: 170px; min-height: 88px; padding: 14px 16px; }
    .clientele-logo-img { max-width: 130px; max-height: 52px; }
    .clientele-track { animation-duration: 28s; }
    .clientele-track--slow { animation-duration: 55s; }
    .clientele-track--reverse { animation-duration: 32s; }
    .clientele-marquee--second { margin-top: 16px; }

    .timeline-feature {
        display: flex;
        flex-direction: column;
        background: #fff;
    }
    .timeline-feature__img {
        height: 280px;
        object-position: center 18%;
        flex-shrink: 0;
    }
    .timeline-feature__card {
        position: relative;
        inset: auto;
        max-width: 100%;
        margin: 0;
        padding: 1.25rem 1.2rem 1.35rem;
        border-radius: 0 0 16px 16px;
    }

    .lead-accordion {
        flex-wrap: wrap;
        height: auto;
        max-width: 100%;
        overflow: visible;
        gap: 10px;
    }
    .lead-expand-card {
        flex: 1 1 calc(50% - 5px);
        min-height: 380px;
        border-radius: 12px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }
    .lead-accordion:hover .lead-expand-card { flex: 1 1 calc(50% - 5px); }
    .lead-accordion .lead-expand-card:hover { flex: 1 1 calc(50% - 5px); }
    .lead-expand-content {
        position: relative;
        z-index: 2;
        padding: 28px 16px 20px;
        background: transparent;
        text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
    }
    .lead-expand-tagline {
        opacity: 1 !important;
        color: rgba(255, 255, 255, 0.95);
    }
    .lead-expand-detail {
        max-height: none;
        opacity: 1;
        overflow: visible;
        margin-top: 0.65rem;
        font-size: 0.8rem;
        line-height: 1.5;
        display: block;
    }
    .lead-expand-card:hover .lead-expand-detail {
        max-height: none;
        opacity: 1;
    }
    .lead-accordion:hover .lead-expand-card:not(:hover) .lead-expand-content { opacity: 1; }
    .lead-accordion:hover .lead-expand-card:not(:hover) .lead-expand-detail {
        max-height: none;
        opacity: 1;
    }
}

/* Mobile Devices (max-width: 767px) */
@media (max-width: 767.98px) {
    .top-bar { display: none; }

    /* Full-screen menu — scrollable, no bottom clip */
    .full-screen-menu__inner {
        min-height: 100%;
        min-height: 100dvh;
        height: auto;
    }
    .full-screen-menu .row.flex-grow-1 {
        flex-grow: 0 !important;
        align-items: flex-start !important;
        margin-top: 1.25rem !important;
        padding-top: 0 !important;
    }
    .full-screen-menu .mt-5 { margin-top: 1.25rem !important; }
    .full-screen-menu .pb-4 { padding-bottom: 2rem !important; }
    .menu-main-links a {
        font-size: 1.65rem;
        margin-bottom: 0.85rem;
    }
    .menu-sub-links a { margin-bottom: 0.85rem; }

    /* Footer — disable sticky reveal on mobile so logo + full content scroll into view */
    .main-footer {
        position: relative !important;
        bottom: auto !important;
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
        justify-content: flex-start !important;
        padding-top: 2.75rem;
        padding-bottom: 3.5rem;
        z-index: 1;
    }
    .content-wrapper {
        margin-bottom: 0;
    }
    .footer-brand {
        margin-bottom: 1rem;
    }
    .footer-watermark {
        display: none;
    }
    .site-logo--footer {
        max-width: 150px;
        width: auto;
        height: auto;
        max-height: none;
        object-fit: contain;
        display: block;
    }
    .main-footer .container {
        padding-bottom: 1rem;
        padding-top: 0.5rem;
    }
    .main-footer .row.g-5 {
        --bs-gutter-y: 2rem;
        margin-bottom: 1.5rem !important;
    }
    
    .col-md-5.text-md-end { text-align: left !important; }
    .justify-content-md-end { justify-content: flex-start !important; }
    
    .hero-section h1 { font-size: 2.2rem; }
    .hero-video-box { width: 100%; max-width: 100%; border-radius: 12px; }

    .hero-section,
    .social-story-section,
    .clientele-section,
    .cta-section,
    .stats-section,
    .build-section,
    .lead-dark-section {
        overflow-x: hidden;
        max-width: 100%;
    }
    .social-track-container {
        max-width: 100%;
        overflow: hidden;
    }
    :root { --header-offset: 80px; }
    .back-to-top {
        right: 1rem;
        z-index: 1035;
    }

    .stats-section { padding: 40px 0 44px; }
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 12px;
        max-width: 100%;
        padding: 0;
    }
    .stat-item:not(:last-child)::after { display: none; }
    .stat-item {
        min-width: 0;
        width: 100%;
        max-width: none;
        padding: 4px 8px 8px;
        border-bottom: none;
    }
    .stat-item:last-child {
        padding-bottom: 4px;
        border-bottom: none;
    }
    .stat-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 10px;
    }
    .stat-number {
        font-size: clamp(2rem, 8.5vw, 2.6rem) !important;
        margin-bottom: 0.45rem;
        line-height: 1;
        font-weight: 700;
    }
    .stat-label {
        font-size: 0.62rem !important;
        letter-spacing: 0.08em;
        line-height: 1.4;
        max-width: 10.5rem;
        font-weight: 600;
    }

    .karachi-section { --karachi-img-h: 260px; padding: 32px 0 48px; }
    .karachi-img-wrapper { width: 90%; }
    .karachi-img-wrapper img { border-radius: 14px; }
    .karachi-dark-box { border-radius: 28px; padding-left: 18px; padding-right: 18px; padding-bottom: 48px; }
    .karachi-content { padding-top: 20px; }
    .karachi-copy { font-size: 0.95rem; margin-bottom: 2rem; }
    .karachi-btn { padding: 0.75rem 1.8rem; }

    .lead-accordion {
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
        overflow: visible;
        gap: 8px;
    }
    .lead-expand-card {
        flex: 1 1 calc(50% - 4px) !important;
        min-height: 0;
        height: auto;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        aspect-ratio: 3 / 4;
        min-height: 320px;
    }
    .lead-expand-content {
        position: relative;
        z-index: 2;
        padding: 22px 16px 18px;
        flex-shrink: 0;
        background: transparent;
        text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
    }
    .lead-expand-content h4 {
        font-size: 0.95rem !important;
        color: #fff;
    }
    .lead-expand-tagline {
        font-size: 0.82rem;
        opacity: 1 !important;
        color: rgba(255, 255, 255, 0.95);
    }
    .lead-expand-detail {
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible !important;
        margin-top: 0.5rem !important;
        font-size: 0.8rem;
        line-height: 1.5;
        display: block;
        -webkit-line-clamp: unset;
        color: rgba(255, 255, 255, 0.94);
    }
    
    /* 1 Image on Mobile */
    .life-carousel-slide { flex: 0 0 100%; }
    .life-nav-btn { width: 15%; } 
    
    .campus-card { width: 85%; }
    
    /* Social story — card up, image carousel down so images aren't fully hidden */
    .social-story-stage {
        min-height: 580px;
        padding-bottom: 12px;
    }
    .fixed-blue-card {
        width: 260px;
        height: 260px;
        top: 22%;
        left: 50%;
        transform: translate(-50%, 0);
        z-index: 3;
    }
    .social-track-container {
        top: 72% !important;
        left: 50%;
        height: 220px;
        transform: translate(-50%, -50%) !important;
        max-width: 100%;
        overflow: hidden;
    }
    .social-card {
        width: 220px;
        height: 220px;
    }
    .social-card__caption {
        padding: 36px 12px 12px;
        gap: 6px;
    }
    .social-card__title {
        font-size: 0.82rem;
        text-align: left;
    }
    .social-card__btn {
        padding: 0.28rem 0.75rem;
        font-size: 0.62rem;
        opacity: 1;
        transform: none;
    }
    
    .display-4 { font-size: clamp(1.7rem, 6.5vw, 2.15rem) !important; }

    .campuses-map-wrapper {
        padding-left: 20px;
        padding-right: 20px;
        gap: 20px;
    }
    .campus-card-v2 { flex: 0 0 260px; width: 260px; }
    .campus-card-v2__thumb { height: 280px; }
    .our-campuses-sec { padding: 48px 0 40px; }
}

/* =========================================
   GLOBAL MOBILE FIT — phones & small tablets
   ========================================= */
@media (max-width: 991.98px) {
    .main-header .container-fluid { padding-left: 16px; padding-right: 16px; }
    .site-logo { max-width: 156px; height: 46px; }
    .menu-toggle-btn,
    .menu-close-btn {
        width: 46px !important;
        height: 46px !important;
    }
    .page-banner {
        height: auto;
        min-height: 280px;
        max-height: none;
        padding: 24px 0;
    }
    .page-banner__panel { max-width: 100%; }
    .display-4 { font-size: clamp(1.85rem, 4.2vw, 2.6rem) !important; }
    .display-5 { font-size: clamp(1.65rem, 3.8vw, 2.2rem) !important; }
    .cta-section .container { padding-top: 3rem !important; padding-bottom: 3rem !important; margin-top: 0 !important; margin-bottom: 0 !important; }
    .about-section h2,
    .people-heading h2 {
        overflow-wrap: break-word;
        word-break: break-word;
    }
}

@media (max-width: 767.98px) {
    :root { --header-offset: calc(72px + env(safe-area-inset-top, 0px)); }
    .main-header {
        padding-top: env(safe-area-inset-top, 0px);
    }
    .site-logo { max-width: 148px; height: 44px; }
    .menu-toggle-btn,
    .menu-close-btn {
        width: 44px !important;
        height: 44px !important;
    }
    .hero-section { padding-top: 1.5rem !important; padding-bottom: 2rem !important; }
    .hero-section .container { padding-top: 0.5rem !important; }
    .hero-section h1 {
        font-size: clamp(1.55rem, 7.2vw, 2.05rem) !important;
        line-height: 1.22 !important;
        margin-bottom: 1.4rem !important;
        overflow-wrap: break-word;
    }
    .hero-section h1 br { display: none; }
    .hero-section h2 { font-size: 0.72rem !important; letter-spacing: 0.12em; }

    .page-banner { min-height: 240px; padding: 18px 0; }
    .page-banner__inner { padding: 12px 12px; }
    .page-banner__panel { padding: 22px 18px 18px; border-radius: 18px; }
    .page-banner__kicker {
        max-width: 100%;
        white-space: normal;
        letter-spacing: 0.08em;
        font-size: 10px !important;
        line-height: 1.35;
        padding: 6px 12px;
        gap: 8px;
    }
    .page-banner__title {
        font-size: clamp(1.45rem, 7.4vw, 1.9rem) !important;
        line-height: 1.18;
        margin-bottom: 0.9rem;
    }
    .page-banner__title span { display: inline; }
    .page-banner__title span::after { display: none; }
    .page-banner__crumb,
    .page-banner__crumb a,
    .page-banner__crumb [aria-current="page"] {
        font-size: 10px !important;
        gap: 6px;
        padding-top: 10px;
    }
    .page-banner__crumb svg {
        width: 11px;
        height: 11px;
    }

    .timeline-btn {
        padding-top: 0.55rem !important;
        padding-bottom: 0.55rem !important;
        gap: 12px;
    }
    .timeline-btn__label {
        font-size: 0.72rem;
        letter-spacing: 0.04em;
        white-space: nowrap;
        line-height: 1.25;
    }
    .timeline-dot {
        width: 12px;
        height: 12px;
        min-width: 12px;
        min-height: 12px;
        box-shadow: none;
    }
    .timeline-btn.active .timeline-dot {
        box-shadow: 0 0 0 3px rgba(163, 3, 32, 0.18);
    }
    .timeline-line {
        left: 11px;
        top: 14px;
        bottom: 14px;
    }
    .timeline-feature {
        display: flex;
        flex-direction: column;
        background: #fff;
    }
    .timeline-feature__img {
        height: 220px;
        object-position: center 18%;
        flex-shrink: 0;
    }
    .timeline-feature__card {
        position: relative;
        inset: auto;
        max-width: 100%;
        margin: 0;
        padding: 1.15rem 1.1rem 1.25rem;
        border-radius: 0 0 16px 16px;
    }

    p:not(.stat-number):not(.stat-label):not(.psy-apart__num):not(.psy-apart__label),
    li, label, input, select, textarea,
    .lead, .text-muted, .small, .karachi-copy, .service-lead,
    .story-card p, .about-why-card p, .service-offer-card p,
    .contact-info__card p, .contact-info__card a, .contact-form p,
    .founder-copy__scroll p, .psy-apart__lead, .psy-apart__card p,
    .footer-contact, .footer-links a,
    .main-footer p, .main-footer li, .cta-section p,
    .glass-card p {
        font-size: 14px !important;
        line-height: 1.65;
    }
    .person-card__meta h3 { font-size: 13px !important; }
    .person-card__meta p {
        font-size: 11px !important;
        line-height: 1.35;
    }

    img, svg, video { max-width: 100%; }
    .story-card__media { min-height: 200px; }
    .story-card__logo { height: 34px; max-width: 130px; }
    .story-card h2 { font-size: 1.28rem; }
    .story-watch {
        width: 100%;
        justify-content: center;
        padding-right: 16px;
    }
    .video-modal { padding: 12px; }
    .video-modal__dialog { border-radius: 12px; }

    .psy-apart { padding: 48px 0; }
    .psy-apart__copy h2 { font-size: clamp(1.7rem, 8vw, 2.4rem); }
    .psy-apart__lead { font-size: 0.95rem; margin-bottom: 1.6rem; }
    .psy-apart__stats { gap: 28px; }
    .psy-apart__num { font-size: clamp(2.1rem, 10vw, 2.8rem); }

    .contact-info__card { padding: 18px 16px; }
    .contact-form { padding: 22px 16px; }
    .contact-form h2 { font-size: 1.4rem; }

    .lead { font-size: 1rem; }
    .cta-section .lead { font-size: 0.95rem; }
    .cta-section .d-flex.gap-4 { gap: 12px !important; }
    .cta-section .btn-lg {
        width: 100%;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        font-size: 0.95rem;
    }

    .karachi-title { font-size: clamp(1.55rem, 7vw, 2.1rem); }
    .footer-tagline { font-size: 1.45rem; }
    .footer-contact a { overflow-wrap: anywhere; }

    .full-screen-menu__inner {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    }
    .site-logo--menu { max-width: 150px; height: 52px; }
    .menu-main-links a {
        font-size: clamp(1.35rem, 6.5vw, 1.7rem);
        margin-bottom: 0.7rem;
        transform: none !important;
    }
    .menu-sub-links a {
        font-size: 0.72rem;
        letter-spacing: 0.1em;
        margin-bottom: 0.65rem;
        white-space: normal;
    }
    .full-screen-menu h4 { font-size: 1.05rem; }

    .people-heading h2 { font-size: clamp(1.45rem, 6.5vw, 1.9rem); }
    .people-heading p { font-size: 0.95rem; }
    .founder-copy h2 { font-size: clamp(1.4rem, 6vw, 1.85rem); }

    .reveal-up,
    .reveal-left,
    .reveal-right { will-change: auto; }

    .back-to-top {
        width: 44px;
        height: 44px;
        right: max(0.85rem, env(safe-area-inset-right));
        bottom: max(0.85rem, env(safe-area-inset-bottom));
    }
}

@media (max-width: 575.98px) {
    .lead-expand-card {
        flex: 1 1 100% !important;
        min-height: 280px;
        aspect-ratio: 16 / 11;
    }
    .lead-accordion:hover .lead-expand-card,
    .lead-accordion .lead-expand-card:hover {
        flex: 1 1 100% !important;
    }
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 24px 10px;
        padding: 0;
    }
    .stat-item {
        min-width: 0;
        padding: 4px 6px;
    }
    .stat-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 10px;
    }
    .stat-number {
        font-size: clamp(2rem, 8.5vw, 2.6rem) !important;
        margin-bottom: 0.45rem;
        line-height: 1;
        font-weight: 700;
    }
    .stat-label {
        font-size: 0.62rem !important;
        letter-spacing: 0.08em;
        line-height: 1.4;
        max-width: 10.5rem;
        font-weight: 600;
    }
    .service-offer-grid,
    .service-offer-grid--2,
    .service-split,
    .about-why-grid { grid-template-columns: 1fr; }
    .service-offer-card,
    .about-why-card { padding: 22px 18px; }
    .container { padding-left: 16px; padding-right: 16px; }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .hero-video-box { border-radius: 12px; }
    .cta-section .btn { width: 100%; margin-bottom: 0.5rem; }
    .karachi-section { --karachi-img-h: 210px; padding: 24px 0 40px; }
    .karachi-img-wrapper { width: 92%; }
    .karachi-dark-box { padding-left: 14px; padding-right: 14px; padding-bottom: 40px; border-radius: 24px; }

    .social-story-stage { min-height: 540px; }
    .fixed-blue-card {
        width: 240px;
        height: 240px;
        top: 4%;
    }
    .social-track-container {
        top: 70% !important;
        height: 200px;
    }
    .social-card {
        width: 200px;
        height: 200px;
    }
    .social-card__title { font-size: 0.76rem; }
}

@media (max-width: 359.98px) {
    .site-logo { max-width: 128px; height: 40px; }
    .hero-section h1 { font-size: 1.42rem !important; }
    .page-banner__title { font-size: 1.38rem !important; }
    .page-banner__kicker { font-size: 10px !important; letter-spacing: 0.06em; }
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px 8px;
    }
    .stat-number { font-size: 1.55rem; }
    .stat-label { font-size: 0.62rem; letter-spacing: 0.04em; }
    .timeline-btn__label {
        font-size: 0.62rem;
        letter-spacing: 0.03em;
    }
    .social-story-stage { min-height: 500px; }
    .fixed-blue-card {
        width: 210px;
        height: 210px;
    }
    .social-card {
        width: 180px;
        height: 180px;
    }
    .menu-main-links a { font-size: 1.28rem; }
    .people-row--5 { grid-template-columns: 1fr 1fr; }
}