/* Shared language control and Arabic layout. Loaded after the page styles. */
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('/fonts/noto-sans-arabic.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

html .topbar nav {
  align-items: center;
}

html .language-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid #8c9386;
  border-radius: 3px;
  font-family: 'Space Grotesk Variable', 'Noto Sans Arabic', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
}

html .language-switch:hover {
  border-color: #b74020;
  color: #b74020;
}

html[lang='ar'] {
  font-family: 'Noto Sans Arabic', Arial, sans-serif;
  --mono: 'Noto Sans Arabic', Arial, sans-serif;
}

/* Latin display tracking must never be applied to connected Arabic letters. */
html[lang='ar'] * {
  letter-spacing: normal !important;
}

html[lang='ar'] :is(h1, h2, h3, h4) {
  -webkit-text-stroke: 0;
  line-height: 1.5;
}

html[lang='ar'] :is(input, textarea, select) {
  font-family: 'Noto Sans Arabic', Arial, sans-serif;
}

html[lang='ar'] :is(.intro, .section-heading p, .project-description,
  .case-summary, .story-section p, .about-copy > p, .about-detail,
  .demo-guide > p, .start-intro > p, .demo-answer, .demo-status,
  .form-field label, .field-help, .field-error, .form-status) {
  line-height: 1.85;
}

html[lang='ar'] .skip {
  left: auto;
  right: 20px;
}

html[lang='ar'] .hero h1 {
  font-size: clamp(64px, 9.6vw, 154px);
  line-height: 1.4;
  white-space: normal;
}

html[lang='ar'] .hero h2 {
  font-size: clamp(25px, 3.1vw, 51px);
  line-height: 1.6;
}

html[lang='ar'] .sculpture {
  right: auto;
  left: 0;
}

html[lang='ar'] .section-heading h2 {
  font-size: clamp(40px, 5.8vw, 92px);
  white-space: normal;
}

html[lang='ar'] .services-heading h2 {
  font-size: clamp(40px, 5.4vw, 86px);
}

html[lang='ar'] .about h2 {
  font-size: clamp(40px, 5.2vw, 84px);
}

html[lang='ar'] .contact h2 {
  font-size: clamp(38px, 6.7vw, 106px);
  white-space: normal;
}

html[lang='ar'] .about-copy {
  border-left: 0;
  border-right: 1px solid var(--rule);
  padding-left: 0;
  padding-right: 56px;
}

html[lang='ar'] .services-note a {
  margin-left: 0;
  margin-right: 8px;
}

html[lang='ar'] .home-demo-link {
  margin-left: 0;
  margin-right: 24px;
}

html[lang='ar'] .project-row > span {
  text-align: left;
}

html[lang='ar'] .project-row:hover > span {
  transform: translate(-3px, -3px);
}

html[lang='ar'] :is(.back-link svg, .next-project svg) {
  transform: scaleX(-1);
}

