/* =========================================================
   SHARED RESPONSIVE LAYOUT SYSTEM
   Loaded after page-specific styles so mobile rules remain
   consistent across the site.
========================================================= */

*,
*::before,
*::after {
    min-width: 0;
}

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

.hero-image-mobile {
    display: none;
}

.hero-code-outcome {
    display: none;
}

@media (max-width: 1199px) {
    .container {
        width: min(calc(100% - 48px), var(--max-width));
    }

    .desktop-nav {
        gap: 20px;
    }

    .about-stats-grid,
    .career-stats-grid,
    .contact-channel-grid,
    .purpose-grid,
    .career-benefits-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .story-grid,
    .team-grid,
    .career-life-grid,
    .internship-grid,
    .enquiry-layout,
    .office-grid,
    .faq-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .story-image,
    .team-image,
    .career-life-image,
    .office-map {
        min-height: 360px;
    }

    .service-feature-grid,
    .jobs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-feature-card {
        grid-template-columns: 1fr;
    }

    .service-feature-image {
        min-height: 220px;
    }

    .industries-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }

    .container {
        width: calc(100% - 32px);
    }

    .nav-wrap {
        height: 70px;
        gap: 12px;
    }

    .brand {
        width: 155px;
        height: 56px;
    }

    .desktop-nav,
    .nav-quote {
        display: none;
    }

    .menu-btn {
        display: block;
    }

    .mobile-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        z-index: 999;
        display: grid;
        gap: 2px;
        max-height: calc(100dvh - 70px);
        padding: 14px 16px 22px;
        overflow-y: auto;
        background: #111a20;
        transform: translateY(-120%);
    }

    .mobile-menu a:not(.btn) {
        padding: 13px 8px;
    }

    .mobile-menu .btn {
        width: 100%;
        min-height: 50px;
        margin-top: 6px;
    }

    .section,
    .story-section,
    .purpose-section,
    .team-section,
    .timeline-section,
    .core-services,
    .why-services,
    .services-process,
    .industries-section,
    .career-life,
    .why-careers,
    .open-positions,
    .internship-section,
    .hiring-process,
    .contact-channels,
    .project-enquiry,
    .contact-process,
    .office-section,
    .contact-faq {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .hero,
    .about-hero,
    .services-hero,
    .careers-hero {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .hero-inner,
    .about-hero-inner,
    .services-hero-inner,
    .careers-hero-inner {
        order: 1;
        display: block;
        min-height: 0;
    }

    .hero-copy,
    .about-hero-content,
    .services-hero-content,
    .careers-hero-content {
        width: 100%;
        max-width: none;
        padding: 38px 0 24px;
    }

    .hero-image,
    .about-hero-image,
    .services-hero-image,
    .careers-hero-image {
        position: relative;
        inset: auto;
        order: 2;
        width: 100%;
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 9;
        margin: 0;
        background-color: #fff;
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }

    .hero-soft-overlay,
    .about-hero-overlay,
    .services-hero-overlay,
    .careers-hero-overlay {
        display: none;
    }

    .hero-side-copy,
    .about-hero-side,
    .services-hero-side,
    .careers-side-text,
    .cta-side-text,
    .about-cta-side,
    .services-cta-side,
    .career-cta-side,
    .contact-final-side {
        display: none;
    }

    .hero h1,
    .about-hero h1,
    .services-hero h1,
    .careers-hero h1,
    .contact-hero h1 {
        font-size: clamp(34px, 10vw, 44px);
        line-height: 1.06;
    }

    .hero-copy > p,
    .about-hero-content > p,
    .services-hero-content > p,
    .careers-hero-content > p,
    .contact-hero-content > p {
        font-size: 15px;
        line-height: 1.6;
    }

    .hero-buttons,
    .services-hero-buttons,
    .careers-hero-buttons,
    .about-cta-buttons,
    .services-cta-buttons,
    .career-cta-buttons,
    .contact-final-buttons,
    .contact-hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .hero-buttons .btn,
    .services-hero-buttons .btn,
    .careers-hero-buttons .btn,
    .about-cta-buttons .btn,
    .services-cta-buttons .btn,
    .career-cta-buttons .btn,
    .contact-final-buttons .btn,
    .contact-hero-actions .btn {
        width: 100%;
        min-height: 50px;
    }

    .hero-points,
    .contact-hero-points {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        margin-top: 28px;
    }

    .hero-point:nth-child(3),
    .contact-hero-points > div:nth-child(3) {
        grid-column: 1 / -1;
    }

    .about-values {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .services-heading h2,
    .purpose-heading h2,
    .timeline-heading h2,
    .career-heading h2,
    .contact-heading h2,
    .faq-intro h2,
    .enquiry-intro h2,
    .section-heading h2,
    .about-copy h2 {
        font-size: clamp(28px, 8vw, 34px);
    }

    .service-grid,
    .stats-grid,
    .purpose-grid,
    .career-stats-grid,
    .career-benefits-grid,
    .contact-channel-grid,
    .service-feature-grid,
    .jobs-grid,
    .internship-points,
    .hiring-grid,
    .contact-process-grid {
        grid-template-columns: 1fr;
    }

    .solutions-track {
        grid-template-columns: 1fr;
        overflow: visible;
        padding-bottom: 0;
    }

    .slider-arrow {
        display: none;
    }

    .service-card,
    .service-feature-card,
    .job-card,
    .career-benefit,
    .contact-channel-card {
        min-height: 0;
    }

    .service-feature-card {
        grid-template-columns: 1fr;
    }

    .service-feature-image {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .service-feature-image img,
    .story-image img,
    .team-image img,
    .career-life-image img {
        height: 100%;
        object-fit: cover;
    }

    .why-services-grid,
    .why-services-grid .why-service-item,
    .about-stats-grid,
    .career-stats-grid {
        grid-template-columns: 1fr;
    }

    .why-service-item {
        min-height: 0;
        padding: 22px 16px;
        border-right: 0;
        border-bottom: 1px solid #dce0e2;
    }

    .why-service-item:last-child {
        border-bottom: 0;
    }

    .why-icon {
        width: 62px;
        height: 62px;
        margin-bottom: 10px;
    }

    .services-process-grid,
    .process-grid,
    .timeline {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .services-process-arrow,
    .process-arrow,
    .timeline-line {
        display: none;
    }

    .timeline-item {
        position: relative;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        text-align: left;
    }

    .industries-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .industry-card {
        min-height: 116px;
    }

    .contact-hero {
        min-height: 0;
        padding: 38px 0 48px;
    }

    .contact-hero-inner {
        min-height: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .contact-hero-content {
        padding: 0;
    }

    .contact-hero-card {
        position: relative;
        inset: auto;
        width: 100%;
        margin: 0;
    }

    .contact-hero-glow {
        right: -80px;
        width: 260px;
        height: 260px;
    }

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

    .office-map {
        min-height: 300px;
        overflow: hidden;
    }

    .footer {
        padding-top: 38px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-col {
        padding: 22px 0 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-left: 0;
    }

    .footer-brand img {
        width: min(220px, 100%);
        max-height: none;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        padding: 16px 0;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        width: calc(100% - 32px);
    }

    .brand {
        width: 145px;
        height: 52px;
    }

    .section,
    .story-section,
    .purpose-section,
    .team-section,
    .timeline-section,
    .core-services,
    .why-services,
    .services-process,
    .industries-section,
    .career-life,
    .why-careers,
    .open-positions,
    .internship-section,
    .hiring-process,
    .contact-channels,
    .project-enquiry,
    .contact-process,
    .office-section,
    .contact-faq {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .hero-copy,
    .about-hero-content,
    .services-hero-content,
    .careers-hero-content {
        padding-top: 32px;
    }

    .hero h1,
    .about-hero h1,
    .services-hero h1,
    .careers-hero h1,
    .contact-hero h1 {
        font-size: clamp(32px, 9.5vw, 38px);
    }

    .hero-points,
    .contact-hero-points,
    .industries-grid {
        grid-template-columns: 1fr;
    }

    .hero-point:nth-child(3),
    .contact-hero-points > div:nth-child(3) {
        grid-column: auto;
    }

    .story-image,
    .team-image,
    .career-life-image,
    .office-map {
        min-height: 240px;
    }

    .service-feature-image {
        aspect-ratio: 4 / 3;
    }

    .footer-bottom span {
        display: block;
    }
}


/* Homepage hero: one authoritative mobile flow. */
@media (max-width: 720px) {
    .hero {
        position: relative;
        min-height: auto;
        overflow: visible;
        background: #fff;
    }

    .hero-inner {
        position: relative;
        min-height: auto;
        display: block;
    }

    .hero-copy,
    .hero-copy.reveal {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 30px 0 0;
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-copy > :not(.hero-code-outcome) {
        position: relative;
        z-index: 1;
    }

    .hero-code-outcome {
        position: absolute;
        display: block;
        z-index: 0;
        top: 72px;
        right: 0;
        width: min(158px, calc(100% - 16px));
        height: 130px;
        color: rgba(210, 139, 8, 0.38);
        pointer-events: none;
        animation: outcome-float 7s ease-in-out infinite;
    }

    .hero-code-outcome svg {
        width: 100%;
        height: 100%;
        overflow: visible;
    }

    .hero-code-outcome .outcome-block {
        fill: rgba(255, 255, 255, 0.55);
        stroke: currentColor;
        stroke-width: 1.2;
    }

    .hero-code-outcome .outcome-flow {
        fill: none;
        stroke: currentColor;
        stroke-width: 1.25;
        stroke-dasharray: 5 7;
        animation: outcome-flow 3.8s linear infinite;
    }

    .hero-code-outcome .outcome-flow-alt {
        animation-delay: -2s;
    }

    .hero-code-outcome .outcome-chart {
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    .hero-code-outcome .outcome-node {
        fill: #d28b08;
        stroke: #ffffff;
        stroke-width: 2;
        animation: outcome-pulse 2.6s ease-in-out infinite;
    }

    .hero-code-outcome .outcome-node-delay {
        animation-delay: -1.3s;
    }

    .hero-code-outcome text {
        fill: #a66d05;
        stroke: none;
        font-family: "Inter", Arial, sans-serif;
        font-size: 8px;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-anchor: middle;
    }

    .hero-code-outcome .code-fragments {
        animation: code-shift 4.5s ease-in-out infinite;
    }

    .hero .eyebrow {
        display: block;
        margin: 0 0 18px;
        padding: 0;
        font-size: 10px;
        line-height: 1.5;
        letter-spacing: 0.15em;
    }

    .hero h1 {
        height: auto;
        margin: 0 0 22px;
        overflow: visible;
        font-size: clamp(38px, 10.5vw, 44px);
        line-height: 1.04;
        letter-spacing: -0.04em;
        transform: none;
    }

    .hero-buttons {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 0;
    }

    .hero-buttons .btn {
        width: 100%;
        min-height: 52px;
        padding: 13px 18px;
        border-radius: 9px;
        font-size: 14px;
    }

    .hero-points {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 14px;
        margin: 30px 0 28px;
    }

    .hero-point:nth-child(3) {
        grid-column: 1 / -1;
    }

    .point-icon {
        width: 34px;
        height: 34px;
    }

    .hero-image.hero-image-desktop {
        display: none;
    }

    .hero-image-mobile {
        position: relative;
        display: block;
        width: 100vw;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
        margin: 0 0 0 calc(50% - 50vw);
        background-color: #fff;
        background-image: url("../images/hero1.png");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
}

@media (max-width: 480px) {
    .hero-copy,
    .hero-copy.reveal {
        padding: 30px 0 0;
    }

    .hero h1 {
        font-size: clamp(36px, 10.5vw, 40px);
    }

    .hero-code-outcome {
        top: 66px;
        right: 0;
        width: min(140px, calc(100% - 16px));
        height: 116px;
        opacity: 0.82;
    }

    .hero-points {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-point:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@keyframes outcome-flow {
    to {
        stroke-dashoffset: -48;
    }
}

@keyframes outcome-pulse {
    50% {
        opacity: 0.45;
        transform: scale(1.35);
        transform-origin: center;
    }
}

@keyframes outcome-float {
    50% {
        transform: translateY(-7px);
    }
}

@keyframes code-shift {
    50% {
        opacity: 0.35;
        transform: translateX(12px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-code-outcome,
    .hero-code-outcome .outcome-flow,
    .hero-code-outcome .outcome-node,
    .hero-code-outcome .code-fragments {
        animation: none;
    }
}

/* Above-the-fold page content must not wait for reveal animation. */
.about-hero-content.reveal,
.services-hero-content.reveal,
.careers-hero-content.reveal,
.contact-hero-content.reveal,
.contact-hero-card.reveal {
    opacity: 1;
    transform: none;
}
