:root {
  --ink: #101511;
  --muted: #596159;
  --line: #d9ded8;
  --soft: #f2f5f0;
  --accent: #3f681d;
}

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

html { background: #dfe3dd; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10.2pt;
  line-height: 1.34;
}

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

.document-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(20px, calc((100% - 210mm) / 2));
  color: #f4f6f1;
  background: #101511;
  box-shadow: 0 5px 20px rgba(0,0,0,.16);
}

.document-toolbar div { display: flex; gap: 9px; }
.document-toolbar a, .document-toolbar button { padding: 8px 13px; color: inherit; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: transparent; font: 700 9pt Arial, sans-serif; cursor: pointer; }
.document-toolbar .download { color: #101511; border-color: #b8ff65; background: #b8ff65; }

.page {
  width: 210mm;
  min-height: 297mm;
  margin: 18px auto;
  padding: 14mm 15mm 13mm;
  background: white;
  box-shadow: 0 15px 45px rgba(16,21,17,.13);
}

.resume-page { height: 297mm; overflow: hidden; }

.document-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10mm;
  align-items: end;
  padding-bottom: 5mm;
  border-bottom: 1.5pt solid var(--ink);
}

.document-header h1 { margin: 0; font-size: 27pt; line-height: .95; letter-spacing: -.045em; }
.document-header .role { margin: 2.5mm 0 0; color: var(--accent); font-size: 11pt; font-weight: 700; }
.contact-list { display: grid; gap: 1.3mm; text-align: right; color: var(--muted); font-size: 8.5pt; }

.summary { margin: 4mm 0 0; font-size: 9.2pt; line-height: 1.4; }

.document-section { margin-top: 4mm; }
.document-section h2 {
  margin: 0 0 2.3mm;
  padding-bottom: 1.3mm;
  color: var(--accent);
  border-bottom: .7pt solid var(--line);
  font-size: 9.2pt;
  line-height: 1;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.job { margin-top: 3.2mm; break-inside: avoid; }
.job:first-of-type { margin-top: 0; }
.job-head { display: grid; grid-template-columns: 1fr auto; gap: 5mm; align-items: baseline; }
.job-head h3 { margin: 0; font-size: 10.5pt; line-height: 1.15; }
.job-head h3 span { font-weight: 400; }
.job-head time { color: var(--muted); font-size: 8.4pt; white-space: nowrap; }
.job-sub { margin: .7mm 0 1.2mm; color: var(--accent); font-size: 8.5pt; font-weight: 700; }
.job ul, .compact-list { margin: 0; padding-left: 4.4mm; }
.job li, .compact-list li { margin: .8mm 0; padding-left: .8mm; }

.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 7mm; }
.project-line { margin-bottom: 2.5mm; break-inside: avoid; }
.project-line h3 { margin: 0 0 .7mm; font-size: 9.5pt; }
.project-line p { margin: 0; color: var(--muted); font-size: 8.5pt; }

.skill-row { display: grid; grid-template-columns: 34mm 1fr; gap: 4mm; margin: 1.2mm 0; font-size: 8.5pt; }
.skill-row strong { color: var(--ink); }
.skill-row span { color: var(--muted); }

.education-row { display: grid; grid-template-columns: 1fr auto; gap: 5mm; font-size: 8.6pt; }
.education-row strong { display: block; }
.education-row span, .education-row time { color: var(--muted); }

.doc-note { margin-top: 3mm; color: var(--muted); font-size: 7.5pt; }

.cv-page .document-header { margin-bottom: 2mm; }
.cv-page .summary { font-size: 10pt; }
.cv-page .document-section { margin-top: 5.5mm; }
.cv-page .document-section h2 { font-size: 9.8pt; }
.cv-page .job { margin-top: 4mm; }
.cv-page .job-head h3 { font-size: 11.5pt; }
.cv-page .job li { margin: 1.3mm 0; }
.cv-strengths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; margin-top: 5mm; }
.cv-strengths div { padding: 3.5mm; background: var(--soft); border-left: 2pt solid var(--accent); }
.cv-strengths strong { display: block; margin-bottom: 1mm; font-size: 9pt; }
.cv-strengths span { color: var(--muted); font-size: 8pt; }
.cv-project { padding: 3.5mm 0; border-bottom: .7pt solid var(--line); break-inside: avoid; }
.cv-project:last-child { border-bottom: 0; }
.cv-project-head { display: flex; justify-content: space-between; gap: 8mm; }
.cv-project h3 { margin: 0; font-size: 11pt; }
.cv-project-head span { color: var(--accent); font-size: 8pt; font-weight: 700; text-align: right; }
.cv-project p { margin: 1.4mm 0; color: var(--muted); }
.cv-project ul { margin: 0; padding-left: 4.4mm; }
.cv-project li { margin: .9mm 0; }
.cv-footer { display: flex; justify-content: space-between; margin-top: 6mm; padding-top: 2mm; color: var(--muted); border-top: .7pt solid var(--line); font-size: 7.5pt; }

@page { size: A4; margin: 0; }

@media print {
  html, body { background: white; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .screen-only { display: none !important; }
  .page { width: 210mm; height: 296.5mm; min-height: 296.5mm; margin: 0; overflow: hidden; box-shadow: none; break-after: page; }
  .page:last-child { break-after: auto; }
}

@media screen and (max-width: 850px) {
  .document-toolbar { padding-inline: 15px; }
  .document-toolbar > span { display: none; }
  .page { width: 100%; min-height: auto; margin: 0; padding: 28px 22px; box-shadow: none; }
  .resume-page { height: auto; overflow: visible; }
  .document-header { grid-template-columns: 1fr; }
  .contact-list { text-align: left; }
  .contact-list a { display: inline-flex; align-items: center; min-height: 24px; }
  .two-column, .cv-strengths { grid-template-columns: 1fr; }
}
