/* ============================================================
   RTL + Arabic layer  |  rtl.css
   Loaded always; every rule is scoped to [dir="rtl"] so the
   LTR site is untouched. Arabic webfont is pulled in once.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700;800&display=swap');

/* ── Arabic typography ──────────────────────────────────────── */
[dir="rtl"] {
    --ff-display: 'Cairo', 'Outfit', sans-serif;
    --ff-body: 'Tajawal', 'Space Grotesk', sans-serif;
    --ff-mono: 'Cairo', ui-monospace, monospace;
}

/* Arabic has no uppercase and taller ascenders/descenders:
   kill letter-spacing tricks and give lines room to breathe. */
[dir="rtl"] body {
    letter-spacing: 0;
    line-height: 1.75;
}

[dir="rtl"] .sec-tag,
[dir="rtl"] .cine-tag,
[dir="rtl"] .cine-kicker,
[dir="rtl"] .hcard-tag,
[dir="rtl"] .hcard-cat,
[dir="rtl"] .stat-key,
[dir="rtl"] .chip-lbl,
[dir="rtl"] .c-lbl,
[dir="rtl"] .f-label,
[dir="rtl"] .t-period,
[dir="rtl"] .m-item {
    letter-spacing: 0;
    text-transform: none;
}

[dir="rtl"] .cine-name,
[dir="rtl"] .cine-role,
[dir="rtl"] .cine-enter,
[dir="rtl"] .sec-title,
[dir="rtl"] .hcard-intro-title,
[dir="rtl"] .stack-title,
[dir="rtl"] .stat-val {
    letter-spacing: 0;
    line-height: 1.25;
}

/* The "// Section" slashes read as noise in Arabic — the JS
   supplies clean text, so just drop the mono/latin styling. */
[dir="rtl"] .sec-tag,
[dir="rtl"] .cine-tag {
    font-family: var(--ff-body);
    font-weight: 700;
}

/* Numerals, emails, phones and brand names stay LTR inside
   an otherwise RTL paragraph. */
[dir="rtl"] .stat-val,
[dir="rtl"] .sk-pct,
[dir="rtl"] .stack-num,
[dir="rtl"] .svc-num,
[dir="rtl"] .t-year,
[dir="rtl"] .cs-num,
[dir="rtl"] .c-val,
[dir="rtl"] .footer-logo,
[dir="rtl"] .nav-logo,
[dir="rtl"] [data-ltr] {
    direction: ltr;
    unicode-bidi: isolate;
}

/* ── Nav ────────────────────────────────────────────────────── */
[dir="rtl"] .nav-links a::after {
    left: auto;
    right: 0;
}

/* ── Hero chips (float on the opposite edge of the avatar) ──── */
[dir="rtl"] .chip-1 {
    right: auto;
    left: -10px;
}

[dir="rtl"] .chip-2 {
    left: auto;
    right: -10px;
}

[dir="rtl"] .chip-3 {
    right: auto;
    left: -20px;
}

/* ── Stats divider ──────────────────────────────────────────── */
[dir="rtl"] .stat-box {
    border-right: none;
    border-left: 1px solid var(--line);
}

[dir="rtl"] .stat-box:last-child {
    border-left: none;
}

/* ── Experience timeline (rail moves to the right) ──────────── */
[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 120px;
}

[dir="rtl"] .timeline-line {
    left: auto;
    right: 92px;
}

[dir="rtl"] .timeline-progress {
    left: auto;
    right: 91px;
}

[dir="rtl"] .t-marker {
    left: auto;
    right: -120px;
    /* row-reverse alone pushes the year past the box edge and the
       viewport clips it — pin the row to the end instead. */
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .t-year {
    letter-spacing: 0;
}

[dir="rtl"] .t-dot {
    right: auto;
    left: -5px;
}

/* ── Portfolio horizontal scroller ──────────────────────────── */
[dir="rtl"] .hcard-tag {
    right: auto;
    left: 18px;
}

[dir="rtl"] .hcard-end {
    text-align: right;
    align-items: flex-end;
}

/* The track is moved by GSAP on the X axis; in RTL the visual
   reading order must still run right-to-left. */
[dir="rtl"] .hsec-track {
    flex-direction: row-reverse;
}

/* ── Services ───────────────────────────────────────────────── */
[dir="rtl"] .svc-num {
    right: auto;
    left: 28px;
}

/* ── FAQ ────────────────────────────────────────────────────── */
[dir="rtl"] .faq-item summary {
    text-align: right;
}

/* ── Contact / form ─────────────────────────────────────────── */
[dir="rtl"] .f-input,
[dir="rtl"] .f-area {
    text-align: right;
}

[dir="rtl"] .f-input::placeholder,
[dir="rtl"] .f-area::placeholder {
    text-align: right;
}

/* ── Back to top ────────────────────────────────────────────── */
[dir="rtl"] #back-top {
    right: auto;
    left: 32px;
}

/* ── Directional icons: mirror arrows, never brand marks ────── */
[dir="rtl"] .ti-arrow-right,
[dir="rtl"] .ti-arrow-up-right,
[dir="rtl"] .ti-arrow-narrow-right,
[dir="rtl"] .hcard-hint i,
[dir="rtl"] .cs-go i {
    transform: scaleX(-1);
}

/* ── Marquee: reverse the drift so it still reads inward ────── */
[dir="rtl"] .marquee-track {
    flex-direction: row-reverse;
}

/* ── Mobile breakpoints ─────────────────────────────────────── */
@media (max-width: 768px) {
    [dir="rtl"] .timeline {
        padding-right: 54px;
    }

    [dir="rtl"] .timeline-line {
        right: 26px;
    }

    [dir="rtl"] .timeline-progress {
        right: 25px;
    }

    [dir="rtl"] .t-marker {
        right: -54px;
    }

    [dir="rtl"] .stat-box {
        border-left: none;
    }
}

/* ============================================================
   Language switch control
   ============================================================ */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    margin-inline-start: 4px;
    border: 1px solid var(--line);
    border-radius: 50px;
    background: rgba(255, 255, 255, .03);
    color: var(--txt-2);
    font-family: var(--ff-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    transition: color var(--dur-f) var(--ease),
        border-color var(--dur-f) var(--ease),
        background var(--dur-f) var(--ease);
}

.lang-switch:hover {
    color: var(--txt);
    border-color: rgba(139, 92, 246, .45);
    background: rgba(139, 92, 246, .1);
}

.lang-switch i {
    font-size: 15px;
    color: var(--purple-lt);
}

.lang-switch .lang-code {
    display: inline-block;
    min-width: 18px;
}

[dir="rtl"] .lang-switch {
    font-family: var(--ff-body);
    letter-spacing: 0;
}

/* Mobile drawer gets its own full-width version */
.mobile-drawer .lang-switch {
    justify-content: center;
    width: 100%;
    max-width: 200px;
    height: 44px;
    margin-top: 10px;
    font-size: 13px;
}

@media (max-width: 980px) {
    .nav .lang-switch {
        display: none;
    }
}

/* Cross-fade applied by i18n.js while strings are swapped */
.lang-swapping {
    transition: opacity .18s ease;
    opacity: 0;
}
