/* Mobile-only adaptation. Desktop remains owned by the existing stylesheets. */
.language-switch {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  padding-inline: 10px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .site-header:has(.language-switch) {
    column-gap: clamp(8px, 1vw, 18px);
  }
}

@media (min-width: 1181px) {
  .site-header:has(.language-switch) {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-rows: 1fr;
  }

  .site-header > .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .site-header > .desktop-nav,
  .page .site-header > .nav {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  .site-header > .language-switch {
    grid-column: 3;
    grid-row: 1;
  }

  .site-header > .header-cta,
  .page .site-header > .contact {
    grid-column: 4;
    grid-row: 1;
  }

  .page .site-header > .language-switch {
    color: var(--white, oklch(0.975 0.008 120));
  }

  .page .mobile-nav-enhanced {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1180px) {
  .site-header:has(.language-switch) {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-rows: 1fr;
  }

  .site-header > .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .site-header > .language-switch {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .site-header > .header-cta,
  .page .site-header > .contact {
    grid-column: 3;
    grid-row: 1;
  }

  .site-header > .mobile-nav {
    grid-column: 4;
    grid-row: 1;
  }

  .page .site-header > .nav {
    display: none;
  }

  .page .mobile-nav-enhanced {
    position: relative;
    display: block;
  }

  .page .site-header > .language-switch,
  .page .site-header > .contact,
  .page .mobile-nav-enhanced summary {
    color: var(--white, oklch(0.975 0.008 120));
  }

  .page .mobile-nav-enhanced summary {
    width: 44px;
    height: 44px;
    border: 1px solid currentColor;
    background: transparent;
    list-style: none;
  }

  .page .mobile-nav-enhanced summary::-webkit-details-marker {
    display: none;
  }

  .page .mobile-nav-enhanced nav {
    position: absolute;
    top: 48px;
    right: 0;
    width: min(310px, calc(100vw - 48px));
    height: auto;
    padding: 8px;
    display: grid;
    gap: 0;
    background: var(--navy-deep, oklch(0.255 0.035 190));
    border: 1px solid currentColor;
  }

  .page .mobile-nav-enhanced nav a {
    min-height: 44px;
    padding-inline: 12px;
    border-bottom: 1px solid currentColor;
  }

  .page .mobile-nav-enhanced nav a:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 767px) {
  :root {
    --content: calc(100% - 32px);
    --studio-shell: calc(100vw - 32px);
  }

  html,
  body {
    overflow-x: clip;
  }

  body {
    font-size: 16px;
  }

  .reveal,
  .hero-content,
  .dm-hero-copy,
  .oa-hero-copy,
  .studio-hero-copy {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .site-header {
    grid-template-columns: 44px 1fr 44px 44px;
    grid-template-rows: 1fr;
    gap: 6px;
    background: var(--paper, oklch(0.992 0.004 120));
    border-bottom-color: var(--line, oklch(0.255 0.035 190 / 0.18));
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .language-switch {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    padding-inline: 8px;
  }

  .header-cta {
    grid-column: 3;
    grid-row: 1;
  }

  .site-header > .contact {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    font-size: 0;
  }

  .site-header > .contact::after {
    content: "\2197";
    font-size: 16px;
  }

  .mobile-nav {
    grid-column: 4;
    grid-row: 1;
  }

  .site-header > .nav {
    display: none;
  }

  .mobile-nav-enhanced {
    display: block;
  }

  .mobile-nav-enhanced nav {
    display: grid;
  }

  .page .site-header {
    grid-template-columns: 112px 1fr 44px 48px;
    overflow: visible;
    background: var(--navy-deep, #041525) !important;
    border-bottom-color: oklch(0.975 0.008 120 / 0.24);
  }

  .page .site-header .brand,
  .page .site-header .brand img {
    width: 108px;
    max-width: 108px;
  }

  .page .site-header .language-switch,
  .page .site-header > .contact {
    color: var(--paper, oklch(0.975 0.008 120));
  }

  .page .mobile-nav-enhanced summary {
    width: 48px;
    min-width: 48px;
    height: 44px;
    color: var(--paper, oklch(0.975 0.008 120));
    border-color: currentColor;
    background: transparent;
    list-style: none;
  }

  .page .mobile-nav-enhanced summary::-webkit-details-marker {
    display: none;
  }

  .page .mobile-nav-enhanced summary span {
    display: none;
  }

  .page .mobile-nav-enhanced summary::after {
    content: "Menu";
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .page .mobile-nav-enhanced[open] {
    z-index: 200;
  }

  .page .mobile-nav-enhanced nav {
    position: fixed !important;
    top: 86px !important;
    right: 16px;
    left: 16px;
    z-index: 201;
    width: auto;
    height: auto !important;
    max-height: calc(100dvh - var(--header-height, 64px) - 16px);
    align-items: stretch;
    gap: 0;
    color: var(--paper, oklch(0.975 0.008 120));
    background: var(--navy-deep, #041525);
    border: 1px solid currentColor;
  }

  .page .mobile-nav-enhanced nav a {
    display: flex;
    min-height: 48px;
    padding-inline: 14px;
    align-items: center;
    color: inherit;
    border-bottom: 1px solid oklch(0.975 0.008 120 / 0.24);
  }

  .page .mobile-nav-enhanced nav a:last-child {
    border-bottom: 0;
  }

  html[lang="ar"] .page .mobile-nav-enhanced summary::after {
    content: "\0627\0644\0642\0627\0626\0645\0629";
    font-size: 10px;
    letter-spacing: 0;
  }

  .mobile-nav summary,
  .header-cta {
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-nav nav {
    position: fixed;
    top: var(--header-height, 64px);
    right: 16px;
    left: 16px;
    z-index: 50;
    width: auto;
    max-height: calc(100dvh - var(--header-height, 64px) - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-nav nav a {
    min-height: 48px;
    font-size: 13px;
  }

  .button,
  .text-link,
  button,
  input,
  select,
  textarea,
  label {
    min-height: 44px;
  }

  p,
  li,
  dd,
  input,
  select,
  textarea {
    font-size: max(16px, 1em);
  }

  h1,
  h2,
  h3,
  p,
  li,
  dd,
  dt,
  a,
  span {
    overflow-wrap: anywhere;
  }

  img,
  video,
  iframe {
    max-width: 100%;
  }

  /* Scroll films become ordinary, finite poster/video sections. */
  .landing-scroll-track-hero,
  .dm-film-track-hero,
  .oa-film-track-hero {
    padding-top: var(--header-height, 64px);
  }

  .landing-scroll-track,
  .landing-scroll-track-hero,
  .landing-scroll-track-close,
  .dm-film-track,
  .dm-film-track-hero,
  .dm-film-track-interface,
  .dm-film-track-showreel,
  .dm-film-track-close,
  .oa-film-track,
  .oa-film-track-hero,
  .oa-film-track-friction,
  .oa-film-track-journey,
  .oa-film-track-assessment {
    height: auto !important;
    min-height: 0 !important;
  }

  [data-scroll-film] > .hero,
  [data-scroll-film] > .contact,
  .dm-film-stage,
  .oa-film-stage {
    position: relative !important;
    top: auto !important;
    height: auto !important;
  }

  .hero-media,
  .contact-media,
  .dm-film-media,
  .dm-interface-media,
  .oa-film-media {
    position: relative;
    inset: auto;
    z-index: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--ink);
    pointer-events: auto;
  }

  .hero-media video,
  .contact-media video,
  .dm-film-media video,
  .dm-interface-media video,
  .oa-film-media video {
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--ink);
  }

  [data-scroll-film] > .hero,
  [data-scroll-film] > .contact,
  .dm-film-stage,
  .oa-film-stage {
    display: flex;
    flex-direction: column;
    min-height: 0 !important;
    isolation: isolate;
  }

  [data-scroll-film] > .hero::before,
  [data-scroll-film] > .hero::after,
  [data-scroll-film] > .contact::before,
  [data-scroll-film] > .contact::after,
  .dm-film-stage::before,
  .dm-film-stage::after,
  .oa-film-stage::before,
  .oa-film-stage::after {
    pointer-events: none;
  }

  [data-scroll-film] > .hero::before,
  [data-scroll-film] > .hero::after,
  [data-scroll-film] > .contact::before,
  [data-scroll-film] > .contact::after {
    background: none;
  }

  [data-scroll-film] .hero-grid,
  [data-scroll-film] .contact-grid {
    display: none;
  }

  .hero-media,
  .contact-media,
  .dm-film-media,
  .oa-film-media {
    order: 0;
  }

  .hero-content,
  .contact-copy,
  .dm-hero-copy,
  .dm-film-copy,
  .dm-showreel-copy,
  .dm-close-copy,
  .oa-hero-copy,
  .oa-friction-copy,
  .oa-journey-copy,
  .oa-assessment-copy {
    position: relative;
    inset: auto;
    order: 1;
    width: var(--content);
    min-height: 0;
    margin-inline: auto;
    padding: 40px 0 56px;
  }

  .hero-content {
    padding-top: 36px;
  }

  .oa-hero-copy h1,
  .oa-assessment-copy h2 {
    max-width: none;
    font-size: clamp(38px, 11vw, 44px);
  }

  .hero-practices,
  .hero-coordinate,
  .dm-hero-index,
  .oa-hero-outcomes,
  .oa-journey-status,
  .oa-phase-rail,
  .dm-chapter-rail {
    position: relative;
    inset: auto;
    order: 2;
    width: var(--content);
    margin: 0 auto 32px;
  }

  .dm-chapter-status {
    margin-bottom: 24px;
  }

  .dm-chapter-rail,
  .oa-phase-rail {
    display: grid;
    grid-template-columns: 1fr;
  }

  .oa-phase-rail li,
  .dm-chapter-rail li {
    min-height: 44px;
  }

  .oa-friction-copy {
    color: var(--paper);
    background: var(--ink);
  }

  .oa-friction-copy > * {
    margin-inline: 16px;
  }

  .studio-hero,
  .work-intro {
    min-height: 0;
    padding-top: calc(var(--header-height, 64px) + 56px);
  }

  .studio-hero {
    display: flex;
    flex-direction: column;
  }

  .studio-hero-copy {
    min-height: 0;
    padding: 180px 0 56px;
    justify-content: flex-end;
  }

  .studio-hero-rail {
    position: relative;
    inset: auto;
    width: 100%;
    flex: 0 0 auto;
  }

  .studio-hero-copy h1,
  .work-intro h1 {
    font-size: clamp(42px, 13vw, 64px);
  }

  html[lang="ar"] .studio-hero-copy h1 {
    font-size: clamp(34px, 10vw, 40px);
    line-height: 1.4;
  }

  .studio-section-heading h2,
  .studio-next h2,
  .form-intro h2 {
    font-size: clamp(28px, 8.5vw, 34px);
    line-height: 1.2;
  }

  html[lang="ar"] .studio-section-heading h2,
  html[lang="ar"] .studio-next h2,
  html[lang="ar"] .form-intro h2 {
    line-height: 1.4;
  }

  .studio-hero-rail,
  .studio-statement-grid,
  .product-promise,
  .product-gallery,
  .product-lines,
  .work-ledger,
  .work-featured-story,
  .work-supporting,
  .work-platform-row,
  .studio-next-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .product-gallery .product-line:nth-child(even),
  .work-supporting-tool {
    margin-top: 0 !important;
  }

  .product-preview img,
  .work-project-image img {
    width: 100%;
    height: auto;
  }

  .work-ims-stage {
    height: auto;
    min-height: 480px;
  }

  .work-ims-toolbar,
  .work-demo-handoff,
  .studio-hero-actions,
  .product-actions {
    align-items: stretch;
  }

  .work-ims-toolbar a,
  .work-ims-toolbar button,
  .studio-hero-actions .button,
  .product-actions .text-link {
    justify-content: center;
  }

  .form-grid,
  .form-choice-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
