/* ===== Variables ===== */
:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --accent: #fbbf24;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --text: #0f172a;
  --text-soft: #475569;
  --text-mute: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --container: 1200px;
  --transition: 0.3s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  direction: rtl;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn-secondary {
  background: white;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover {
  background: var(--primary);
  color: white;
}
.btn-block { width: 100%; }

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow-sm); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand-logo {
  width: 42px; height: 42px;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0;
}
.brand-name { font-size: 17px; color: var(--text); }
.nav-links { display: flex; gap: 28px; }
.nav-link {
  position: relative;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-soft);
  padding: 6px 0;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.nav-cta { padding: 10px 24px; font-size: 14px; }
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 8px;
}
.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; left: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(30, 58, 138, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -150px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 1;
}
.hero-text { animation: fadeInUp 0.8s ease; }
.tag {
  display: inline-block;
  background: rgba(30, 58, 138, 0.1);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 14px;
}
.hero-subtitle {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 20px;
}
.hero-desc {
  font-size: 16px;
  color: var(--text-soft);
  margin-bottom: 32px;
  max-width: 540px;
}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 420px;
  animation: fadeInUp 0.8s ease 0.2s both;
}
.shape-bg {
  position: absolute;
  width: 320px; height: 320px;
  background: var(--primary);
  border-radius: 32px;
  transform: rotate(8deg);
  box-shadow: var(--shadow-lg);
}
.shape-fg {
  position: relative;
  width: 320px; height: 320px;
  background: white;
  border: 3px solid var(--primary);
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
}
.initials {
  font-size: 110px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -3px;
}
.divider {
  width: 80px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin: 6px 0;
}
.role-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 1px;
}

/* ===== Stats ===== */
.stats {
  background: var(--bg-dark);
  padding: 60px 0;
  color: white;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  text-align: center;
}
.stat-num {
  font-size: 48px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 4px;
  font-family: 'Tajawal', sans-serif;
}
.stat-label {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}

/* ===== Sections ===== */
section { padding: 80px 0; }
.section-head { text-align: center; margin-bottom: 60px; }
.section-tag {
  display: inline-block;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  color: var(--text);
}

/* ===== About ===== */
.about { background: var(--bg-alt); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 50px;
  align-items: start;
}
.about-text p { color: var(--text-soft); margin-bottom: 16px; }
.about-text strong { color: var(--text); }

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.service-card {
  background: white;
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}
.service-icon { font-size: 32px; margin-bottom: 12px; }
.service-card h3 { font-size: 17px; margin-bottom: 8px; color: var(--text); }
.service-card p { font-size: 14px; color: var(--text-soft); line-height: 1.7; }

/* ===== CV ===== */
.cv-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 50px;
}
.block-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  padding-right: 12px;
  border-right: 4px solid var(--primary);
}

.timeline { position: relative; padding-right: 8px; }
.timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  right: 8px;
  width: 2px;
  background: var(--border);
}
.timeline li {
  position: relative;
  padding-right: 30px;
  padding-bottom: 24px;
}
.timeline li::before {
  content: '';
  position: absolute;
  right: 0;
  top: 8px;
  width: 16px; height: 16px;
  background: white;
  border: 3px solid var(--primary);
  border-radius: 50%;
}
.t-year { font-size: 13px; color: var(--primary); font-weight: 700; margin-bottom: 4px; }
.t-body h4 { font-size: 16px; margin-bottom: 2px; }
.t-body span { font-size: 14px; color: var(--text-soft); }

.skills .skill { margin-bottom: 16px; }
.skill-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
.skill-head span:last-child { color: var(--primary); font-weight: 700; }
.bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width 1s ease;
}
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.languages { display: flex; flex-direction: column; gap: 8px; }
.lang {
  display: flex;
  justify-content: space-between;
  background: var(--bg-alt);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}
.lang strong { color: var(--text); }
.lang span { color: var(--text-soft); }

/* ===== Portfolio ===== */
.portfolio { background: var(--bg-alt); }
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.project {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.project:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.project-cover {
  height: 160px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  color: white;
}
.project-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 60%);
}
.cover-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}
.cover-num {
  font-size: 56px;
  font-weight: 900;
  opacity: 0.4;
  letter-spacing: -2px;
  position: relative;
  z-index: 1;
}
.project h3 {
  font-size: 18px;
  margin: 20px 24px 8px;
  color: var(--text);
}
.project p {
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 24px 16px;
  line-height: 1.7;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 24px 24px;
}
.project-tags span {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 50px;
  align-items: start;
}
.contact-info h3 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 16px;
}
.info-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.info-list li {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-alt);
  padding: 14px 18px;
  border-radius: 10px;
}
.info-ico { font-size: 22px; }
.info-list b { display: block; font-size: 13px; color: var(--text-soft); }
.info-list a, .info-list span { font-size: 15px; color: var(--text); font-weight: 500; }
.info-list a:hover { color: var(--primary); }

.socials { display: flex; gap: 10px; }
.social {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: var(--transition);
}
.social:hover { background: var(--primary-dark); transform: translateY(-3px); }

.contact-form {
  background: var(--bg-alt);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  transition: var(--transition);
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}
.form-status {
  margin-top: 14px;
  font-size: 14px;
  text-align: center;
}
.form-status.ok { color: #059669; }
.form-status.err { color: #dc2626; }

/* ===== Footer ===== */
.footer {
  background: var(--bg-dark);
  color: white;
  padding: 50px 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
}
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-brand strong { font-size: 17px; display: block; }
.footer-brand p { font-size: 13px; color: rgba(255, 255, 255, 0.65); }
.footer-nav, .footer-socials { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a, .footer-socials a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  transition: var(--transition);
}
.footer-nav a:hover, .footer-socials a:hover { color: white; padding-right: 6px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.6s ease both; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .hero-inner, .about-grid, .cv-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { height: 320px; }
  .shape-bg, .shape-fg { width: 260px; height: 260px; }
  .initials { font-size: 90px; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-nav, .footer-socials { align-items: center; }
}
@media (max-width: 700px) {
  .nav-links, .nav-cta { display: none; }
  .menu-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: white;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .hero { padding: 110px 0 60px; }
  .hero-buttons { justify-content: stretch; }
  .hero-buttons .btn { flex: 1; }
  .services-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .contact-form { padding: 22px; }
}
