/* ============================================
   Home page
   ============================================ */

/* أسهم الأزرار بتتعكس في العربي */
html[dir="rtl"] .home-arrow,
html[dir="rtl"] .home-clients__arrow svg {
    transform: scaleX(-1);
}

/* ── Badges الأقسام (كبسولة + أيقونة خضرا) ── */
.home-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 15px;
    border: 1px solid var(--n200);
    border-radius: 21px;
    background: var(--n100);
    color: var(--text-black);
    font-size: 18px;
    font-weight: 500;
    line-height: 22px;
    margin: 0;
}

.home-badge svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--primary-600);
}

.home-badge--white {
    background: var(--white);
    border-color: var(--n100);
}

.home-badge__logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

/* رأس القسم: badge ← 16 ← العنوان */
.home-section-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.home-section-head--start {
    align-items: flex-start;
}

.home-section-head .page-title {
    margin: 0;
}

/* عناوين الأقسام في العربي وزنها 500 */
html[dir="rtl"] .home-section-head .page-title,
html[dir="rtl"] .home-about__heading {
    font-weight: 500;
}

/* ══════════════════ Hero ══════════════════ */
.home-hero {
    position: relative;
    min-height: 758px;
    background: #060A08;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* الخلفية الافتراضية (لو مفيش فيديو ولا صورة): نقشة الدوائر الداكنة */
.home-hero:not(.home-hero--media)::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../images/textures/circuit-pattern-608x608.png');
    background-repeat: repeat;
    opacity: 0.1;
    pointer-events: none;
}

.home-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.home-hero__poster,
.home-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* طبقة سودا 50% فوق الفيديو/الصورة */
.home-hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.home-hero__inner {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 23px;
    padding-top: 270px;
    padding-bottom: 140px;
}

.home-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 8px 16px;
    box-sizing: border-box;
    border-radius: 45.5px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.home-hero__badge svg {
    flex-shrink: 0;
    color: var(--primary-600);
}

.home-hero__title {
    max-width: 960px;
    margin: 0;
    font-size: 56px;
    font-weight: 800;
    line-height: 84px;
    color: var(--primary-500);
}

html[dir="rtl"] .home-hero__title {
    max-width: 1140px;
    font-weight: 600;
    line-height: 67px;
    color: var(--white);
}

.home-hero__desc {
    max-width: 870px;
    margin: 1px 0 0;
    font-size: 20px;
    font-weight: 500;
    line-height: 30px;
    color: var(--white);
}

/* أيقونة الماوس (32×56) في نص أسفل الـ Hero */
.home-hero__scroll {
    position: absolute;
    z-index: 2;
    bottom: 20px;
    left: 50%;
    width: 32px;
    height: 56px;
    margin-inline-start: -16px;
    color: var(--white);
    opacity: .9;
    transition: opacity .2s;
}

html[dir="rtl"] .home-hero__scroll {
    left: auto;
    right: 50%;
}

.home-hero__scroll:hover,
.home-hero__scroll:focus-visible {
    opacity: 1;
}

.home-hero__scroll svg {
    display: block;
}

.home-hero__scroll-wheel {
    animation: home-scroll-wheel 1.8s ease-in-out infinite;
}

.home-hero__scroll-chevron {
    animation: home-scroll-chevron 1.8s ease-in-out infinite;
}

@keyframes home-scroll-wheel {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(4px); opacity: .4; }
}

@keyframes home-scroll-chevron {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* ══════════════════ About + الأرقام ══════════════════ */
.home-about {
    position: relative;
    overflow: hidden;
    padding-block: 56px;
}

/* نقشة مثلثات خفيفة خلف الصور */
.home-about::before {
    content: '';
    position: absolute;
    top: 53px;
    inset-inline-end: -73px;
    width: 649px;
    height: 572px;
    background: url('../images/textures/about-scope-pattern-bottomright.svg') no-repeat right bottom / 100% auto;
    opacity: .9;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .45) 32%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .45) 32%, #000 100%);
    pointer-events: none;
}

html[dir="rtl"] .home-about::before {
    transform: scaleX(-1);
}

.home-about .container {
    position: relative;
    z-index: 1;
}

