:root {
  --bg: #e9edf3;
  --bg-deep: #dfe6ef;
  --text: #111827;
  --muted: #4b5563;
  --line: #d1d5db;
  --line-soft: #e5e7eb;
  --accent: #0f172a;
  --accent-soft: #d7ab63;
  --paper: #ffffff;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(215, 171, 99, 0.10), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.rtl-mode {
  direction: rtl;
  text-align: right;
}

.resume-header {
  padding: 36px 16px 16px;
}

.resume-header-inner {
  width: min(900px, 94%);
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.resume-header-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(215, 171, 99, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.02), transparent 40%);
}

.resume-eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  position: relative;
}

.resume-role {
  margin: 10px 0 8px;
  font-size: 1.08rem;
  font-weight: 700;
  color: #243042;
  position: relative;
}

.resume-contact {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  position: relative;
}

.resume-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  position: relative;
}

.resume-contact-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.resume-contact-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--muted);
}

.resume-contact-item a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  word-break: break-word;
}

.resume-contact-item a:hover {
  color: #a06c28;
}

.resume-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  position: relative;
}

.resume-btn {
  border: 1px solid #9ca3af;
  border-radius: 999px;
  background: #f9fafb;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.resume-btn:hover {
  transform: translateY(-1px);
  border-color: #6b7280;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}

.resume-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.resume-main {
  width: min(900px, 94%);
  margin: 0 auto 32px;
  background: var(--paper);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius);
  padding: 28px 30px 32px;
  box-shadow: var(--shadow);
}

.resume-section-group {
  display: grid;
  gap: 18px;
}

section + section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

h2 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #334155;
}

h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.42;
}

p {
  margin: 0;
  font-size: 0.96rem;
}

ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

li {
  margin: 6px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.resume-entry + .resume-entry {
  margin-top: 18px;
}

.entry-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

#summary-title + p,
#tools-title + p {
  color: #243042;
}

#education-title + h3 {
  margin-bottom: 6px;
}

.resume-subheading {
  margin: 2px 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #475569;
}

section[aria-labelledby="skills-title"] ul,
section[aria-labelledby="projects-title"] ul,
section[aria-labelledby="languages-title"] ul,
section[aria-labelledby="cert-title"] ul {
  display: grid;
  gap: 4px;
}

section[aria-labelledby="experience-title"] .resume-entry {
  padding-left: 18px;
  border-left: 2px solid rgba(15, 23, 42, 0.12);
}

body.rtl-mode section[aria-labelledby="experience-title"] .resume-entry {
  padding-left: 0;
  padding-right: 18px;
  border-left: 0;
  border-right: 2px solid rgba(15, 23, 42, 0.12);
}

body.rtl-mode ul {
  padding-left: 0;
  padding-right: 20px;
}

body.rtl-mode .resume-actions,
body.rtl-mode .resume-contact-grid {
  direction: rtl;
}

body.rtl-mode .resume-contact-item a {
  unicode-bidi: isolate;
}

@media (max-width: 700px) {
  .resume-header {
    padding-top: 24px;
  }

  .resume-header-inner,
  .resume-main {
    padding: 18px;
  }

  .resume-contact {
    line-height: 1.6;
  }

  .resume-contact-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.8rem;
  }

  .resume-role {
    font-size: 1rem;
  }

  section + section {
    margin-top: 20px;
    padding-top: 16px;
  }
}

@media (max-width: 520px) {
  .resume-actions {
    flex-direction: column;
  }

  .resume-btn {
    width: 100%;
  }
}

@page {
  size: A4;
  margin: 14mm;
}

@media print {
  html,
  body {
    background: #fff;
    color: #000;
  }

  .site-header {
    display: none !important;
  }

  .resume-header {
    padding: 0;
  }

  .resume-header-inner,
  .resume-main {
    width: 100%;
    max-width: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

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

  .resume-main {
    margin-top: 8px;
  }

  section,
  .resume-entry {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  section + section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #d1d5db;
  }

  section[aria-labelledby="experience-title"] .resume-entry {
    padding-left: 0;
    border-left: none;
  }

  body.rtl-mode section[aria-labelledby="experience-title"] .resume-entry {
    padding-right: 0;
    border-right: none;
  }

  h1 {
    font-size: 20pt;
  }

  h2 {
    font-size: 12.5pt;
  }

  h3 {
    font-size: 10.5pt;
  }

  p,
  li,
  .entry-meta {
    font-size: 10pt;
    line-height: 1.45;
  }
}
