/* ============================================================
   1.  متغيرات CSS (الثيمات)
   ============================================================ */
:root {
    /* الخطوط */
    --font-en: 'Poppins', sans-serif;
    --font-ar: 'Cairo', sans-serif;

    /* الثيم الداكن (الافتراضي) */
    --bg-primary: #09090B;
    --bg-secondary: rgba(255, 255, 255, 0.06);
    --bg-card: rgba(255, 255, 255, 0.07);
    --bg-card-hover: rgba(255, 255, 255, 0.12);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.10);
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* لوحة الألوان البرتقالية */
    --accent-1: #F97316;
    --accent-2: #FB923C;
    --accent-3: #F59E0B;

    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(249, 115, 22, 0.15);
    --nav-bg: rgba(9, 9, 11, 0.80);
    --blob-1: rgba(249, 115, 22, 0.20);
    --blob-2: rgba(251, 146, 60, 0.15);
    --blob-3: rgba(245, 158, 11, 0.12);
    --scrollbar-track: #1A1A1E;
    --scrollbar-thumb: #3A3A44;
    --progress-bg: rgba(255, 255, 255, 0.08);
    --progress-fill: linear-gradient(135deg, #F97316, #F59E0B);
    --toggle-bg: #2A2A32;
    --toggle-dot: #F1F5F9;
    --ripple-color: rgba(255, 255, 255, 0.2);
    --backdrop-blur: 20px;
    --radius-card: 20px;
    --radius-btn: 12px;
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* الثيم الفاتح */
[data-theme="light"] {
    --bg-primary: #F8FAFC;
    --bg-secondary: rgba(0, 0, 0, 0.04);
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.90);
    --bg-glass: rgba(255, 255, 255, 0.65);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --accent-1: #EA580C;
    --accent-2: #F97316;
    --accent-3: #D97706;
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 40px rgba(234, 88, 12, 0.12);
    --nav-bg: rgba(248, 250, 252, 0.85);
    --blob-1: rgba(234, 88, 12, 0.12);
    --blob-2: rgba(249, 115, 22, 0.08);
    --blob-3: rgba(217, 119, 6, 0.06);
    --scrollbar-track: #E2E8F0;
    --scrollbar-thumb: #94A3B8;
    --progress-bg: rgba(0, 0, 0, 0.06);
    --progress-fill: linear-gradient(135deg, #EA580C, #D97706);
    --toggle-bg: #CBD5E1;
    --toggle-dot: #0F172A;
    --ripple-color: rgba(0, 0, 0, 0.08);
}

/* ============================================================
   2.  إعادة تعيين القيم الأساسية
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-en);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background var(--transition-smooth), color var(--transition-smooth);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

/* دعم الاتجاه من اليمين لليسار */
[dir="rtl"] body {
    font-family: var(--font-ar), var(--font-en);
    text-align: right;
}

[dir="rtl"] .nav-links a,
[dir="rtl"] .hero-buttons,
[dir="rtl"] .social-grid,
[dir="rtl"] .contact-grid,
[dir="rtl"] .skills-grid {
    direction: rtl;
}

/* ============================================================
   3.  شريط التمرير المخصص
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

/* ============================================================
   4.  شريط التقدم (Scroll Progress)
   ============================================================ */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--progress-fill);
    z-index: 10000;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
    will-change: width;
}

/* ============================================================
   5.  شاشة التحميل
   ============================================================ */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 24px;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--bg-glass);
    border-top-color: var(--accent-1);
    animation: spin 1s linear infinite;
    will-change: transform;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loader-text {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ============================================================
   6.  الخلفيات المتحركة (Blobs)
   ============================================================ */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    transition: transform 0.3s ease;
    will-change: transform;
}
.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--blob-1);
    top: -100px;
    left: -100px;
    animation: floatBlob 12s ease-in-out infinite alternate;
}
.blob-2 {
    width: 350px;
    height: 350px;
    background: var(--blob-2);
    bottom: -50px;
    right: -50px;
    animation: floatBlob 16s ease-in-out infinite alternate-reverse;
}
.blob-3 {
    width: 250px;
    height: 250px;
    background: var(--blob-3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatBlob 20s ease-in-out infinite alternate;
}
@keyframes floatBlob {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, -40px) scale(1.1); }
    66%  { transform: translate(-20px, 30px) scale(0.9); }
    100% { transform: translate(20px, -20px) scale(1.05); }
}

