:root {
    --primary: #423290;
    --primary-dark: #2e2368;
    --secondary: #9c27b0;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --radius: 1rem;
    --transition: 0.25s ease;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.15);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Almarai', system-ui, -apple-system, sans-serif;
    color: var(--dark);
    background: #fff;
    overflow-x: hidden;
}

[dir="rtl"] body { font-family: 'Almarai', 'Inter', system-ui, sans-serif; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-secondary { border-color: var(--secondary) !important; }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #fff;
    padding: 0.75rem 1.75rem;
    border-radius: 50rem;
    font-weight: 600;
    transition: var(--transition);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(66, 50, 144, 0.35);
    color: #fff;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 50rem;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

/* Navbar */
.navbar-brand { font-weight: 800; font-size: 1.5rem; }
.navbar-brand span { color: var(--primary); }

.main-nav {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
    padding: 1rem 0;
}
.main-nav.scrolled { padding: 0.5rem 0; box-shadow: var(--shadow); }

.nav-link {
    font-weight: 600;
    color: var(--dark) !important;
    margin: 0 0.5rem;
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Hero */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(135deg, #f3f0ff 0%, #ffffff 60%, #fdf0ff 100%);
}
.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    z-index: -1;
}
.hero-shape-1 { width: 500px; height: 500px; background: #ddd6fe; top: -100px; right: -100px; }
.hero-shape-2 { width: 350px; height: 350px; background: #f5d0fe; bottom: -80px; left: -80px; }
[dir="rtl"] .hero-shape-1 { right: auto; left: -100px; }
[dir="rtl"] .hero-shape-2 { left: auto; right: -80px; }

.hero-title { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.hero-subtitle { font-size: 1.15rem; color: var(--gray); max-width: 540px; }

/* Sections */
.section { padding: 5rem 0; position: relative; }
.section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    margin-top: 0.75rem;
}
[dir="rtl"] .section-title::after { margin-right: auto; }
[dir="ltr"] .section-title::after { margin-left: auto; }
.section-subtitle { color: var(--gray); max-width: 600px; }

/* Cards */
.feature-card, .service-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
    height: 100%;
}
.feature-card:hover, .service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.icon-box {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin-bottom: 1.25rem;
}

/* Stats */
.stat-item { text-align: center; padding: 1.5rem; }
.stat-number { font-size: 2.6rem; font-weight: 800; color: inherit; }
.stat-label { font-weight: 600; opacity: .9; color: inherit; }

/* Portfolio / Clients */
.client-logo {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition);
    max-height: 50px;
    object-fit: contain;
}
.client-logo:hover { filter: grayscale(0); opacity: 1; }

/* Testimonials */
.testimonial-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.05);
}

/* Contact */
.contact-form .form-control {
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
}
.contact-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(66, 50, 144, 0.1);
}

/* Footer */
.footer {
    background: var(--dark);
    color: #cbd5e1;
    padding: 4rem 0 1.5rem;
}
.footer a { color: #94a3b8; }
.footer a:hover { color: #fff; }
.footer-brand { font-size: 1.5rem; font-weight: 800; color: #fff; }
.social-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    color: #fff;
    margin: 0 0.25rem;
    transition: var(--transition);
}
.social-icon:hover { background: var(--primary); color: #fff; transform: translateY(-3px); }

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}
[dir="rtl"] .back-to-top { right: auto; left: 1.5rem; }
.back-to-top.visible { opacity: 1; visibility: visible; }

/* Utilities */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.bg-soft { background: #f8fafc; }

/* Animations */
[data-aos] { transition: opacity 0.6s ease, transform 0.6s ease; }
[data-aos="fade-up"] { opacity: 0; transform: translateY(30px); }
[data-aos="fade-up"].aos-animate { opacity: 1; transform: translateY(0); }

/* Mobile */
@media (max-width: 991.98px) {
    .hero { min-height: auto; padding-top: 6rem; padding-bottom: 3rem; text-align: center; }
    .hero-subtitle { margin: 0 auto; }
    .hero-shape { opacity: 0.3; }
    .section { padding: 3rem 0; }
    .navbar-collapse {
        background: #fff;
        padding: 1rem;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        margin-top: 0.75rem;
    }
}
