/* A compact native language menu, available even without JavaScript. */
.header-inner {
  position: relative;
}
.brand {
  margin-inline-end: auto;
  min-width: 0;
}
.navigation {
  gap: clamp(14px, 1.8vw, 28px);
}
.language-switcher {
  position: relative;
  flex-shrink: 0;
}
.language-switcher summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #555555;
  border-radius: 3px;
  cursor: pointer;
  list-style: none;
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0;
}
.language-switcher summary::-webkit-details-marker {
  display: none;
}
.language-switcher summary > svg {
  width: 17px;
  height: 17px;
}
.language-switcher summary > .language-chevron {
  width: 12px;
  height: 12px;
}
.language-switcher[open] summary {
  border-color: #b8b8b8;
  background: #2b2b2b;
}
.language-options {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 12px);
  width: min(300px, calc(100vw - 40px));
  max-height: min(70vh, 480px);
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 10px;
  border: 1px solid #555555;
  border-radius: 4px;
  background: #282828;
  box-shadow: 0 16px 36px #00000040;
  z-index: 30;
}
.language-options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 2px;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.language-native {
  unicode-bidi: isolate;
}
.language-english {
  color: #b8b8b8;
  font-family: "DM Sans", sans-serif;
  font-size: 0.75rem;
  text-align: end;
}
.language-options a:hover,
.language-options a:focus-visible {
  background: #3b3b3b;
  outline-offset: -2px;
}
.language-options a[aria-current="page"] {
  color: #202020;
  background: #eeeeee;
}
.language-options a[aria-current="page"] .language-english {
  color: #555555;
}
.language-options a:lang(ar) {
  font-family: Tahoma, Arial, sans-serif;
}

/* Allow translated copy to grow without clipping aligned content rows. */
.hero-content,
.section-heading > *,
.service,
.technology-category,
.work-title,
.work-detail > *,
.about-layout > *,
.approach-layout > *,
.contact-top > div,
.inquiry-grid > * {
  min-width: 0;
}
html:not(:lang(en)) h1,
html:not(:lang(en)) h2,
html:not(:lang(en)) h3,
html:not(:lang(en)) .brand-caption,
html:not(:lang(en)) .work-name {
  overflow-wrap: anywhere;
  hyphens: auto;
}
html:not(:lang(en)) .hero h1 {
  font-size: clamp(2.8rem, 5.6vw, 5rem);
}
.contact-bottom {
  flex-wrap: wrap;
}
.email-link,
a[href^="mailto:"],
.technology-tools li {
  unicode-bidi: isolate;
}
.email-link,
.inquiry-privacy a[href^="mailto:"] {
  direction: ltr;
  display: inline-block;
}
.logo-marquee {
  direction: ltr;
}

/* Matching sans-serif system fonts cover scripts absent from DM Sans. */
html:lang(ar) {
  font-family: Tahoma, Arial, sans-serif;
}
html:lang(zh) {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
html:lang(ja) {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
html:lang(ko) {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
html:lang(hi) {
  font-family: "Kohinoor Devanagari", "Nirmala UI", sans-serif;
}
html:is(:lang(ar), :lang(zh), :lang(ja), :lang(ko), :lang(hi)) * {
  letter-spacing: normal;
}
html:is(:lang(ar), :lang(zh), :lang(ja), :lang(ko), :lang(hi)) :is(h1, h2, h3) {
  line-height: 1.45;
}
html:is(:lang(ar), :lang(zh), :lang(ja), :lang(ko), :lang(hi))
  .about-signature
  > span {
  font-family: inherit;
}
html:lang(ko) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
html:lang(ar) p {
  line-height: 1.9;
}

/* Reflect layout for Arabic; keep branded marks, email and motion predictable. */
[dir="rtl"] .service {
  border-right: 0;
  border-left: 1px solid #454545;
}
[dir="rtl"] .service:first-child {
  padding-left: 25px;
  padding-right: 0;
}
[dir="rtl"] .service:last-child {
  padding-right: 25px;
  padding-left: 0;
  border-left: 0;
}
[dir="rtl"] .work-detail {
  margin-inline: 72px 64px;
}
[dir="rtl"] .work-outcome {
  border-left: 0;
  border-right: 1px solid var(--line);
  padding-left: 0;
  padding-right: 32px;
}
[dir="rtl"] .work-client > span {
  margin-left: 0;
  margin-right: 3px;
}
[dir="rtl"] .dialog-close {
  right: auto;
  left: 12px;
}
[dir="rtl"] .contact-dialog h2 {
  padding-right: 0;
  padding-left: 12px;
}
[dir="rtl"] .inquiry-submit .arrow,
[dir="rtl"] .contact-action .arrow {
  transform: scaleX(-1);
}

@media (max-width: 1150px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }
  .brand {
    flex: 1;
  }
  .language-switcher {
    order: 2;
  }
  .menu-toggle {
    order: 3;
  }
  .navigation {
    order: 4;
    width: 100%;
  }
  .js .menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    margin: 0;
    background: transparent;
    border: 1px solid var(--line);
  }
  .menu-toggle span {
    width: 17px;
    height: 1px;
    background: var(--ink);
    transition: transform 0.2s;
  }
  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }
  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }
  .js .navigation {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    padding: 16px 24px;
    margin: 0;
    background: #202020;
    border: 1px solid #454545;
    box-shadow: 0 10px 16px #00000020;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .js .navigation.is-open {
    display: flex;
  }
  .js .navigation > a {
    padding: 13px 0;
    font-size: 1rem;
  }
  .js .navigation .nav-contact {
    justify-content: space-between;
    border: 0;
    border-top: 1px solid var(--line);
    margin-top: 6px;
  }
  .language-switcher {
    position: static;
  }
  .language-options {
    top: 100%;
  }
  [dir="rtl"] .service:nth-child(2) {
    border-left: 0;
    padding-left: 0;
    padding-right: 30px;
  }
  [dir="rtl"] .service:first-child {
    padding-left: 30px;
  }
  [dir="rtl"] .service:nth-child(3) {
    padding-right: 0;
    padding-left: 30px;
  }
  [dir="rtl"] .service:last-child {
    padding-right: 30px;
  }
}
@media (max-width: 900px) {
  [dir="rtl"] .work-detail {
    margin-inline-end: 0;
  }
}
@media (max-width: 700px) {
  .header-inner {
    gap: 8px;
  }
  .brand-caption {
    letter-spacing: 0;
  }
  .brand {
    flex-basis: calc(100% - 148px);
  }
  .language-switcher summary {
    gap: 5px;
    padding-inline: 8px;
  }
  .language-switcher summary > svg {
    width: 15px;
  }
  .language-switcher summary > .language-chevron {
    display: none;
  }
  html:not(:lang(en)) .hero h1 {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
  }
  [dir="rtl"] .service {
    border-left: 0;
  }
  [dir="rtl"] .service:first-child,
  [dir="rtl"] .service:nth-child(2),
  [dir="rtl"] .service:nth-child(3),
  [dir="rtl"] .service:last-child {
    padding-inline: 0;
  }
  [dir="rtl"] .work-detail {
    margin-inline: 0;
  }
  [dir="rtl"] .work-outcome {
    border-right: 0;
    padding-right: 0;
  }
}
@media print {
  .language-switcher {
    display: none;
  }
}
