:root {
    /* Luxury Tech Palette */
    --h-color: #0f172a;
    --b-color: #475569;
    --acc-color: #00b4ff;
    --acc-grad: linear-gradient(135deg, #00b4ff, #00d2ff);
    --bg-pri: #ffffff;
    --bg-sec: #f8fbff;
    --border: #f1f5f9;

    /* Typography */
    --font-h: 'Montserrat', sans-serif;
    --font-b: 'Inter', sans-serif;

    /* Shadows */
    --sh-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --sh-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --sh-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --sh-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --acc-glow: 0 0 20px rgba(0, 180, 255, 0.2);

    /* Sizing */
    --nav-h: 78px;
    --radius: 12px;
    --trans: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-pri);
    color: var(--b-color);
    font-family: var(--font-b);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-h);
    color: var(--h-color);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Arabic headings */
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3,
[lang="ar"] h4, [lang="ar"] h5, [lang="ar"] h6 {
    font-family: 'Noto Kufi Arabic', sans-serif !important;
    letter-spacing: 0;
}

.cyan-grad-text {
    background: var(--acc-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-luxury {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 2rem;
    font-weight: 700;
    border-radius: 50px;
    transition: var(--trans);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-h);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.btn-pri {
    background: var(--acc-grad);
    color: #fff;
    box-shadow: var(--sh-md);
}
.btn-pri:hover { transform: translateY(-3px); box-shadow: var(--sh-xl); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--h-color);
}
.btn-outline:hover { border-color: var(--acc-color); color: var(--acc-color); }

.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 5%;
}

/* ── Tightened section padding (reduced vertical spacing between blocks) ── */
/* !important used to override existing inline paddings on legacy pages */
/* Vertical-only — DON'T set horizontal so `.sec-pad.container`
   keeps its `.container` horizontal padding instead of getting wiped. */
.sec-pad { padding-top: 2.25rem !important; padding-bottom: 2.25rem !important; }

/* ── Sub-hero (interior page top heroes) ── */
.sub-hero-luxury { padding: 4.5rem 0 1.75rem !important; }

/* ── Uniform detail-page hero (services/solutions/it-services/news) ──
   Small image on the side, title on the opposite side. Layout reverses
   automatically in RTL because flex default respects writing direction. */
.page-hero {
    background: linear-gradient(180deg, #f5fafd 0%, #ffffff 100%) !important;
    text-align: left;
}
.page-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    max-width: 1080px;
    margin: 0 auto;
}
.page-hero-img {
    flex: 0 0 auto;
    width: 200px;
    max-width: 30%;
    height: auto;
    object-fit: contain;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

/* Normalize ALL interior-page hero titles: no italic, smaller, site font */
.sub-hero-luxury .sub-hero-h1,
.sub-hero-luxury h1,
.page-hero-title {
    flex: 1 1 auto;
    font-size: 2rem !important;
    font-weight: 800 !important;
    font-style: normal !important;
    font-family: var(--font-h) !important;
    color: var(--h-color) !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}
.sub-hero-luxury .cyan-grad-text,
.page-hero-title .cyan-grad-text {
    font-style: normal !important;
    font-family: inherit !important;
}

[dir="rtl"] .page-hero { text-align: right; }

/* Arabic: use the site Arabic font (Noto Kufi Arabic) for hero titles,
   overriding the var(--font-h) Latin font set above. */
[lang="ar"] .sub-hero-luxury .sub-hero-h1,
[lang="ar"] .sub-hero-luxury h1,
[lang="ar"] .page-hero-title,
[lang="ar"] .sub-hero-luxury .cyan-grad-text,
[lang="ar"] .page-hero-title .cyan-grad-text {
    font-family: 'Noto Kufi Arabic', sans-serif !important;
}

@media (max-width: 768px) {
    .page-hero-inner {
        flex-direction: column-reverse;
        text-align: center;
        gap: 1.25rem;
    }
    .page-hero-img { max-width: 180px; width: 180px; }
    .sub-hero-luxury .sub-hero-h1,
    .sub-hero-luxury h1,
    .page-hero-title { font-size: 1.55rem !important; text-align: center; }
}

/* ────────────────────────────────────────────────────────────
   IT Services — creative card pattern (used on homepage + /services)
   ──────────────────────────────────────────────────────────── */
.it-services-creative-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    max-width: 1200px;
    margin: 0 auto;
}

