html,
body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

/* Responsive Adjustments */

/* Large Desktop (min-width: 1440px) */
@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }
}

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px 20px;
    }

    .container {
        padding: 0 24px;
        max-width: 100%;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.25rem;
    }

    .section-title {
        font-size: 2.5rem;
    }
}

/* Mobile Large (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --section-padding: 40px 15px !important;
        /* Reduced whitespace between sections */
    }

    .container {
        padding: 0 15px !important;
        max-width: 100vw !important;
    }

    /* Typography controlled via inline styles */
    .txt-left-mb { text-align: left !important; }
    .txt-center-mb { text-align: center !important; }
    .txt-right-mb { text-align: right !important; }


    /* Subpage Hero Clearance - Elevated to Full Height */
    .page-header {
        padding: 160px 20px 80px 20px !important;
        /* Visual balance: (160-80 navbar) = 80px top gap, 80px bottom gap */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .page-header h1 {
        font-size: 2.5rem !important;
        /* Standardized for mobile */
        margin-bottom: 1.25rem !important;
    }

    .page-header .tagline {
        font-size: 1.15rem !important;
        /* Corresponds to the 1.5rem desktop request, scaled for mobile */
        margin-bottom: 2.5rem !important;
        line-height: 1.5 !important;
    }

    /* Card Alignment & Centering */
    .card,
    .expertise-card,
    .domain-card,
    .feature-card,
    .industry-card,
    .portfolio-card,
    .glass-card,
    .team-member,
    .stat-card {
        padding: 1.5rem !important;
        align-items: center !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Alignment controlled via inline styles */


    /* Center lists inside cards */
    .card ul,
    .feature-card ul,
    .glass-card ul {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding-top: 1rem !important;
    }

    /* Fix Portfolio Card Image Visibility on Mobile */
    .portfolio-card {
        padding: 0 !important;
    }

    .portfolio-image {
        width: 100% !important;
    }

    .portfolio-content {
        padding: 1.5rem !important;
        text-align: center !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .card ul li,
    .feature-card ul li,
    .glass-card ul li {
        justify-content: center !important;
        text-align: center !important;
        font-size: 0.85rem !important;
    }

    .card-icon,
    .expertise-icon,
    .industry-icon,
    .feature-icon,
    .icon-wrapper {
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 1rem !important;
    }

    /* Fixed Image Aspect Ratios to Prevent Flatness */
    .service-visual,
    .service-graphic,
    .about-image {
        position: relative !important;
        width: 100% !important;
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
        border-radius: var(--radius-lg) !important;
        overflow: hidden !important;
        order: 2 !important;
        margin-top: 1rem !important;
    }

    .service-visual img,
    .service-graphic img,
    .about-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        display: block !important;
        border-radius: var(--radius-lg) !important;
    }

    /* Who We Are Stats */
    .stat-number {
        font-size: 1.5rem !important;
        margin-bottom: 0.25rem !important;
    }

    .stat-label {
        font-size: 0.85rem !important;
        margin-bottom: 0 !important;
    }

    /* Force all grid content to stack and space normally */
    .grid-2,
    .grid-3,
    .grid-4,
    .trust-grid,
    .domain-grid,
    .expertise-grid,
    .portfolio-grid,
    .team-grid,
    .philosophy-grid,
    .service-row {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
        margin-bottom: 2rem !important;
    }

    .flex.gap-4 {
        gap: 0.75rem !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    /* Header Nav refinements */
    .nav-menu {
        padding-top: 80px !important;
    }

    /* Prevent text overflow */
    /* Overflow and alignment controlled via inline styles */


    span,
    a {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Container safeguard */
    .container {
        padding: 0 15px !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }

    /* Section safeguard */
    section {
        overflow: hidden !important;
    }

    /* Image safeguard */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    h1 {
        /* Fluid via clamp() */
    }

    h2 {
        /* Fluid via clamp() */
    }

    .section-title {
        /* Fluid via clamp() */
    }

    .section-subtitle {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .flex-col-md {
        flex-direction: column;
    }

    .logo {
        font-size: 1.2rem !important;
    }

    .logo-icon {
        width: 28px !important;
        height: 28px !important;
    }

    /* Standard Button Sizing for Mobile */
    .btn {
        /* width: auto !important; */
        /* min-width: 140px !important; */
        /* Reduced to fit side-by-side */
        max-width: 100%;
        padding: 1.2rem 1.2rem !important;
        font-size: 1rem !important;
        margin: 0 !important;
        display: inline-flex !important;
        justify-content: center;
        align-items: center;
    }

    .header-actions .btn {
        display: none !important;
    }

    .flex-col-mobile {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    /* Industry grid stacking */
    .industry-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    /* Mobile Header Navigation Refinements */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 100px 2rem 4rem 2rem;
        transition: 0.3s ease-in-out;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
        align-items: center;
        text-align: center;
        display: flex !important;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1rem 0;
        width: 100%;
    }

    .nav-link {
        font-size: 1.1rem !important;
        /* Balanced menu text size */
        font-weight: 600;
        display: block;
        padding: 8px;
        color: var(--text-main);
    }

    /* Sidebar Button balance */
    .nav-menu .btn {
        min-width: 180px;
        margin-top: 1rem !important;
    }

    .hamburger {
        display: block;
        cursor: pointer;
        z-index: 1001;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Hero section centering & proportions */
    .hero-new,
    .page-header {
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .hero-new .tagline,
    .page-header p {
        font-size: 0.95rem !important;
        margin-bottom: 2rem !important;
        max-width: 600px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .flex.gap-4 {
        gap: 0.75rem !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    /* Glass card normalization */
    .glass-card {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        padding: 1.5rem !important;
    }

    /* Industry card vertical alignment */
    .industry-card {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }

    /* Badge & Service Centering */
    .service-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    .badge {
        margin-left: auto !important;
        margin-right: auto !important;
        display: inline-flex !important;
    }

    .portfolio-tags {
        justify-content: center !important;
    }
}

/* Mobile Small (max-width: 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 1.85rem !important;
    }

    .section-title {
        font-size: 1.65rem !important;
    }

    .badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .btn {
        min-width: 100%;
    }
}