/* =========================================================
   CV / Dossier page — builds on the tokens and components in styles.css
   ========================================================= */
/* Focused reading layout: centered column with fluid side margins */
.cv-page {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 6vw, 72px) clamp(56px, 8vw, 96px);
}
.cv-page:focus { outline: none; }

.cv {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Identity */
.cv-id {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px 48px;
}
.cv-id__main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cv-id__name {
  font-weight: 500;
  font-size: clamp(44px, 7vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text);
}
.cv-id__role {
  font-weight: 400;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}
.cv-id__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 15px;
  line-height: 22px;
  color: var(--text-2);
}
.cv-id__contact li + li::before {
  content: '·';
  margin-right: 12px;
  color: var(--muted);
}
.cv-id__contact .cv-sep { display: none; }   /* the text separator is for the PDF; the screen shows "·" */
.cv-id__contact a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cv-id__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.cv-print {
  padding: 12px 4px;
  background: none;
  border: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  line-height: 20px;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.cv-print:hover { color: var(--text); }

/* Stats */
.cv-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 32px;
}
.cv-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cv-stat__num {
  font-weight: 500;
  font-size: clamp(32px, 3.6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}
.cv-stat__label {
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-2);
}

/* Sections */
.cv-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cv-heading {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cv-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
}

/* Experience */
.cv-exp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}
.cv-exp {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cv-exp__sector {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.cv-exp__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 20px;
  line-height: 26px;
  color: var(--text);
}
.cv-exp__desc {
  font-size: 14px;
  line-height: 22px;
  color: var(--text-2);
}
.cv-exp__link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 4px;
  font-weight: 500;
  font-size: 15px;
  line-height: 20px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.cv-exp__link:hover { color: var(--text); }

.cv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.cv-tags li:not(:last-child)::after { content: ' ·'; }
.cv-note {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

/* Panels: expertise + education/tools/methods */
.cv-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cv-label { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text); }
.cv-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.cv-skill-grid,
.cv-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 32px;
  align-items: start;
}

