/* =========================================
   1. المتغيرات والألوان (Variables)
   ========================================= */
:root {
    --bg: #F9F6EE; /* Bone White */
    --primary: #781C2E; /* Dark Garnet */
}

/* =========================================
   2. الإعدادات العامة
   ========================================= */
* {
    margin: 0; padding: 0; box-sizing: border-box; cursor: none;
    -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}

html { scroll-behavior: initial; }

body {
    background-color: var(--bg);
    color: var(--primary);
    font-family: 'Manrope', sans-serif;
    overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Syne', sans-serif; font-style: normal; }

img { -webkit-user-drag: none; pointer-events: none; }

/* =========================================
   3. الماوس السحري (X-Ray Mode)
   ========================================= */
.cursor {
    width: 20px; height: 20px; background-color: #fff; mix-blend-mode: difference; 
    border-radius: 50%; position: fixed; pointer-events: none; z-index: 99999; 
    transform: translate(-50%, -50%); transition: width 0.3s, height 0.3s, border-radius 0.3s;
}

/* =========================================
   4. الشعار الجانبي
   ========================================= */
.fixed-sidebar-logo {
    position: fixed; left: 2rem; top: 50%; transform: translateY(-50%) rotate(-90deg); 
    transform-origin: left center; z-index: 90; pointer-events: none;
}
.fixed-sidebar-logo span {
    font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.8rem; letter-spacing: 3px; 
    color: var(--primary); opacity: 0.6; white-space: nowrap; display: inline-block; pointer-events: auto;
}

/* =========================================
   5. شاشة التحميل والقائمة العلوية
   ========================================= */
.preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: var(--bg); z-index: 100000; display: flex; justify-content: center; align-items: center; }
.preloader-logo { width: 100px; height: auto; animation: pulse 1.5s infinite alternate ease-in-out; }
@keyframes pulse { 0% { transform: scale(0.95); opacity: 0.7; } 100% { transform: scale(1.05); opacity: 1; } }

.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 2rem 4rem 2rem 5rem; 
    position: fixed; 
    width: 100%; 
    top: 0; 
    z-index: 100; 
    background: transparent; /* هيدر شفاف بالكامل */
}
.logo-img { height: 40px; width: auto; pointer-events: auto; }
.nav-links { display: flex; gap: 2.5rem; pointer-events: auto; align-items: center;}

/* إضافة تأثير نعومة عند انقلاب لون نصوص الهيدر */
.nav-links a { 
    color: var(--primary); 
    text-decoration: none; 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    font-weight: 600; 
    transition: color 0.4s ease; 
}

/* الكلاس الجديد الذي سيتم إضافته بالجافاسكربت لقلب الألوان للبيج */
.navbar.nav-dark-bg .nav-links a {
    color: var(--bg);
}

/* =========================================
   6. الواجهة الرئيسية
   ========================================= */
.hero { height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 0 4rem 0 7rem; position: relative; overflow: hidden; }
.hero-bg-interactive { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; }
.hero-content { position: relative; z-index: 1; pointer-events: none; }
.hero-title { font-size: 8vw; line-height: 0.95; font-weight: 800; text-transform: uppercase; color: var(--primary); }
.hero-subtitle { margin-top: 2.5rem; font-size: 1.4rem; opacity: 0; max-width: 650px; line-height: 1.5; font-weight: 500; color: var(--primary); }
.line { display: block; overflow: hidden; padding-top: 10px; }
.line span { display: block; transform: translateY(150%) rotate(8deg); opacity: 0; transform-origin: left top; }

/* =========================================
   7. الشريط المتحرك وقسم الخبرات
   ========================================= */
.marquee-container { padding: 3rem 0; background: var(--primary); color: var(--bg); overflow: hidden; white-space: nowrap; position: relative; z-index: 2;}
.marquee-content { display: inline-block; font-size: 2.5rem; font-family: 'Syne', sans-serif; font-weight: 800; animation: marqueeAnim 22s linear infinite; }
@keyframes marqueeAnim { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.expertise { padding: 10rem 4rem; }
.section-title { font-size: 4vw; margin-bottom: 4rem; text-transform: uppercase; font-weight: 800; }
.expertise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4rem; border-top: 1px solid rgba(120, 28, 46, 0.15); padding-top: 4rem; }
.expertise-item h3 { font-size: 1.6rem; margin-bottom: 1.2rem; }

