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

:root {
  --ink: #1a1a2e;
  --ink-light: #475569;
  --ink-muted: #8494a7;
  --accent: #1a365d;
  --accent-light: #2b6cb0;
  --accent-bg: #edf2fc;
  --border: #d6dce6;
  --white: #fff;
}

@page {
  size: A4;
  margin: 12mm 15mm;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #94a3b8;
  line-height: 1.4;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.page {
  width: 210mm;
  margin: 1rem auto;
  background: var(--white);
  padding: 12mm 16mm;
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
}

/* ===== HEADER ===== */
.header {
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
}

.header-row-1 {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.25rem;
}

.name {
  font-size: 1.8em;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.role {
  font-size: 1em;
  font-weight: 600;
  color: var(--accent-light);
}

.header-row-2 {
  font-size: 0.85em;
  color: var(--ink-light);
  line-height: 1.55;
  letter-spacing: 0.2px;
}

.header-row-2 span,
.header-row-2 a {
  color: var(--ink-light);
  text-decoration: none;
}

.header-row-2 a:hover {
  color: var(--accent-light);
}

/* ===== SECTIONS ===== */
.section {
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  padding: 0.1rem 0 0.1rem 0.5rem;
  border-left: 3px solid var(--accent-light);
  border-bottom: none;
  margin-bottom: 0.35rem;
}

/* ===== SUMMARY ===== */
.summary {
  font-size: 0.92em;
  color: var(--ink);
  line-height: 1.45;
  text-align: justify;
}

/* ===== SKILLS (pills) ===== */
.skills-row {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 0 0.6rem;
  padding: 0.28rem 0.4rem;
  align-items: center;
  border-bottom: 1px solid #eef1f5;
}

.skills-row:last-child {
  border-bottom: none;
}

.skills-row.even {
  background: #f8fafc;
}

.skills-cat {
  font-size: 0.75em;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.skills-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.pill {
  font-size: 0.73em;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: var(--accent-bg);
  color: var(--ink);
}

.pill.key {
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
}

/* ===== EXPERIENCE ===== */
.timeline {
  position: relative;
  padding-left: 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}

.job {
  position: relative;
  margin-bottom: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #eef1f5;
  break-inside: auto;
}

.job-header {
  break-after: avoid;
}

.job::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--accent-light);
}

.job:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.job-title-line {
  flex: 1;
  min-width: 0;
}

.job-title-line h3 {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--ink);
  display: inline;
}

.job-at {
  font-size: 0.85em;
  color: var(--ink-muted);
}

.job-company {
  font-size: 0.88em;
  font-weight: 600;
  color: var(--accent-light);
}

.job-location {
  font-size: 0.82em;
  color: var(--ink-muted);
}

.job-dates {
  font-size: 0.75em;
  color: var(--ink-light);
  font-weight: 600;
  white-space: nowrap;
  margin-left: 0.5rem;
  background: #f1f5f9;
  padding: 0.12rem 0.5rem;
  border-radius: 3px;
}

.job-summary {
  font-size: 0.85em;
  color: var(--ink);
  line-height: 1.4;
  margin-top: 0.1rem;
}

.job-summary strong {
  font-weight: 700;
  color: var(--accent-light);
}

.job-compact {
  margin-bottom: 0.25rem;
  padding-bottom: 0.2rem;
}

.job-highlights {
  list-style: none;
  padding: 0;
}

.job-highlights li {
  font-size: 0.85em;
  padding-left: 0.75rem;
  position: relative;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 0.06rem;
}

.job-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-light);
}

.job-highlights strong {
  font-weight: 700;
  color: var(--accent-light);
}

/* ===== BOTTOM GRID (Education + Certs + Languages) ===== */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.6rem;
  padding-top: 0.3rem;
  border-top: 2px solid var(--border);
  page-break-inside: avoid;
}

.bottom-col {
  min-width: 0;
}

.bottom-item {
  font-size: 0.85em;
  margin-bottom: 0.15rem;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.bottom-item strong {
  font-weight: 700;
  color: var(--ink);
}

.muted {
  color: var(--ink-light);
  font-size: 0.92em;
}

/* ===== CERTIFICATIONS ===== */
.bottom-item a {
  color: var(--accent-light);
  text-decoration: none;
}

.bottom-item a:hover {
  text-decoration: underline;
}

/* ===== PRINT ===== */
@media print {
  body {
    background: white;
  }

  .page {
    margin: 0;
    padding: 0;
    box-shadow: none;
    width: 100%;
  }

  #print-btn {
    display: none !important;
  }

  .job {
    break-inside: auto;
  }

  .job-header {
    break-after: avoid;
  }

  .job-highlights li {
    orphans: 2;
    widows: 2;
  }

  .bottom-grid {
    page-break-inside: avoid;
  }

  .pill.key {
    background: var(--accent) !important;
    color: var(--white) !important;
  }

  .skills-row.even {
    background: #f8fafc !important;
  }

  .job-dates {
    background: #f1f5f9 !important;
  }

  .timeline::before {
    background: var(--border) !important;
  }

  .job::before {
    background: var(--accent-light) !important;
    box-shadow: 0 0 0 1px var(--accent-light) !important;
  }
}

/* ===== DOWNLOAD BUTTON ===== */
#print-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

#print-btn:hover {
  background: #2b6cb0;
}