html[lang='ar'] .case-title {
  font-size: clamp(44px, 6.2vw, 100px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

html[lang='ar'] .case-title-long {
  font-size: clamp(40px, 5vw, 80px);
}

html[lang='ar'] .case-title-short {
  font-size: clamp(64px, 8.8vw, 140px);
}

html[lang='ar'] :is(.case-subtitle, .story-section h2, .flow-section h2) {
  line-height: 1.6;
}

html[lang='ar'] .contents {
  border-right: 0;
  border-left: 1px solid var(--rule);
  padding: 8px 0 20px 23px;
}

html[lang='ar'] .contents a[aria-current] {
  border-left: 0;
  border-right: 3px solid var(--orange);
  padding-left: 0;
  padding-right: 12px;
  margin-left: 0;
  margin-right: -15px;
}

html[lang='ar'] .flow li {
  border-left: 0;
  border-right: 1px solid var(--rule);
  padding-left: 0;
  padding-right: 26px;
}

html[lang='ar'] .flow li:first-child {
  border-right: 0;
  padding-right: 0;
}

html[lang='ar'] .growth-page h1 {
  font-size: clamp(42px, 5.5vw, 88px);
  line-height: 1.55;
}

html[lang='ar'] .demo-guide h2 {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.65;
}

html[lang='ar'] .demo-workspace h2 {
  font-size: 30px;
  line-height: 1.65;
}

html[lang='ar'] .demo-table {
  text-align: right;
}

html[lang='ar'] .demo-table th:last-child,
html[lang='ar'] .service-table td:last-child {
  text-align: left;
}

html[lang='ar'] .flight-table th:last-child {
  text-align: right;
}

html[lang='ar'] .source-dot {
  margin-right: 0;
  margin-left: 12px;
}

html[lang='ar'] .reasoning ol {
  padding-left: 0;
  padding-right: 25px;
}

html[lang='ar'] .honeypot {
  left: auto;
  right: -10000px;
}

/* Keep identifiers, URLs, numbers and code in their original reading order. */
html[lang='ar'] :is(.wordmark, .stack, .case-meta > div:last-child dd,
  .case-title, .featured h3, .project-row h3, .next-project strong,
  .demo-tabs a, .contact-email, a[href^='mailto:'], time, code, pre,
  [dir='ltr'], .number, .service-table td:last-child, .demo-total strong,
  .invoice-record dd, #current-mileage, #issued-mileage,
  .architecture-cover li > span, .flow .step, .demo-steps li > span,
  input[type='email'], input[type='url'], input[type='tel'], input[type='number']) {
  direction: ltr;
  unicode-bidi: isolate;
}

html[lang='ar'] :is(.wordmark, .case-title, .featured h3, .project-row h3,
  .next-project strong, .number) {
  font-family: 'Space Grotesk Variable', 'Space Grotesk', Arial, sans-serif;
}

html[lang='ar'] :is(.stack, .case-title, .featured h3, .project-row h3,
  .next-project strong, .case-meta > div:last-child dd, .invoice-record dd,
  .demo-total strong, .number, #current-mileage, #issued-mileage) {
  text-align: right;
}

html[lang='ar'] :is(time, code, pre, input[type='email'], input[type='url'],
  input[type='tel'], input[type='number']) {
  font-family: 'IBM Plex Mono', monospace;
}

html[lang='ar'] body > header:not(.topbar),
html[lang='ar'] body > header:not(.topbar) ~ main > nav,
html[lang='ar'] body > header:not(.topbar) ~ footer {
  font-family: 'Noto Sans Arabic', Arial, sans-serif;
}

html[lang='ar'] body > header:not(.topbar) ~ main h1 {
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1.6;
}

@media (min-width: 901px) {
  html[lang='ar'] .flight-choices legend {
    float: right;
    margin: 13px 0 0 20px;
  }

  html[lang='ar'] .flight-choices .demo-choices {
    margin-left: 0;
    margin-right: 132px;
  }
}

@media (max-width: 1100px) {
  html[lang='ar'] .about-copy { padding-right: 35px; }
  html[lang='ar'] .flow li { padding-right: 20px; }
}

@media (max-width: 900px) {
  html .growth-page .topbar { height: auto; min-height: 80px; }
  html .growth-page .topbar nav { gap: 10px; }
  html[lang='ar'] .growth-page h1 { font-size: clamp(36px, 7.8vw, 60px); }
  html[lang='ar'] .demo-guide h2 { font-size: 30px; }
  html[lang='ar'] .demo-workspace h2 { font-size: 21px; }
  html[lang='ar'] .source-dot { margin-left: 5px; }
  html[lang='ar'] .home-demo-link { margin-right: 0; }
}

@media (max-width: 760px) {
  html .topbar,
  html .growth-page .topbar {
    height: auto;
    min-height: 80px;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding-block: 16px;
  }

  html .topbar nav,
  html .growth-page .topbar nav {
    min-width: 0;
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  html .topbar .language-switch { font-size: 11px; padding-inline: 7px; }
  html[lang='ar'] .hero h1 { font-size: clamp(53px, 12.5vw, 90px); }
  html[lang='ar'] .hero h2 { font-size: clamp(23px, 5.4vw, 34px); }
  html[lang='ar'] .hero-actions { flex-wrap: wrap; gap: 18px 24px; }
  html[lang='ar'] .hero-foot { flex-wrap: wrap; }
  html[lang='ar'] .hero-foot > div { white-space: normal; }
  html[lang='ar'] .sculpture { left: auto; }
  html[lang='ar'] :is(.section-heading h2, .services-heading h2, .about h2) {
    font-size: clamp(35px, 8.5vw, 54px);
  }
  html[lang='ar'] .contact h2 { font-size: clamp(35px, 8.5vw, 58px); }
  html[lang='ar'] .about-copy { border-right: 0; padding-right: 0; }
  html[lang='ar'] .services-note a { margin-right: 0; }
  html[lang='ar'] .case-title { font-size: clamp(38px, 10.4vw, 68px); }
  html[lang='ar'] .case-title-long { font-size: clamp(29px, 8.8vw, 62px); }
  html[lang='ar'] .case-subtitle { font-size: 24px; }
  html[lang='ar'] .contents { border-left: 0; padding: 0 0 28px; }
  html[lang='ar'] :is(.story-section h2, .flow-section h2) { font-size: 30px; }
  html[lang='ar'] .flow li,
  html[lang='ar'] .flow li:first-child {
    border-right: 0;
    padding: 22px 0 0;
  }
  html[lang='ar'] .next-project strong { font-size: clamp(27px, 7.8vw, 42px); }
  html[lang='ar'] :is(.demo-workspace > header, .demo-bottom) { flex-wrap: wrap; }
  html[lang='ar'] .demo-label { white-space: normal; }
  html[lang='ar'] .demo-choices button { line-height: 1.8; }
  html[lang='ar'] .demo-total { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  html[lang='en'] .case-title-long { font-size: clamp(30px, 9vw, 42px); }
  html .topbar .wordmark,
  html .growth-page .topbar .wordmark { font-size: 15px; }
  html .topbar nav,
  html .growth-page .topbar nav { font-size: 11px; gap: 8px; }
  body > header:not(.topbar) { flex-wrap: wrap; gap: 12px 18px; }
  body > header:not(.topbar) .language-switch { min-height: 32px; font-size: 11px; }
  html[lang='ar'] .contact-addresses .contact-email { font-size: 27px; }
}
