/*
 * Responsive implementation layer.
 * Desktop remains owned by styles.css and agency-dark.css.
 * Tablet and mobile ranges below do not overlap.
 */

.menu-toggle {
  display: none;
}

/* Tablet: 768px–1279px */
@media (min-width: 768px) and (max-width: 1279px) {
  :root {
    --page-gutter: 48px;
    --content-width: calc(100vw - (var(--page-gutter) * 2));
    --header-height: 84px;
    --section-space-y: 80px;
    --footer-space-y: 64px;
  }

  html {
    scroll-padding-top: calc(var(--header-height) + 20px);
  }

  body {
    font-size: 16px;
  }

  .section-blueprint {
    --blueprint-pitch: calc((100% + 24px) / 6);
  }

  .site-header-inner {
    min-height: var(--header-height);
  }

  .brand-wordmark {
    font-size: 1.0625rem;
  }

  .primary-nav {
    gap: 14px;
  }

  .primary-nav a {
    min-height: 44px;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
  }

  .primary-nav .nav-cta {
    min-height: 48px;
    padding: 12px 16px;
  }

  .primary-nav .nav-cta .arrow-icon {
    width: 16px;
    height: 16px;
  }

  .eyebrow {
    margin-bottom: 24px;
  }

  .hero {
    padding-bottom: 48px;
  }

  .hero-grid {
    min-height: 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 24px;
    align-items: stretch;
  }

  .hero-copy {
    grid-column: 1 / 4;
    padding: 72px 0 32px;
  }

  .hero-copy h1 {
    max-width: 5.2em;
    margin-bottom: 28px;
    font-size: clamp(4rem, 7vw, 5.25rem);
  }

  .hero-copy > p:not(.eyebrow) {
    max-width: 29rem;
    font-size: 1rem;
  }

  .hero-gallery {
    display: flex;
    grid-column: 4 / 7;
    padding: 72px 0 32px;
  }

  .hero-image-single {
    min-height: 0;
    flex: 1;
    aspect-ratio: auto;
  }

  .client-wordmarks-viewport {
    margin-top: 48px;
  }

  .clarity-grid,
  .work-heading-grid,
  .services-shell,
  .brands-heading,
  .about-shell,
  .faq-shell {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 24px;
  }

  .clarity-grid > div:first-child,
  .clarity-copy {
    max-width: 49rem;
    grid-column: 1 / 7;
  }

  .clarity-copy {
    padding-top: 48px;
  }

  .clarity-section h2,
  .clarity-second-line,
  .work-heading-grid h2,
  .process-section h2,
  .services-intro h2,
  .brands-heading h2,
  .about-copy h2,
  .faq-intro h2,
  .contact-heading h2 {
    font-size: clamp(3.25rem, 6vw, 4.5rem);
  }

  .clarity-second-line {
    margin-top: 36px;
  }

  .clarity-copy p {
    max-width: 43rem;
    margin-bottom: 24px;
    font-size: 1.0625rem;
  }

  .clarity-copy .button {
    width: fit-content;
    margin-top: 8px;
  }

  .work-heading-grid {
    row-gap: 24px;
  }

  .work-heading-grid > div {
    grid-column: 1 / 4;
  }

  .work-heading-grid > p {
    grid-column: 4 / 7;
  }

  .naming-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .naming-grid img {
    transform: scale(0.7);
  }

  .process-section h2 {
    margin-bottom: 48px;
  }

  .process-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 24px;
  }

  .process-list h3 {
    margin-top: 24px;
  }

  .process-media .step-number {
    font-size: clamp(4.75rem, 10vw, 6rem);
  }

  .services-intro {
    grid-column: 1 / 3;
  }

  .service-list {
    grid-column: 3 / 7;
  }

  .service-list a {
    min-height: 136px;
    padding-block: 22px;
  }

  .service-list strong {
    font-size: 1.75rem;
  }

  .brands-heading > div {
    grid-column: 1 / 4;
  }

  .brands-heading > p {
    grid-column: 4 / 7;
  }

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

  .brand-card-body {
    min-height: 260px;
    padding: 22px 24px 0;
  }

  .brand-card-title {
    font-size: 1.75rem;
  }

  .about-shell {
    align-items: start;
  }

  .about-portrait {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-column: 1 / 3;
    aspect-ratio: auto;
  }

  .about-copy {
    grid-column: 3 / 7;
  }

  .about-copy h2 {
    margin: 24px 0;
  }

  .contact-heading .contact-title-first {
    display: block;
  }

  .contact-title-default-break {
    display: none;
  }

  .faq-intro {
    grid-column: 1 / 3;
  }

  .faq-list {
    min-height: 620px;
    grid-column: 3 / 7;
  }

  .faq-list summary {
    min-height: 76px;
    font-size: 1.25rem;
  }

  .form-grid {
    gap: 72px;
  }

  .footer-main {
    min-height: 360px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px;
  }

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

  .footer-main > nav:nth-of-type(1) {
    grid-column: 3 / 4;
  }

  .footer-main > nav:nth-of-type(2) {
    grid-column: 4 / 6;
  }

  .footer-contact {
    grid-column: 6 / 7;
  }

  .footer-brand > a {
    font-size: 3rem;
  }

  .footer-main nav a,
  .footer-contact > a,
  .footer-social > * {
    font-size: 0.9375rem;
  }
}

