:root {
  --primary: #043f5f;
  --primary-light: #0a6e8a;
  --primary-dark: #022d44;
  --secondary: #0a6e8a;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-cyan: #06b6d4;
  --accent-rose: #f43f5e;
  --gradient-primary: linear-gradient(135deg, #043f5f, #0a6e8a);
  --gradient-hero: linear-gradient(135deg, #022d44 0%, #043f5f 50%, #0a6e8a 100%);
  --gradient-warm: linear-gradient(135deg, #022d44 0%, #043f5f 50%, #0a6e8a 100%);
  --gradient-cool: linear-gradient(135deg, #0a6e8a 0%, #06b6d4 100%);
  --gradient-green: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --gradient-gold: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --bg: #ffffff;
  --bg-alt: #f1f5f9;
  --bg-section: #f8fafc;
  --text: #0f172a;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --card-bg: rgba(255,255,255,0.85);
  --card-border: rgba(0,0,0,0.08);
  --nav-bg: rgba(255,255,255,0.75);
  --nav-border: rgba(0,0,0,0.06);
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.1);
  --glow: none;
  --glow-text: none;
  --border-color: #e2e8f0;
  --font-ar: 'Tajawal', sans-serif;
  --font-en: 'Inter', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --max-width: 1140px;
}

html.dark {
  --bg: #07071a;
  --bg-alt: #0d0d2b;
  --bg-section: #0a0a22;
  --text: #e2e8f0;
  --text-light: #94a3b8;
  --text-muted: #64748b;
  --card-bg: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.08);
  --nav-bg: rgba(7,7,26,0.85);
  --nav-border: rgba(255,255,255,0.06);
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.4);
  --glow: 0 0 20px rgba(4,63,95,0.3);
  --glow-text: 0 0 30px rgba(4,63,95,0.3);
  --border-color: rgba(255,255,255,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-en); color: var(--text); background: var(--bg); line-height: 1.7; overflow-x: hidden; transition: background var(--transition), color var(--transition); }
html[lang="ar"], html[lang="ar"] body { font-family: var(--font-ar); }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
ul { list-style: none; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; background: var(--bg-section); }
.section-dark { background: var(--bg-alt); color: var(--text); }
.section-alt { background: var(--bg-section); }
.section-subtitle { font-size: 1.25rem; font-weight: 700; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--primary); display: inline-block; }
.section-header-center { text-align: center; }
.section-header-center .section-desc { margin: 0 auto; }
.section-alt { background: var(--bg); }
html.dark .section-dark { background: var(--bg-alt); }
html.dark .section-alt { background: var(--bg); }

.section-label { display: inline-block; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 12px;
  background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.section-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; line-height: 1.25; letter-spacing: -0.5px; }
html[lang="ar"] .section-title { font-weight: 800; letter-spacing: 0; }
.section-desc { color: var(--text-light); max-width: 600px; line-height: 1.8; font-size: 1.05rem; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header .section-desc { margin: 0 auto; }

.skip-link { position: absolute; top: -100%; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 8px 20px; z-index: 1000; border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-weight: 500; }
.skip-link:focus { top: 0; }

.navbar { position: fixed; top: 0; left: 0; width: 100%; z-index: 999; background: var(--nav-bg); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid var(--nav-border); transition: background var(--transition), border-color var(--transition); box-shadow: var(--shadow); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.navbar-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem;
  background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.navbar-logo img { border-radius: 50%; border: 2px solid var(--primary-light); }
.navbar-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.navbar-toggle span { display: block; width: 24px; height: 2px; background: var(--text); transition: var(--transition); border-radius: 2px; }
.navbar-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.navbar-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navbar-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.navbar-links { display: flex; align-items: center; gap: 6px; }
.navbar-links a { font-size: 0.88rem; font-weight: 500; color: var(--text); padding: 8px 16px; border-radius: 8px; transition: var(--transition); }
.navbar-links a:hover { color: var(--primary); background: rgba(4,63,95,0.08); }
.navbar-links a[aria-current="page"] { color: var(--primary); background: rgba(4,63,95,0.1); font-weight: 600; }
.navbar-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--card-bg); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); color: var(--text); font-size: 1rem; }
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.lang-toggle { background: var(--card-bg); border: 1px solid var(--border-color); padding: 7px 14px; border-radius: 10px; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: var(--transition); color: var(--text); display: flex; align-items: center; gap: 6px; }
.lang-toggle:hover { border-color: var(--primary); color: var(--primary); }

