/* Arabic locale overrides */
:root {
  --ar-display: "Alexandria", sans-serif;
  --ar-body: "IBM Plex Sans Arabic", sans-serif;
}

html {
  direction: ltr;
}

body {
  direction: ltr;
  font-family: var(--ar-body);
}

:is(.intro, .header, .menu, main, footer) {
  direction: rtl;
}

:is(.logo, .menu nav a, .hero h1, .hero__inside-copy strong, .manifesto__lead,
  .statement__line, .chapter h2, .panel h2, .merchant h2, .join h2,
  .order-card b, .chapter__stats strong) {
  font-family: var(--ar-display);
}

:is(.hero h1 em, .hero__inside-copy em, .chapter h2 em, .panel h2 em,
  .merchant h2 em, .join h2 em) {
  font-family: var(--ar-body);
  font-style: normal;
  font-weight: 500;
}

:is(.header__center, .portal-link, .language-switch, .menu-toggle span, .menu__number,
  .menu__footer, .intro__coordinates, .intro__gravity-meta, .portal-lintel,
  .portal-node, .portal-floor, .hero__inside-meta, .hero__inside-copy > span,
  .hero__topline, .hero__index, .round-link span, .scroll-cue, .section-meta,
  .statement__eyebrow, .chapter__meta, .kicker, .chapter__stats small,
  .h-scroll__header, .order-card span, .text-link, .join__overline,
  .join__actions a, .footer__bottom) {
  letter-spacing: 0;
}

.cursor {
  display: grid;
}

.progress i {
  transform-origin: right;
}