/* Compact tablet navigation only; content remains in the tablet layout. */
@media (min-width: 768px) and (max-width: 899px) {
  .primary-nav {
    gap: 9px;
  }

  .primary-nav a {
    font-size: 0.625rem;
  }

  .primary-nav .nav-cta {
    padding-inline: 11px;
  }
}

/* Mobile: 0px–767px */
@media (max-width: 767px) {
  :root {
    --page-gutter: 20px;
    --content-width: calc(100vw - (var(--page-gutter) * 2));
    --header-height: 72px;
    --section-space-y: 72px;
    --footer-space-y: 56px;
  }

  html {
    scroll-padding-top: calc(var(--header-height) + 16px);
  }

  body {
    padding-right: env(safe-area-inset-right);
    padding-left: env(safe-area-inset-left);
    font-size: 16px;
  }

  body.nav-open {
    height: 100dvh;
    overflow: hidden;
  }

  .section-blueprint {
    --blueprint-pitch: calc((100% + 12px) / 4);
    top: -40px;
    bottom: -40px;
  }

  .site-header {
    --menu-enter-duration: 560ms;
    --menu-exit-duration: 340ms;
    --menu-ease: cubic-bezier(0.4, 0, 0.2, 1);
    min-height: var(--header-height);
  }

  .site-header-inner {
    position: relative;
    z-index: 2;
    min-height: var(--header-height);
  }

  .site-header.is-menu-open {
    transform: translateY(0);
  }

  .brand-wordmark {
    max-width: 9rem;
    font-size: 0.9375rem;
    line-height: 1.1;
  }

  .js .menu-toggle {
    position: relative;
    z-index: 2;
    display: grid;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--acid);
    background: var(--acid);
    color: var(--canvas);
    cursor: pointer;
    isolation: isolate;
    overflow: hidden;
    place-items: center;
    transition:
      background-color 220ms var(--ease-out),
      color 220ms var(--ease-out),
      transform 180ms var(--ease-out);
  }

  .js .menu-toggle:active {
    transform: scale(0.96);
  }

  .menu-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .menu-toggle-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 14px;
  }

  .menu-toggle-icon span {
    position: absolute;
    left: 0;
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform-origin: center;
    transition: transform 380ms var(--menu-ease);
  }

  .menu-toggle-icon span:first-child {
    top: 2px;
  }

  .menu-toggle-icon span:last-child {
    bottom: 2px;
  }

  .site-header.is-menu-open .menu-toggle-icon span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .site-header.is-menu-open .menu-toggle-icon span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  .primary-nav {
    width: 100%;
    flex: 1 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 0 24px;
  }

  .primary-nav a {
    width: 100%;
    min-height: 52px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--grid-line-strong);
    font-size: 0.8125rem;
  }

  .primary-nav a:not(.nav-cta)::after {
    display: none;
  }

  .primary-nav .nav-cta {
    min-height: 56px;
    margin-top: 16px;
    align-items: center;
    justify-content: space-between;
    padding-inline: 18px;
    border-color: var(--acid);
  }

  .site-header-inner {
    flex-wrap: wrap;
  }

  .js .primary-nav {
    position: fixed;
    z-index: 1;
    top: var(--header-height);
    right: 0;
    left: 0;
    width: 100%;
    height: calc(100dvh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    padding: 20px max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    overflow-y: auto;
    border-top: 1px solid var(--grid-line);
    background: var(--canvas);
    clip-path: inset(0 0 100% 0);
    opacity: 0.985;
    pointer-events: none;
    transform: translateY(-4px);
    transform-origin: top;
    visibility: hidden;
    transition:
      clip-path var(--menu-exit-duration) cubic-bezier(0.4, 0, 1, 1),
      opacity 220ms cubic-bezier(0.4, 0, 1, 1),
      transform var(--menu-exit-duration) cubic-bezier(0.4, 0, 1, 1),
      visibility 0s linear var(--menu-exit-duration);
  }

  .js .primary-nav::before {
    position: absolute;
    z-index: 2;
    top: 0;
    right: max(20px, env(safe-area-inset-right));
    left: max(20px, env(safe-area-inset-left));
    height: 1px;
    background: var(--acid);
    content: "";
    pointer-events: none;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms cubic-bezier(0.4, 0, 1, 1);
  }

  .js .primary-nav > a {
    position: relative;
    z-index: 1;
    opacity: 0;
    filter: blur(3px);
    transform: translateY(18px);
    transition:
      opacity 160ms cubic-bezier(0.4, 0, 1, 1),
      filter 180ms cubic-bezier(0.4, 0, 1, 1),
      transform 220ms cubic-bezier(0.4, 0, 1, 1);
  }

  .js .primary-nav > a:nth-child(1) {
    transition-delay: 92ms;
  }

  .js .primary-nav > a:nth-child(2) {
    transition-delay: 74ms;
  }

  .js .primary-nav > a:nth-child(3) {
    transition-delay: 55ms;
  }

  .js .primary-nav > a:nth-child(4) {
    transition-delay: 37ms;
  }

  .js .primary-nav > a:nth-child(5) {
    transition-delay: 18ms;
  }

  .js .primary-nav > a:nth-child(6) {
    transition-delay: 0ms;
  }

  .js .site-header.is-menu-open .primary-nav {
    clip-path: inset(0);
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
    transition:
      clip-path var(--menu-enter-duration) var(--menu-ease),
      opacity 320ms var(--menu-ease),
      transform var(--menu-enter-duration) var(--menu-ease),
      visibility 0s linear 0s;
  }

  .js .site-header.is-menu-open .primary-nav::before {
    transform: scaleX(1);
    transition: transform 480ms var(--menu-ease) 60ms;
  }

  .js .site-header.is-menu-open .primary-nav > a {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
    transition:
      opacity 360ms var(--menu-ease),
      filter 420ms var(--menu-ease),
      transform 480ms var(--menu-ease);
  }

  .js .site-header.is-menu-open .primary-nav > a:nth-child(1) {
    transition-delay: 90ms;
  }

  .js .site-header.is-menu-open .primary-nav > a:nth-child(2) {
    transition-delay: 136ms;
  }

  .js .site-header.is-menu-open .primary-nav > a:nth-child(3) {
    transition-delay: 182ms;
  }

  .js .site-header.is-menu-open .primary-nav > a:nth-child(4) {
    transition-delay: 228ms;
  }

  .js .site-header.is-menu-open .primary-nav > a:nth-child(5) {
    transition-delay: 274ms;
  }

  .js .site-header.is-menu-open .primary-nav > a:nth-child(6) {
    transition-delay: 320ms;
  }

  .eyebrow {
    margin-bottom: 22px;
    font-size: 0.75rem;
    letter-spacing: 0.13em;
  }

  .button {
    width: 100%;
    min-height: 56px;
    justify-content: space-between;
    padding: 15px 18px;
    font-size: 0.75rem;
  }

  .hero {
    padding-bottom: 48px;
  }

  .hero .section-blueprint {
    -webkit-mask-image: linear-gradient(to bottom, transparent 32px, #000 132px, #000 calc(100% - 132px), transparent calc(100% - 24px));
    mask-image: linear-gradient(to bottom, transparent 32px, #000 132px, #000 calc(100% - 132px), transparent calc(100% - 24px));
  }

  .hero-grid {
    display: grid;
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 12px;
  }

  .hero-copy {
    display: block;
    max-width: none;
    grid-column: 1 / 5;
    padding: 64px 0 0;
  }

  .hero-copy h1 {
    max-width: 5em;
    margin-bottom: 28px;
    font-size: clamp(3.75rem, 18vw, 5rem);
    line-height: 0.88;
  }

  .hero-copy > p:not(.eyebrow) {
    max-width: 32rem;
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.62;
  }

  .hero-copy .button-row {
    margin-top: 24px;
  }

  .hero-gallery {
    grid-column: 1 / 5;
    padding-top: 40px;
  }

  .hero-image-single {
    aspect-ratio: 4 / 3;
  }

  .client-wordmarks-viewport {
    margin-top: 40px;
  }

  .client-wordmarks {
    width: 760px;
    max-width: none;
  }

  .clarity-grid,
  .work-heading-grid,
  .services-shell,
  .brands-heading,
  .about-shell,
  .faq-shell {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 12px;
  }

  .clarity-grid > div:first-child,
  .clarity-copy,
  .work-heading-grid > div,
  .work-heading-grid > p,
  .services-intro,
  .service-list,
  .brands-heading > div,
  .brands-heading > p,
  .about-portrait,
  .about-copy,
  .faq-intro,
  .faq-list {
    grid-column: 1 / 5;
  }

  .clarity-section h2,
  .clarity-second-line,
  .work-heading-grid h2,
  .process-section h2,
  .services-intro h2,
  .brands-heading h2,
  .about-copy h2,
  .faq-intro h2,
  .contact-heading h2 {
    font-size: clamp(2.75rem, 13vw, 3.75rem);
    line-height: 0.94;
  }

  .clarity-section h2 br,
  .contact-heading h2 br {
    display: none;
  }

  .clarity-second-line {
    margin-top: 32px;
  }

  .clarity-copy {
    padding-top: 40px;
  }

  .clarity-copy p {
    margin-bottom: 24px;
    font-size: 1rem;
    line-height: 1.65;
  }

  .clarity-copy .button {
    margin-top: 8px;
  }

  .work-heading-grid,
  .brands-heading {
    margin-bottom: 40px;
    row-gap: 24px;
  }

  .work-heading-grid > p,
  .brands-heading > p,
  .services-intro > p:last-child,
  .faq-intro > p:last-child {
    font-size: 1rem;
    line-height: 1.62;
  }

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

  .naming-grid img {
    transform: scale(0.74);
  }

  .process-section h2 {
    margin-bottom: 40px;
  }

  .process-list {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .process-media {
    aspect-ratio: 1 / 1;
  }

  .process-media .step-number {
    bottom: 18px;
    left: 20px;
    font-size: 5.25rem;
  }

  .process-list h3 {
    margin-top: 22px;
    font-size: 1.75rem;
  }

  .process-list li > p:last-child {
    font-size: 1rem;
  }

  .services-shell {
    gap: 40px 12px;
  }

  .services-intro h2 {
    margin: 0 0 24px;
  }

  .service-list a {
    min-height: 132px;
    padding: 22px 0;
    grid-template-columns: 34px minmax(0, 1fr) 24px;
    gap: 12px;
  }

  .service-number {
    font-size: 0.875rem;
  }

  .service-list strong {
    margin-bottom: 8px;
    font-size: 1.5rem;
  }

  .service-list small {
    font-size: 0.9375rem;
    line-height: 1.5;
  }

  .service-arrow {
    width: 22px;
    height: 18px;
  }

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

  .brand-card-body {
    min-height: 260px;
    padding: 22px 20px 0;
  }

  .brand-card-title {
    font-size: 1.75rem;
  }

  .brand-card-description {
    font-size: 1rem;
  }

  .brand-card-tags {
    gap: 6px;
  }

  .brand-card-tags li {
    padding: 7px 9px;
    font-size: 0.6875rem;
  }

  .brand-card-link {
    min-height: 60px;
  }

  .about-shell {
    gap: 40px 12px;
  }

  .about-portrait {
    aspect-ratio: 4 / 5;
  }

  .about-copy h2 {
    margin: 0 0 28px;
  }

  .about-prose p {
    margin-bottom: 22px;
    font-size: 1rem;
    line-height: 1.65;
  }

  .role-list {
    margin: 32px 0;
  }

  .role-list li {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-size: 1rem;
  }

  .faq-shell {
    gap: 40px 12px;
  }

  .faq-intro h2 {
    margin: 0 0 24px;
  }

  .faq-list {
    min-height: 0;
    margin-top: 0;
  }

  .faq-list summary {
    min-height: 72px;
    padding: 16px 0;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 12px;
    font-size: 1.125rem;
  }

  .faq-list summary span {
    width: 44px;
    height: 44px;
  }

  .faq-answer-inner {
    padding: 0 44px 28px 0;
  }

  .faq-answer p {
    font-size: 1rem;
  }

  .contact-heading h2 {
    margin-top: 0;
  }

  .contact-heading > p:not(.eyebrow) {
    font-size: 1rem;
  }

  .text-link {
    min-height: 44px;
    font-size: 1rem;
  }

  .project-form {
    margin-top: 32px;
  }

  .form-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .form-column {
    display: contents;
  }

  .form-submit {
    order: 100;
  }

  .field {
    min-height: 72px;
  }

  .custom-select-trigger {
    min-height: 44px;
  }

  .custom-select-list {
    max-height: min(320px, 48vh);
  }

  .field-textarea {
    min-height: 136px;
    margin-top: 16px;
  }

  .form-submit {
    min-height: 60px;
    margin-top: 28px;
  }

  .site-footer {
    padding-bottom: max(var(--footer-space-y), env(safe-area-inset-bottom));
  }

  .footer-main {
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px 12px;
  }

  .footer-brand,
  .footer-main > nav:nth-of-type(1),
  .footer-main > nav:nth-of-type(2),
  .footer-contact {
    grid-column: 1 / 5;
  }

  .footer-brand > a {
    font-size: 3rem;
  }

  .footer-brand p {
    margin-top: 20px;
    font-size: 1rem;
  }

  .footer-main h2,
  .footer-contact h2 {
    margin-bottom: 18px;
  }

  .footer-main nav a,
  .footer-contact > a,
  .footer-social > * {
    min-height: 44px;
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-size: 1rem;
  }

  .footer-social {
    margin-top: 24px;
    padding-top: 24px;
  }

  .footer-bottom {
    min-height: 0;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 20px;
    margin-top: 48px;
    padding-top: 28px;
    font-size: 0.875rem;
  }

  .footer-location {
    width: 100%;
    margin: 12px 0 0 !important;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .js .primary-nav,
  .js .primary-nav::before,
  .js .primary-nav > a {
    transition: none;
  }

  .menu-toggle-icon span {
    transition: none;
  }

  .js .primary-nav > a {
    filter: none;
  }
}
