    :root {
      --primary: #0f172a;
      --primary-soft: #1d3a5f;
      --accent: #0ea5e9;
      --bg: #f3f4f6;
      --card-bg: #ffffff;
      --text-main: #111827;
      --text-muted: #6b7280;
      --border-soft: #e5e7eb;
      --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
      --radius-lg: 18px;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: "Vazirmatn", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: radial-gradient(circle at top, #e0f2fe 0, #f9fafb 40%, #e5e7eb 100%);
      color: var(--text-main);
      padding: 32px 12px;
      display: flex;
      justify-content: center;
    }

    .page {
      width: 100%;
      max-width: 950px;
      background: linear-gradient(135deg, #ffffff 0, #f9fafb 40%, #f3f4f6 100%);
      border-radius: 24px;
      box-shadow: var(--shadow-soft);
      overflow: hidden;
      border: 1px solid rgba(15, 23, 42, 0.08);
    }

    /* هدر */
    .header {
      display: flex;
      flex-wrap: wrap;
      padding: 28px 32px 18px;
      background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 55%),
                  radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), transparent 55%);
      color: #f9fafb;
      position: relative;
      overflow: hidden;
    }

    .header::before {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.9));
      mix-blend-mode: multiply;
      z-index: 0;
    }

    .header-main,
    .header-meta {
      position: relative;
      z-index: 1;
    }

    .header-main {
      flex: 1 1 260px;
    }

    .header-name {
      font-size: 26px;
      font-weight: 700;
      letter-spacing: 0.03em;
      margin-bottom: 6px;
    }

    .header-title {
      font-size: 15px;
      font-weight: 500;
      opacity: 0.9;
      margin-bottom: 14px;
    }

    .header-tagline {
      font-size: 13px;
      line-height: 1.7;
      max-width: 430px;
      opacity: 0.92;
    }

    .header-meta {
      flex: 1 1 220px;
      display: flex;
      justify-content: flex-end;
      align-items: flex-start;
      gap: 12px;
      flex-wrap: wrap;
      font-size: 12px;
    }

    .meta-card {
      background: rgba(15, 23, 42, 0.4);
      border-radius: 14px;
      padding: 12px 14px;
      border: 1px solid rgba(148, 163, 184, 0.5);
      min-width: 210px;
      backdrop-filter: blur(10px);
    }

    .meta-row {
      display: flex;
      align-items: center;
      margin-bottom: 4px;
      gap: 6px;
    }

    .meta-label {
      opacity: 0.8;
    }

    .meta-value {
      font-weight: 500;
    }

    .header-strip {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 32px 14px;
      border-bottom: 1px solid var(--border-soft);
      background: linear-gradient(to right, rgba(14, 165, 233, 0.06), transparent);
      font-size: 11px;
      color: var(--text-muted);
    }

    .chip-row {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .chip {
      padding: 3px 9px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.6);
      background: rgba(15, 23, 42, 0.02);
    }

    .content {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
      gap: 20px;
      padding: 20px 26px 26px;
    }

    @media (max-width: 820px) {
      .content {
        grid-template-columns: 1fr;
      }
      .header {
        padding: 24px 20px 16px;
      }
      .header-strip {
        padding: 10px 20px 12px;
      }
      .page {
        border-radius: 18px;
      }
    }

    .section {
      margin-bottom: 18px;
      padding: 14px 16px 16px;
      background: var(--card-bg);
      border-radius: var(--radius-lg);
      border: 1px solid rgba(148, 163, 184, 0.35);
      box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    }

    .section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }

    .section-title {
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--primary-soft);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .section-title::before {
      content: "";
      width: 22px;
      height: 2px;
      border-radius: 999px;
      background: linear-gradient(to left, var(--accent), var(--primary-soft));
    }

    .section-sub {
      font-size: 11px;
      color: var(--text-muted);
    }

    .section-body {
      font-size: 12px;
      color: var(--text-main);
      line-height: 1.9;
    }

    .education-item {
      margin-bottom: 10px;
      padding-bottom: 8px;
      border-bottom: 1px dashed rgba(148, 163, 184, 0.6);
    }

    .education-item:last-child {
      border-bottom: none;
      padding-bottom: 0;
      margin-bottom: 0;
    }

    .edu-top {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 4px;
    }

    .edu-degree {
      font-weight: 600;
      font-size: 13px;
      color: var(--primary);
    }

    .edu-org {
      font-size: 12px;
      color: var(--text-muted);
    }

    .edu-info {
      font-size: 11px;
      color: var(--text-muted);
    }

    .experience-item {
      margin-bottom: 10px;
      padding-bottom: 8px;
      border-bottom: 1px dashed rgba(148, 163, 184, 0.6);
    }

    .experience-item:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
    }

    .exp-top {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 3px;
    }

    .exp-role {
      font-weight: 600;
      font-size: 13px;
      color: var(--primary);
    }

    .exp-company {
      font-size: 12px;
      color: var(--text-muted);
    }

    .exp-meta {
      font-size: 11px;
      color: var(--text-muted);
      margin-bottom: 4px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px 12px;
    }

    .exp-bullets {
      margin: 0;
      padding-right: 16px;
      list-style-type: "• ";
    }

    .exp-bullets li {
      margin-bottom: 3px;
    }

    .skills-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .skill-pill {
      font-size: 11px;
      padding: 4px 9px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.8);
      background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.10), #ffffff);
      white-space: nowrap;
    }

    .skills-group {
      margin-bottom: 8px;
    }

    .skills-group:last-child {
      margin-bottom: 0;
    }

    .skills-group-title {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      margin-bottom: 4px;
    }

    .cert-item {
      margin-bottom: 9px;
      padding-bottom: 7px;
      border-bottom: 1px dashed rgba(148, 163, 184, 0.6);
    }

    .cert-item:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
    }

    .cert-name {
      font-size: 12px;
      font-weight: 600;
      color: var(--primary);
      margin-bottom: 2px;
    }

    .cert-issuer {
      font-size: 11px;
      color: var(--text-muted);
      margin-bottom: 1px;
    }

    .cert-meta {
      font-size: 11px;
      color: var(--text-muted);
    }

    .info-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 4px 10px;
      font-size: 11px;
      color: var(--text-muted);
    }

    .info-label {
      font-weight: 500;
      color: var(--text-main);
    }

    .footer {
      padding: 10px 26px 18px;
      font-size: 10px;
      color: #9ca3af;
      display: flex;
      justify-content: space-between;
      border-top: 1px solid var(--border-soft);
      background: #f9fafb;
    }

    @media print {
      body {
        background: #ffffff;
        padding: 0;
      }
      .page {
        box-shadow: none;
        border-radius: 0;
        border: none;
      }
    }
    
    .contact-link {
  color: #4F6D7A;
  text-decoration: none;
  font-weight: 500;
}

.contact-link:hover {
  color: #56A3A6;
}

#popup-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9990;
  transition: opacity .25s ease;
}

.popup-hidden {
  opacity: 0;
  pointer-events: none;
}

.popup-bg {
  position: absolute;
  inset: 0;
}

.popup-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0,0,0,0.4);
  z-index: 9991;
}

.popup-close {
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 34px;
  background: rgba(255,255,255,0.4);
  border: none;
  border-radius: 50%;
  padding: 4px 14px;
  cursor: pointer;
  z-index: 9992;
  backdrop-filter: blur(5px);
}
.popup-close:hover {
  background: rgba(255,255,255,0.7);
}

.btn-view {
  padding: 6px 14px;
  margin-top: 8px;
  background: #1d3a5f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s;
}

.btn-view:hover {
  background: #0284c7;
}


