/* ===========================================================================
   Teradix design system, right-to-left foundation.
   Load ONLY on Arabic pages (<html lang="ar" dir="rtl">), AFTER every other
   stylesheet. Every selector starts with [dir="rtl"], so it is inert elsewhere.
   Guide for page and section work: tools/i18n/RTL.md

   What lives here: the Arabic typeface, Arabic line-height and tracking, bidi
   helpers for numbers, and the mirroring of the SHARED chrome and primitives
   (header, mega menus, buttons, arrows, eyebrows, headings, lists, cards,
   footer). Section-level fixes live in css/rtl/<key>.css, not here.

   Contents
     1  Typeface            6  Offset blocks (buttons)
     2  Type rhythm         7  Header and mega menus
     3  Numbers and Latin   8  Shared primitives
     4  Never mirrored      9  Hero and logo bar
     5  Arrows             10  Closing call to action
                           11  Footer (.foot2)
   =========================================================================== */

/* ---- 1. Typeface ---------------------------------------------------------
   Thmanyah Sans is the only suitable Arabic face on disk (fonts/Thamnaya).
   The unicode-range keeps it to Arabic script, so Latin words, product names,
   digits, % and $ still come from Outfit and Duplet exactly as on the English
   pages. There is no 600 cut: 600 and 700 both use Bold. */
@font-face{font-family:"Thmanyah Sans";font-weight:300;font-style:normal;font-display:swap;
  src:url("../fonts/Thamnaya/thmanyahsans-Light.otf") format("opentype");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08FF,U+200C-200F,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:"Thmanyah Sans";font-weight:400;font-style:normal;font-display:swap;
  src:url("../fonts/Thamnaya/thmanyahsans-Regular.otf") format("opentype");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08FF,U+200C-200F,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:"Thmanyah Sans";font-weight:500;font-style:normal;font-display:swap;
  src:url("../fonts/Thamnaya/thmanyahsans-Medium.otf") format("opentype");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08FF,U+200C-200F,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:"Thmanyah Sans";font-weight:600 700;font-style:normal;font-display:swap;
  src:url("../fonts/Thamnaya/thmanyahsans-Bold.otf") format("opentype");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08FF,U+200C-200F,U+FB50-FDFF,U+FE70-FEFC}
@font-face{font-family:"Thmanyah Sans";font-weight:800 900;font-style:normal;font-display:swap;
  src:url("../fonts/Thamnaya/thmanyahsans-Black.otf") format("opentype");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08FF,U+200C-200F,U+FB50-FDFF,U+FE70-FEFC}

/* The design system reads its fonts from --display and --body, so resetting the
   two tokens re-fonts every component. Latin first, Arabic second, then the
   system Arabic faces as a fallback while the file loads. */
[dir="rtl"]{
  --ar:"Thmanyah Sans","Geeza Pro","Segoe UI","Noto Sans Arabic","Tahoma";
  --display:"Outfit",var(--ar),Arial,sans-serif;
  --body:"Duplet","Outfit",var(--ar),Arial,sans-serif;
  /* Arabic line-heights, for section files to reuse */
  --lh-ar-h1:1.3; --lh-ar-h2:1.36; --lh-ar-h3:1.45; --lh-ar-ui:1.5; --lh-ar-copy:1.8;
}

/* ---- 2. Type rhythm ------------------------------------------------------
   Arabic joins its letters: any tracking, positive or negative, tears the
   words apart, and uppercase only shouts the Latin words left inside. Both are
   switched off for everything on an Arabic page. Opt out with lang="en" on an
   all-Latin fragment that must keep its English styling. */
[dir="rtl"] body *:not(:lang(en)),
[dir="rtl"] body *:not(:lang(en))::before,
[dir="rtl"] body *:not(:lang(en))::after{letter-spacing:0!important;text-transform:none!important}

[dir="rtl"] body{line-height:var(--lh-ar-copy)}
/* A floor for every heading. Latin display type is set as tight as .97; Arabic
   at that leading collides with its own marks. [lang] is doubled in on purpose
   so the floor beats section rules such as ".demo.demo--v2 h2"; a section file
   that needs a different value can still win with one more class. */