:is(.intro__coordinates, .hero__index, .section-meta span:last-child,
  .chapter__meta span:last-child, #panelCount) {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Header and menu */
.header > .logo {
  justify-self: start;
}

.header__actions {
  justify-self: end;
  gap: 30px;
}

.language-switch {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.language-switch:hover {
  color: inherit;
  background: transparent;
  opacity: 0.64;
}

.menu nav a {
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.menu nav a:hover {
  padding-left: 0;
  padding-right: 0.16em;
}

.menu nav span {
  font-family: var(--ar-body);
}

/* Hero */
.hero__object {
  right: auto;
  left: 4vw;
}

.hero__orbit span {
  right: 8%;
  left: auto;
}

.portal-lintel span:last-child {
  direction: ltr;
  text-align: left;
}

.hero__headline {
  right: var(--pad);
  left: auto;
  top: 44%;
  width: 62vw;
}

.hero .line-mask {
  overflow: visible;
}

.hero h1 {
  font-size: clamp(78px, 8.8vw, 150px);
  line-height: 1.16;
  letter-spacing: -0.05em;
}

.hero .line-mask:nth-child(2) h1 {
  font-size: clamp(70px, 7.8vw, 134px);
}

.hero h1 em {
  font-size: 0.82em;
  letter-spacing: 0;
}

.hero__topline {
  right: var(--pad);
  left: auto;
}

.hero__index {
  right: auto;
  left: var(--pad);
}

.hero__inside-copy strong {
  line-height: 1.2;
}

.hero .round-link span {
  font-size: 15px;
  line-height: 1.35;
}

/* Story and statement */
.manifesto__lead {
  line-height: 1.16;
  letter-spacing: -0.045em;
}

.manifesto__body {
  margin-right: auto;
  margin-left: 0;
}

.orbit-mark {
  right: var(--pad);
  left: auto;
}

.statement__eyebrow,
.join__overline {
  padding-right: 54px;
  padding-left: 0;
}

.statement__eyebrow::before,
.join__overline::before,
.section-meta::before {
  right: 0;
  left: auto;
}

.statement__line {
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.statement__line span {
  padding-right: 0;
  padding-left: 0.35em;
}

.statement p {
  margin-right: auto;
  margin-left: var(--pad);
}

/* Movement */
.image-shade--warm {
  transform: scaleX(-1);
}

.chapter__copy {
  width: min(720px, 54vw);
  margin-top: clamp(100px, 14vh, 145px);
  margin-bottom: clamp(65px, 8vh, 90px);
}

.chapter__meta::before {
  right: 0;
  left: auto;
}

.chapter h2 {
  margin: 20px 0 26px;
  font-size: clamp(76px, 6.4vw, 122px);
  line-height: 1.2;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.chapter__description {
  width: min(470px, 92%);
  font-size: clamp(16px, 1.1vw, 20px);
}

.chapter__stats div {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.chapter__stats div + div {
  padding-right: 32px;
  padding-left: 32px;
}

.chapter__stats div:first-child {
  padding-right: var(--pad);
}

.chapter__stats div:last-child {
  padding-left: var(--pad);
}

/* Arabic-native horizontal panels. No 400vw RTL track. */
.h-scroll__track {
  position: relative;
  width: 100%;
  height: 100%;
  direction: ltr;
  transform: none !important;
}

.panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  direction: rtl;
  flex: none;
  border-right: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  will-change: transform;
}

.panel:nth-child(1) { transform: translate3d(0, 0, 0); }
.panel:nth-child(2) { transform: translate3d(-100vw, 0, 0); }
.panel:nth-child(3) { transform: translate3d(-200vw, 0, 0); }
.panel:nth-child(4) { transform: translate3d(-300vw, 0, 0); }

.panel__num {
  right: auto;
  left: var(--pad);
}

.panel h2 {
  width: min(760px, 61vw);
  margin: 16px 0 25px;
  font-size: clamp(58px, 5.6vw, 104px);
  line-height: 1.22;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.panel > p:not(.kicker) {
  width: min(470px, 86vw);
  font-size: clamp(18px, 1.4vw, 23px);
  line-height: 1.65;
}

.panel .kicker {
  font-size: 11px !important;
}

.panel .text-link {
  font-size: 13px;
}

:is(.glyph-search, .order-card, .chart) {
  right: auto;
  left: 8vw;
}

.glyph-search {
  left: 9vw;
}

.chart {
  left: 7vw;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  border-left: 0;
}

.panel__veil {
  transform: scaleX(-1);
}

.catalog-order {
  right: var(--pad);
  left: auto;
  text-align: right;
}

.catalog-order span {
  letter-spacing: 0;
}

.catalog-order strong {
  font-family: var(--ar-display);
}

.catalog-order i::after {
  right: 0;
  left: 38%;
}

.panel--photo {
  justify-content: center;
  padding-bottom: 7vh;
}

.panel--photo h2 {
  margin-bottom: 30px;
}

.panel--photo .text-link {
  width: min(480px, 42vw);
}

/* Network */
.image-shade--left {
  transform: none;
  background: linear-gradient(90deg, rgba(12, 8, 30, 0.02) 0%, rgba(20, 13, 47, 0.2) 48%, rgba(16, 10, 39, 0.84) 100%);
}

.code-scene--network {
  filter: brightness(1.14) saturate(1.06);
}

.merchant__copy {
  width: 100%;
}

.merchant .section-meta--light {
  margin-bottom: auto;
}

.merchant h2 {
  margin-bottom: 25px;
  font-size: clamp(50px, 4.8vw, 88px);
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.merchant__copy > p {
  width: min(500px, 90%);
}

/* Join and footer */
.join h2 {
  font-size: clamp(52px, 8vw, 136px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.app-downloads {
  direction: rtl;
}

.app-downloads--footer {
  grid-column: 2;
  width: max-content;
  margin-inline: auto;
  justify-self: center;
  align-items: center;
  text-align: center;
}

.app-downloads--footer .app-downloads__label {
  width: 100%;
  text-align: center;
}

.app-downloads--footer .app-downloads__links {
  justify-content: center;
}

.app-downloads--footer .app-download {
  align-items: center;
  text-align: center;
}

.app-downloads__label,
.app-download small {
  letter-spacing: 0;
  text-transform: none;
}

.app-download {
  align-items: flex-start;
}

.footer__contact {
  text-align: right;
}

.customer-service span {
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 850px) {
  .cursor {
    display: none;
  }

  .app-downloads--footer {
    width: 100%;
  }

  .header__actions {
    right: auto;
    left: var(--pad);
    gap: 14px;
  }

  .header > .logo {
    position: fixed;
    top: 27px;
    right: var(--pad);
    left: auto;
    z-index: 2;
    display: inline-flex !important;
    visibility: visible;
    opacity: 1;
  }

  .hero__object {
    right: auto;
    left: 50%;
  }

  .hero__headline {
    right: var(--pad);
    left: var(--pad);
    top: 66%;
    width: calc(100% - var(--pad) * 2);
  }

  .hero h1 {
    font-size: clamp(44px, 13vw, 66px);
    line-height: 1.16;
  }

  .hero .line-mask:nth-child(2) h1 {
    font-size: clamp(40px, 12vw, 60px);
  }

  .hero__bottom > p {
    grid-column: 1;
    justify-self: end;
    text-align: right;
  }

  .hero__bottom .round-link {
    grid-column: 2;
    justify-self: start;
  }

  .hero .round-link span {
    font-size: 13px;
  }

  .chapter__copy {
    width: 100%;
    margin-top: 21vh;
  }

  .chapter h2,
  .merchant h2 {
    width: auto;
    white-space: normal;
  }

  .chapter h2 {
    font-size: 14vw;
  }

  .merchant h2 {
    font-size: 7.8vw;
    white-space: nowrap;
  }

  .panel h2 {
    width: 100%;
    max-width: 100%;
    font-size: 10.5vw;
    line-height: 1.3;
    white-space: normal;
  }

  .panel > p:not(.kicker) {
    width: 100%;
    max-width: 100%;
  }

  :is(.glyph-search, .order-card, .chart) {
    right: auto;
    left: -10vw;
  }

  .panel--photo {
    justify-content: center;
    padding-bottom: 4vh;
  }

  .panel--photo .text-link {
    width: 100%;
  }

  .merchant__copy {
    width: 100%;
  }

  .merchant .section-meta--light {
    right: var(--pad);
    left: var(--pad);
    margin: 0;
  }

  .join h2 {
    font-size: 10vw;
  }

  .footer__contact {
    text-align: center;
  }
}
