* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
  background-color: #0d1117;
  color: #c9d1d9;
  line-height: 1.6;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 10%;
  border-bottom: 1px solid #21262d;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f0f6fc;
}

.logo span {
  color: #58a6ff;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: #8b949e;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #58a6ff;
}

.btn-nav {
  padding: 8px 16px;
  border: 1px solid #30363d;
  border-radius: 6px;
}

/* Hero Section */
.hero {
  padding: 100px 10% 80px;
  max-width: 800px;
}

.hero .subtitle {
  color: #58a6ff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 3rem;
  color: #f0f6fc;
  margin-bottom: 12px;
}

.hero h2 {
  font-size: 1.6rem;
  color: #8b949e;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero .description {
  font-size: 1.1rem;
  margin-bottom: 32px;
  color: #8b949e;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.btn {
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn.primary {
  background-color: #238636;
  color: #ffffff;
}

.btn.primary:hover {
  background-color: #2ea043;
}

.btn.secondary {
  background-color: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
}

.btn.secondary:hover {
  background-color: #30363d;
}

/* Sections Common */
.section {
  padding: 80px 10%;
}

.section-title {
  font-size: 1.8rem;
  color: #f0f6fc;
  margin-bottom: 40px;
  position: relative;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.skill-card {
  background-color: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 30px 24px;
  transition: transform 0.2s, border-color 0.2s;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: #58a6ff;
}

.skill-card i {
  font-size: 1.8rem;
  color: #58a6ff;
  margin-bottom: 16px;
}

.skill-card h4 {
  font-size: 1.2rem;
  color: #f0f6fc;
  margin-bottom: 8px;
}

.skill-card p {
  color: #8b949e;
  font-size: 0.9rem;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background-color: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 32px;
  transition: border-color 0.2s;
}

.project-card:hover {
  border-color: #58a6ff;
}

.project-card h4 {
  font-size: 1.3rem;
  color: #f0f6fc;
  margin-bottom: 12px;
}

.project-card p {
  color: #8b949e;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.tags {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tags span {
  background-color: #21262d;
  color: #58a6ff;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
}

.link-btn {
  color: #58a6ff;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.link-btn:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  padding: 80px 10% 40px;
  text-align: center;
  border-top: 1px solid #21262d;
}

.footer h3 {
  font-size: 1.8rem;
  color: #f0f6fc;
  margin-bottom: 10px;
}

.footer p {
  color: #8b949e;
}

.social-links {
  margin: 24px 0;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-links a {
  color: #8b949e;
  font-size: 1.5rem;
  transition: color 0.2s;
}

.social-links a:hover {
  color: #58a6ff;
}

.copyright {
  font-size: 0.85rem;
  margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .navbar { padding: 20px 5%; }
  .section, .hero { padding-left: 5%; padding-right: 5%; }
  .nav-links { display: none; }
}
/* Clean Portfolio Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: #161b22;
  border: 1px solid #30363d;
  aspect-ratio: 1 / 1; /* يخلي كل الصور مربعة ومتساوية تماماً */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-6px);
  border-color: #58a6ff;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* يعرض التصميم بالكامل داخل الإطار بدون قص أي تفاصيل */
  padding: 10px;
  background-color: #0d1117;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

/* طبقة تظهر عند تمرير الماوس فقط */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 17, 23, 0.95) 15%, rgba(13, 17, 23, 0.4) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h4 {
  color: #f0f6fc;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.gallery-overlay span {
  color: #58a6ff;
  font-size: 0.85rem;
  font-weight: 500;
}
.social-links a.whatsapp-btn:hover {
  color: #25d366;
  border-color: #25d366;
}

/* 3 أعمدة في الأعلى */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* البطاقة الرابعة تتمدد بعرض السطر كاملاً في الأسفل وتتوسط المكان */
.projects-grid .project-card:last-child {
  grid-column: 1 / -1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.projects-grid .project-card:last-child .tags,
.projects-grid .project-card:last-child .project-links {
  justify-content: center;
}

/* للشاشات المتوسطة والصغيرة */
@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}