/* عمود النص 635 وصندوق الصور 553 */
.home-about__grid {
    display: grid;
    grid-template-columns: minmax(0, 635px) minmax(0, 553px);
    justify-content: space-between;
    gap: 44px;
    align-items: center;
}

/* الترتيب: الفقرة ← 24 ← badge + العنوان ← 24 ← الأرقام ← 32 ← الزرار */
.home-about__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.home-about__lead {
    max-width: 531px;
    margin: 0 0 24px;
    font-size: 20px;
    line-height: 30px;
    color: var(--n600);
}

.home-about__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.home-about__heading {
    max-width: 586px;
    margin: 0;
}

.home-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 32px;
}

.home-stats__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-stats__item strong {
    display: block;
    font-size: 40px;
    font-weight: 600;
    line-height: 60px;
    color: var(--text-black);
}

.home-stats__item span {
    font-size: 24px;
    font-weight: 600;
    line-height: 36px;
    color: var(--text-black);
}

html[dir="rtl"] .home-stats__item span {
    font-weight: 500;
}

.home-about__cta {
    gap: 8px;
}

.home-about__cta .home-arrow {
    width: 24px;
    height: 24px;
}

/* صندوق الصور — نفس كلاسات about.css (553×476) */
.home-about__media {
    width: 553px;
    max-width: 100%;
    margin-inline-start: auto;
    align-self: start;
    margin-top: 26px;
}

/* ══════════════════ Services ══════════════════ */
.home-services {
    position: relative;
    background: #F6FDF8;
    overflow: hidden;
}

/* نقشة خضرا خفيفة أعلى الطرف */
.home-services::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    width: 350px;
    height: 356px;
    background: url('../images/textures/about-scope-pattern-topleft.svg') no-repeat;
    transform: scaleX(-1);
    pointer-events: none;
}

html[dir="rtl"] .home-services::before {
    transform: none;
}

.home-services .container {
    position: relative;
    z-index: 1;
}

.home-services__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
}

.home-services__title {
    color: var(--n800);
}

.home-services__seeall {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 124px;
    height: 48px;
    padding: 0 20px;
    box-sizing: border-box;
    background: var(--white);
    border-radius: 12px;
    color: var(--text-black);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    transition: background-color .2s;
}

.home-services__seeall:hover {
    background: var(--primary-50);
}

.home-services__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.home-service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 16px;
    background: var(--white);
    border: 1px solid var(--n100);
    border-radius: 24px;
    text-align: center;
    box-sizing: border-box;
}

/* أيقونة مزدوجة: 72 (#EEFCF0) ← 57.6 (#DCF9E1) ← أيقونة 40 */
.home-service-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 19.2px;
    background: #EEFCF0;
    flex-shrink: 0;
}

.home-service-card__icon-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 57.6px;
    height: 57.6px;
    border-radius: 16.46px;
    background: #DCF9E1;
    color: var(--primary-600);
}

.home-service-card__icon-inner img,
.home-service-card__icon-inner svg {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.home-service-card__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.home-service-card h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    line-height: 30px;
    color: var(--text-black);
}

.home-service-card p {
    margin: 0;
    font-size: 16px;
    line-height: 30px;
    color: var(--n500);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.home-service-card__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 10px 20px;
    box-sizing: border-box;
    border: 1px solid var(--primary-600);
    border-radius: 12px;
    color: var(--primary-700);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    transition: background-color .2s;
}

.home-service-card__more:hover {
    background: var(--primary-50);
}

/* ══════════════════ Leadership Team ══════════════════ */
.home-team {
    background: var(--white);
}

.home-team__lead {
    max-width: 647px;
    margin: 12px auto 56px;
    font-size: 20px;
    line-height: 30px;
    color: var(--n500);
}

.home-team__track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.home-team__track::-webkit-scrollbar {
    display: none;
}

