/* Shfrah on the Orisa theme: Arabic type and right-to-left fixes. */
/* Type: Tajarib for all text (its @font-face rules are in site.css, which every page loads after this file) */
:root {
  --at-ff-heading: "Tajarib", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --at-ff-body: "Tajarib", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --at-heading-font: "Tajarib", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
/* Arabic letters join: never track them apart. */
html[dir="rtl"] body, html[dir="rtl"] body * { letter-spacing: 0 !important; }

/* Shfrah logo, light and dark */
.shf-logo { height: 30px; width: auto; display: block; }
.shf-logo-dark { display: none; }
[data-bs-theme="dark"] .shf-logo-light { display: none; }
[data-bs-theme="dark"] .shf-logo-dark { display: block; }

/* platforms we integrate with: text marks in place of client logos */
.shf-plat { font-family: var(--at-ff-heading); font-weight: 700; font-size: 19px; line-height: 1; white-space: nowrap; color: #171717; opacity: .78; }
[data-bs-theme="dark"] .shf-plat { color: #fff; }

/* numbers stay left-to-right inside Arabic text (odometers, metrics, stats) */
.odometer, .card_case__studies-metric-value, .fz-ds-1 { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .card_case__studies-metric-value { text-align: left; }

/* Arabic needs more line height than the theme's Latin headings */
html[dir="rtl"] h1.lh-1, html[dir="rtl"] h2.lh-1:not(.sec-1-home-4__brand), html[dir="rtl"] h3.lh-1, html[dir="rtl"] h4.lh-1 { line-height: 1.25 !important; }
html[dir="rtl"] .reveal-text { line-height: 1.3; }
html[dir="rtl"] .sec-1-home-4__brand { line-height: 1.05; }

/* Font Awesome glyphs as inline SVG (content.py FA_SVG): sized and aligned like the icon font they replace */
.shf-ico { display: inline-block; height: 1em; width: auto; vertical-align: -.125em; overflow: visible; }
/* offcanvas social links: WhatsApp / email glyphs sized like the theme's svg icons (17px glyph in an 18px box) */
.at-offcanvas-social__link .shf-ico { width: 18px; height: 17px; }

/* ---------- native scrolling (touch-only screens, reduced motion): main.js creates no ScrollSmoother there and
   sets .shf-native-scroll on <html>.
   - The header leaves the page flow, as ScrollSmoother's fixed wrapper made it (else the page starts 78px lower).
   - <main> drops the template's will-change: transform (meant for a footer reveal this page does not use): it would
     make <main> the containing block of position: fixed elements, and the أعمالنا deck's fixed pin would scroll away.
     The ScrollSmoother path (desktop) keeps it. */
.shf-native-scroll body > header.z-index-5 {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
}
.shf-native-scroll #smooth-content main {
    will-change: auto;
}

/* testimonials asterisk (.rotate-infinite): started ~14,000px off screen, Chrome cannot composite its endless
   rotation ("compositor property animations have no effect"), so it ticked on the main thread and forced a full
   layer update on every frame of the page, scrolling or idle. It now starts only near the viewport
   (sections/perf.js toggles .is-inview), and a fresh start there is composited. Reduced motion: no spin. */
.rotate-infinite { animation: none; }
.rotate-infinite.is-inview { animation: rotate-infinite 15s linear infinite; }
@media (prefers-reduced-motion: reduce) { .rotate-infinite.is-inview { animation: none; } }

/* reveal-text where the page scrolls natively (main.js adds .shf-reveal, .shf-w and --shf-i): the words light up once,
   50ms apart (site.js shortens the step of a long text: --shf-step), from the reading side, as composited CSS
   transitions (desktop keeps the theme's scrubbed reveal). Only the reveal animates: the words take their dim start at
   once (transition: none, which also voids the delay site.css gives them), so headings further down no longer fade
   out word by word at load (on the English home: 984 transitions, the last ending 10 s after load) */
.shf-reveal .shf-w {
    opacity: 0.4;
    transform: translateX(-7px);
    transition: none;
}
[dir="ltr"] .shf-reveal .shf-w { transform: translateX(-7px); }
.shf-reveal.is-revealed .shf-w {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: calc(var(--shf-i, 0) * var(--shf-step, 50ms));
}
@media (prefers-reduced-motion: reduce) {
    .shf-reveal .shf-w, [dir] .shf-reveal .shf-w, .shf-reveal.is-revealed .shf-w { opacity: 1; transform: none; transition: none; }
}

/* at_fade_anim where the page scrolls natively (main.js adds .shf-fade and the --shf-f* values): the theme's fade and
   20px rise, same duration and delay, as a composited CSS transition; 'bounce' items get a CSS bounce curve */
.shf-fade {
    opacity: 0;
    transform: translate(var(--shf-fx, 0px), var(--shf-fy, 20px));
    transition: opacity var(--shf-fd, 0.75s) cubic-bezier(0.25, 0.46, 0.45, 0.94) var(--shf-fdl, 0.15s),
        transform var(--shf-fd, 0.75s) cubic-bezier(0.25, 0.46, 0.45, 0.94) var(--shf-fdl, 0.15s);
}
.shf-fade--bounce {
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94), cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94), linear(0, 0.063, 0.25, 0.563, 1 36.4%, 0.812, 0.75, 0.813, 1 72.7%, 0.953, 0.938, 0.953, 1 90.9%, 0.984, 1);
}
.shf-fade.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .shf-fade { opacity: 1; transform: none; transition: none; }
}

