/* Resume — an HTML sheet that is also the source of assets/resume.pdf.
   On screen it sits on the grey resume-doc backdrop; in print it is the whole A4 page (see build-resume-pdf.sh).

   One grid for the whole sheet: 40px side margins, three equal columns, 24px gutters.
   The header contact row, the Experience rows (meta in column 1, bullets in columns 2-3) and the bottom row all
   sit on those columns. Spacing comes from a 4px scale (--s1..--s6); body text sits on a 17px line (1.42, as before). */

.resume-doc { container-type: inline-size; padding: 32px 24px; }

.cv {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --margin: 40px;
  --gap: 24px;
  --lh: 17px;

  --cv-ink: #111;
  --cv-strong: #141414;
  --cv-body: #434343;
  --cv-mute: #7b7b7b;
  --cv-rule: #c6c6c6;
  --cv-head: #3b3b3b;
  --cv-head-body: #cdcdcd;
  --cv-head-rule: #636363;

  width: min(100%, 210mm);
  min-height: 297mm;
  margin: 0 auto;
  background: #fff;
  color: var(--cv-body);
  font-family: "Inter", system-ui, sans-serif;
  font-optical-sizing: auto;
  font-variation-settings: normal;
  font-size: 12px;
  line-height: var(--lh);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.45);
}
.cv ::selection { background: var(--cyan); color: #000; -webkit-text-fill-color: #000; }
.cv a { text-decoration: none; }
.cv a:hover { text-decoration: underline; }
.cv strong { color: var(--cv-strong); font-weight: 600; }
.cv ul { list-style: none; }

/* ---------- Header ---------- */
.cv-head {
  display: grid;
  grid-template-columns: 1fr 128px;
  column-gap: var(--gap);
  padding: var(--s5) var(--margin) var(--s4);
  background: var(--cv-head);
  color: #fff;
}
.cv-head h1 { font-size: 44px; font-weight: 600; line-height: 48px; letter-spacing: -0.045em; }
.cv-role { margin-top: var(--s2); font-size: 13px; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.cv-sub { margin-top: 0; font-size: 13px; color: var(--cv-head-body); opacity: 0.8; }
.cv-summary { margin-top: var(--s4); font-size: 13px; line-height: 20px; color: var(--cv-head-body); text-wrap: pretty; }

/* the photo takes the height of the text block beside it, so its top meets the name and its bottom meets the summary */
.cv-photo { position: relative; border-radius: 12px; overflow: hidden; }
.cv-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }

/* email · LinkedIn · portfolio on one line, evenly spaced edge to edge */
.cv-contact {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; gap: var(--gap);
  margin-top: var(--s4); padding-top: var(--s3);
  border-top: 1px solid var(--cv-head-rule);
  font-size: 13px; line-height: 20px;
}
.cv-contact .k { display: block; font-size: 10px; font-weight: 500; line-height: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: #a9a9a9; }
.cv-contact a { font-weight: 500; }

/* ---------- Body ---------- */
.cv-body { display: grid; gap: var(--s5); padding: var(--s5) var(--margin) var(--s4); }

/* a column carries its own dashed rule, set in the gutter so the text stays on the page margin */
.cv-col { position: relative; }
.cv-col::before { content: ""; position: absolute; left: calc(var(--gap) / -2); top: 0; bottom: 0; border-left: 1px dashed var(--cv-rule); }

.cv h2 { font-size: 20px; font-weight: 600; line-height: 24px; letter-spacing: -0.03em; color: var(--cv-ink); margin-bottom: var(--s2); }

.cv-org { font-weight: 600; color: var(--cv-strong); text-transform: uppercase; }
.cv-title { color: var(--cv-strong); text-transform: uppercase; }
.cv-when { margin-top: var(--s1); color: var(--cv-mute); }

/* Experience: meta in column 1, bullets in columns 2-3 — the same three columns as the bottom row */
.cv-job { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); }
.cv-job + .cv-job { margin-top: var(--s4); }
.cv-points { grid-column: 2 / 4; }
.cv-points li { position: relative; padding-left: var(--s3); text-wrap: pretty; }
.cv-points li + li { margin-top: var(--s1); }
.cv-points li::before { content: "•"; position: absolute; left: 0; color: var(--cv-ink); }

/* Bottom row */
.cv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5) var(--gap); }
.cv-skills { grid-column: span 2; }
.cv-skillgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); }
.cv-edu + .cv-edu { margin-top: var(--s3); }
.cv-skill + .cv-skill { margin-top: var(--s2); }
.cv-skill span { white-space: nowrap; }
.cv-skill b { display: block; font-weight: 600; color: var(--cv-strong); }
.cv-social { display: flex; gap: var(--s2); }
.cv-social a { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: #000; color: #fff; }
.cv-social svg { width: 16px; height: 16px; }

/* ---------- Narrow sheet (mobile, or a squeezed desktop pane) ---------- */
@container (max-width: 640px) {
  .cv { --margin: 20px; min-height: 0; }
  .cv-head { grid-template-columns: 1fr; }
  .cv-photo { grid-row: 1; width: 112px; height: 112px; margin-bottom: var(--s4); }
  .cv-head h1 { font-size: 40px; }
  .cv-contact { flex-direction: column; gap: var(--s2); }
  .cv-col::before { left: -10px; }
  .cv-job, .cv-grid, .cv-skillgrid { grid-template-columns: 1fr; }
  .cv-skills { grid-column: auto; }
  .cv-skillgrid > div + div { margin-top: var(--s2); }
  .cv-job .cv-when { margin: 0 0 var(--s2); }
  .cv-points { grid-column: auto; }
}
@media (max-width: 900px) { .resume-doc { padding: 16px; } }

/* ---------- Print / PDF: only the sheet, A4, edge to edge ---------- */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  .skip, .side, .resume-bar, .cursor { display: none !important; }
  .sheet, .resume, .resume-doc { position: static !important; inset: auto; height: auto; overflow: visible; padding: 0; margin: 0; background: none; }
  .cv { width: 210mm; height: 297mm; box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
