:root {
  --primary: #0f2942;
  --secondary: #d4af37;
  --accent: #1b4965;
  --bg-light: #f7f9fb;
  --text-dark: #1a1a1a;
  --white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Vazirmatn', 'Tahoma', 'Segoe UI', sans-serif;
  color: var(--text-dark);
  line-height: 1.9;
  background: var(--white);
  scroll-behavior: smooth;
}

body.en { font-family: 'Segoe UI', 'Vazirmatn', sans-serif; }

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 40px;
  background: var(--primary);
  z-index: 1000;
  flex-wrap: wrap;
}

.nav-name { color: var(--white); font-weight: bold; font-size: 1.1rem; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.nav-links a:hover { color: var(--secondary); }

.lang-btn {
  background: var(--secondary);
  color: var(--primary);
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  padding: 120px 20px 60px;
}

.profile-img {
  width: 180px; height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--secondary);
  margin-bottom: 20px;
}

.hero h1 { font-size: 2.5rem; margin-bottom: 10px; }
.hero-title { font-size: 1.3rem; color: var(--secondary); margin-bottom: 15px; }
.hero-desc { max-width: 600px; margin: 0 auto 30px; font-size: 1.05rem; opacity: 0.9; }

.hero-buttons { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }

.btn {
  padding: 12px 28px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s;
}

.btn-primary { background: var(--secondary); color: var(--primary); }
.btn-primary:hover { opacity: 0.85; }
.btn-outline { border: 2px solid var(--white); color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--primary); }

.section {
  padding: 80px 8%;
  max-width: 1100px;
  margin: 0 auto;
}

.alt-bg { background: var(--bg-light); max-width: 100%; }
.alt-bg > * { max-width: 1100px; margin-left: auto; margin-right: auto; display: block; }

.section h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 35px;
  text-align: center;
  position: relative;
}

.section h2::after {
  content: '';
  width: 60px; height: 4px;
  background: var(--secondary);
  display: block;
  margin: 12px auto 0;
}

.sub-heading {
  color: var(--accent);
  margin: 30px 0 15px;
  font-size: 1.3rem;
}

.about-content p { margin-bottom: 20px; font-size: 1.05rem; }

.timeline-item {
  background: var(--white);
  border-right: 4px solid var(--secondary);
  padding: 20px 25px;
  margin-bottom: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.timeline-date {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  padding: 4px 14px;
  border-radius: 15px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.timeline-item h3 { color: var(--primary); margin-bottom: 10px; font-size: 1.2rem; }
.timeline-item ul { padding-right: 20px; padding-left: 0; }
.timeline-item li { margin-bottom: 6px; }

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  margin-bottom: 20px;
}

.edu-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  text-align: center;
  transition: transform 0.3s;
}

.edu-card:hover { transform: translateY(-5px); }

.edu-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #e0e0e0;
}

.edu-card p { padding: 12px; font-size: 0.9rem; color: var(--primary); }

.note {
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  margin-top: 10px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.project-card {
  background: var(--white);
  padding: 28px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-top: 4px solid var(--secondary);
}

.project-card h3 { color: var(--primary); margin-bottom: 12px; }

.book-content {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.book-cover {
  width: 250px;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.book-text { flex: 1; min-width: 280px; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.skill-category h3 { color: var(--accent); margin-bottom: 15px; font-size: 1.15rem; }

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

.tags span {
  background: var(--primary);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.contact-content {
  text-align: center;
  font-size: 1.1rem;
}

.contact-content p { margin-bottom: 15px; }
.contact-content a { color: var(--accent); text-decoration: none; }
.contact-content a:hover { text-decoration: underline; }

footer {
  text-align: center;
  padding: 30px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .navbar { flex-direction: column; gap: 10px; }
  .nav-links { justify-content: center; gap: 12px; }
  .section { padding: 60px 5%; }
  .book-content { flex-direction: column; text-align: center; }
}