[dir="rtl"][lang] :is(h1,.h1){line-height:var(--lh-ar-h1)}
[dir="rtl"][lang] :is(h2,.h2){line-height:var(--lh-ar-h2)}
[dir="rtl"][lang] :is(h3,.h3,h4,.h4){line-height:var(--lh-ar-h3)}
[dir="rtl"] .lead{line-height:1.75}
/* the eyebrow asks Outfit for stylistic set 1; in Thmanyah Sans the same tag
   stretches the word endings, so it is switched off */
[dir="rtl"] .eyebrow{line-height:var(--lh-ar-ui);font-weight:700;font-feature-settings:normal}
/* headings that set their own tight leading for Latin */
[dir="rtl"] .hero__copy h1{line-height:var(--lh-ar-h1)}
[dir="rtl"] .hero__copy .lead,
[dir="rtl"] :is(.blind__head,.after-head,.eng-head,.cases,.sect-head) .lead{line-height:1.75}
[dir="rtl"] .day p{line-height:1.8}
/* single-line labels set with line-height:1 clip Arabic marks: give them room */
[dir="rtl"] :is(.btn,.nav__link,.nav__ghost,.mCol__h,.mCard__go,.day__d,.film__tx b,.film__tx span,.badge__face){line-height:var(--lh-ar-ui)}

/* ---- 3. Numbers and Latin inside Arabic ------------------------------------
   Digits stay Western (0-9). The bidi algorithm reorders a bare range or a
   signed figure inside Arabic text ("5–10%" turns into "10%–5", "$10B+" into
   "+$10B"), so every figure with a sign, a unit or a range is isolated:
   wrap it in <bdi> in the markup. The classes below do the same job.
     .num   a figure, range, percentage or amount: always left-to-right
     .ltr   a Latin phrase, a URL, an email, a product screenshot wrapper */
[dir="rtl"] :is(.num,.ltr){direction:ltr;unicode-bidi:isolate}
[dir="rtl"] .ltr{text-align:left}
[dir="rtl"] bdi{unicode-bidi:isolate}
/* containers that hold only a figure sort themselves out (no strong letter,
   or a Latin unit, reads left to right; an Arabic word reads right to left) */
[dir="rtl"] :is(.stat,.hlogos__stat b,.mega__stat b,.proof b,.f2-stat b,output){unicode-bidi:plaintext}
[dir="rtl"] :is(.stat,.proof b,output){font-variant-numeric:tabular-nums}
/* fields whose value is always Latin */
[dir="rtl"] input:is([type="email"],[type="tel"],[type="url"],[type="number"]){direction:ltr;text-align:right}

/* ---- 4. Never mirrored -----------------------------------------------------
   dir="rtl" does not flip images or video, so the logo, product screenshots,
   films and the isometric illustrations are already safe. Three things do need
   pinning: inline SVG (its text anchors follow the direction), marquees (their
   animation is written for a left-anchored track) and the keep-ltr opt-out for
   product mock-ups built in HTML and for charts with a time axis. */
[dir="rtl"] svg{direction:ltr}
[dir="rtl"] :is(.marq,.keep-ltr,[data-rtl="keep"]){direction:ltr}
[dir="rtl"] :is(.keep-ltr,[data-rtl="keep"]){text-align:left}
[dir="rtl"] :is(.nav__brand,.f2-logo) img{transform:none}

/* ---- 5. Arrows -------------------------------------------------------------
   The design system has one arrow icon. Its path is mirrored inside the SVG,
   so every arrow on an Arabic page points left without touching the markup,
   and the hover nudge on the SVG itself stays free to run (leftwards). */
[dir="rtl"] path[d="M5 12h14M13 6l6 6-6 6"]{transform:scaleX(-1);transform-origin:12px 12px}
/* the mobile menu (css/teradix-nav-mobile.css) already turns its own arrow by
   flipping the whole SVG; flipping the path as well would turn it back */