/* ============================================================
   7.  الحاوية الرئيسية
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   8.  شريط التنقل
   ============================================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 16px 0;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(0px);
    background: transparent;
}
header.scrolled {
    background: var(--nav-bg);
    backdrop-filter: blur(var(--backdrop-blur));
    border-bottom: 1px solid var(--border-glass);
    padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 22px;
    font-weight: 700;
    background: var(--progress-fill);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition-smooth);
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--progress-fill);
    transition: width var(--transition-smooth);
    border-radius: 2px;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}
.nav-links a.active::after {
    width: 100%;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ============================================================
   9.  أزرار التحكم (الثيم، اللغة، القائمة)
   ============================================================ */
.theme-toggle {
    width: 48px;
    height: 26px;
    background: var(--toggle-bg);
    border-radius: 13px;
    border: none;
    cursor: pointer;
    position: relative;
    transition: background var(--transition-smooth);
    flex-shrink: 0;
}
.theme-toggle .dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--toggle-dot);
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .theme-toggle .dot {
    left: 25px;
}
.theme-toggle .icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    pointer-events: none;
    opacity: 0.6;
}
.theme-toggle .icon-sun { left: 5px; }
.theme-toggle .icon-moon { right: 5px; }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 1; }

.lang-toggle {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 4px 6px;
    display: flex;
    gap: 4px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(4px);
}
.lang-toggle button {
    background: transparent;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-smooth);
    font-family: var(--font-en);
}
.lang-toggle button.active {
    background: var(--accent-1);
    color: #fff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}
.lang-toggle button:hover:not(.active) {
    color: var(--text-primary);
}

.mobile-toggle {
    display: none;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 20px;
    backdrop-filter: blur(4px);
    transition: all var(--transition-smooth);
}
.mobile-toggle:hover {
    background: var(--bg-card-hover);
}

/* ============================================================
   10. القسم الرئيسي (Hero)
   ============================================================ */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    animation: fadeUp 0.8s ease forwards;
    opacity: 0;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-badge {
    display: inline-block;
    padding: 6px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-1);
    backdrop-filter: blur(4px);
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.hero h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -1px;
}
.hero h1 .highlight {
    background: var(--progress-fill);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.8;
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ============================================================
   11. الأزرار الزجاجية
   ============================================================ */
.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-btn);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}
.btn-glass:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-1);
}
.btn-glass:active {
    transform: scale(0.96);
}

.btn-glass-primary {
    background: var(--progress-fill);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.25);
}
.btn-glass-primary:hover {
    box-shadow: 0 8px 40px rgba(249, 115, 22, 0.35);
    transform: translateY(-2px);
    border-color: transparent;
}

.btn-glass .ripple {
    position: absolute;
    border-radius: 50%;
    background: var(--ripple-color);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out forwards;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* ============================================================
   12. صورة البطل والبطاقات العائمة
   ============================================================ */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeUp 0.8s ease 0.2s forwards;
    opacity: 0;
}
.hero-image .glass-avatar {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 2px solid var(--border-glass);
    backdrop-filter: blur(var(--backdrop-blur));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glass), var(--shadow-glow);
    position: relative;
    transition: all var(--transition-smooth);
    cursor: pointer;
}
.hero-image .glass-avatar:hover {
    transform: scale(1.02);
    border-color: var(--accent-1);
}
.hero-image .glass-avatar .ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent-1);
    border-right-color: var(--accent-2);
    animation: spinRing 6s linear infinite;
}
.hero-image .glass-avatar .ring:nth-child(2) {
    inset: -16px;
    animation-duration: 8s;
    animation-direction: reverse;
    border-top-color: var(--accent-2);
    border-right-color: var(--accent-3);
}
@keyframes spinRing {
    to { transform: rotate(360deg); }
}

.float-card {
    position: absolute;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--backdrop-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 12px 20px;
    box-shadow: var(--shadow-glass);
    animation: floatCard 5s ease-in-out infinite;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    pointer-events: none;
}
.float-card .emoji { font-size: 20px; }
.float-card-1 { top: 10%; right: -10%; animation-delay: 0s; }
.float-card-2 { bottom: 20%; left: -8%; animation-delay: 1.5s; }
.float-card-3 { top: 50%; right: -5%; animation-delay: 3s; }