/* =========================================
   8. القسم السينمائي العمودي (تأثير الفيديو والطبقات)
   ========================================= */
.cinematic-vertical { 
    background-color: var(--primary); 
    position: relative;
    padding-bottom: 5vh; 
}

.cinematic-header {
    padding: 5rem 4rem 0 7rem;
    position: sticky; 
    top: 0;
    z-index: 10;
    pointer-events: none; 
}

.vertical-stack {
    position: relative;
    width: 100%;
}

.stack-panel {
    position: sticky; 
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--primary);
    transform-origin: center top;
}

.stack-panel .img-container { 
    width: 65vw; 
    height: 60vh; 
    overflow: hidden; 
    border-radius: 12px; 
    pointer-events: auto; 
    box-shadow: 0 -20px 50px rgba(0,0,0,0.3); 
    margin-bottom: 1.5rem;
}

.stack-panel .project-img { 
    width: 100%; 
    height: 125%; 
    object-fit: cover; 
    transition: filter 0.6s ease; 
}

.stack-panel .img-container:hover .project-img { 
    filter: brightness(0.85); 
}

.stack-panel .project-info { 
    width: 65vw;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid rgba(249, 246, 238, 0.2); 
    padding-bottom: 1rem; 
}

.stack-panel .project-title { font-size: 3rem; color: var(--bg); }
.stack-panel .project-category { font-size: 1.2rem; opacity: 0.8; color: var(--bg); }

/* =========================================
   9. الفوتر
   ========================================= */
.footer { background-color: var(--primary); color: var(--bg); padding: 10rem 4rem 2rem 4rem; display: flex; flex-direction: column; justify-content: space-between; min-height: 85vh; position: relative; overflow: hidden; }
.footer-bg-logo { position: absolute; right: -5%; bottom: -10%; width: 60vw; opacity: 0.04; pointer-events: none; z-index: 0; }
.footer-content { position: relative; z-index: 1; }
.footer-title { font-size: 11vw; line-height: 0.9; text-transform: uppercase; font-weight: 800; }
.footer-email { display: inline-block; font-size: 3.5rem; color: var(--bg); text-decoration: none; margin-top: 2rem; border-bottom: 2px solid var(--bg); pointer-events: auto; }
.footer-bottom { position: relative; z-index: 1; margin-top: 8rem; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(249, 246, 238, 0.15); padding-top: 2rem; opacity: 0.8; }
.social-links { display: flex; gap: 2.5rem; }
.social-links a { color: var(--bg); text-decoration: none; pointer-events: auto; }

/* =========================================
/* =========================================
   10. التجاوب مع الأجهزة (Responsive)
   ========================================= */
@media (max-width: 1024px) { 
    .navbar { padding: 1.5rem 2rem; } 
    .hero { padding: 0 2rem; } 
    .cinematic-header { padding: 5rem 4rem; } 
    .fixed-sidebar-logo { display: none; } 
}

@media (max-width: 768px) {
    /* تصغير الخط أكثر ليحتوي الكلمات الطويلة 100% داخل الشاشة */
    .hero-title { font-size: 8.5vw; } 
    .hero-subtitle { font-size: 1rem; padding-right: 1rem; }
    
    .expertise-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    
    .cinematic-header { padding: 5rem 2rem; }
    .stack-panel .img-container { width: 90vw; height: 50vh; }
    .stack-panel .project-info { width: 90vw; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .stack-panel .project-title { font-size: 2rem; }
    
    /* تصغير الخط في الفوتر أكثر */
    .footer-title { font-size: 10vw; } 
    .footer-email { font-size: 1.3rem; word-break: break-word; } 
    .footer-bottom { flex-direction: column; text-align: center; gap: 1.5rem; }
    
    /* إخفاء الماوس المخصص فقط في الجوال، وإرجاع الكانفاس للعمل! */
    .cursor { display: none; } 
    /* شلنا .hero-bg-interactive من هنا عشان تطلع الخيوط في الجوال */
}