[dir="rtl"] .mnav__cta path[d="M5 12h14M13 6l6 6-6 6"]{transform:none}
/* a text arrow is not mirrored by the bidi algorithm: swap the glyph */
[dir="rtl"] .sol .sol-link::after{content:"\2190"}
[dir="rtl"] .sol .sol-link:hover::after{transform:translateX(-3px)}
/* hover nudges */
[dir="rtl"] .btn--primary:hover svg{transform:translateX(-3px)}
[dir="rtl"] :is(.nav__right,.mega__side) .btn--primary:hover svg,
[dir="rtl"] .hero__actions .btn--primary:hover svg,
[dir="rtl"] .hero__actions .btn.btn--primary.btn--lg:hover svg,
[dir="rtl"] .mCard__go:hover svg,
[dir="rtl"] .foot2 .f2-btn:hover svg,
[dir="rtl"] .foot2 .f2-alt:hover svg{transform:translateX(-4px)}
[dir="rtl"] .demo2__btn:hover svg{transform:translateX(-5px)}
/* the idle arrow pulse on the header and hero buttons */
@keyframes ctaArrowRtl{0%,70%,100%{transform:translateX(0)}84%{transform:translateX(-4px)}}
[dir="rtl"] :is(.nav__right,.mega__side,.hero__actions) .btn--primary svg{animation-name:ctaArrowRtl}
@media(prefers-reduced-motion:reduce){
  [dir="rtl"] :is(.nav__right,.mega__side,.hero__actions) .btn--primary svg{animation:none}}

/* ---- 6. Offset blocks ------------------------------------------------------
   The primary button stands on a solid block that falls to the bottom-right in
   English. In Arabic it falls to the bottom-left, and the hover lift goes up
   and to the right. Same sizes, x reversed. */
