/* Shared responsive layer for the complete TaskOne website. */

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

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

img {
    height: auto;
}

.menu-toggle {
    display: none;
    width: 46px;
    height: 42px;
    padding: 9px;
    border: 1px solid #0b2b83;
    border-radius: 9px;
    background: #fff;
    color: #0b2b83;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 23px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .25s ease, opacity .25s ease;
}

header.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

header.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

header.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1180px) {
    header .container {
        width: 96%;
    }

    header nav ul {
        gap: 14px;
    }

    header nav a {
        font-size: 15px;
    }

    header .header-btn a {
        width: 170px;
    }
}

/* Collapse the shared header before the desktop navigation runs out of room. */
@media (max-width: 1024px) {
    header .top-bar {
        height: auto;
        min-height: 48px;
        padding: 9px 0;
    }

    header .top-flex {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px 24px;
        font-size: 14px;
    }

    header .main-header {
        height: auto !important;
        min-height: 76px;
        padding: 12px 0;
    }

    header .header-flex {
        min-height: 52px;
        height: auto !important;
        flex-wrap: wrap;
        gap: 0;
    }

    header .logo img {
        width: min(190px, 54vw);
        height: auto;
        display: block;
    }

    header .menu-toggle {
        display: inline-flex;
        margin-left: auto;
        order: 2;
    }

    header nav {
        position: static !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        order: 3;
        display: none;
        width: 100%;
        margin-top: 12px;
    }

    header nav ul {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0 !important;
        margin: 0 !important;
        padding: 6px 0 !important;
        border-top: 1px solid #e8edf7;
        border-bottom: 1px solid #e8edf7;
    }

    header nav li {
        width: 100%;
    }

    header nav a {
        display: block;
        width: 100%;
        padding: 11px 12px;
        text-align: center;
        font-size: 16px;
    }

    header .header-btn {
        display: none;
        order: 4;
        width: 100%;
        padding-top: 12px;
        justify-content: center;
    }

    header .header-btn a {
        width: min(100%, 260px);
        height: 46px;
    }

    header.menu-open nav {
        display: block;
    }

    header.menu-open .header-btn {
        display: flex;
    }

    .taskone-footer .footer-container {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 42px !important;
        padding-bottom: 54px !important;
    }
}