.it-card-creative {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 2.5rem 2rem 1.75rem;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.175,0.885,0.32,1.275),
                box-shadow 0.5s ease,
                border-color 0.4s ease;
    border: 1px solid rgba(15,23,42,0.06);
    box-shadow: 0 8px 24px rgba(15,23,42,0.04);
    display: flex;
    flex-direction: column;
    min-height: 360px;
    isolation: isolate;
}

/* animated top gradient bar */
.it-card-creative::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #046bd2 0%, #00b4ff 100%);
    transform: scaleX(0.25);
    transform-origin: left;
    transition: transform 0.55s ease;
}
[dir="rtl"] .it-card-creative::before { transform-origin: right; }
.it-card-creative:hover::before { transform: scaleX(1); }

/* radial glow corner */
.it-card-creative::after {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(0,180,255,0.18) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}
[dir="rtl"] .it-card-creative::after { right: auto; left: -120px; }
.it-card-creative:hover::after { opacity: 1; }

.it-card-creative:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(4,107,210,0.15);
    border-color: rgba(4,107,210,0.18);
}

/* big translucent gradient number in the corner */
.it-card-creative .it-card-num {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, rgba(4,107,210,0.13) 0%, rgba(0,180,255,0.05) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    pointer-events: none;
    font-family: var(--font-h);
    letter-spacing: -0.04em;
}
[dir="rtl"] .it-card-creative .it-card-num { right: auto; left: 1.5rem; }

/* icon framed in a soft tinted square */
.it-card-creative .it-card-icon {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 12px 24px rgba(4,107,210,0.10), inset 0 1px 0 rgba(255,255,255,0.9);
    transition: transform 0.4s ease;
}
.it-card-creative:hover .it-card-icon { transform: rotate(-6deg) scale(1.05); }
.it-card-creative .it-card-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.it-card-creative h4 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 0.65rem;
    color: var(--h-color);
    line-height: 1.3;
}

.it-card-creative p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--b-color);
    flex-grow: 1;
    margin: 0 0 1.5rem;
    opacity: 0.85;
}

.it-card-creative .it-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--acc-color);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: gap 0.3s ease;
}
.it-card-creative .it-card-cta svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}
.it-card-creative:hover .it-card-cta { gap: 0.85rem; }
.it-card-creative:hover .it-card-cta svg { transform: translateX(4px); }
[dir="rtl"] .it-card-creative .it-card-cta svg { transform: rotate(180deg); }
[dir="rtl"] .it-card-creative:hover .it-card-cta svg { transform: rotate(180deg) translateX(4px); }

/* Responsive layout */
@media (max-width: 1024px) {
    .it-services-creative-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
    .it-services-creative-grid > .it-card-creative:last-child {
        grid-column: 1 / -1;
        max-width: 520px;
        margin: 0 auto;
        width: 100%;
    }
    .it-card-creative .it-card-num { font-size: 4rem; }
}
@media (max-width: 700px) {
    .it-services-creative-grid { grid-template-columns: 1fr; gap: 1rem; }
    .it-services-creative-grid > .it-card-creative:last-child { max-width: none; }
    .it-card-creative { padding: 2rem 1.5rem 1.5rem; min-height: auto; }
    .it-card-creative .it-card-num { font-size: 3.4rem; top: 0.85rem; right: 1.1rem; }
    [dir="rtl"] .it-card-creative .it-card-num { left: 1.1rem; }
    .it-card-creative .it-card-icon { width: 72px; height: 72px; border-radius: 16px; }
    .it-card-creative .it-card-icon img { width: 44px; height: 44px; }
    .it-card-creative h4 { font-size: 1.1rem; }
    .it-card-creative p { font-size: 0.9rem; }
}

/* ── Global responsive helpers ── */
.classic-heading { line-height: 1.15; }

