/* ATS-friendly: linear flow, semantic sections, real text — no critical content in images */
:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #5c6370;
  --accent: #0d47a1;
  --accent-soft: #e3ecf7;
  --border: #e2e6ed;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  padding: 2.25rem 2rem;
}

header.cv-header {
  border-bottom: 3px solid var(--accent);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.title-line {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
}

.contact-row span {
  white-space: nowrap;
}

section {
  margin-bottom: 1.35rem;
}

section:last-child {
  margin-bottom: 0;
}

h2 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  font-weight: 700;
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: 0.35rem;
}

p.summary {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

p.summary + p.summary {
  margin-top: 0.65rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1.25rem;
  font-size: 0.9rem;
}

.skill-block h3 {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.skill-block p {
  margin: 0;
  line-height: 1.45;
}

.job {
  margin-bottom: 1.25rem;
  page-break-inside: avoid;
}

.job:last-child {
  margin-bottom: 0;
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.2rem;
}

.job-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.job-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.company {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  color: var(--text);
}

ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

li {
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.sub-project {
  margin-top: 0.85rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--accent-soft);
}

.sub-project h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.sub-project .sub-desc {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.cert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cert-table th,
.cert-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.cert-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.cert-table tr:last-child td {
  border-bottom: none;
}

.edu-block {
  font-size: 0.95rem;
}

.edu-block strong {
  display: block;
  margin-bottom: 0.15rem;
}

.lang-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.92rem;
}

.soft-skills-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.92rem;
}

.soft-skills-list li {
  margin-bottom: 0.4rem;
}

[dir="rtl"] body {
  text-align: right;
}

[dir="rtl"] .contact-row,
[dir="rtl"] .lang-row,
[dir="rtl"] .job-head {
  direction: rtl;
}

[dir="rtl"] ul,
[dir="rtl"] .soft-skills-list {
  padding-right: 1.15rem;
  padding-left: 0;
}

[dir="rtl"] .sub-project {
  border-right: 3px solid var(--accent-soft);
  border-left: none;
  padding-right: 0.5rem;
  padding-left: 0;
}

[dir="rtl"] .cert-table th,
[dir="rtl"] .cert-table td {
  text-align: right;
}

@media print {
  body {
    background: #fff;
  }

  .page {
    padding: 0;
    max-width: none;
  }

  .sheet {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  a {
    color: #000;
  }
}
