:root {
  --ink: #1a1d21;
  --muted: #56616c;
  --accent: #145c66;
  --line: #dfe3e8;
  --soft: #f2f6f6;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 16px/1.5 "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Nawigacja jest widoczna wyłącznie na stronie, nie w PDF. */
.switcher {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 28px 0;
  display: flex;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.switcher a {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  text-decoration: none;
}

.switcher a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.switcher a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.cv-header {
  max-width: 880px;
  margin: 0 auto;
  padding: 26px 28px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  border-bottom: 2px solid var(--accent);
}

.identity {
  flex: 1 1 auto;
  min-width: 0;
}

.identity h1 {
  margin: 0;
  font-size: 2.65rem;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.identity .role {
  margin: 9px 0 0;
  color: var(--accent);
  font-size: 1.08rem;
  font-weight: 700;
}

.identity .specialization {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact {
  flex: 0 1 340px;
}

.contact p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: right;
  overflow-wrap: anywhere;
}

.contact a {
  color: var(--ink);
  text-decoration: none;
}

.contact a:hover {
  color: var(--accent);
  text-decoration: underline;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 6px 28px 56px;
}

h2 {
  margin: 1.75em 0 0.65em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  break-after: avoid;
}

h3 {
  margin: 0 0 0.3em;
  font-size: 1.06rem;
  line-height: 1.3;
  break-after: avoid;
}

p {
  margin: 0 0 0.65em;
}

ul {
  margin: 0;
  padding-left: 1.1em;
}

li {
  margin: 0.27em 0;
}

li::marker {
  color: var(--accent);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  padding: 0.08em 0.25em;
  border-radius: 3px;
  background: var(--soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.profile {
  margin-bottom: 0;
}

.experience,
.project {
  margin-top: 1.25em;
}

.project-meta {
  margin: 0 0 0.55em;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.project-summary {
  margin-bottom: 0.45em;
}

.project-links {
  white-space: nowrap;
}

.skills {
  display: grid;
  grid-template-columns: 35mm 1fr;
  gap: 0 14px;
  margin: 0;
}

.skills .row {
  display: contents;
}

.skills dt,
.skills dd {
  padding: 0.43em 0;
  border-bottom: 1px dotted var(--line);
}

.skills dt {
  font-size: 0.9rem;
  font-weight: 700;
}

.skills dd {
  margin: 0;
}

.languages {
  margin: 0.9em 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.education p {
  margin-bottom: 0.35em;
}

.legal {
  margin: 1.4em 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

@media print {
  @page {
    size: A4;
    margin: 9mm 12mm;
  }

  body {
    font-size: 9.4pt;
    line-height: 1.26;
  }

  .switcher {
    display: none;
  }

  .cv-header {
    max-width: none;
    padding: 0 0 3mm;
    gap: 8mm;
    break-inside: avoid;
  }

  .identity h1 {
    margin-bottom: 1.5mm;
    font-size: 24pt;
  }

  .identity .role {
    margin: 0;
    font-size: 11.5pt;
  }

  .identity .specialization {
    margin-top: 1.2mm;
    font-size: 9pt;
  }

  .contact {
    flex: 0 0 72mm;
  }

  .contact p {
    font-size: 8.8pt;
    line-height: 1.42;
  }

  main {
    max-width: none;
    padding: 0;
  }

  h2 {
    margin: 2.2mm 0 1.1mm;
    padding-bottom: 1mm;
    font-size: 8.8pt;
  }

  h3 {
    margin-bottom: 0.7mm;
    font-size: 10.6pt;
  }

  p {
    margin-bottom: 1.2mm;
    orphans: 2;
    widows: 2;
  }

  ul {
    padding-left: 1.05em;
  }

  li {
    margin: 0.4mm 0;
    break-inside: avoid;
  }

  .experience,
  .project {
    margin-top: 1.8mm;
    break-inside: avoid;
  }

  .project-meta {
    margin-bottom: 1.1mm;
    font-size: 8.7pt;
  }

  .project-summary {
    margin-bottom: 0.8mm;
  }

  .skills {
    grid-template-columns: 31mm 1fr;
    gap: 0 10px;
    break-inside: avoid;
  }

  .skills dt,
  .skills dd {
    padding: 0.4mm 0;
  }

  .skills dt {
    font-size: 8.9pt;
  }

  .languages {
    margin-top: 1.5mm;
    font-size: 8.9pt;
  }

  .legal {
    margin-top: 2.5mm;
    font-size: 7.5pt;
  }

  a {
    color: var(--accent);
    text-decoration: none;
  }
}

@media (max-width: 700px) {
  .cv-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .contact {
    flex: none;
  }

  .contact p {
    text-align: left;
  }

  .project-links {
    white-space: normal;
  }

  .skills {
    grid-template-columns: 30mm 1fr;
    gap: 0 10px;
  }
}
