:root {
  --ink: #1a1615;
  --ink-strong: #0c0a09;
  --rule: #d8d9d1;
  --paper: #fefff3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--rule);
  color: var(--ink);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.32;
  -webkit-font-smoothing: auto;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.role a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sheet {
  width: min(210mm, calc(100% - 28px));
  min-height: 297mm;
  margin: 8px auto 16px;
  padding: 9mm 11mm 9mm;
  background: var(--paper);
  border-radius: 4px;
}

.home {
  width: min(210mm, calc(100% - 28px));
  margin: 12px auto 0;
  font-size: 13px;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.intro {
  margin: 0 0 10px;
}

.tagline {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.3;
}

.contacts {
  display: flex;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.contacts a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contacts svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex: none;
}

.contacts svg.icon-globe,
.contacts svg.icon-globe * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary {
  margin: 0;
}

.education {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
}

.education h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.role h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.education p {
  margin: 1px 0 0;
}

.rule {
  width: 177px;
  height: 1px;
  margin: 14px auto;
  border: 0;
  background: var(--rule);
}

.role-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: block;
  width: 64px;
  height: 36px;
  flex: none;
  object-fit: contain;
  object-position: center;
}

.role-main {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-areas:
    "company when"
    "title place";
  column-gap: 20px;
  row-gap: 2px;
  align-items: baseline;
}

.role h3,
.role-title {
  margin: 0;
  line-height: 1.3;
}

.role h3 {
  grid-area: company;
  font-weight: 600;
  color: var(--ink-strong);
}

.role-title {
  grid-area: title;
}

.role-side {
  justify-self: end;
  text-align: right;
  font-size: 12.5px;
  line-height: 1.3;
  white-space: nowrap;
}

.when {
  grid-area: when;
  display: inline-flex;
  justify-content: flex-end;
  gap: 12px;
}

.place {
  grid-area: place;
}

.role p {
  margin: 6px 0 0;
}

.role ul {
  margin: 4px 0 0;
  padding: 0 0 0 1.1em;
}

.role li {
  margin: 2px 0 0;
}

.role li:first-child {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .home,
  .sheet {
    width: calc(100% - 16px);
  }

  .home {
    margin: 8px auto 0;
  }

  .sheet {
    min-height: 0;
    margin: 6px auto 12px;
    padding: 16px 14px 24px;
  }

  h1 {
    font-size: 26px;
  }

  .contacts {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .education {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .role-main {
    grid-template-columns: 1fr;
    grid-template-areas:
      "company"
      "title"
      "when"
      "place";
  }

  .role-side {
    justify-self: start;
    text-align: left;
    white-space: normal;
  }

  .role-head {
    align-items: center;
  }
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  .home {
    display: none !important;
  }

  html,
  body {
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    background: var(--paper);
    overflow: hidden;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sheet {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    max-height: 297mm;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    page-break-after: avoid;
    break-after: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a,
  .role a {
    text-decoration: none;
    color: inherit;
  }

  .role,
  .role-head,
  .education {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
