@font-face {
  font-family: YekanBakh;
  src: url("assets/fonts/YekanBakhFaNum-Regular.ttf");
}
@font-face {
  font-family: YekanBakh;
  src: url("assets/fonts/YekanBakhFaNum-SemiBold.ttf");
  font-weight: 600;
}
@font-face {
  font-family: YekanBakh;
  src: url("assets/fonts/YekanBakhFaNum-Bold.ttf");
  font-weight: 700;
}
@font-face {
  font-family: YekanBakh;
  src: url("assets/fonts/YekanBakhFaNum-ExtraBold.ttf");
  font-weight: 800;
}

:root {
  --primary: #0f172a;
  --accent: #10b981;
  --text-main: #334155;
  --text-muted: #64748b;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
}

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

body {
  font-family: YekanBakh, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  padding-bottom: 80px;
}

a {
  text-decoration: none;
  color: inherit;
}

.resume-nav {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-link, .download-link {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

.download-link {
  background-color: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.download-link:hover {
  background-color: #334155;
  color: white;
  transform: translateY(-1px);
}

.resume-wrapper {
  max-width: 1000px;
  margin: 40px auto;
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  border: 1px solid var(--border);
}

.resume-header {
  padding: 48px;
  background: linear-gradient(to right, #f8fafc, #ffffff);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.header-main {
  flex: 1;
}

.header-main h1 {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 8px;
}

.header-main h1 span {
  color: var(--accent);
}

.header-main h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.summary {
  font-size: 15px;
  color: var(--text-main);
}

.header-contact {
  flex: 0 0 250px;
  background: var(--bg-page);
  padding: 24px;
  border-radius: 16px;
}

.header-contact ul {
  list-style: none;
}

.header-contact li {
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 12px;
}

.header-contact li:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.resume-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  min-height: 500px;
}

.resume-main {
  padding: 48px;
  border-left: 1px solid var(--border);
}

.resume-sidebar {
  padding: 48px 32px;
  background-color: #fafbfc;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 32px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 0;
  width: 40%;
  height: 4px;
  background-color: var(--accent);
  border-radius: 4px;
}

.resume-section {
  margin-bottom: 48px;
}

.resume-section:last-child {
  margin-bottom: 0;
}

.job-card {
  margin-bottom: 40px;
}

.job-card:last-child {
  margin-bottom: 0;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.job-header h4 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.job-duration {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: #ecfdf5;
  padding: 4px 10px;
  border-radius: 8px;
}

.job-role {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.projects-list {
  border-right: 2px solid var(--border);
  padding-right: 20px;
}

.project-item {
  margin-bottom: 20px;
  position: relative;
}

.project-item::before {
  content: "";
  position: absolute;
  right: -26px;
  top: 6px;
  width: 10px;
  height: 10px;
  background-color: var(--border);
  border-radius: 50%;
  border: 2px solid white;
}

.project-item:last-child {
  margin-bottom: 0;
}

.project-item h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.project-item p {
  font-size: 13px;
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.8;
}

.edu-card {
  margin-bottom: 24px;
}

.edu-card:last-child {
  margin-bottom: 0;
}

.edu-degree {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 4px;
}

.edu-uni {
  font-size: 14px;
  color: var(--text-muted);
}

.edu-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.mt-4 {
  margin-top: 24px;
}

@media (max-width: 768px) {
  .resume-header {
    flex-direction: column;
    padding: 32px 24px;
  }
  .header-contact {
    flex: auto;
  }
  .resume-grid {
    grid-template-columns: 1fr;
  }
  .resume-main {
    border-left: none;
    border-bottom: 1px solid var(--border);
    padding: 32px 24px;
  }
  .resume-sidebar {
    padding: 32px 24px;
  }
  .job-header {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .resume-main { padding: 24px 16px; }
  .resume-sidebar { padding: 24px 16px; }
  .header-contact ul { flex-direction: column; gap: 12px; }
  .header-contact li { border-bottom: 1px dashed var(--border); padding-bottom: 12px; }
  .header-contact li:last-child { border-bottom: none; padding-bottom: 0; }
}

@media print {
  @page {
    size: A4;
    margin: 8mm 10mm;
  }

  body {
    background-color: #ffffff !important;
    color: #1e293b !important;
    padding-bottom: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .resume-nav {
    display: none !important;
  }

  .resume-wrapper {
    max-width: 100% !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .resume-header {
    background: #f8fafc !important;
    padding: 24px 32px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .header-contact {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .resume-grid {
    display: grid !important;
    grid-template-columns: 1fr 280px !important;
    min-height: auto !important;
  }

  .resume-main {
    padding: 28px 24px 28px 32px !important;
    border-left: 1px solid var(--border) !important;
  }

  .resume-sidebar {
    padding: 28px 20px !important;
    background-color: #f8fafc !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .job-card, .edu-card, .project-item, .resume-section {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .tech-stack {
    background: #f1f5f9 !important;
    border-left: 3px solid var(--primary) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .job-duration {
    background: #ecfdf5 !important;
    color: var(--accent) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  a {
    text-decoration: none !important;
    color: inherit !important;
  }
}