.hero { min-height: 100vh; display: flex; align-items: center; padding: 100px 0; position: relative; overflow: hidden; background: var(--bg); }
.hero::before { content: ''; position: absolute; top: -50%; right: -20%; width: 70%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(4,63,95,0.08) 0%, transparent 60%); pointer-events: none; }
.hero::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 60%; height: 150%;
  background: radial-gradient(ellipse at center, rgba(4,63,95,0.06) 0%, transparent 60%); pointer-events: none; }
html.dark .hero::before { background: radial-gradient(ellipse at center, rgba(4,63,95,0.15) 0%, transparent 60%); }
html.dark .hero::after { background: radial-gradient(ellipse at center, rgba(4,63,95,0.1) 0%, transparent 60%); }
.hero .container { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero-content h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.15; margin-bottom: 12px; letter-spacing: -1px; }
.hero-content h1 span { display: block;
  background: linear-gradient(135deg, #043f5f, #0a6e8a, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.typing-wrapper { font-size: 1.2rem; color: var(--text-light); margin-bottom: 20px; min-height: 1.8rem; }
.typing-wrapper .cursor { display: inline-block; width: 2px; height: 1.2em; background: var(--primary); margin-left: 2px; animation: blink 1s step-end infinite; vertical-align: text-bottom; }
@keyframes blink { 50% { opacity: 0; } }
.hero-content p { color: var(--text-light); line-height: 1.8; margin-bottom: 32px; max-width: 500px; }
.hero-image { display: flex; justify-content: center; align-items: center; }
.hero-image .img-wrap { position: relative; width: 260px; height: 260px; }
.hero-image .img-wrap::before { content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: var(--gradient-primary); z-index: 0; }
.hero-image .hero-img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; box-shadow: 0 0 0 4px var(--bg), 0 8px 32px rgba(4,63,95,0.15); }
.hero-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hero-shape { position: absolute; border-radius: 50%; opacity: 0.4; }
.hero-shape-1 { width: 60px; height: 60px; background: var(--accent-pink); top: 15%; left: 10%; animation: float 8s ease-in-out infinite; }
.hero-shape-2 { width: 40px; height: 40px; background: var(--accent-amber); top: 60%; left: 5%; animation: float 6s ease-in-out infinite reverse; }
.hero-shape-3 { width: 80px; height: 80px; background: var(--accent-cyan); bottom: 20%; right: 15%; animation: float 10s ease-in-out infinite 1s; }
.hero-shape-4 { width: 50px; height: 50px; background: var(--accent-emerald); top: 25%; right: 25%; animation: float 7s ease-in-out infinite 0.5s; }
@keyframes float { 0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); } }

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; border-radius: 50px; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: var(--transition); border: none; text-decoration: none; }
.btn-primary { background: var(--gradient-primary); color: #fff; box-shadow: 0 4px 15px rgba(4,63,95,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(4,63,95,0.4); }
html.dark .btn-primary { box-shadow: 0 4px 20px rgba(4,63,95,0.4); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--gradient-primary); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-ghost { background: rgba(4,63,95,0.08); color: var(--primary); }
.btn-ghost:hover { background: rgba(4,63,95,0.15); transform: translateY(-2px); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.card { background: var(--card-bg); backdrop-filter: blur(10px); border-radius: var(--radius); padding: 32px 24px; box-shadow: var(--shadow); transition: var(--transition); border: 1px solid var(--card-border); position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; border-radius: 0 2px 2px 0;
  background: var(--gradient-primary); opacity: 0; transition: var(--transition); }
html[lang="ar"] .card::before { left: auto; right: 0; border-radius: 2px 0 0 2px; }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-6px); border-color: rgba(4,63,95,0.2); }
.card:hover::before { opacity: 1; }
html.dark .card:hover { border-color: rgba(4,63,95,0.3); }
.card-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
  background: rgba(4,63,95,0.1); }
