/* ==========================================================================
   CV page (/cv). Structure modelled on cv.jarocki.me: compact header, About,
   Work Experience, Education, Skills, Projects. Everything visual comes from
   the portfolio tokens in styles.css (Inter, gray ramp, type scale, 576px
   column, 18px logo tiles, two-tone copy, faint date tags).
   ========================================================================== */

.cv {
  gap: 40px;
  letter-spacing: -0.01em;
}

/* ---------- Header ---------- */
.cv-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cv-head__id {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cv-head__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cv-name {
  font-size: var(--base); /* body-sized name, like the homepage intro */
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.cv-role {
  font-size: var(--sm);
  color: var(--text-muted);
  letter-spacing: -0.02em;
}
.cv-loc {
  font-size: var(--xs);
  color: var(--text-faint);
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: var(--sm);
  letter-spacing: -0.02em;
}
.cv-contact__link {
  position: relative;
  padding: 4px 0;
  color: var(--text-muted);
  transition: color 0.15s var(--ease);
}
.cv-contact__link::before {
  content: "";
  position: absolute;
  inset: 0 -8px;
  border-radius: 9px;
  background: var(--surface-hover);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
.cv-contact__link:hover,
.cv-contact__link:focus-visible { color: var(--text); }
.cv-contact__link:hover::before { opacity: 1; }

.cv-contact-print { display: none; }
.cv-sep { margin: 0 0.5em; color: var(--text-faint); }

/* ---------- Sections ---------- */
.cv-sec {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cv-sec__title {
  font-size: var(--base);   /* muted section titles, like .block__title */
  font-weight: 400;
  color: var(--text-muted);
}

.cv-about {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--sm);
  line-height: 1.5;
  color: var(--text);
  text-wrap: pretty;
}

/* ---------- Entries (work, education) ---------- */
.cv-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.cv-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
}
.cv-item:first-child { border-top: 0; padding-top: 0; }
.cv-item:last-child { padding-bottom: 0; }
.cv-list--tight .cv-item { padding: 10px 0; }
.cv-list--tight .cv-item:first-child { padding-top: 0; }

.cv-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--sm);
}
.cv-item__who {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.cv-logo {
  width: 18px;
  height: 18px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface);
}
.cv-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Companies with no logo in the repo: a quiet monogram tile on the gray ramp. */
.cv-logo--mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-quiet);
  border: 0.5px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

.cv-item__name {
  font-weight: 600;
  color: var(--text-strong);
}
.cv-item__co {
  font-weight: 400;
  color: var(--text-muted);
}
.cv-item__co::before {
  content: "·";
  margin: 0 0.42em;
  color: var(--text-faint);
}
.cv-item__tag {
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: var(--sm);
}

.cv-item__role {
  font-size: var(--xs);
  color: var(--text);
  padding-left: 30px; /* align under the company name, past the 18px logo + 12px gap */
}
.cv-list--tight .cv-item__role { padding-left: 0; }

.cv-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 30px;
  margin-top: 2px;
  font-size: var(--xs);
  line-height: 1.45;
  color: var(--text-muted);
  text-wrap: pretty;
}
.cv-bullets li {
  position: relative;
}
.cv-bullets li::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 0.62em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
}
.cv-lead { color: var(--text); } /* two-tone: the lead clause in darker ink */

/* Inline links: underline wipes in on hover, like .lnk */
.cv-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.18s var(--ease);
}
.cv-link:hover,
.cv-link:focus-visible { text-decoration-color: currentColor; }

/* ---------- Skills: a quiet wrap of hairline chips ---------- */
.cv-skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cv-skills li {
  font-size: var(--xs);
  color: var(--text-muted);
  padding: 3px 9px;
  border: 0.5px solid var(--border);
  border-radius: var(--r-pill);
  white-space: nowrap;
}

/* ---------- Projects ---------- */
.cv-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.cv-project {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cv-project__title {
  font-size: var(--sm);
  font-weight: 600;
  color: var(--text-strong);
}
.cv-arrow {
  display: inline-block;
  margin-left: 3px;
  font-weight: 400;
  color: var(--text-faint);
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}
.cv-project__title:hover .cv-arrow { transform: translate(1px, -1px); color: var(--text-muted); }
.cv-project__desc {
  font-size: var(--xs);
  line-height: 1.45;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* ---------- Footer ---------- */
.cv-footer { margin-top: 0; }
.cv-print-btn {
  font: inherit;
  font-size: var(--xs);
  color: var(--text-faint);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.15s var(--ease);
}
.cv-print-btn:hover,
.cv-print-btn:focus-visible { color: var(--text); }

@media (max-width: 560px) {
  .cv-projects { grid-template-columns: 1fr; gap: 14px; }
}

/* ==========================================================================
   Print / Save as PDF: A4, one page, quiet.
   ========================================================================== */
@page {
  size: A4;
  margin: 10mm 15mm;
}

@media print {
  html, body {
    background: #fff !important;
    cursor: auto !important;
  }
  .top-fade,
  .cv-chrome,
  .cv-print-btn,
  .cv-contact,
  .cv-footer { display: none !important; }

  .cv-shell {
    min-height: 0;
    padding: 0;
    display: block;
  }
  .cv {
    max-width: none;
    gap: 4.5mm;
  }

  .cv-head {
    flex-direction: column;
    align-items: stretch;
    gap: 2.5mm;
  }
  .cv-avatar { width: 38px; height: 38px; }
  .cv-name { font-size: 11pt; }
  .cv-role { font-size: 9pt; }
  .cv-loc { font-size: 8pt; }

  .cv-contact-print {
    display: block;
    font-size: 7.5pt;
    color: var(--text-muted);
    text-align: left;
  }

  .cv-sec { gap: 2.2mm; break-inside: auto; }
  .cv-sec--keep { break-inside: avoid; }
  .cv-skills, .cv-projects { break-inside: avoid; }
  .cv-sec__title { font-size: 9pt; }

  .cv-about { gap: 1.2mm; font-size: 8.5pt; line-height: 1.4; }

  .cv-item {
    gap: 0.4mm;
    padding: 2mm 0;
    break-inside: avoid;
  }
  .cv-list--tight .cv-item { padding: 1.6mm 0; }
  .cv-item__head { font-size: 8.75pt; }
  .cv-item__tag { font-size: 8pt; }
  .cv-item__role { font-size: 8pt; }
  .cv-bullets { font-size: 8pt; line-height: 1.35; gap: 0.4mm; }

  .cv-logo { width: 16px; height: 16px; }
  .cv-item__who { gap: 9px; }
  .cv-item__role, .cv-bullets { padding-left: 25px; }

  .cv-skills { gap: 1mm; }
  .cv-skills li { font-size: 7.5pt; padding: 0.3mm 1.8mm; }

  .cv-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5mm; }
  .cv-project__title { font-size: 8.5pt; }
  .cv-project__desc { font-size: 8pt; line-height: 1.35; }
  .cv-arrow { display: none; }

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

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