/* touch screens: the hero's glass (backdrop-filter) re-blurred the moving hero photo on every scroll frame */
@media (hover: none), (pointer: coarse) {
    .sec-1-home-4-wrap .sec-1-home-4__tag,
    .sec-1-home-4-wrap .sec-1-home-4__tag:hover { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(80, 79, 83, 0.86); }
    .sec-1-home-4-wrap .sec-1-home-4__btns .at-btn,
    .sec-1-home-4-wrap .sec-1-home-4__btns .at-btn:hover { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* blog cards: the "zoom morph" hover that image-hover-effects.js applied with jQuery inline styles, as plain CSS
   (mouse only: a tap no longer leaves a stuck zoom on phones) */
.hover-effect-1 { position: relative; overflow: hidden; cursor: pointer; }
.hover-effect-1 img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.25, .46, .45, .94), filter .6s cubic-bezier(.25, .46, .45, .94); }
.hover-effect-1::after { content: ""; position: absolute; inset: 0; background: linear-gradient(-45deg, rgba(255, 255, 255, .1), rgba(0, 0, 0, .1)); opacity: 0; transition: opacity .6s; pointer-events: none; }
@media (hover: hover) {
    .hover-effect-1:hover img { transform: scale(1.05) rotate(-1deg); filter: brightness(1.1) contrast(1.1) saturate(1.2); }
    .hover-effect-1:hover::after { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .hover-effect-1 img, .hover-effect-1::after { transition: none; }
    .hover-effect-1:hover img { transform: none; }
}

/* theme "process" pills: lossless 101x272 webps (33-48 KB each) replaced by lossy copies of the same size (imgfix.mjs) */
.card__process-pill--1 { background-image: url("../imgs/shfrah/process/img-81.webp"); }
.card__process-pill--2 { background-image: url("../imgs/shfrah/process/img-82.webp"); }
.card__process-pill--3 { background-image: url("../imgs/shfrah/process/img-83.webp"); }
.card__process-pill--4 { background-image: url("../imgs/shfrah/process/img-84.webp"); }

/* touch screens scroll natively: keep the browser's own scroll restore (reload, Back) instant. Bootstrap's :root smooth
   scrolling made Chrome animate the restore from the top, and ScrollTrigger's load refreshes cut that animation short.
   A media query, not .shf-native-scroll: the restore starts before main.js adds the class. */
@media (hover: none), (pointer: coarse) { :root { scroll-behavior: auto; } }

/* ---------------------------------------------------------------- cover: subtitle pill, one bold statement, the five service pills */
.sec-1-home-4-wrap .sec-1-home-4.shf-hero { padding-top: 0; min-height: clamp(480px, calc(100vh - 150px), 960px); display: flex; align-items: center; }
@supports (height: 100svh) { .sec-1-home-4-wrap .sec-1-home-4.shf-hero { min-height: clamp(440px, calc(100svh - 150px), 960px); } }
.shf-hero > .container { padding-top: 120px; padding-bottom: 96px; }
/* the photo is an <img> layer under the theme's dark gradient (::after, z -1): it loads with the page instead of after main.js */
.shf-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform-origin: 50% 40%; }
/* small subtitle in a pill, the same shape and glass as the service pills */
.shf-hero__pill {
    display: inline-flex;
    align-items: center;
    margin-bottom: 28px;
    padding: 7px 18px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(70, 70, 70, 0.2);
    color: #FEFEFE;
    font-family: var(--at-ff-body);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.4;
}
/* the statement keeps the site's heading font and weight (theme h1: body font, 700); only the size is the cover's */
.shf-hero__statement {
    margin: 0;
    font-size: clamp(54px, 8.6vw, 132px);
    line-height: 1.2;
    letter-spacing: 0;
    text-wrap: balance;
}
/* each word rises from behind its own line; the padding keeps Arabic dots and the shadda inside the mask */
.shf-hero__statement .shf-w { display: inline-block; overflow: hidden; vertical-align: top; padding: .08em .06em .24em; margin: -.08em -.06em -.24em; }
.shf-hero__statement .shf-w > span { display: inline-block; }
.shf-hero .shf-hero__tags { justify-content: flex-start; margin-top: 44px; }
/* the company profile under the pills (opens the PDF in a new tab): a quiet outline link, white on the photo */
.shf-hero__profile { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; padding: 10px 20px; border-radius: 50px;
    border: 1px solid #FEFEFE; background: #FEFEFE; color: #121212; font-family: var(--at-ff-body); font-weight: 600; font-size: 16px;
    line-height: 1.4; text-decoration: none; transition: background-color .25s, color .25s, border-color .25s; }