[dir="rtl"] .btn.btn--primary,
[dir="rtl"] .demo2__btn{box-shadow:-6px 6px 0 #0203E9}
[dir="rtl"] .btn.btn--primary:hover,
[dir="rtl"] .demo2__btn:hover{transform:translate(2px,-2px);box-shadow:-8px 8px 0 #0203E9}
[dir="rtl"] .nav .btn.btn--primary,
[dir="rtl"] .mega__side .btn.btn--primary{box-shadow:-4px 4px 0 #0203E9}
[dir="rtl"] .nav .btn.btn--primary:hover,
[dir="rtl"] .mega__side .btn.btn--primary:hover{box-shadow:-6px 6px 0 #0203E9}
[dir="rtl"] .btn.btn--primary.btn--lg{box-shadow:-8px 8px 0 #0203E9}
[dir="rtl"] .btn.btn--primary.btn--lg:hover{box-shadow:-11px 11px 0 #0203E9}
[dir="rtl"] :is(.hero__actions,.nav__right,.mega__side) .btn--primary:hover{transform:translate(2px,-2px)}
[dir="rtl"] .hero__actions .btn.btn--primary.btn--lg{box-shadow:-7px 7px 0 #0203E9}
[dir="rtl"] .demo2__btn{box-shadow:-10px 10px 0 #0203E9}
[dir="rtl"] .demo2__btn:hover{transform:translate(3px,-3px);box-shadow:-13px 13px 0 #0203E9}
[dir="rtl"] .demo2__btn--sm{box-shadow:-8px 8px 0 #0203E9}
[dir="rtl"] .demo2__btn--sm:hover{box-shadow:-11px 11px 0 #0203E9}

/* ---- 7. Header and mega menus ---------------------------------------------
   The bar itself mirrors through flex: logo right, menu centre, actions left.
   The sliding highlight (.nav__glider) is placed by script in physical pixels
   and must keep left:0. */
[dir="rtl"] .nav__glider{left:0;right:auto}
[dir="rtl"] .mCol{border-right:0;border-left:1px solid rgba(74,84,180,.32)}
[dir="rtl"] .mCol:first-child,
[dir="rtl"] .mCol--list:first-child{padding-left:10px;padding-right:0}
[dir="rtl"] .mCol--list:first-child{padding-left:14px}
[dir="rtl"] .mCol:first-child{margin-left:0;margin-right:-14px}
[dir="rtl"] .mCol--list:first-child{margin-left:0;margin-right:-12px}
[dir="rtl"] .mCol__h{padding-left:14px;padding-right:14px}
[dir="rtl"] .mCol--list .mCol__h{padding-left:14px;padding-right:12px}
[dir="rtl"] .mCol:not(.mCol--list) .mLink{padding-left:12px;padding-right:14px}
[dir="rtl"] .mCol:not(.mCol--list) .mLink--ico{padding:10px 14px}
[dir="rtl"] .mItem__go{right:auto;left:13px;transform:translateX(4px)}
[dir="rtl"] .mItem:hover .mItem__go{transform:none}
[dir="rtl"] .mLink em{margin-left:0;margin-right:7px}
[dir="rtl"] .mItem__tx b,
[dir="rtl"] .mLink b{line-height:1.45}
[dir="rtl"] .mItem__tx span,
[dir="rtl"] .mLink span{line-height:1.7}
[dir="rtl"] .mega__side{margin:18px 26px 18px 0}
[dir="rtl"] .mega__side h4{line-height:1.5}
[dir="rtl"] .mega__side p,
[dir="rtl"] .mega__stat span{line-height:1.75}
@media(max-width:1000px){[dir="rtl"] .mega__side{margin-right:0}}
/* the lime edge under an open menu starts from the reading side */
[dir="rtl"] .megaEdge{background:linear-gradient(270deg,transparent,rgba(231,255,90,.8) 16%,rgba(125,138,235,.55) 52%,rgba(125,138,235,.15) 86%,transparent)}

/* ---- 8. Shared primitives -------------------------------------------------- */
/* the highlighted words in a heading: the underline draws from the right */
[dir="rtl"] .hl::after{transform-origin:100% 50%;bottom:-.2em}
[dir="rtl"] .foot2 .f2-hl::after{transform-origin:100% 50%}
/* a highlighted phrase is kept on one line in English. Arabic phrases run
   longer, so on a phone they may wrap, and the drawn rule (which cannot follow
   a wrapped phrase) gives way to the lime colour alone */
@media(max-width:640px){
  [dir="rtl"] .hl,
  [dir="rtl"] .foot2 .f2-hl{white-space:normal}
  [dir="rtl"] .foot2 .f2-hl{display:inline;
    text-decoration:underline #E7FF5A;text-decoration-thickness:.12em;
    text-underline-offset:.34em;text-decoration-skip-ink:none}
  [dir="rtl"] .hl::after,
  [dir="rtl"] .foot2 .f2-hl::after{display:none}
}
/* go-live cards: the lime progress rule starts at the right */
[dir="rtl"] .day::after{left:auto;right:0}
[dir="rtl"] .day h3{line-height:var(--lh-ar-h3)}
/* lists (.proof, .cta-list): the design system builds ticks and bullets as flex
   items, so they move to the right of the text on their own */
[dir="rtl"] .proof li{line-height:var(--lh-ar-ui)}
/* stat rule and card sheen are symmetric: nothing to do. */

/* ---- 9. Hero and logo bar --------------------------------------------------
   The isometric scene is never mirrored, so on wide screens the copy keeps its
   place on the left, over the solid side of the scene, and reads right to left
   inside its own column. Below 981px the copy takes the full width. */
@media(min-width:981px){
  [dir="rtl"] .hero__copy{justify-self:end;width:fit-content;max-width:min(46vw,900px);
    padding-left:var(--pad);padding-right:0}
  /* Arabic lines all start at the inner edge of the column, so the solid side
     of the veil reaches a little further before it lets the scene through */
  [dir="rtl"] .hero__veil{background:linear-gradient(98deg,#080E5E 0%,#080E5E 41%,
    rgba(8,14,94,.8) 48%,rgba(8,14,94,.26) 56%,rgba(8,14,94,0) 63%)}
}
/* narrow screens: the English copy keeps its left gutter and gives up the right
   one; Arabic keeps the right gutter instead */
@media(max-width:980px){
  [dir="rtl"] .hero__copy{padding-right:var(--pad);padding-left:0}
}
[dir="rtl"] .hero__copy h1{max-width:none}
[dir="rtl"] .hero__copy .lead{max-width:44ch}
[dir="rtl"] .badge__face{padding:7px 7px 7px 24px}
@media(max-height:720px){[dir="rtl"] .badge__face{padding:6px 6px 6px 20px}}
[dir="rtl"] .badge__tx{margin-right:0;padding-top:0}
[dir="rtl"] .film{padding:0 0 0 20px}
[dir="rtl"] .film:hover{transform:translate(2px,-2px);box-shadow:-6px 6px 0 #E7FF5A}
[dir="rtl"] .film__tx{text-align:right}
/* the play triangle is a media control: it keeps pointing right */
[dir="rtl"] .hlogos__stat{padding-right:0;padding-left:clamp(24px,3vw,56px);
  border-right:0;border-left:1px solid rgba(74,84,180,.55)}
[dir="rtl"] .hlogos__stat span{line-height:1.6}

/* ---- 10. Closing call to action (.demo2) ------------------------------------ */
[dir="rtl"] :is(.demo2__steps,.demo2__calc,.demo2__proof){text-align:right}
[dir="rtl"] .demo2__steps li+li{border-left:0;border-right:1px solid #D5D9F2}
@media(max-width:900px){[dir="rtl"] .demo2__steps li+li{border-right:0}}
[dir="rtl"] .demo2__guar{border-left:0;border-right:5px solid #E7FF5A;text-align:right}
[dir="rtl"] .demo2__micro span{border-left:0;border-right:4px solid #E7FF5A}
[dir="rtl"] :is(.demo2__lead,.demo2__steps span,.demo2__note){line-height:1.8}
[dir="rtl"] .demo2__steps b{line-height:1.5}
/* the spend slider and its money scale read low to high, left to right */
[dir="rtl"] :is(.demo__range,.demo__scale){direction:ltr}

/* ---- 11. Footer (.foot2) ---------------------------------------------------- */
[dir="rtl"] .foot2{line-height:1.7}
[dir="rtl"] .foot2 .f2-title{line-height:1.4}
[dir="rtl"] .foot2 .f2-lead{line-height:1.8}
[dir="rtl"] .foot2 :is(.f2-eyebrow,.f2-h,.f2-btn,.f2-alt){line-height:var(--lh-ar-ui)}
[dir="rtl"] .foot2 .f2-item b{line-height:1.5}
[dir="rtl"] .foot2 .f2-link{line-height:1.6}
[dir="rtl"] .foot2 a.f2-btn{box-shadow:-6px 6px 0 #0203E9}
[dir="rtl"] .foot2 a.f2-btn:hover{transform:translate(2px,-2px);box-shadow:-8px 8px 0 #0203E9}
[dir="rtl"] .foot2 .f2-social a:hover{transform:translate(2px,-2px);box-shadow:-5px 5px 0 #0203E9}
[dir="rtl"] .foot2 .f2-link::after,
[dir="rtl"] .foot2 .f2-alt::after{transform-origin:100% 50%}
[dir="rtl"] .foot2 .f2-item b svg{transform:translateX(6px)}
[dir="rtl"] .foot2 .f2-item:hover b svg,
[dir="rtl"] .foot2 .f2-item:focus-visible b svg{transform:none}
[dir="rtl"] .foot2 .f2-stat::before{left:auto;right:0}
[dir="rtl"] .foot2 .f2-soon em{margin-right:0;margin-left:7px}
[dir="rtl"] .foot2 .f2-safe{padding:10px 10px 10px 14px}
[dir="rtl"] .foot2 .f2-legal ul+ul{padding-left:0;padding-right:26px;border-left:0;border-right:1px solid var(--f2-line)}
@media(max-width:640px){[dir="rtl"] .foot2 .f2-legal ul+ul{padding-right:0;border-right:0}}
/* the scene is an illustration: it is not mirrored, it only changes side with
   its grid column, so its auto margin moves to the other edge */
[dir="rtl"] .foot2 .f2-scene,
[dir="rtl"] .foot2--v3 .f2-scene{margin-left:0;margin-right:auto;direction:ltr}
@media(max-width:900px){[dir="rtl"] .foot2--v3 .f2-scene{margin-inline:0 auto;direction:ltr}}
@media(max-width:860px){[dir="rtl"] .foot2 .f2-scene{margin-inline:auto}}
/* the wash of light behind the scene follows it to the left */
[dir="rtl"] .foot2{background:
  linear-gradient(180deg,rgba(6,10,72,0) 0,#04072E 100%),
  radial-gradient(52% 460px at 20% 0,rgba(61,64,255,.34),rgba(6,10,72,0) 72%),
  radial-gradient(40% 380px at 100% 100%,rgba(231,255,90,.07),rgba(6,10,72,0) 70%),
  #060A48}