.cv-skills {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cv-skill { font-size: 15px; line-height: 20px; color: var(--text-2); }


.cv-edu__degree {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  line-height: 22px;
  color: var(--text);
}
.cv-edu__school {
  margin-top: -8px;
  font-size: 14px;
  line-height: 22px;
  color: var(--text-2);
}

/* Employment history */
.cv-jobs { display: flex; flex-direction: column; gap: 32px; }
.cv-job { display: flex; flex-direction: column; gap: 4px; }
.cv-job__title { font-family: var(--font-sans); font-weight: 600; font-size: 20px; line-height: 26px; color: var(--text); }
/* Company | Location | Dates on one line: the separators are real text, so parsers and copy-paste keep them */
.cv-job__meta { font-size: 15px; line-height: 22px; color: var(--muted); }
.cv-job__dates { white-space: nowrap; }
.cv-sep { color: var(--muted); white-space: pre; }
.cv-job__project { margin-top: 10px; font-family: var(--font-sans); font-weight: 600; font-size: 14px; line-height: 20px; color: var(--text); }
.cv-job__desc { margin-top: 4px; font-size: 16px; line-height: 1.5; color: var(--text-2); }
.cv-edu { font-size: 14px; line-height: 22px; color: var(--text-2); }
.cv-edu .cv-edu__degree { font-size: inherit; line-height: inherit; }
.cv-job__points { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-left: 18px; list-style: disc; font-size: 16px; line-height: 1.5; color: var(--text-2); }
.cv-job__points li::marker { color: var(--muted); }
.cv-highlights { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; list-style: disc; }
.cv-highlights li::marker { color: var(--muted); }
.cv-highlights strong { color: var(--text); font-weight: 600; }
.cv-section > .cv-note { margin-top: -4px; }
.cv-exp__points { display: flex; flex-direction: column; gap: 4px; padding-left: 18px; list-style: disc; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.cv-ai { margin-top: 12px; font-size: 15px; line-height: 1.45; color: var(--text-2); }

/* Responsive */
@media (max-width: 1024px) {
  .cv-skill-grid,
  .cv-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .cv { gap: 32px; }
  .cv-id__contact { flex-direction: column; gap: 2px; }
  .cv-id__contact li + li::before { content: none; }
  .cv-id__actions { width: 100%; flex-wrap: wrap; gap: 12px; }
  .cv-id__actions .c-btn { flex: 1; }
  .cv-print { display: none; }        /* printing from a phone is rare; the PDF covers it */
  .cv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cv-exp-grid,
  .cv-skill-grid,
  .cv-footer-grid { grid-template-columns: minmax(0, 1fr); }
  .cv-summary p { font-size: 15px; line-height: 24px; }
}

/* =========================================================
   Print — plain, light layout (the designed PDF is the primary download)
   ========================================================= */
/* Footnote variants: the full method on screen, a one-line version in print */
.cv-print-only { display: none; }

/* =========================================================
   Print / PDF: a compact two-page resume
   Projects print as a tight list (no cards that jump pages and leave gaps);
   skills, tools and methods print as inline text; the AI workflow paragraph is screen-only.
   ========================================================= */
@media print {
  @page { size: A4; margin: 12mm 14mm; }

  :root[data-theme] {
    --text: #1a1916;
    --text-2: #3a3935;
    --muted: #6a6862;
    --accent: #2f4b44;
    --line: #bcbab3;
    --bg: #fff;
    --surface: #fff;
  }
  html, body { background: #fff !important; }
  .skip-link, .c-header, .c-terminal,
  .c-topbar, .cv-id__actions, .cv-exp__link, .cv-ai,
  .cv-screen-only, .cv-exp .cv-tags { display: none !important; }
  .cv-print-only { display: flex; }

  body { font-size: 9.5pt; line-height: 1.4; }
  .cv-page { padding: 0; max-width: none; }
  .cv { gap: 10pt; }
  .cv-section { gap: 6pt; }
  .cv-heading { padding-top: 0; border-top: 0; font-weight: 700; font-size: 20px; line-height: 28px; color: var(--accent); break-after: avoid; page-break-after: avoid; margin: 0; }
  .c-footnote { font-size: 7.5pt; line-height: 1.35; margin: 0; }

  /* Identity + stats */
  .cv-id { padding-bottom: 0; }
  .cv-id__name { font-weight: 700; font-size: 22pt; line-height: 1.15; }
  .cv-id__role { font-weight: 700; font-size: 12pt; line-height: 1.3; color: var(--accent); }
  .cv-id__contact { display: block; font-size: 8.5pt; white-space: nowrap; }
  .cv-id__contact li { display: inline; }
  .cv-id__contact li + li::before { content: none; }
  .cv-id__contact .cv-sep { display: inline; }
  .cv-summary p { font-size: 9.5pt; line-height: 1.45; margin: 0; }
  .cv-job__title { font-size: 11pt; line-height: 1.3; }
  .cv-job__dates { font-size: 8pt; color: var(--accent); }
  .cv-job__meta { color: var(--text-2); }
  .cv-job__meta, .cv-job__desc, .cv-edu { font-size: 9.5pt; line-height: 1.4; margin: 0; }
  .cv-job .cv-job__project { margin: 3pt 0 0; font-size: 9.5pt; line-height: 1.4; break-after: avoid; }
  .cv-stats { grid-template-columns: repeat(4, 1fr); gap: 6pt; }
  .cv-stat { padding: 6pt 8pt; break-inside: avoid; border-radius: 4px; }
  .cv-stat__num { font-size: 15pt; line-height: 1.2; }
  .cv-stat__label { font-size: 7pt; letter-spacing: 0.5px; overflow-wrap: normal; }

  /* Jobs */
  .cv-jobs { gap: 4pt; }
  .cv-job { break-inside: avoid; }
  .cv-job p { margin: 0; }

  /* Projects: one tight list instead of cards */
  .cv-exp-grid { display: flex; flex-direction: column; gap: 6pt; }
  .cv-exp { padding: 2pt 0 2pt 10pt; gap: 2pt; border-left: 2px solid var(--accent); break-inside: avoid; }
  .cv-exp__sector { font-weight: 700; color: var(--accent); font-size: 6.5pt; line-height: 1.3; }
  .cv-exp__title { font-size: 10.5pt; line-height: 1.3; }
  .cv-exp__desc, .cv-exp__points { font-size: 9.5pt; line-height: 1.4; margin: 0; }
  .cv-exp__title, .cv-job__title { font-weight: 700; }
  .cv-note { font-size: 8pt; margin: 0; }

  /* Skills, tools, methods, education: one plain line each ("Label: a, b, c"), so tracking systems read them in order */
  .cv-skill-grid, .cv-footer-grid { display: block; }
  .cv-panel { display: block; margin: 0 0 2pt; break-inside: avoid; }
  .cv-panel > .cv-label { display: inline; font-size: 9.5pt; line-height: 1.4; color: var(--text); }
  .cv-panel > .cv-label::after { content: ": "; }
  .cv-skills, .cv-tags { display: inline; gap: 0; }
  .cv-tags li::after { content: none; }
  .cv-skills li, .cv-tags li { display: inline; font-size: 9.5pt; line-height: 1.4; padding: 0; border: 0; background: none !important; color: var(--text-2); font-family: inherit; }
  .cv-skills li:not(:last-child)::after, .cv-tags li:not(:last-child)::after { content: ", "; }
  .cv-edu__degree, .cv-edu__school { display: inline; font-family: inherit; font-weight: 400; font-size: 9.5pt; line-height: 1.4; margin: 0; color: var(--text-2); }

  /* Plain text for parsing: no letter-spacing (it splits words into letters), no boxes, one column */
  * { letter-spacing: 0 !important; }
  .cv-job { break-inside: auto; }
  .cv-jobs { gap: 6pt; }
  .cv-job__title, .cv-job__meta { break-after: avoid; }
  .cv-job:not(:first-child) { break-inside: avoid; }   /* the shorter jobs stay on one page */
  .cv-job__points, .cv-highlights { font-size: 9.5pt; line-height: 1.4; }
  .cv-job__points { margin: 2pt 0 0; gap: 1pt; padding-left: 12pt; }
  .cv-job__points li, .cv-highlights li { break-inside: avoid; }
  .cv-highlights { gap: 1pt; padding-left: 12pt; margin: 2pt 0 0; }
  .cv-section > .cv-note { margin: 2pt 0 0; }
  .cv-section[aria-labelledby="cv-expertise"] { break-inside: avoid; }

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

/* Let tag and skill rows wrap so /cv/ fits a 320px viewport */
.cv-tags, .cv-skills { flex-wrap: wrap; min-width: 0; }

/* Grid (styles.css): the résumé shares the site's content column, on screen only; print keeps its own layout */
@media screen {
  .cv-page { max-width: calc(var(--content-max) + var(--content-pad) * 2); padding-left: var(--content-pad); padding-right: var(--content-pad); }
}
@media screen and (min-width: 900px) {
  .cv { container-type: inline-size; --col: calc((100cqw - 12 * var(--grid-gap)) / 13); --read-x: calc(var(--col) * 5 + var(--grid-gap) * 5); }
  /* Section headings in the 5, their content in the 8 */
  .cv-section { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); column-gap: var(--grid-gap); align-items: start; }
  .cv-section > * { grid-column: 6 / -1; }
  .cv-section > .cv-heading { grid-column: 1 / span 5; grid-row: 1 / span 9; }
  .cv-section > .cv-note { grid-column: 6 / -1; }
  .cv-summary { max-width: none; }
  .cv-footer-grid { margin-left: var(--read-x); }
  .cv-exp-grid { column-gap: var(--grid-gap); }   /* 4 | 4 inside the 8 */
}
