:root {
    --bg-color: #000000;
    --text-primary: #EDEDED;
    --text-secondary: #A1A1A1;
    --accent-color: #3B82F6;
    /* Blue-500 */
    --accent-glow: rgba(59, 130, 246, 0.15);
    --border-color: #333333;
    --card-bg: #0A0A0A;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-speed: 0.3s;
}

[dir="rtl"] {
    --font-main: 'Inter', 'Noto Naskh Arabic', sans-serif;
    /* Fallback for Arabic if needed, keeping Inter for numbers/latin */
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: direction 0.3s ease;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, #999);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-speed);
}

.nav-menu a:hover {
    color: var(--text-primary);
}

.lang-selector {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition-speed);
}

.lang-btn:hover,
.lang-btn.active {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background-color: #1a1a1a;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 70px;
    /* Offset for fixed header */
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #fff 0%, #666 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

.primary-btn {
    display: inline-block;
    background-color: var(--text-primary);
    color: var(--bg-color);
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: transform var(--transition-speed), opacity var(--transition-speed);
}

.primary-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Services (Bento Grid) */
.services {
    padding: 100px 0;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, minmax(200px, auto));
    gap: 20px;
}

.bento-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 12px;
    transition: border-color var(--transition-speed);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bento-card:hover {
    border-color: var(--accent-color);
}

.bento-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.bento-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Bento grid precise layout */
.bento-card.individual {
    grid-column: span 1;
}

.bento-card.education {
    grid-column: span 1;
}

.bento-card.enterprise {
    grid-column: span 1;
    grid-row: span 2;
}

.bento-card.legal {
    grid-column: span 2;
}

/* Agentic Flow */
.agentic-flow {
    padding: 100px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
}

.agentic-flow h2 {
    margin-bottom: 60px;
    font-size: 2rem;
}

.flow-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.flow-step {
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    width: 150px;
    background: var(--card-bg);
}

.step-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--accent-color);
    display: flex;
    justify-content: center;
}

.step-icon svg {
    stroke: var(--accent-color);
}

.icon-wrapper {
    margin-bottom: 15px;
}

.service-icon {
    stroke: var(--accent-color);
    width: 32px;
    height: 32px;
}

.flow-step span {
    font-weight: 500;
    color: var(--text-secondary);
}

.flow-arrow {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

/* Contact */
.contact {
    padding: 100px 0;
    text-align: center;
}

.contact h2 {
    font-size: 2rem;
    margin-bottom: 40px;
}

.contact-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-input {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Footer */
.footer-content {
    padding: 40px 20px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.social-links a {
    color: var(--text-secondary);
    margin-left: 20px;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--text-primary);
}

/* Responsive & RTL Adjustments */
@media (max-width: 768px) {
    .header-content .nav-menu {
        display: none;
        /* Simplify for mobile for now */
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .bento-card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .flow-visual {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }
}

/* RTL Specific Overrides */
[dir="rtl"] .flow-arrow {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    [dir="rtl"] .flow-arrow {
        transform: rotate(90deg);
        /* Downwards in mobile doesn't need mirror usually, but arrow symbol might */
    }
}

[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
}

[dir="rtl"] .social-links a {
    margin-left: 0;
    margin-right: 20px;
}