.home-team__card {
    flex: 0 0 calc((100% - 40px) / 3);
    max-width: 397px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* صندوق الصورة 397×477 بتدرّج أخضر، والشخص صورة مفرّغة (PNG) قاعدة على الحرف السفلي */
.home-team__photo {
    position: relative;
    width: 100%;
    aspect-ratio: 397 / 477;
    border-radius: 24px;
    background: linear-gradient(360deg, #F2FDF4 0%, #D4F7DA 85.25%, #A8F0B4 100%);
    overflow: hidden;
    margin-bottom: 36px;
}

.home-team__photo img {
    position: absolute;
    inset: 50px 0 0;
    width: 100%;
    height: calc(100% - 50px);
    object-fit: contain;
    object-position: center bottom;
}

.home-team__photo img.home-team__placeholder {
    inset: 0;
    width: 64px;
    height: 64px;
    margin: auto;
    object-position: center;
    opacity: .55;
}

.home-team__card h3 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 600;
    line-height: 36px;
    color: var(--text-black);
}

.home-team__card p {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    line-height: 30px;
    color: var(--n500);
}

.home-team__dots {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 18px;
}

/* مساحة ضغط 40×40 والنقطة الظاهرة 12 */
.home-team__dot {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: none;
}

.home-team__dot + .home-team__dot {
    margin-inline-start: -16px;
}

.home-team__dot::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 14px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-100);
    transition: background-color .2s;
}

.home-team__dot.active::before {
    background: var(--primary-600);
}

/* ══════════════════ Clients ══════════════════ */
.home-clients {
    background: var(--white);
}

.home-clients__title {
    max-width: 420px;
}

.home-clients__card {
    position: relative;
    max-width: 1232px;
    margin: 64px auto 0;
    padding: 48px 148px;
    background: #EAFAEF;
    border: 1px solid var(--primary-100);
    border-radius: 32px;
    box-sizing: border-box;
    overflow: hidden;
}

/* نقشة مثلثات خفيفة في الركنين السفليين للكارت */
.home-clients__pattern {
    position: absolute;
    bottom: 0;
    width: 440px;
    height: 385px;
    background: url('../images/textures/about-scope-pattern-bottomright.svg') no-repeat right bottom / contain;
    pointer-events: none;
}

.home-clients__pattern--start {
    inset-inline-start: 0;
    transform: scaleX(-1);
}

.home-clients__pattern--end {
    inset-inline-end: 0;
}

html[dir="rtl"] .home-clients__pattern--start {
    transform: none;
}

html[dir="rtl"] .home-clients__pattern--end {
    transform: scaleX(-1);
}

.home-clients__slides {
    position: relative;
    z-index: 1;
}

.home-clients__slide {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 64px;
}

.home-clients__slide.active {
    display: flex;
}

.home-clients__quote {
    margin: 0;
    font-size: 24px;
    line-height: 36px;
    color: var(--n700);
}

.home-clients__client {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.home-clients__logo {
    width: 125px;
    height: 125px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.home-clients__logo img {
    width: 74px;
    height: 97px;
    max-width: 70%;
    max-height: 78%;
    object-fit: contain;
}

.home-clients__client strong {
    font-size: 20px;
    font-weight: 600;
    line-height: 30px;
    color: var(--text-black);
}

.home-clients__arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 99px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s;
}

.home-clients__arrow--prev {
    inset-inline-start: 64px;
    border: 1px solid var(--n200);
    color: var(--n900);
}

.home-clients__arrow--next {
    inset-inline-end: 64px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.11);
    color: var(--n800);
}

.home-clients__arrow:hover {
    background: var(--n100);
}

/* ══════════════════ Partners ══════════════════ */
.home-partners__title {
    font-weight: 500;
}

/* شريط لوجوهات بيلف بشكل مستمر (infinite marquee) */
.home-partners__marquee {
    margin-top: 60px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
}

.home-partners__track {
    display: flex;
    align-items: center;
    gap: 24px;
    width: max-content;
    animation: home-partners-scroll 30s linear infinite;
}

.home-partners__marquee:hover .home-partners__track {
    animation-play-state: paused;
}

@keyframes home-partners-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - 12px)); }
}

.home-partners__logo {
    flex-shrink: 0;
    width: 200px;
    height: 80.33px;
    border: 0.82px solid var(--n200);
    border-radius: 19.67px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    box-sizing: border-box;
}

.home-partners__logo img {
    max-width: 100%;
    max-height: 44px;
    object-fit: contain;
}

