/* =========================================================
   LARGE TABLET / SMALL DESKTOP
   ========================================================= */

@media (max-width: 1100px) {

    :root {
        --section: 90px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .hero {
        padding-top: 145px;
    }

    .system-visual {
        max-width: 760px;
    }

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

    .process-flow {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 30px;
    }

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

    .solution-stack article {
        grid-template-columns: 120px 1fr;
    }

    .solution-stack article p {
        grid-column: 2;
    }

    .build-row {
        grid-template-columns: 55px 1fr 230px;
    }

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

    .contact-option-card:first-child {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   TABLET / MOBILE NAV
   ========================================================= */

@media (max-width: 991.98px) {

    .site-header .navbar-collapse {
        margin-top: 12px;
        padding: 16px;

        border: 1px solid var(--border);
        border-radius: 14px;

        background: #ffffff;

        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    }

    .nav-link {
        padding: 0.8rem 0.35rem !important;
    }

    .nav-link::after {
        right: auto;
        left: 0.35rem;

        width: 34px;
    }

    .site-header .btn {
        width: 100%;
    }

    .education-grid,
    .dashboard-body,
    .project-detail-grid,
    .contact-expectation-grid {
        grid-template-columns: 1fr;
    }

    .project-detail-grid,
    .contact-expectation-grid {
        border-left: 0;
    }

    .project-detail-block,
    .contact-expectation-grid article {
        border-left: 1px solid var(--border);
    }

    .contact-expectation-grid article {
        border-left-color: #30323a;
    }

    .solution-stack article {
        grid-template-columns: 1fr;
    }

    .solution-stack article p {
        grid-column: auto;
    }

    .build-row {
        grid-template-columns: 50px 1fr;
    }

    .build-ui {
        grid-column: 2;
    }

    .footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 50px 40px;
    }

    .footer-brand-column {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767.98px) {

    :root {
        --section: 72px;
    }

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .site-container,
    .container,
    .container-fluid {
        max-width: 100%;
    }

    main {
        padding-bottom: 82px;
    }


    /* Header */

    .site-header .navbar {
        width: 100%;
        padding: 15px 0;
    }

    .site-header .site-container {
        padding-right: 14px;
        padding-left: 14px;
    }

    .brand {
        min-width: 0;
    }

    .brand-logo {
        width: 26px;
        height: 26px;
    }

    .brand-word {
        font-size: 0.8rem;
        letter-spacing: 0.11em;

        white-space: nowrap;
    }


    /* Home hero */

    .hero {
        min-height: auto;
        padding: 125px 0 72px;

        overflow: hidden;
    }

    .hero h1 {
        max-width: 100%;

        font-size: clamp(3.5rem, 15vw, 5rem);

        overflow-wrap: break-word;
    }

    .hero-lead {
        font-size: 1rem;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;

        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        min-width: 0;

        white-space: normal;
        text-align: center;
    }

    .capability-line {
        flex-wrap: wrap;
        gap: 8px;

        font-size: 0.7rem;
    }


    /* System visual */

    .system-visual {
        width: 100%;
        max-width: 100%;
        height: 420px;

        overflow: hidden;
    }

    .node {
        font-size: 0.67rem;
    }

    .system-core {
        width: 190px;
        padding: 18px;
    }

    .node-a,
    .node-b {
        left: 18px;
    }

    .node-c,
    .node-d,
    .node-e {
        right: 18px;
    }


    /* Main content */

    .pain-grid,
    .capability-grid,
    .project-grid,
    .contact-options {
        grid-template-columns: 1fr;
    }

    .contact-option-card:first-child {
        grid-column: auto;
    }

    .pain-item,
    .capability {
        min-height: auto;
    }

    .pain-item h3 {
        margin-top: 30px;
    }

    .section-inline-cta {
        flex-direction: column;
    }

    .capability h3 {
        margin-top: 42px;
    }

    .build-row {
        grid-template-columns: 38px 1fr;
        gap: 16px;
    }

    .build-row h3 {
        font-size: 1.9rem;
    }

    .build-ui {
        grid-column: 1 / -1;
    }

    .decision-path {
        grid-template-columns: 1fr;
    }

    .process-flow {
        grid-template-columns: 1fr;

        border-top: 0;
        border-left: 1px solid var(--border);
    }

    .process-step {
        min-height: auto;
        margin-bottom: 28px;
        padding: 0 0 28px 22px;

        border-bottom: 1px solid var(--border);
    }

    .process-step h3 {
        margin: 12px 0 6px;
    }

    .process-step:not(:last-child)::after {
        display: none;
    }

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

    .dashboard-demo {
        padding: 12px;
    }

    .work-empty {
        padding: 34px 24px;
    }

    .project-detail-block {
        padding: 28px 22px;
    }

    .project-detail-block h2 {
        margin-top: 30px;

        font-size: 2.5rem;
    }

    .project-detail-media img {
        max-height: 480px;
    }


    /* Contact */

    .contact-page {
        padding: 145px 0 90px;
    }

    .contact-page h1 {
        font-size: clamp(3.6rem, 17vw, 5.6rem);
    }

    .contact-option-card {
        min-height: 190px;
    }

    .contact-option-card strong {
        font-size: 2rem;
    }

    .contact-expectation {
        margin-top: 64px;
    }

    .contact-expectation-grid article {
        padding: 24px;
    }


    /* Inquiry modal */

    .vs-inquiry-modal {
        align-items: flex-end;

        padding: 0;
    }

    .vs-inquiry-dialog {
        width: 100%;
        max-height: 92vh;

        padding:
            32px
            18px
            calc(24px + env(safe-area-inset-bottom));

        border-radius: 18px 18px 0 0;

        transform: translateY(40px);
    }

    .vs-inquiry-header {
        margin-bottom: 24px;
        padding-right: 34px;
    }

    .vs-inquiry-header h2 {
        font-size: 40px;
    }

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

    .vs-inquiry-close {
        top: 14px;
        right: 14px;
    }


    /* Floating assistant */

    .vs-contact-assistant {
        right: 12px;
        bottom:
            calc(
                12px +
                env(safe-area-inset-bottom)
            );

        max-width: calc(100vw - 24px);
    }

    .vs-contact-launcher {
        min-height: 46px;
        max-width: calc(100vw - 24px);
        padding: 0 14px;

        font-size: 13px;

        box-shadow: 0 8px 26px rgba(8, 9, 11, 0.12);
    }

    .vs-contact-panel {
        position: fixed;
        right: 14px;
        bottom:
            calc(
                70px +
                env(safe-area-inset-bottom)
            );
        left: 14px;

        width: auto;
        max-width: none;
        max-height: calc(100dvh - 100px);
        overflow-y: auto;

        padding: 20px 18px;

        border-radius: 16px;

        overscroll-behavior: contain;
    }

    .vs-contact-panel-header {
        margin-bottom: 8px;
    }

    .vs-contact-panel-header h3 {
        font-size: 30px;
        line-height: 0.98;
    }

    .vs-contact-intro {
        margin-bottom: 16px;

        font-size: 14px;
    }

    .vs-contact-option {
        grid-template-columns:
            30px
            minmax(0, 1fr)
            20px;
        gap: 8px;

        padding: 12px 0;
    }

    .vs-contact-option strong {
        font-size: 13px;
    }

    .vs-contact-option small {
        font-size: 11px;
        line-height: 1.35;
    }

    .vs-contact-direct {
        margin-top: 14px;
    }


    /* Footer */

    .site-footer {
        padding:
            68px
            0
            calc(
                26px +
                env(safe-area-inset-bottom)
            );
    }

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

    .footer-brand-column {
        grid-column: auto;
    }

    .footer-statement {
        max-width: 340px;

        font-size: 2.7rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;

        margin-top: 48px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 430px) {

    :root {
        --section: 62px;
    }

    .site-container {
        padding-right: 18px;
        padding-left: 18px;
    }

    .hero h1 {
        font-size: 3.8rem;
    }

    .system-visual {
        height: 380px;
    }

    .system-core {
        width: 165px;
    }

    .node {
        padding: 8px 10px;
    }

    .node-c {
        top: 60px;
    }

    .node-d {
        top: 175px;
    }

    .node-e {
        bottom: 55px;
    }

    .section-heading h2,
    .page-hero h1,
    .final-cta h2 {
        font-size: 2.95rem;
    }

    .editorial-transition h2 {
        font-size: 3.15rem;
    }

    .pain-item {
        padding: 26px;
    }

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

    .tr {
        grid-template-columns: 28px 1fr;
    }

    .tr .status {
        grid-column: 2;

        width: max-content;
    }

    .action-cloud span {
        width: 100%;
    }

    .project-image,
    .project-visual {
        height: 170px;
    }

    .work-empty {
        padding: 28px 20px;
    }

    .contact-prompts {
        margin: 26px 0;
    }

    .contact-option-card {
        min-height: 170px;
        padding: 20px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1 !important;

        transform: none !important;

        transition: none !important;
    }

    .btn,
    .contact-option-card,
    .vs-contact-launcher,
    .vs-contact-panel,
    .vs-inquiry-dialog {
        transition: none !important;
    }
}