/* ── Smart news grid (responsive) ──
   Behavior:
     1 card  → spans the full row
     2 cards → split 50 / 50
     3 cards → three equal columns
     4+ cards → 3 columns, extras wrap; leftover items in the last row are
                 centered so the row stays visually balanced
   Breakpoints:
     ≤1024px (tablet)  → max 2 per row
     ≤700px  (mobile)  → single column, max-width 520px, centered with side gap */
.smart-news-grid {
    display: grid;
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.smart-news-grid--cols-1 { grid-template-columns: minmax(0, 1fr); }
.smart-news-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.smart-news-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 4+ articles use flexbox so the trailing row is automatically centered */
.smart-news-grid--cols-many {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.smart-news-grid--cols-many > article {
    flex: 0 1 calc((100% - 2 * 2.5rem) / 3);
    max-width: calc((100% - 2 * 2.5rem) / 3);
}

/* Tablet: 1 article per row, centered, with comfortable side gap */
@media (max-width: 1024px) {
    .smart-news-grid {
        gap: 2rem;
        max-width: 640px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .smart-news-grid--cols-1,
    .smart-news-grid--cols-2,
    .smart-news-grid--cols-3 {
        grid-template-columns: minmax(0, 1fr);
    }
    .smart-news-grid--cols-many > article {
        flex: 0 1 100%;
        max-width: 100%;
    }
}

/* Mobile: single column, narrower max-width, lighter padding */
@media (max-width: 700px) {
    .smart-news-grid {
        gap: 1.5rem;
        max-width: 520px;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ── Subheading tagline — bumped to a larger, easier-to-read size ──
   Applies to the small uppercase tagline above section headings
   (e.g. "TECHNOLOGY STACK", "DISCOVER", "INSIGHTS"). */
.hero-tagline {
    font-size: 1rem !important;
    letter-spacing: 0.2rem !important;
}
@media (max-width: 1024px) {
    .hero-tagline { font-size: 0.95rem !important; }
}
@media (max-width: 768px) {
    .hero-tagline { font-size: 0.88rem !important; letter-spacing: 0.18em !important; }
}

/* ── RTL select alignment fix for tablet/mobile ──
   Native select elements default to LTR alignment on some mobile
   browsers; force right-alignment for Arabic. */
[dir="rtl"] select,
[lang="ar"] select {
    text-align: right;
    text-align-last: right;
    direction: rtl;
}
[dir="rtl"] select option,
[lang="ar"] select option {
    direction: rtl;
    text-align: right;
}
@media (max-width: 1024px) {
    [dir="rtl"] .consultation-box select,
    [lang="ar"] .consultation-box select {
        text-align: right !important;
        text-align-last: right !important;
        padding-right: 1rem !important;
        padding-left: 2.4rem !important;
    }
}

/* ── Tablet (iPad Air, iPad Pro 11" portrait, etc.) ──
   Stops the side-by-side content+form layout from being cramped
   between roughly 769px and 1024px. */
@media (max-width: 1024px) {
    /* Comfortable side gap on tablets. Default .container uses
       `padding: 0 5%` which at 1024px = ~51px — fine on the upper end
       but drops with viewport. Set a stable minimum so cards/content
       never feel glued to the edges. */
    .container { padding-left: 2.5rem !important; padding-right: 2.5rem !important; }

    /* Service / Solution / IT-services detail pages.
       Inline styles use flex: 1 1 500px and flex: 0 0 min(100%, 480px),
       so we override with !important. */
    .content-form-wrap > div:first-child {
        flex: 1 1 100% !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }
    .content-form-wrap > div:last-child {
        flex: 1 1 100% !important;
        position: static !important;
        width: 100% !important;
    }
    .content-form-wrap .consultation-box {
        max-width: 560px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Careers detail two-column → single column on tablet */
    .careers-detail-grid {
        grid-template-columns: 1fr !important;
    }
    .careers-detail-grid aside {
        position: static !important;
        max-width: 560px;
        margin: 0 auto;
        width: 100%;
    }

    /* Tighten hero spacing & sizing for tablets */
    .sub-hero-luxury { padding: 5rem 0 2rem !important; }
    .sub-hero-luxury .sub-hero-h1,
    .sub-hero-luxury h1,
    .page-hero-title { font-size: 1.75rem !important; }
    .page-hero-img { width: 170px !important; max-width: 28% !important; }

    /* Section headings slightly smaller */
    h2.classic-heading { font-size: 2.1rem !important; }

    /* Homepage hero — shrink the huge desktop type and stack the 2-col grid */
    .premium-hero { padding: 4rem 0 3rem !important; min-height: auto !important; }
    .hero-grid { grid-template-columns: 1fr !important; gap: 2.5rem !important; text-align: center; }
    [dir="rtl"] .hero-grid { grid-template-columns: 1fr !important; }
    .hero-h1 { font-size: 3rem !important; }
    .hero-p { font-size: 1.05rem !important; }
    .hero-visual { max-width: 360px; margin: 0 auto; }

    /* Homepage stats: 4 cols → 2 cols on tablet */
    .modern-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 2rem !important;
    }

    /* Homepage bento grid: 3 cols → 2 cols on tablet */
    .bento-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1.75rem !important; }
    .bento-card { padding: 2.25rem 1.75rem !important; }

    /* Luxury-grid (vacancies, service cards with wide content) →
       drop to one column on tablet so cards have room to breathe. */
    .luxury-grid {
        grid-template-columns: 1fr !important;
        gap: 1.75rem !important;
        max-width: 720px;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    /* Inline card titles that go too big on tablet */
    .bento-card h3,
    .luxury-grid h3 { font-size: 1.5rem !important; line-height: 1.3 !important; }
}

/* ── Mobile global ── */
@media (max-width: 768px) {
    .sec-pad { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .sub-hero-luxury { padding: 4.5rem 0 2rem !important; }
    .sub-hero-luxury p { font-size: 0.95rem !important; line-height: 1.7 !important; }
    .sub-hero-luxury .hero-tagline { font-size: 0.7rem !important; letter-spacing: 0.2em !important; margin-bottom: 0.85rem !important; }

    h2.classic-heading { font-size: 1.75rem !important; }

    /* Hero */
    .premium-hero { padding: 2.5rem 0 4rem !important; min-height: auto !important; }
    .hero-grid { grid-template-columns: 1fr !important; gap: 2rem !important; text-align: center; }
    .hero-h1 { font-size: 2.1rem !important; }
    .hero-p { font-size: 0.95rem !important; }
    .hero-visual { display: none; }

    /* Stats */
    .modern-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
        padding: 1.5rem !important;
        margin-top: -2rem !important;
        border-radius: 16px !important;
    }
    .stat-val { font-size: 1.85rem !important; }
    .stat-label { font-size: 0.72rem !important; letter-spacing: 0.05rem !important; }

    /* Cards: stack to 1 column with comfortable internal padding */
    .bento-grid,
    .luxury-grid { grid-template-columns: 1fr !important; gap: 1.25rem !important; }
    .bento-card { padding: 1.75rem 1.25rem !important; border-radius: 16px !important; }

    /* Tighter tagline + paragraphs across sections */
    .hero-tagline { font-size: 0.7rem !important; letter-spacing: 0.18em !important; }

    /* Client showcase — vertical-only, preserves container horizontal padding */
    .client-showcase { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .client-title { font-size: 1.6rem !important; }
    .logo-marquee { gap: 2rem !important; }

    /* Comfortable side gap so cards never touch viewport edges */
    .container { padding-left: 2rem !important; padding-right: 2rem !important; }

    /* Buttons sized down */
    .btn-luxury { padding: 0.85rem 1.6rem; font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .sub-hero-luxury { padding: 3.75rem 0 1.75rem !important; }
    .sub-hero-luxury .sub-hero-h1,
    .sub-hero-luxury h1,
    .page-hero-title { font-size: 1.4rem !important; }
    .hero-h1 { font-size: 1.85rem !important; }
    .modern-stats { gap: 0.75rem !important; padding: 1.25rem !important; }
    .stat-val { font-size: 1.5rem !important; }
    .bento-card { padding: 1.5rem 1.1rem !important; }
    h2.classic-heading { font-size: 1.55rem !important; }
    .btn-luxury { padding: 0.75rem 1.4rem; font-size: 0.8rem; }
    .container { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
}
