@page {
  size: A4;
  margin: 14mm 15mm;
}

:root {
  --text: #1f2937;
  --muted: #5b6472;
  --heading: #111827;
  --line: #d9dee7;
  --accent: #2457a6;
  --paper: #ffffff;
  --background: #eef1f5;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

.cv {
  width: min(100% - 32px, 850px);
  margin: 32px auto;
  padding: 42px 48px;
  background: var(--paper);
  box-shadow: 0 8px 30px rgba(17, 24, 39, 0.08);
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--heading);
}

h1 {
  margin: 0;
  color: var(--heading);
  font-size: 2.25rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

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

.contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  font-size: 0.82rem;
  text-align: right;
}

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

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

section {
  margin-top: 23px;
}

h2 {
  margin: 0 0 10px;
  color: var(--heading);
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h2::after {
  content: "";
  display: block;
  width: 42px;
  margin-top: 7px;
  border-bottom: 2px solid var(--accent);
}

p {
  margin: 0;
}

.item {
  margin-top: 13px;
}

.item + .item {
  margin-top: 18px;
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
}

h3 {
  margin: 0;
  color: var(--heading);
  font-size: 0.98rem;
}

.item-top span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.institution {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.item > p:not(.institution) {
  margin-top: 3px;
  font-size: 0.86rem;
}

.skills {
  display: grid;
  gap: 4px;
}

.skills p {
  font-size: 0.87rem;
}

.skills strong {
  color: var(--heading);
}

ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

li {
  margin: 3px 0;
  font-size: 0.86rem;
}

.courses {
  margin-top: 0;
  columns: 2;
  column-gap: 35px;
}

.courses li {
  break-inside: avoid;
}

.last {
  margin-bottom: 0;
}

.actions {
  display: flex;
  justify-content: center;
  margin: 0 auto 32px;
}

button {
  border: 0;
  border-radius: 7px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

@media (max-width: 700px) {
  .cv {
    width: 100%;
    margin: 0;
    padding: 30px 24px;
    box-shadow: none;
  }

  .header {
    flex-direction: column;
    gap: 18px;
  }

  .contact {
    align-items: flex-start;
    text-align: left;
  }

  .item-top {
    flex-direction: column;
    gap: 2px;
  }

  .courses {
    columns: 1;
  }
}

@media print {
  body {
    background: white;
  }

  .cv {
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .actions {
    display: none;
  }

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

  section,
  .item {
    break-inside: avoid;
  }
}