.card-icon svg { width: 24px; height: 24px; color: var(--primary); }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; font-weight: 700; }
.card p { font-size: 0.9rem; color: var(--text-light); line-height: 1.7; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about-image .img-wrap { position: relative; border-radius: var(--radius-lg); overflow: hidden; }
.about-image .img-wrap::before { content: ''; position: absolute; inset: -3px; border-radius: var(--radius-lg);
  background: var(--gradient-primary); z-index: 0; }
.about-image img { border-radius: var(--radius-lg); position: relative; z-index: 1; width: 100%; }
.skills-section { margin-top: 32px; }
.skills-section > h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.skills-section > h3::before { content: ''; width: 4px; height: 20px; border-radius: 2px;
  background: var(--gradient-primary); display: inline-block; }
.skill-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.skill-item { margin-bottom: 2px; }
.skill-item .skill-header { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 0.82rem; font-weight: 500; color: var(--text-light); }
.skill-item .skill-track { height: 6px; background: var(--bg-alt); border-radius: 4px; overflow: hidden; }
.skill-item .skill-fill { height: 100%; border-radius: 4px; width: 0; transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1); }
.skill-fill.html { background: linear-gradient(90deg, #e34f26, #f06529); }
.skill-fill.css { background: linear-gradient(90deg, #1572b6, #33a9dc); }
.skill-fill.javascript { background: linear-gradient(90deg, #f7df1e, #f0db4f); }
.skill-fill.php { background: linear-gradient(90deg, #777bb4, #8993be); }
.skill-fill.sql { background: linear-gradient(90deg, #4479a1, #5b9bd5); }
.skill-fill.laravel { background: linear-gradient(90deg, #ff2d20, #ff6b6b); }
.skill-fill.python { background: linear-gradient(90deg, #3776ab, #4d8fc5); }
.skill-fill.vue { background: linear-gradient(90deg, #4fc08d, #6bdbaa); }
.skill-fill.bootstrap { background: linear-gradient(90deg, #7952b3, #9068c9); }
.skill-fill.flask { background: linear-gradient(90deg, #000, #333); }
.skill-fill.docker { background: linear-gradient(90deg, #2496ed, #48b0ff); }
.skill-fill.linux { background: linear-gradient(90deg, #fcc624, #f5d76e); }
.skill-fill.api { background: linear-gradient(90deg, #00b894, #00d2a0); }
.skill-fill.django { background: linear-gradient(90deg, #092e20, #0c3b29); }
.skill-fill.git { background: linear-gradient(90deg, #f05032, #f4735c); }

.soft-skills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.soft-skill-tag { padding: 6px 18px; border-radius: 20px; font-size: 0.84rem;
  background: rgba(4,63,95,0.08); color: var(--primary); font-weight: 500; transition: var(--transition); }
.soft-skill-tag:hover { background: var(--gradient-primary); color: #fff; transform: translateY(-2px); }

.experience-section { margin-top: 32px; }
.experience-timeline { position: relative; padding-left: 28px; }
html[lang="ar"] .experience-timeline { padding-left: 0; padding-right: 28px; }
.experience-timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--secondary), var(--accent-pink)); }
html[lang="ar"] .experience-timeline::before { left: auto; right: 8px; }
.timeline-item { position: relative; margin-bottom: 32px; padding-left: 28px; }
html[lang="ar"] .timeline-item { padding-left: 0; padding-right: 28px; }
.timeline-item::before { content: ''; position: absolute; left: -16px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--gradient-primary); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--primary); }
html[lang="ar"] .timeline-item::before { left: auto; right: -16px; }
.timeline-item h4 { font-size: 1rem; margin-bottom: 4px; font-weight: 700; }
.timeline-item .timeline-period { font-size: 0.8rem; color: var(--primary-light); font-weight: 500; margin-bottom: 6px; }
.timeline-item p { font-size: 0.88rem; color: var(--text-light); line-height: 1.7; }
.section-dark .timeline-item::before { border-color: var(--bg-alt); }
.section-dark .timeline-item p { color: var(--text-light); }
.section-dark .experience-timeline::before { opacity: 0.8; }

.page-header { padding: 120px 0 48px; position: relative; overflow: hidden; text-align: center; }
.page-header .container > * { max-width: 700px; margin-left: auto; margin-right: auto; }
.page-header::before { content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(4,63,95,0.04) 0%, rgba(10,110,138,0.04) 100%); pointer-events: none; }
html.dark .page-header::before { background: linear-gradient(135deg, rgba(4,63,95,0.08) 0%, rgba(10,110,138,0.06) 100%); }
.page-header h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 8px;
  background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-header p { color: var(--text-light); font-size: 1.05rem; }

.project-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 40px; }
.filter-btn { padding: 8px 22px; border: 1px solid var(--border-color); border-radius: 50px; background: var(--card-bg); cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: var(--transition); color: var(--text-light); backdrop-filter: blur(10px); }
.filter-btn:hover, .filter-btn.active { background: var(--gradient-primary); color: #fff; border-color: transparent; box-shadow: 0 4px 15px rgba(4,63,95,0.3); }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.project-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); cursor: pointer; background: var(--card-bg); border: 1px solid var(--card-border); backdrop-filter: blur(10px); position: relative; }
.project-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-6px); border-color: rgba(4,63,95,0.2); }
.project-card-image { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.project-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.project-card:hover .project-card-image img { transform: scale(1.08); }
.project-card-body { padding: 20px 24px 24px; }
.project-card-body h3 { font-size: 1.05rem; margin-bottom: 6px; font-weight: 700; }
.project-card-body p { font-size: 0.85rem; color: var(--text-light); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.project-tags span { padding: 3px 12px; border-radius: 12px; font-size: 0.75rem;
  background: rgba(4,63,95,0.08); color: var(--primary); font-weight: 500; }

.project-detail { padding: 40px 0 80px; max-width: 900px; margin: 0 auto; }
.project-detail-header { margin-bottom: 32px; }
.project-detail-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.project-detail-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.project-detail-meta a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 50px; font-size: 0.85rem;
  background: rgba(4,63,95,0.08); color: var(--primary); font-weight: 500; transition: var(--transition); border: 1px solid transparent; }
.project-detail-meta a:hover { background: var(--gradient-primary); color: #fff; border-color: transparent; }
.project-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 32px; }
.project-gallery img { border-radius: var(--radius-sm); width: 100%; aspect-ratio: 16/10; object-fit: cover;
  box-shadow: var(--shadow); transition: var(--transition); }
.project-gallery img:hover { transform: scale(1.02); }
.project-description p { color: var(--text-light); line-height: 1.9; margin-bottom: 12px; }
.project-tech { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.project-tech span { padding: 5px 16px; border-radius: 50px; font-size: 0.82rem;
  background: rgba(4,63,95,0.08); color: var(--primary); font-weight: 500; }
.project-features { list-style: none; margin-top: 16px; }
.project-features li { padding: 8px 0 8px 24px; position: relative; color: var(--text-light); }
.project-features li::before { content: '→'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
html[lang="ar"] .project-features li { padding-left: 0; padding-right: 24px; }
html[lang="ar"] .project-features li::before { left: auto; right: 0; content: '←'; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.blog-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); background: var(--card-bg); border: 1px solid var(--card-border); backdrop-filter: blur(10px); }
.blog-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-6px); border-color: rgba(4,63,95,0.2); }
.blog-card-image { aspect-ratio: 16/9; overflow: hidden; position: relative; }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.blog-card:hover .blog-card-image img { transform: scale(1.08); }
.blog-card-body { padding: 24px; }
.blog-card-meta { display: flex; gap: 12px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.blog-card-meta span:first-child::after { content: '·'; margin-left: 12px; }
.blog-card h3 { font-size: 1.1rem; margin-bottom: 8px; line-height: 1.4; font-weight: 700; }
.blog-card p { font-size: 0.88rem; color: var(--text-light); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card .btn { margin-top: 16px; padding: 8px 20px; font-size: 0.82rem; }

.blog-post { max-width: 800px; margin: 0 auto; padding: 40px 0 80px; }
.blog-post-header { margin-bottom: 32px; }
.blog-post-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; line-height: 1.3; }
.blog-post-meta { display: flex; gap: 16px; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.blog-post-image { border-radius: var(--radius); margin-bottom: 32px; aspect-ratio: 16/9; object-fit: cover; width: 100%;
  box-shadow: var(--shadow); }
.blog-post-content { line-height: 1.9; color: var(--text); }
.blog-post-content p { margin-bottom: 16px; }
.blog-post-content h2 { font-size: 1.4rem; margin: 40px 0 12px; font-weight: 700; }
.blog-post-content h3 { font-size: 1.15rem; margin: 28px 0 8px; font-weight: 600; }
.blog-post-content ul, .blog-post-content ol { padding-left: 24px; margin-bottom: 16px; }
.blog-post-content li { margin-bottom: 8px; color: var(--text-light); }
html[lang="ar"] .blog-post-content ul, html[lang="ar"] .blog-post-content ol { padding-left: 0; padding-right: 24px; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-info h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; }
.contact-item { display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-start; }
.contact-item-icon { width: 48px; height: 48px; border-radius: 14px;
  background: rgba(4,63,95,0.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-item-icon svg { width: 22px; height: 22px; color: var(--primary); }
.contact-item h4 { font-size: 0.82rem; margin-bottom: 2px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.contact-item p, .contact-item a { font-weight: 600; }
.social-links { display: flex; gap: 10px; margin-top: 24px; }
.social-links a { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); display: flex; align-items: center; justify-content: center; transition: var(--transition); color: var(--text); }
.social-links a svg { width: 20px; height: 20px; }
.social-links a:hover { background: var(--gradient-primary); border-color: transparent; color: #fff; transform: translateY(-3px); }

.contact-form { padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--card-border); background: var(--card-bg); backdrop-filter: blur(10px); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 0.9rem; transition: var(--transition); background: var(--bg); color: var(--text); font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(4,63,95,0.15); }
.form-group textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.footer { background: var(--bg-alt); color: var(--text); padding: 60px 0 0; border-top: 1px solid var(--border-color); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; }
.footer-brand img { border-radius: 50%; margin-bottom: 12px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; color: var(--text-light); }
.footer h4 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.footer ul li { margin-bottom: 10px; }
.footer ul li a { font-size: 0.9rem; color: var(--text-light); transition: var(--transition); }
.footer ul li a:hover { color: var(--primary); }
.footer-socials { display: flex; gap: 10px; margin-top: 16px; }
.footer-socials a { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; transition: var(--transition); color: var(--text-light); }
.footer-socials a:hover { background: var(--gradient-primary); color: #fff; border-color: transparent; }
.footer-bottom { border-top: 1px solid var(--border-color); margin-top: 40px; padding: 20px 0; text-align: center; font-size: 0.85rem; color: var(--text-muted); }

.back-to-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 12px;
  background: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: var(--transition); z-index: 99; border: none; cursor: pointer;
  box-shadow: 0 4px 15px rgba(4,63,95,0.3); }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(4,63,95,0.4); }

.error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 80px 0; }
.error-page h1 { font-size: 6rem; font-weight: 800;
  background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; }
.error-page p { font-size: 1.2rem; color: var(--text-light); margin: 16px 0 32px; }

.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat-item { text-align: center; padding: 24px; background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--card-border); backdrop-filter: blur(10px); }
.stat-number { font-size: 2.5rem; font-weight: 800;
  background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 0.9rem; color: var(--text-light); margin-top: 4px; }

.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cert-item { background: var(--card-bg); padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--card-border);
  backdrop-filter: blur(10px); }
.cert-item h4 { font-size: 0.9rem; margin-bottom: 4px; font-weight: 600; }
.cert-item p { font-size: 0.8rem; color: var(--text-muted); }

.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.course-tag { padding: 8px 16px; border-radius: 20px; font-size: 0.85rem;
  background: rgba(4,63,95,0.08); color: var(--primary); font-weight: 500; text-align: center; transition: var(--transition); }
.course-tag:hover { background: var(--gradient-primary); color: #fff; }

.hobbies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.hobby-item { background: var(--card-bg); border: 1px solid var(--card-border); padding: 24px 20px; border-radius: var(--radius);
  text-align: center; backdrop-filter: blur(10px); transition: var(--transition); }
.hobby-item:hover { border-color: rgba(4,63,95,0.2); transform: translateY(-4px); }
.hobby-item h4 { font-size: 0.95rem; font-weight: 600; }
.hobby-item p { font-size: 0.82rem; color: var(--text-light); margin-top: 4px; }

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 24px; font-weight: 500; color: var(--primary); transition: var(--transition); }
.back-link:hover { gap: 10px; }

@media (max-width: 992px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-content h1 { font-size: 2.4rem; }
  .hero-content .btn-group { justify-content: center; }
  .hero-content p { margin: 0 auto 32px; }
  .hero-image { order: -1; }
  .hero-image .img-wrap { width: 220px; height: 220px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-image { order: -1; max-width: 400px; margin: 0 auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: 1fr; }
  .skill-bars { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .navbar-toggle { display: flex; }
  .navbar-links { position: fixed; top: 68px; left: 0; width: 100%; background: var(--nav-bg); backdrop-filter: blur(20px) saturate(180%); flex-direction: column; padding: 16px 24px 24px; gap: 4px; border-bottom: 1px solid var(--nav-border); transform: translateY(-120%); opacity: 0; visibility: hidden; transition: var(--transition); }
  .navbar-links.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .navbar-links a { width: 100%; }
  .navbar-actions { width: 100%; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border-color); margin-top: 8px; }
  .section { padding: 64px 0; }
  .section-title { font-size: 1.6rem; }
  .hero-content h1 { font-size: 1.8rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .page-header { padding: 100px 0 32px; }
  .page-header h1 { font-size: 1.8rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .contact-form { padding: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .project-gallery { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .project-detail { padding: 24px 0 60px; }
}

@media (max-width: 480px) {
  .hero-image .img-wrap { width: 180px; height: 180px; }
  .stat-number { font-size: 1.8rem; }
  .hero-content h1 { font-size: 1.5rem; }
}

html[lang="ar"] .hero-content { text-align: right; }
html[lang="ar"] .hero-content .btn-group { justify-content: flex-start; }
html[lang="ar"] .hero-content p { margin: 0 0 32px; }
html[lang="ar"] .skills-section > h3::before { margin-left: 8px; margin-right: 0; }
@media (max-width: 992px) {
  html[lang="ar"] .hero-content { text-align: center; }
  html[lang="ar"] .hero-content .btn-group { justify-content: center; }
  html[lang="ar"] .hero-content p { margin: 0 auto 32px; }
}
