/* =========================================
   1. RESET & VARIABLES (ULTRA-PREMIUM ARABIC SUPPORT)
   ========================================= */
:root {
    --color-primary: #0F2820;
    --color-accent: #D4AF37;
    /* More metallic gold */
    --color-dark: #0A1A15;
    --color-text: #2C2C2C;
    --color-text-light: #666;
    --color-body-bg: #FFFFFF;

    --container-xl: 1400px;
    --header-height: 100px;

    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Cairo', sans-serif;

    --transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-body-bg);
    line-height: 1.8;
    overflow-x: hidden;
    direction: rtl;
    /* Enforce RTL globally */
    text-align: right;
}

/* Typography Hierarchy */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.3;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

h2 {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 30px;
}

h3 {
    font-size: 1.8rem;
    font-weight: 600;
}

p {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 30px;
    font-weight: 400;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Utilities */
.container {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 20px;
    /* Reduced padding for mobile */
    width: 100%;
}

@media (min-width: 768px) {
    .container {
        padding: 0 40px;
    }
}

.section {
    padding: 80px 0;
    position: relative;
}

/* Reduced from 140px for mobile */
@media (min-width: 992px) {
    .section {
        padding: 120px 0;
    }
}

.text-center {
    text-align: center;
}

/* Useful override */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    border-radius: 4px;
    /* Slight rounded for touch targets */
}

@media (min-width: 992px) {
    .btn {
        padding: 18px 45px;
        border-radius: 0;
    }
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3);
}

.btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.btn-outline:hover {
    background: #fff;
    color: var(--color-primary);
}

.text-gold {
    color: var(--color-accent) !important;
}

.bg-light {
    background-color: #F8F6F4;
}

.bg-dark {
    background-color: var(--color-primary);
    color: #fff;
}

/* =========================================
   3. NAVIGATION
   ========================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: var(--transition);
    background: transparent;
    /* Changed via JS/PHP based on page */
}

@media (min-width: 992px) {
    header {
        height: var(--header-height);
    }
}

header.scrolled {
    background: #fff;
    height: 80px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.05);
}

.nav-links {
    display: none;
    gap: 30px;
}

/* Hidden mobile default */
@media (min-width: 992px) {
    .nav-links {
        display: flex;
    }
}

.nav-links a {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.3s;
    right: 0;
    /* RTL origin */
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: block;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    margin-right: auto;
}

/* align left in RTL */
@media (min-width: 992px) {
    .mobile-menu-btn {
        display: none;
    }
}

header.scrolled .mobile-menu-btn {
    color: var(--color-primary);
}

/* Mobile Menu Active State */
.nav-links.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--color-primary);
    justify-content: center;
    align-items: center;
    z-index: 998;
    padding: 20px;
}

.nav-links.active a {
    color: #fff !important;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* =========================================
   4. COMPONENTS
   ========================================= */
/* Hero */
.hero-section {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    text-align: center;
    /* Center align hero text usually looks best */
    padding-top: 60px;
    /* Offset for mobile header */
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
        gap: 80px;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
}

/* Cards */
.project-card {
    position: relative;
    overflow: hidden;
    height: 400px;
    display: block;
}

@media (min-width: 992px) {
    .project-card {
        height: 500px;
    }
}

.project-card img {
    height: 100%;
    transition: transform 0.8s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(15, 40, 32, 0.95), rgba(15, 40, 32, 0.4));
    backdrop-filter: blur(5px);
    color: #fff;
    text-align: right;
    z-index: 2;
    transform: translateY(10px);
    transition: transform 0.6s ease;
}

.project-card:hover .project-info {
    transform: translateY(0);
}

/* Stat Box */
.stat-box {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 992px) {
    .stat-box {
        border-bottom: none;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        padding: 40px;
    }

    /* L TR border logic switch */
    .stat-box:last-child {
        border-left: none;
    }
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}