@media (max-width: 900px) {
    header .top-bar {
        height: auto;
        min-height: 48px;
        padding: 9px 0;
    }

    header .top-flex {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px 24px;
        font-size: 14px;
    }

    header .main-header {
        height: auto !important;
        min-height: 76px;
        padding: 12px 0;
    }

    header .header-flex {
        min-height: 52px;
        height: auto !important;
        flex-wrap: wrap;
        gap: 0;
    }

    header .logo img {
        width: min(190px, 54vw);
        height: auto;
        display: block;
    }

    header .menu-toggle {
        display: inline-flex;
        margin-left: auto;
        order: 2;
    }

    header nav {
        position: static !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        order: 3;
        display: none;
        width: 100%;
        margin-top: 12px;
    }

    header nav ul {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0 !important;
        margin: 0 !important;
        padding: 6px 0 !important;
        border-top: 1px solid #e8edf7;
        border-bottom: 1px solid #e8edf7;
    }

    header nav li {
        width: 100%;
    }

    header nav a {
        display: block;
        width: 100%;
        padding: 11px 12px;
        text-align: center;
        font-size: 16px;
    }

    header .header-btn {
        display: none;
        order: 4;
        width: 100%;
        padding-top: 12px;
        justify-content: center;
    }

    header .header-btn a {
        width: min(100%, 260px);
        height: 46px;
    }

    header.menu-open nav {
        display: block;
    }

    header.menu-open .header-btn {
        display: flex;
    }

    /* Shared tablet section sizing */
    body > .promise-section {
        padding: 72px 20px;
    }

    .promise-title,
    .section-title,
    .values-heading,
    .success-promise-title,
    .cta-title {
        font-size: clamp(2rem, 6vw, 2.75rem) !important;
    }

    .promise-description,
    .section-subtitle,
    .cta-subtitle {
        max-width: 680px;
        margin-left: auto;
        margin-right: auto;
    }

    .premium-section,
    .global-presence-section,
    .programs-section,
    .portfolio-section,
    .process-section,
    .success-stories-section,
    .cta-section {
        padding-top: 64px !important;
        padding-bottom: 64px !important;
    }

    .story-content-card {
        padding: 34px;
    }

    .success-metrics-card {
        margin-top: 28px;
    }

    /* Home page */
    .tw-ai-sections .ai-hero-section {
        padding: 68px 24px;
    }

    .tw-ai-sections .ai-hero-content {
        flex-direction: column;
        align-items: center;
        gap: 44px;
    }

    .tw-ai-sections .ai-hero-text {
        width: 100%;
        min-width: 0;
        padding-right: 0;
        text-align: center;
    }

    .tw-ai-sections .ai-hero-text p {
        margin-left: auto;
        margin-right: auto;
    }

    .tw-ai-sections .ai-hero-buttons {
        justify-content: center;
    }

    .tw-ai-sections .ai-illustration {
        width: min(380px, 78vw);
        height: auto;
        aspect-ratio: 1;
    }

    .tw-ai-sections .section-container,
    .tw-ai-sections .ai-features,
    .tw-ai-sections .ai-stories-section,
    .tw-ai-sections .partners-section,
    .tw-ai-sections .why-choose-section,
    .tw-ai-sections .promise-section {
        padding-top: 64px;
        padding-bottom: 64px;
    }

    .tw-ai-sections .features-grid,
    .tw-ai-sections .ai-stories-grid,
    .tw-ai-sections .partners-grid,
    .tw-ai-sections .industry-focus {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tw-ai-sections .presence-map,
    .tw-ai-sections .presence-locations {
        width: 100%;
        max-width: none;
    }

    /* Shared footer */
    .taskone-footer {
        padding-top: 60px !important;
    }

    .taskone-footer .footer-container {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 42px !important;
        padding-bottom: 54px !important;
    }
}

@media (max-width: 640px) {
    header .top-flex {
        width: 100%;
        flex-direction: column;
        gap: 5px;
        font-size: 13px;
    }

    header .main-header {
        padding: 10px 0;
    }

    body > .promise-section {
        min-height: 0;
        padding: 56px 16px !important;
    }

    .promise-title {
        font-size: clamp(1.9rem, 10vw, 2.35rem) !important;
        letter-spacing: -.5px;
    }

    .promise-description {
        font-size: 1rem !important;
        line-height: 1.65;
    }

    .premium-section,
    .global-presence-section,
    .programs-section,
    .portfolio-section,
    .process-section,
    .success-stories-section,
    .success-promise-section,
    .cta-section {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }

    .container {
        max-width: 100%;
    }

    .section-title,
    .values-heading,
    .success-promise-title,
    .cta-title {
        font-size: clamp(1.75rem, 8vw, 2.15rem) !important;
        line-height: 1.2;
    }

    .section-subtitle,
    .values-subheading,
    .success-promise-subtitle,
    .cta-subtitle {
        margin-bottom: 36px !important;
        font-size: 1rem !important;
    }

    .story-content-card,
    .stats-grid,
    .service-card,
    .step-card,
    .value-box,
    .promise-card,
    .success-metrics-card {
        padding: 24px 20px !important;
    }

    .stat-number {
        font-size: 2.6rem;
    }

    .office-card,
    .program-card,
    .service-card,
    .step-card {
        margin-bottom: 18px;
    }

    .card-footer-info {
        align-items: flex-start;
        gap: 14px;
    }

    .process-section .step-item {
        margin-bottom: 34px;
    }

    .process-section .step-line {
        display: none;
    }

    .metrics-value-large {
        font-size: 3.8rem !important;
    }

    .metrics-main-label {
        font-size: 1.25rem;
    }

    .metrics-stats {
        gap: 20px;
    }

    .metric-item {
        flex: 1 1 0;
    }

    .metric-item-value {
        font-size: 1.55rem !important;
    }

    /* Case studies */
    .success-stories-section .story-card {
        padding: 26px 20px;
        margin-bottom: 32px;
    }

    .success-stories-section .story-header {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 12px;
        margin-bottom: 28px;
    }

    .success-stories-section .story-details {
        min-width: 0;
        padding-left: 0;
    }

    .success-stories-section .solution-title {
        font-size: 1.35rem;
    }

    .success-stories-section .story-metrics-block {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 14px 30px;
    }

    .success-stories-section .content-block ul {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact-hero {
        padding: 58px 18px 60px !important;
    }

    .contact-hero h1 {
        font-size: clamp(2rem, 10vw, 2.6rem) !important;
    }

    .contact-hero p {
        font-size: 1rem;
    }

    .contact-content {
        width: calc(100% - 24px) !important;
        margin: 28px auto 46px !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .ai-contact-section,
    .taskone-card {
        padding: 28px 20px !important;
    }

    /* Home page */
    .tw-ai-sections .ai-hero-section {
        padding: 54px 18px;
    }

    .tw-ai-sections .ai-hero-content {
        gap: 34px;
    }

    .tw-ai-sections .ai-hero-text h1 {
        font-size: clamp(2rem, 10vw, 2.55rem);
    }

    .tw-ai-sections .ai-hero-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .tw-ai-sections .ai-hero-buttons .btn {
        width: 100%;
        min-width: 0;
        padding: 14px 18px;
    }

    .tw-ai-sections .ai-illustration {
        width: min(320px, 88vw);
    }

    .tw-ai-sections .section-container,
    .tw-ai-sections .ai-features,
    .tw-ai-sections .ai-stories-section,
    .tw-ai-sections .partners-section,
    .tw-ai-sections .why-choose-section,
    .tw-ai-sections .promise-section,
    .tw-ai-sections .tw-global-presence-interactive,
    .tw-ai-sections .presence-cta {
        padding: 50px 18px;
    }

    .tw-ai-sections .features-grid,
    .tw-ai-sections .ai-stories-grid,
    .tw-ai-sections .partners-grid,
    .tw-ai-sections .industry-focus,
    .tw-ai-sections .stats-grid,
    .tw-ai-sections .reasons-grid {
        grid-template-columns: 1fr !important;
    }

    .tw-ai-sections .feature-card,
    .tw-ai-sections .ai-story-card,
    .tw-ai-sections .partner-card,
    .tw-ai-sections .industry-card,
    .tw-ai-sections .wp-ai-card {
        width: 100%;
        min-width: 0;
    }

    .tw-ai-sections .section-header h2,
    .tw-ai-sections .ai-features-header h2,
    .tw-ai-sections .ai-stories-header h2,
    .tw-ai-sections .wp-ai-header h2,
    .tw-ai-sections .presence-header h2,
    .tw-ai-sections .presence-cta h2 {
        font-size: clamp(1.8rem, 8vw, 2.2rem);
        line-height: 1.2;
    }

    .tw-ai-sections .pillars-grid {
        gap: 20px;
        margin-bottom: 48px;
    }

    .tw-ai-sections .pillar-item {
        width: 100%;
        max-width: 330px;
    }

    .tw-ai-sections .wp-ai-insights-section {
        margin: 48px auto;
        padding: 0 18px;
    }

    .tw-ai-sections .wp-ai-card-header,
    .tw-ai-sections .wp-ai-card-footer {
        gap: 12px;
        flex-wrap: wrap;
    }

    .tw-ai-sections .presence-map {
        height: auto;
        min-height: 330px;
        padding: 14px;
    }

    .tw-ai-sections .presence-card {
        align-items: flex-start;
    }

    .tw-ai-sections .presence-stats {
        flex-wrap: wrap;
        gap: 24px;
    }

    .tw-ai-sections .presence-stats .stat {
        flex: 1 1 90px;
    }

    .tw-ai-sections .locations {
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    .tw-ai-sections .locations .dot {
        display: none;
    }

    /* Shared footer */
    .taskone-footer {
        padding-top: 46px !important;
    }

    .taskone-footer .footer-container {
        grid-template-columns: 1fr !important;
        gap: 34px !important;
        width: calc(100% - 36px) !important;
        padding-bottom: 42px !important;
    }

    .taskone-footer .footer-logo img {
        width: min(210px, 70vw);
    }

    .taskone-footer .footer-col h3 {
        font-size: 21px;
        margin-bottom: 22px;
    }

    .taskone-footer .footer-phone {
        font-size: 21px;
        overflow-wrap: anywhere;
    }

    .taskone-footer .footer-email {
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    .taskone-footer .footer-bottom-inner {
        width: calc(100% - 36px);
        flex-wrap: wrap;
        text-align: center;
        font-size: 14px;
    }
}

@media (max-width: 390px) {
    header .logo img {
        width: 164px;
    }

    header .menu-toggle {
        width: 42px;
        height: 40px;
    }

    .tw-ai-sections .presence-card {
        flex-direction: column;
    }

    .tw-ai-sections .card-num {
        margin-bottom: 10px;
    }

    .metrics-stats {
        flex-direction: column;
    }
}