/* filled white, unlike the outlined service pills next to it; on hover it turns into an outline */
.shf-hero__profile:hover, .shf-hero__profile:focus-visible { background: transparent; color: #FEFEFE; border-color: #FEFEFE; }
.shf-hero__profile:focus-visible { outline: 2px solid #FEFEFE; outline-offset: 3px; }
@media (max-width: 575.98px) {
    .shf-hero > .container { padding-top: 96px; padding-bottom: 72px; }
    .shf-hero__pill { font-size: 14px; padding: 6px 14px; margin-bottom: 22px; }
    .shf-hero .shf-hero__tags { margin-top: 32px; }
    .shf-hero__profile { margin-top: 22px; font-size: 15px; padding: 9px 16px; }
}
/* entrance on page load, CSS only (nothing waits for a scroll trigger), transform and opacity only:
   the photo settles from a slow zoom, the subtitle slides in from the reading side, the words rise one by one,
   then the five pills follow, right to left */
@keyframes shfBgIn { from { opacity: 0; transform: scale(1.14); } to { opacity: 1; transform: scale(1); } }
@keyframes shfSlideIn { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes shfRise { from { transform: translateY(110%); } to { transform: none; } }
@keyframes shfPop { from { opacity: 0; transform: translateX(-26px) scale(.92); } to { opacity: 1; transform: none; } }
.shf-hero__bg { animation: shfBgIn 2.2s cubic-bezier(.16, .84, .3, 1) both; }
.shf-hero__pill { animation: shfSlideIn .8s cubic-bezier(.2, .8, .2, 1) .35s both; }
.shf-hero__statement .shf-w > span { animation: shfRise 1s cubic-bezier(.2, .85, .25, 1) both; }
.shf-hero__statement .shf-w:nth-child(1) > span { animation-delay: .5s; }
.shf-hero__statement .shf-w:nth-child(2) > span { animation-delay: .64s; }
.shf-hero__statement .shf-w:nth-child(3) > span { animation-delay: .78s; }
.shf-hero .sec-1-home-4__tag { animation: shfPop .7s cubic-bezier(.2, .8, .2, 1) both; }
.shf-hero .sec-1-home-4__tag:nth-child(1) { animation-delay: 1.1s; }
.shf-hero .sec-1-home-4__tag:nth-child(2) { animation-delay: 1.18s; }
.shf-hero .sec-1-home-4__tag:nth-child(3) { animation-delay: 1.26s; }
.shf-hero .sec-1-home-4__tag:nth-child(4) { animation-delay: 1.34s; }
.shf-hero .sec-1-home-4__tag:nth-child(5) { animation-delay: 1.42s; }
.shf-hero__profile { animation: shfPop .7s cubic-bezier(.2, .8, .2, 1) 1.6s both; }
@media (prefers-reduced-motion: reduce) {
    .shf-hero__bg, .shf-hero__pill, .shf-hero__statement .shf-w > span, .shf-hero .sec-1-home-4__tag, .shf-hero__profile { animation: none; }
}
/* phones in landscape and other low screens: the statement stays in the first screen */
@media (max-height: 520px) {
    .sec-1-home-4-wrap .sec-1-home-4.shf-hero { min-height: 0; }
    .shf-hero > .container { padding-top: 56px; padding-bottom: 48px; }
}

/* footer: the logo image in place of the big word (the heading keeps its scale-in animation) */
.footer-4-connect-title.shf-footer-brand { font-size: 0 !important; line-height: 0; }
.shf-footer-brand .shf-footer-logo { display: block; width: min(560px, 74%); height: auto; margin: 0 auto; }

/* the about statement and the testimonial's name are paragraphs now (they were an h5 and an h3 with no section of their
   own, content.py): the theme's heading type, as before */
p.revert-text { font-weight: 700; color: var(--at-neutral-900); }
p.revert-text, .home-4-section-7 p.h5 { letter-spacing: -5%; transition: color 0.3s ease-out; }

/* «ماذا نقدّم» cards: the title links to its service page, and its ::after makes the whole card the target (the card
   clips it: overflow hidden; the title's own box is positioned, so inset: 0 would cover only the text block) */
.at-service-card .shf-card-link::after { content: ""; position: absolute; inset: -100vmax; z-index: 1; }

/* ---------------------------------------------------------------- keyboard focus
   The theme takes the outline off every link and button (main.css a:focus, button:focus): keyboard focus gets a ring
   again (:focus-visible: a mouse click shows none), white on the dark cover, cards and pictures (site.css does the same
   for the top bar and the footer, and keeps its own focus styles where it has them). */
a:focus-visible, button:focus-visible { outline: 2px solid var(--at-neutral-900); outline-offset: 3px; }
.shf-hero a:focus-visible, .at-service-card.card-1 a:focus-visible, .at-service-card.card-3 a:focus-visible { outline-color: #FEFEFE; }
/* the closed full-screen menu (offcanvas 2) waits off screen; the theme hides its menu and logo there but left its
   WhatsApp and email links in the Tab order: hidden until it opens (and kept while it closes, .menu-open-temp) */
.at-offcanvas-2-area:not(.menu-open):not(.menu-open-temp) .at-offcanvas-social { visibility: hidden; }


/* ---------------------------------------------------------------- English (LTR) home only
   build.py --lang en appends this to the flipped shfrah.css (assets/css/shfrah.ltr.css). Inter and the English
   tracking come from site.css (html[lang="en"]), as on every English page. */

/* cover statement: seven English words instead of three Arabic ones. Sized to hold two lines on a laptop; Latin
   letters need less line height than Arabic marks, and Inter's large bold sizes read better a little tighter */
.shf-hero__statement { font-size: clamp(44px, 7.4vw, 120px); line-height: 1.08; letter-spacing: -0.025em; }
/* the words rise one after another, closer together than the three Arabic ones (.14s): the seventh starts at .98s,
   just before the pills (1.1s) */
.shf-hero__statement .shf-w:nth-child(2) > span { animation-delay: .58s; }
.shf-hero__statement .shf-w:nth-child(3) > span { animation-delay: .66s; }
.shf-hero__statement .shf-w:nth-child(4) > span { animation-delay: .74s; }
.shf-hero__statement .shf-w:nth-child(5) > span { animation-delay: .82s; }
.shf-hero__statement .shf-w:nth-child(6) > span { animation-delay: .9s; }
.shf-hero__statement .shf-w:nth-child(7) > span { animation-delay: .98s; }
/* section headings wrap into even lines: the English ones otherwise leave one word alone on a phone ("Sectors we
   build / for", "What partners / say") */
.reveal-text { text-wrap: balance; }

/* odometers: the theme spaces their digits 12px apart (main.css .odometer), so the products count read «2 0». They
   track like the text around them, as in Arabic (where shfrah.css sets every letter-spacing to 0) */
.odometer { letter-spacing: inherit; }
/* «How we work» step titles in the 96px column of 992-1199px: at 24px «Discover & diagnose» broke into three lines with
   a lone «&», and «diagnose» ran past the card */
@media (min-width: 992px) and (max-width: 1199.98px) { .card__process-title { font-size: 19px; } }
/* «What our partners say» on laptops and desktops: two lines in its column (the theme's 60-72px set it one word a line);
   the column is 211px wide all through 992-1199px */
@media (min-width: 992px) and (max-width: 1199.98px) { .home-4-section-7 h2.reveal-text { font-size: 36px; } }
@media (min-width: 1200px) { .home-4-section-7 h2.reveal-text { font-size: clamp(34px, 3.3vw, 60px); } }
/* «We write what we learn» (the journal head, section 8) in its 3-column cell: at the theme's sizes (42px at 992-1199,
   64px from 1200) it read «We write / what / we learn» at 1024, 1100, 1440 and 1536. «what we learn» fits its column
   up to 35px at 992-1199 (216px), 42px at 1200-1399 (261px) and about 3.7vw from 1400 (326px and up): these sizes
   keep it «We write / what we learn» with room to spare. Its lead no longer leaves «team.» alone (1440). */
@media (min-width: 992px) and (max-width: 1199.98px) { .home-4-section-8 h2.reveal-text { font-size: 33px; } }
@media (min-width: 1200px) and (max-width: 1399.98px) { .home-4-section-8 h2.reveal-text { font-size: 40px; } }
@media (min-width: 1400px) { .home-4-section-8 h2.reveal-text { font-size: clamp(40px, 3.3vw, 60px); } }
.home-4-section-8 .row.align-items-end p { text-wrap: pretty; }
