/* Fluid responsive corrections shared by every page. */
html {
  overflow-x: clip;
}

body,
main,
section,
footer {
  min-width: 0;
  max-width: 100%;
}

body:not(.home-page) .mobile-close-icon,
body:not(.home-page) .main-nav .mobile-menu-cta {
  display: none;
}

/*
 * The source layouts use 1920px artboard measurements and switch to their
 * compact desktop layout at 1450px. Keep the MacBook range between those two
 * sizes fluid so 14/15/16-inch viewports do not fall back to fixed columns.
 */
@media (min-width: 1451px) and (max-width: 1919px) {
  .technologies-content > h2 {
    width: 86%;
    font-size: clamp(30px, 2.1vw, 40px);
  }

  .technology-grid > span {
    padding-inline: 15px;
    font-size: 16px;
  }

  .process-intro-copy {
    width: 47%;
  }

  .method-card {
    padding: 20px;
  }

  .method-visual,
  .method-card-featured .method-visual {
    width: 100%;
  }

  .method-card header h3,
  .six-list h3 {
    font-size: 23px;
  }

  .method-copy {
    font-size: 14px;
  }

  .six-intro {
    width: 38%;
  }

  .six-copy {
    width: 90%;
  }

  .six-list {
    width: 57%;
  }

  .six-list li {
    grid-template-columns: 45px 31% minmax(0, 1fr);
    gap: 16px;
  }

  .six-list p {
    font-size: 15px;
  }

  .result-grid {
    right: 44px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .why-metrics-grid {
    right: 5.5%;
    left: 5.5%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .why-metric-card h3 {
    font-size: 20px;
  }

  .why-metric-card p {
    font-size: 15px;
  }

  .problem-flow {
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr) 70px minmax(0, 1fr) 70px minmax(0, 1fr);
    column-gap: 28px;
  }

  .problem-arrow {
    width: 70px;
    height: 37px;
  }

  .problem-item h3 {
    font-size: 25px;
  }

  .problem-item p {
    font-size: 15px;
  }

  .commitment-statement {
    left: 28%;
    width: 68%;
    font-size: 48px;
    letter-spacing: -3px;
  }

  .commitment-list {
    width: 65%;
  }

  .commitment-list article {
    grid-template-columns: 60px 38% minmax(0, 1fr);
  }

  .case-detail-title-block h1 {
    font-size: 60px;
  }

  .case-detail-title-block h1 span {
    white-space: normal;
  }

  .case-detail-title-block > p {
    font-size: 24px;
  }

  .case-detail-visuals {
    grid-template-columns: 37% minmax(0, 1fr);
  }

  .case-detail-row {
    grid-template-columns: 36% 58%;
    column-gap: 4%;
  }

  .case-detail-row ul,
  .case-tech-stack,
  .case-stack-content {
    width: 100%;
  }

  .case-detail-row h2 {
    font-size: 25px;
    white-space: normal;
  }

  .case-detail-row li {
    font-size: 17px;
  }
}

/* Long condensed page titles need an intermediate fluid step before mobile. */
@media (max-width: 1300px) and (min-width: 761px) {
  .technologies-hero > h1,
  .case-list-hero > h1 {
    font-size: clamp(118px, 20vw, 260px);
  }

  .what-hero > h1 {
    font-size: clamp(110px, 18.5vw, 240px);
  }

  .process-hero > h1 {
    font-size: clamp(125px, 20vw, 260px);
  }
}

@media (max-width: 1050px) and (min-width: 761px) {
  .home-page .approach-intro,
  .home-page .values {
    grid-template-columns: minmax(160px, 28%) minmax(0, 1fr);
  }

  .home-page .approach-copy {
    white-space: normal;
  }

  .home-page .approach-line {
    display: inline;
  }

  .home-page .value-list li {
    grid-template-columns: 42px minmax(140px, .7fr) minmax(0, 1fr);
    gap: 16px;
  }

  .case-list-hero {
    min-height: 0;
    padding-bottom: 90px;
  }

  .case-list-hero > h2 {
    margin-top: 30px;
  }

  .case-intro {
    margin: 50px 0 0 auto;
  }

  .process-six {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  }
}

@media (max-width: 760px) {
  /* Use the homepage mobile header and full-screen menu on every inner page. */
  body:not(.home-page) .site-header {
    position: absolute;
    z-index: 60;
    top: 0;
    left: 0;
    width: 100%;
    height: 74px;
    padding: 12px;
    background: transparent;
    backdrop-filter: none;
  }

  body:not(.home-page) .brand {
    position: absolute;
    z-index: 3;
    top: 19.5px;
    left: 12px;
    width: 144px;
    height: 35px;
    transition: top .35s ease, left .35s ease;
  }

  body:not(.home-page) .menu-toggle {
    position: absolute;
    z-index: 3;
    top: 12px;
    right: 12px;
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(203, 205, 198, .5);
    transition: top .35s ease, right .35s ease, border-color .25s ease, background-color .25s ease;
  }

  body:not(.home-page) .menu-toggle > span {
    position: absolute;
    display: block;
    width: 19px;
    height: 1px;
    border-radius: 1px;
    background: var(--ink);
    opacity: 1;
    transition: opacity .2s ease, transform .35s cubic-bezier(.22, 1, .36, 1);
  }

  body:not(.home-page) .menu-toggle > span:first-of-type {
    transform: translateY(-4px);
  }

  body:not(.home-page) .menu-toggle > span:last-of-type {
    transform: translateY(4px);
  }

  body:not(.home-page) .mobile-close-icon {
    position: absolute;
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 0;
    transform: rotate(-60deg) scale(.7);
    transition: opacity .25s ease, transform .35s cubic-bezier(.22, 1, .36, 1);
  }

  body:not(.home-page).menu-open .site-header {
    position: fixed;
    height: 98px;
    padding: 24px;
    background: var(--paper);
  }

  body:not(.home-page).menu-open .brand {
    top: 31.5px;
    left: 24px;
  }

  body:not(.home-page).menu-open .menu-toggle {
    top: 24px;
    right: 24px;
    border: 1px solid var(--ink);
    background: var(--paper);
  }

  body:not(.home-page).menu-open .menu-toggle > span:first-of-type {
    opacity: 0;
    transform: translateY(0) rotate(35deg) scale(.7);
  }

  body:not(.home-page).menu-open .menu-toggle > span:last-of-type {
    opacity: 0;
    transform: translateY(0) rotate(-35deg) scale(.7);
  }

  body:not(.home-page).menu-open .mobile-close-icon {
    opacity: 1;
    transform: rotate(0) scale(1);
  }

  body:not(.home-page) .main-nav {
    position: fixed;
    z-index: 1;
    inset: 0;
    display: flex;
    visibility: hidden;
    width: 100%;
    min-height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 103px 24px 40px;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-18px);
    transition: transform .42s cubic-bezier(.22, 1, .36, 1), opacity .28s ease, visibility .42s;
  }

  body:not(.home-page) .main-nav.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  body:not(.home-page) .main-nav > a:not(.mobile-menu-cta) {
    display: flex;
    width: 100%;
    height: 55px;
    flex: 0 0 55px;
    align-items: center;
    gap: 12px;
    padding: 0;
    border-bottom: 1px solid rgba(17, 17, 17, .1);
    color: inherit;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.28;
    letter-spacing: -.5px;
    text-decoration: none;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity .3s ease, transform .4s cubic-bezier(.22, 1, .36, 1);
  }

  body:not(.home-page) .main-nav > a:first-child {
    border-top: 1px solid rgba(17, 17, 17, .1);
  }

  body:not(.home-page) .main-nav > a:not(.mobile-menu-cta) > span,
  body:not(.home-page) .main-nav a[aria-current="page"] > span {
    width: 8px;
    height: 8px;
    background: #cbcdc6;
    transform: none;
  }

  body:not(.home-page) .main-nav.is-open > a:not(.mobile-menu-cta) {
    opacity: 1;
    transform: translateY(0);
  }

  body:not(.home-page) .main-nav.is-open > a:nth-child(1) { transition-delay: .06s; }
  body:not(.home-page) .main-nav.is-open > a:nth-child(2) { transition-delay: .1s; }
  body:not(.home-page) .main-nav.is-open > a:nth-child(3) { transition-delay: .14s; }
  body:not(.home-page) .main-nav.is-open > a:nth-child(4) { transition-delay: .18s; }
  body:not(.home-page) .main-nav.is-open > a:nth-child(5) { transition-delay: .22s; }

  body:not(.home-page) .main-nav .mobile-menu-cta {
    display: grid;
    width: 118px;
    height: 39px;
    flex: 0 0 39px;
    place-items: center;
    align-self: flex-start;
    margin-top: 39px;
    padding: 0 25px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .3s ease .26s, transform .4s cubic-bezier(.22, 1, .36, 1) .26s;
  }

  body:not(.home-page) .main-nav.is-open .mobile-menu-cta {
    opacity: 1;
    transform: translateY(0);
  }

  /* Home: replace fixed-height, absolutely positioned mobile sections with flow layout. */
  .home-page .hero {
    display: grid;
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 42%);
    column-gap: 12px;
    overflow: hidden;
    padding: 96px var(--gutter) 40px;
  }

  .home-page .hero-title {
    position: relative;
    inset: auto;
    width: 100%;
    grid-column: 1 / -1;
  }

  .home-page .hero-title h1 {
    width: 100%;
    font-size: clamp(36px, 12vw, 52px);
    letter-spacing: clamp(-4.8px, -1.1vw, -2.5px);
  }

  .home-page .hero-title .line,
  .home-page .hero-title .line-inner {
    width: auto;
    max-width: 100%;
  }

  .home-page .hero-title .line-three {
    font-size: clamp(44px, 14vw, 62px);
  }

  .home-page .leaf-mark {
    top: clamp(-46px, -11vw, -34px);
    right: 0;
    left: auto;
    width: clamp(62px, 22vw, 94px);
    height: auto;
  }

  .home-page .doodle {
    top: 12%;
    right: 1%;
    left: auto;
    width: clamp(42px, 14vw, 60px);
    height: auto;
  }

  .home-page .hero-intro {
    position: static;
    display: block;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin-top: clamp(42px, 13vw, 58px);
  }

  .home-page .hero-intro p {
    width: 100%;
  }

  .home-page .hero-intro .pill-button {
    margin-top: 24px;
  }

  .home-page .hero-orb {
    position: static;
    width: 100%;
    height: auto;
    max-width: 180px;
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    aspect-ratio: 1;
    margin-top: 22px;
  }

  .home-page .statement {
    height: clamp(190px, 48vw, 212px);
  }

  .home-page .statement-image {
    height: 100%;
  }

  .home-page .statement-copy {
    height: auto;
    min-height: 66px;
  }

  .home-page .services {
    height: auto;
    min-height: 0;
    padding: 54px var(--gutter) 72px;
  }

  .home-page .service-heading .pill-button,
  .home-page .service-grid {
    position: static;
    inset: auto;
  }

  .home-page .service-heading .pill-button {
    margin-top: 30px;
  }

  .home-page .service-grid {
    height: auto;
    grid-auto-rows: auto;
    gap: 28px;
    margin-top: 46px;
  }

  .home-page .service-card {
    min-height: 0;
    grid-template-columns: clamp(76px, 27vw, 110px) minmax(0, 1fr);
    gap: clamp(16px, 6vw, 30px);
    padding-bottom: 26px;
  }

  .home-page .service-card > img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .home-page .work {
    height: auto;
    padding: 54px var(--gutter) 78px;
  }

  .home-page .work-heading .pill-button,
  .home-page .case-grid {
    position: static;
    inset: auto;
  }

  .home-page .work-heading .pill-button {
    margin-top: 30px;
  }

  .home-page .case-grid {
    gap: 20px;
    margin-top: 46px;
  }

  .home-page .case-grid .case-card:nth-child(n) {
    height: auto;
    min-height: 0;
    aspect-ratio: 1.1 / 1;
  }

  .home-page .approach {
    height: auto;
    padding: 66px var(--gutter) 72px;
  }

  .home-page .approach-intro,
  .home-page .values {
    display: block;
  }

  .home-page .approach-label,
  .home-page .approach-copy,
  .home-page .values-number,
  .home-page .value-list {
    position: static;
    inset: auto;
    width: auto;
  }

  .home-page .approach-label {
    font-size: clamp(20px, 6vw, 22px);
  }

  .home-page .approach-copy {
    margin-top: 32px;
    font-size: clamp(25px, 7.2vw, 28px);
  }

  .home-page .values {
    margin-top: 58px;
  }

  .home-page .values-number {
    font-size: clamp(78px, 26vw, 100px);
  }

  .home-page .value-list {
    margin-top: 34px;
  }

  .home-page .value-list li {
    height: auto;
    min-height: 0;
    padding: 22px 0 28px;
  }

  .home-page .site-footer {
    position: relative;
    display: flex;
    height: auto;
    min-height: 0;
    flex-direction: column-reverse;
    gap: 72px;
    padding: 66px var(--gutter) 36px;
  }

  .home-page .footer-cta,
  .home-page .footer-meta,
  .home-page .awards,
  .home-page .footer-meta p {
    position: static;
    inset: auto;
  }

  .home-page .footer-meta {
    display: flex;
    flex-direction: column-reverse;
    gap: 24px;
  }

  .home-page .awards {
    width: 100%;
    justify-content: flex-start;
    gap: clamp(18px, 7vw, 30px);
  }

  .home-page .footer-meta p {
    white-space: normal;
  }

  /* Shared page heroes and contact/footer sections. */
  .technologies-hero {
    min-height: 0;
    padding: 130px 16px 70px;
  }

  .technologies-hero > h1 {
    position: relative;
    inset: auto;
    max-width: 100%;
    font-size: clamp(64px, 18vw, 118px);
  }

  .case-list-hero {
    min-height: 0;
    padding: 130px 16px 70px;
  }

  .case-list-hero > h1,
  .case-list-rule,
  .case-eyebrow,
  .case-list-hero > h2,
  .case-intro {
    position: relative;
    inset: auto;
  }

  .case-list-hero > h1 {
    max-width: 100%;
    font-size: clamp(62px, 19vw, 122px);
  }

  .case-list-rule {
    margin-top: 48px;
  }

  .case-eyebrow {
    display: block;
    margin-top: 28px;
  }

  .case-list-hero > h2 {
    margin-top: 30px;
  }

  .case-intro {
    margin-top: 42px;
  }

  .case-detail-page .case-detail-thumb {
    display: none;
  }

  .case-detail-page .case-detail-title-block {
    margin-top: 0;
  }

  .technologies-footer,
  .case-footer,
  .process-footer,
  .what-footer {
    height: auto;
    min-height: 0;
    justify-content: flex-start;
    gap: 72px;
  }

  /* Why Work With Us: let copy and cards define section height. */
  .why-hero {
    height: auto;
    padding: 130px 16px 70px;
  }

  .why-hero-title,
  .why-hero-summary,
  .why-quick-stats {
    position: relative;
    inset: auto;
  }

  .why-hero-title {
    font-size: clamp(64px, 20vw, 110px);
  }

  .why-title-line {
    height: auto;
    min-height: .75em;
  }

  .why-hero-summary {
    margin-top: 48px;
  }

  .why-hero-summary .pill-button {
    position: relative;
    inset: auto;
  }

  .why-quick-stats {
    margin-top: 46px;
  }

  .why-quick-stats article {
    min-height: 0;
  }

  .why-partner {
    height: auto;
    padding: 70px 16px 76px;
  }

  .why-partner-title,
  .why-partner-copy,
  .why-partner-button,
  .why-partner-art {
    position: relative;
    inset: auto;
    width: auto;
  }

  .why-partner-title {
    font-size: clamp(40px, 12vw, 60px);
  }

  .why-partner-copy {
    margin-top: 34px;
  }

  .why-partner-button {
    margin-top: 26px;
  }

  .why-partner-art {
    height: auto;
    aspect-ratio: 642 / 514;
    margin-top: 58px;
  }

  .why-partner-art span {
    width: 55%;
    height: 35%;
  }

  .why-partner-art img {
    width: 86%;
    height: 90%;
  }

  /* What We Think: keep the artwork layered, but move the copy back into flow. */
  .what-hero {
    height: auto;
    padding: 120px 0 0;
  }

  .what-hero > h1 {
    position: relative;
    inset: auto;
    width: calc(100% - 32px);
    max-width: 100%;
    margin: 0 16px 50px;
    font-size: clamp(60px, 18vw, 116px);
  }

  .what-hero-stage {
    min-height: 0;
    padding: 50px 16px 70px;
  }

  .what-hero-copy {
    position: relative;
    inset: auto;
    width: auto;
    margin: 515px 0 0;
  }

  .what-footer {
    gap: 72px;
  }

  .process-results {
    min-height: 0;
  }

  .result-grid article {
    height: auto;
    min-height: 207px;
  }

  .case-detail-title-block h1,
  .case-detail-title-block > p,
  .case-detail-row,
  .technology-contact-copy,
  .case-contact-copy {
    max-width: 100%;
  }

  .case-tech-stack span,
  .process-tags span,
  .method-tags span,
  .what-tags span {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .vision-metrics {
    grid-template-columns: 1fr;
  }

  .commitment-heading > strong {
    font-size: clamp(105px, 34vw, 145px);
  }
}

@media (max-width: 360px) {
  .home-page .hero-title h1 {
    font-size: clamp(34px, 11.5vw, 42px);
  }

  .home-page .hero-title .line-three {
    font-size: clamp(40px, 13vw, 48px);
  }

  .technologies-hero > h1,
  .what-hero > h1 {
    font-size: clamp(54px, 17.5vw, 64px);
  }

  .case-list-hero > h1 {
    font-size: clamp(56px, 18vw, 66px);
  }

  .process-hero > h1 {
    font-size: clamp(66px, 22vw, 82px);
  }

  .technology-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: 52px;
  }

  .technology-grid > span {
    justify-content: flex-start;
    padding-inline: 22px;
  }

  .case-meta {
    grid-template-columns: 1fr;
  }
}