@keyframes floatCard {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-12px); }
}

/* ============================================================
   13. الأقسام العامة
   ============================================================ */
section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}
.section-header h2 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.section-header h2 .highlight {
    background: var(--progress-fill);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-header p {
    color: var(--text-secondary);
    font-size: 16px;
}
.section-sub {
    display: inline-block;
    padding: 4px 16px;
    background: var(--bg-glass);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-1);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* ============================================================
   14. البطاقات الزجاجية
   ============================================================ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--backdrop-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 32px 28px;
    box-shadow: var(--shadow-glass);
    transition: all var(--transition-smooth);
}
.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glass), var(--shadow-glow);
    border-color: rgba(249, 115, 22, 0.2);
}

/* ============================================================
   15. قسم "عني"
   ============================================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.about-text p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 16px;
    font-size: 15px;
}
.about-text p:last-child { margin-bottom: 0; }

.about-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.timeline-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 20px;
    background: var(--bg-glass);
    border-radius: 16px;
    border-left: 3px solid var(--accent-1);
    transition: all var(--transition-smooth);
}
.timeline-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}
[dir="rtl"] .timeline-item {
    border-left: none;
    border-right: 3px solid var(--accent-1);
}
[dir="rtl"] .timeline-item:hover {
    transform: translateX(-4px);
}
.timeline-item .year {
    font-weight: 700;
    color: var(--accent-1);
    font-size: 14px;
    min-width: 70px;
}
.timeline-item .info h4 {
    font-size: 15px;
    font-weight: 600;
}
.timeline-item .info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================
   16. قسم المهارات
   ============================================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.skill-card {
    text-align: center;
    padding: 32px 24px;
}
.skill-card .skill-icon {
    font-size: 44px;
    margin-bottom: 12px;
    display: inline-block;
}
.skill-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}
.skill-card .skill-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.skill-bar {
    width: 100%;
    height: 6px;
    background: var(--progress-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.skill-bar .fill {
    height: 100%;
    border-radius: 4px;
    background: var(--progress-fill);
    width: 0%;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
}
.skill-card .skill-percent {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-1);
    margin-top: 6px;
}

/* ============================================================
   17. قسم وسائل التواصل (تم التعديل هنا)
   ============================================================ */
.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 أعمدة ثابتة */
    gap: 20px;
}
.social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-smooth);
    position: relative;
    gap: 8px;
}
.social-card .social-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    font-size: 26px;
    transition: all var(--transition-smooth);
}
.social-card:hover .social-icon {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--accent-1);
    box-shadow: var(--shadow-glow);
}
.social-card .social-name {
    font-size: 14px;
    font-weight: 500;
}
.social-card .social-handle {
    font-size: 12px;
    color: var(--text-secondary);
}
.social-card .tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 4px 14px;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid var(--border-glass);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-smooth);
    white-space: nowrap;
}
.social-card:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ============================================================
   18. قسم الألعاب
   ============================================================ */
#games { padding: 120px 0; }
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}
.game-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    border-radius: var(--radius-card);
    text-decoration: none;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.game-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-glass), var(--shadow-glow);
    border-color: var(--accent-1);
}
.game-image {
    width: 100%;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
}
.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}
.game-card:hover .game-image img {
    transform: scale(1.08);
}
.game-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.game-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.game-info p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.game-badge {
    display: inline-block;
    width: fit-content;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-1);
}

/* ============================================================
   19. قسم الاتصال
   ============================================================ */
.contact-section {
    margin-bottom: 60px;
}
.contact-section:last-child { margin-bottom: 0; }
.contact-section-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-radius: var(--radius-card);
    text-align: center;
    transition: all var(--transition-smooth);
}
.contact-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-1);
    box-shadow: var(--shadow-glass), var(--shadow-glow);
}
.social-icon-large {
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.contact-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.contact-link {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-smooth);
}
.contact-link:hover {
    color: var(--accent-1);
}

/* ============================================================
   20. التذييل
   ============================================================ */
footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-glass);
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}
footer .heart {
    color: #ef4444;
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}
footer a {
    color: var(--accent-1);
    text-decoration: none;
}

