/* ==========================================================================
   1. المتغيرات والهوية البصرية (CSS Variables - Dark & Light Modes)
   ========================================================================== */
:root,
[data-theme="dark"] {
    --bg-main: #09090b;
    --bg-card: #121217;
    --bg-card-hover: #18181f;
    --bg-glass: rgba(9, 9, 11, 0.78);
    
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-glow: #a855f7;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(139, 92, 246, 0.45);
    
    --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 35px -5px rgba(139, 92, 246, 0.3);
}

[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-glass: rgba(248, 250, 252, 0.85);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --accent-primary: #4f46e5;
    --accent-secondary: #7c3aed;
    --accent-glow: #9333ea;
    
    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(99, 102, 241, 0.45);
    
    --shadow-card: 0 15px 35px -10px rgba(15, 23, 42, 0.07);
    --shadow-glow: 0 0 30px -5px rgba(99, 102, 241, 0.2);
}

:root {
    --font-heading: 'Changa', sans-serif;
    --font-body: 'Alexandria', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-bento: 22px;
    --radius-btn: 14px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. الإعدادات الأساسية (Base & Reset)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   3. شريط التنقل العلوي الثابت (Sticky Navbar)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 76px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    transition: var(--transition-smooth);
}

.nav-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    position: relative;
    padding: 0.3rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-glow));
    border-radius: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.icon-btn:hover {
    border-color: var(--border-hover);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.mobile-only {
    display: none;
}

/* ==========================================================================
   4. قسم الواجهة الرئيسية (Hero Section)
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    padding: 130px 0 70px;
    display: flex;
    align-items: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 3.5rem;
    align-items: center;
}

/* يمين الشاشة في RTL: كارت الصورة (Bento Avatar) */
.hero-visual {
    display: flex;
    justify-content: center;
}

.avatar-bento {
    position: relative;
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1 / 1.06;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-bento);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.avatar-bento:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.glow-backdrop {
    position: absolute;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    opacity: 0.22;
    filter: blur(35px);
    z-index: 0;
}

.profile-img {
    width: 82%;
    height: 82%;
    object-fit: cover;
    border-radius: 16px;
    z-index: 1;
    border: 1px solid var(--border-subtle);
    transition: var(--transition-smooth);
}

.status-pill {
    position: absolute;
    bottom: 18px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    padding: 0.45rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* يسار الشاشة في RTL: النصوص والعبارة المتحركة */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.greeting-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 50px;
    color: var(--accent-primary);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.2rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 4.5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* صندوق جملة I'm الإنجليزية (LTR) */
.typewriter-box {
    font-family: var(--font-mono);
    font-size: clamp(1.05rem, 2.1vw, 1.45rem);
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 0.8rem 1.35rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 58px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    flex-wrap: wrap;
}

.static-prefix {
    color: var(--text-secondary);
}

.dynamic-text {
    color: var(--accent-secondary);
    font-weight: 700;
}

.typing-cursor {
    color: var(--accent-glow);
    font-weight: 700;
    animation: blink 0.85s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-bio {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 550px;
    margin-bottom: 2.2rem;
}

.hero-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-btn);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 22px -6px rgba(99, 102, 241, 0.55);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -6px rgba(139, 92, 246, 0.7);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* ==========================================================================
   5. التجاوب مع الشاشات والموبايل (Responsive Design)
   ========================================================================== */
@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .hero-content {
        align-items: center;
    }

    .avatar-bento {
        max-width: 310px;
    }

    .hero-cta {
        justify-content: center;
    }

    .mobile-only {
        display: flex;
    }

    .nav-Menu {
        position: fixed;
        top: 76px;
        right: 0;
        left: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-subtle);
        padding: 1.5rem;
        transform: translateY(-150%);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition-smooth);
        box-shadow: var(--shadow-card);
    }

    .nav-Menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links {
        flex-direction: column;
        gap: 1.25rem;
    }
}