html[dir="rtl"] .home-partners__track {
    animation-name: home-partners-scroll-rtl;
}

@keyframes home-partners-scroll-rtl {
    from { transform: translateX(0); }
    to { transform: translateX(calc(50% + 12px)); }
}

/* تقليل الحركة: بدون لف تلقائي ولا أنيميشن الماوس */
@media (prefers-reduced-motion: reduce) {
    .home-partners__track,
    .home-hero__scroll-wheel,
    .home-hero__scroll-chevron {
        animation: none;
    }
    .home-partners__marquee {
        overflow-x: auto;
    }
}

/* ══════════════════ Responsive ══════════════════ */
@media (max-width: 1300px) {
    .home-clients__card {
        padding: 48px 120px;
    }
    .home-clients__arrow--prev { inset-inline-start: 40px; }
    .home-clients__arrow--next { inset-inline-end: 40px; }
}

@media (max-width: 1100px) {
    .home-about__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 48px;
    }
    .home-about__media {
        margin-inline: auto;
        margin-top: 0;
    }
    .home-services__grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 560px;
        margin-inline: auto;
    }
    .home-team__card {
        flex: 0 0 calc((100% - 20px) / 2);
    }
    .home-clients__card {
        padding: 48px 96px;
    }
    .home-clients__arrow--prev { inset-inline-start: 24px; }
    .home-clients__arrow--next { inset-inline-end: 24px; }
}

@media (max-width: 700px) {
    .home-hero {
        min-height: 640px;
    }
    .home-hero__inner {
        padding-top: 168px;
        padding-bottom: 112px;
        gap: 20px;
    }
    .home-hero__title,
    html[dir="rtl"] .home-hero__title {
        font-size: 34px;
        line-height: 46px;
    }
    .home-hero__desc {
        font-size: 17px;
        line-height: 27px;
    }
    .home-about__lead {
        font-size: 17px;
        line-height: 28px;
    }
    .home-about__heading {
        font-size: 26px;
        line-height: 38px;
    }
    .home-stats {
        gap: 20px 24px;
    }
    .home-stats__item strong {
        font-size: 32px;
        line-height: 44px;
    }
    .home-stats__item span {
        font-size: 18px;
        line-height: 28px;
    }
    .home-services__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }
    .home-team__lead {
        font-size: 17px;
        line-height: 27px;
        margin-bottom: 40px;
    }
    .home-team__card {
        flex: 0 0 85%;
    }
    .home-team__card h3 {
        font-size: 20px;
        line-height: 30px;
    }
    .home-team__card p {
        font-size: 17px;
        line-height: 26px;
    }
    .home-clients__card {
        margin-top: 40px;
        padding: 32px 20px 88px;
        border-radius: 24px;
    }
    .home-clients__slide {
        gap: 32px;
    }
    .home-clients__quote {
        font-size: 18px;
        line-height: 28px;
    }
    .home-clients__logo {
        width: 96px;
        height: 96px;
    }
    /* الأسهم تنزل تحت المحتوى في الموبايل بدل ما تغطي النص */
    .home-clients__arrow {
        top: auto;
        bottom: 24px;
        transform: none;
    }
    .home-clients__arrow--prev { inset-inline-start: calc(50% - 48px); }
    .home-clients__arrow--next { inset-inline-end: calc(50% - 48px); }
    .home-partners__marquee {
        margin-top: 40px;
    }
}

/* صورة فريق عادية (JPG مش مفرّغة): تملا الصندوق كله */
.home-team__photo--cover img {
    inset: 0;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* زرار إيقاف/تشغيل فيديو الخلفية — في الركن السفلي ناحية نهاية السطر */
.home-hero__video-toggle {
    position: absolute;
    z-index: 2;
    bottom: 32px;
    inset-inline-end: 32px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--white);
    transition: background-color .2s;
}

.home-hero__video-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.home-hero__video-icon--play,
.home-hero__video-toggle.is-paused .home-hero__video-icon--pause {
    display: none;
}

.home-hero__video-toggle.is-paused .home-hero__video-icon--play {
    display: block;
}

@media (max-width: 767px) {
    .home-hero__video-toggle {
        bottom: 20px;
        inset-inline-end: 16px;
    }
}