/* ============================================================
   21. زر العودة للأعلى
   ============================================================ */
#back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--backdrop-blur));
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glass);
}
#back-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#back-top:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-1);
}
[dir="rtl"] #back-top {
    right: auto;
    left: 30px;
}

/* ============================================================
   22. التجاوب مع الشاشات
   ============================================================ */
@media (max-width: 1024px) {
    .hero h1 { font-size: 44px; }
    .hero-image .glass-avatar { width: 260px; height: 260px; }
    .float-card-1 { right: 0%; }
    .float-card-3 { right: 0%; }
    .float-card-2 { left: 0%; }
}

@media (max-width: 900px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-buttons {
        justify-content: center;
    }
    .hero-image { order: -1; }
    .hero-image .glass-avatar {
        width: 200px;
        height: 200px;
    }
    .float-card { display: none; }
    .about-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .section-header h2 { font-size: 32px; }

    /* تعديل الشبكة الاجتماعية إلى عمودين على الشاشات المتوسطة */
    .social-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--nav-bg);
        backdrop-filter: blur(var(--backdrop-blur));
        flex-direction: column;
        padding: 80px 32px 32px;
        transition: right var(--transition-smooth);
        border-left: 1px solid var(--border-glass);
        gap: 24px;
        align-items: flex-start;
    }
    .nav-links.open { right: 0; }
    .mobile-toggle { display: block; }
    .nav-controls .lang-toggle { display: none; }
    [dir="rtl"] .nav-links {
        right: auto;
        left: -100%;
        border-left: none;
        border-right: 1px solid var(--border-glass);
    }
    [dir="rtl"] .nav-links.open { left: 0; right: auto; }
    .contact-social { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .hero { padding: 100px 0 60px; }
    .hero h1 { font-size: 32px; }
    .hero-title { font-size: 17px; }
    .hero-desc { font-size: 14px; }
    .hero-image .glass-avatar {
        width: 160px;
        height: 160px;
    }
    .btn-glass { padding: 10px 20px; font-size: 13px; }
    section { padding: 60px 0; }
    .section-header h2 { font-size: 28px; }
    .glass-card { padding: 24px 16px; }
    .skills-grid { grid-template-columns: 1fr 1fr; }
    
    /* تعديل الشبكة الاجتماعية إلى عمود واحد على الشاشات الصغيرة */
    .social-grid {
        grid-template-columns: 1fr 1fr; /* أو 1fr إذا أردت عمود واحد، لكن الأفضل عمودين */
    }
    .contact-social { grid-template-columns: 1fr 1fr; }
    .nav-brand { font-size: 18px; }
    #back-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
        bottom: 20px;
        right: 20px;
    }
    [dir="rtl"] #back-top { right: auto; left: 20px; }
    .timeline-item { flex-direction: column; gap: 4px; }
    .games-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .skills-grid { grid-template-columns: 1fr; }
    .social-grid { grid-template-columns: 1fr 1fr; } /* عمودين حتى في أصغر الأحجام */
    .contact-social { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
}

/* ============================================================
   23. تأثيرات الظهور عند التمرير
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================================
   24. إمكانية الوصول (Accessibility)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-1);
    outline-offset: 2px;
}

/* ============================================================
   25. تأثيرات إضافية (Emoji 3D)
   ============================================================ */
.skill-icon-3d {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
    perspective: 300px;
}
.emoji-3d {
    font-size: 52px;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    filter: drop-shadow(0 4px 8px rgba(249, 115, 22, 0.2));
    line-height: 1;
}
.emoji-shadow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 12px;
    background: radial-gradient(ellipse, rgba(249, 115, 22, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(6px);
    transition: all 0.4s ease;
}
.skill-card:hover .emoji-3d {
    transform: rotateX(15deg) rotateY(15deg) scale(1.1);
    filter: drop-shadow(0 8px 20px rgba(249, 115, 22, 0.4));
}
.skill-card:hover .emoji-shadow {
    width: 100%;
    opacity: 0.6;
    transform: translateX(-50%) scale(1.2);
}
.skill-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-1);
    box-shadow: var(--shadow-glass), var(--shadow-glow), 0 0 60px rgba(249, 115, 22, 0.08);
}