@page { size: A4; margin: 12mm 0; }
@page :first { margin-top: 0; }
:root {
  --brand: #b91c1c;
  --brand-2: #ea580c;
  --ink: #1c1917;
  --muted: #57534e;
  --faint: #8a817c;
  --line: #ece4df;
  --side: #fbf4f1;
  --chip: #fde8e3;
}
* { box-sizing: border-box; }
html { color-scheme: light; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body { margin: 0; background: #e9e4e0; color: var(--ink); font: 9.6pt/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
.page { width: 210mm; margin: 24px auto; background: #fff; box-shadow: 0 6px 30px rgba(28, 25, 23, .14); }

/* header */
.top { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 26px 30px 22px; color: #fff; background: linear-gradient(120deg, #7f1d1d 0%, var(--brand) 55%, var(--brand-2) 100%); }
.photo { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, .85); }
.top h1 { margin: 0; font-size: 23pt; line-height: 1.05; letter-spacing: -.02em; }
.top .title { margin: 5px 0 2px; font-size: 12pt; font-weight: 700; color: #ffe4d6; }
.top .sub { margin: 0; font-size: 9.5pt; color: rgba(255, 255, 255, .88); max-width: 46ch; }
.qr { width: 84px; text-align: center; font-size: 7pt; line-height: 1.25; color: rgba(255, 255, 255, .9); }
.qr svg { display: block; width: 84px; height: 84px; padding: 5px; background: #fff; border-radius: 8px; margin-bottom: 4px; }

.contact { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 30px; border-bottom: 1px solid var(--line); background: #fff; font-size: 8.8pt; color: var(--muted); }
.contact span, .contact a { display: inline-flex; align-items: center; gap: 6px; }
.contact svg { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.numbers { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.numbers div { padding: 10px 30px; border-right: 1px solid var(--line); }
.numbers div:last-child { border-right: 0; }
.numbers strong { display: block; font-size: 17pt; line-height: 1.1; color: var(--brand); }
.numbers span { font-size: 8.4pt; color: var(--muted); }

/* body */
.cols { display: grid; grid-template-columns: 64mm 1fr; }
.side { background: var(--side); padding: 18px 20px 22px 30px; }
.main { padding: 18px 30px 22px 24px; }
h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 8.6pt; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
section + section { margin-top: 16px; }
p { margin: 0 0 6px; }
.profile { font-size: 9.8pt; color: #292524; }

.skill { margin-bottom: 9px; break-inside: avoid; }
.skill h3 { margin: 0 0 4px; font-size: 8.6pt; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 2px 8px; border-radius: 999px; background: var(--chip); color: #7f1d1d; font-size: 7.9pt; font-weight: 600; }
.plain { margin: 0; padding-left: 15px; }
.plain li { margin-bottom: 4px; font-size: 8.8pt; color: #44403c; }
.plain li::marker { color: var(--brand); }

.job-head, .proj-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.job-head strong { font-size: 10.5pt; }
.when { font-size: 8.6pt; font-weight: 700; color: var(--brand); }
.bullets { margin: 4px 0 0; padding-left: 15px; }
.bullets li { margin-bottom: 3px; }
.bullets li::marker { color: var(--brand); }

.proj { padding: 9px 0 8px; border-top: 1px dashed var(--line); break-inside: avoid; }
.proj:first-of-type { border-top: 0; padding-top: 0; }
.proj-head strong { font-size: 10.4pt; }
.proj-head a { font-size: 8.4pt; font-weight: 600; color: var(--brand); }
.label { margin: 0 0 2px; font-size: 8.4pt; color: var(--faint); }
.stack { margin: 3px 0 0; font-size: 8pt; color: var(--faint); }
.also { font-size: 8.8pt; color: #44403c; }

.dl { text-align: center; margin: 0 auto 30px; }
.dl a { display: inline-block; padding: 11px 20px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 700; font-size: 10pt; }

@media print {
  body { background: #fff; }
  .page { width: auto; margin: 0; box-shadow: none; }
  .dl { display: none; }
}
@media screen and (max-width: 760px) {
  .page { width: auto; margin: 0; box-shadow: none; }
  .top { grid-template-columns: auto 1fr; padding: 22px 16px; }
  .qr { display: none; }
  .photo { width: 72px; height: 72px; }
  .top h1 { font-size: 19pt; }
  .contact, .numbers div { padding-left: 16px; padding-right: 16px; }
  .cols { grid-template-columns: 1fr; }
  .side { order: 2; padding: 18px 16px; }
  .main { padding: 18px 16px; }
  body { font-size: 10pt; }
  .dl { margin-top: 20px; }
}
@media screen and (max-width: 420px) {
  .numbers div { padding: 10px 12px; }
  .numbers span { font-size: 8pt; line-height: 1.3; display: block; }
}
.cert { display: block; break-inside: avoid; }
.cert img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 5px; }
.cert span { display: block; font-size: 8.4pt; line-height: 1.4; color: #44403c; }
.job-2 { margin-top: 10px; }
.edu { font-size: 8.8pt; line-height: 1.45; color: #44403c; }
.edu strong { color: var(--ink); }
