:root {
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --side: #111111;
  --side-text: #edf2f7;
  --name: #ffffff;
  --cyan: #3ec6e0;
  --paper: #ffffff;
  --bar: #5b2a6e;
  --side-w: 72mm;
  --photo-size: 88px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #e8eef2;
  color: var(--ink);
  font-family: "Source Sans 3", Arial, sans-serif;
}

.toolbar {
  width: min(210mm, 100%);
  margin: 16px auto 0;
  padding: 0 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.toolbar a,
.toolbar button {
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.toolbar a.is-current {
  background: var(--side);
  color: #ffffff;
  border-color: var(--side);
}

.sheet {
  position: relative;
  width: min(210mm, 100%);
  min-height: 297mm;
  margin: 12px auto 28px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

.side {
  position: relative;
  z-index: 1;
  flex: 0 0 var(--side-w);
  width: var(--side-w);
  padding: 12px 13px 22px;
  background: var(--side);
  color: var(--side-text);
}

.side__photo {
  display: block;
  width: var(--photo-size);
  height: var(--photo-size);
  margin: 2px auto 8px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  border: 3px solid var(--cyan);
}

.side h1 {
  margin: 0 0 2px;
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.side h1 span {
  display: block;
  color: var(--name);
}

.side h1 b {
  display: block;
  color: var(--cyan);
  font-weight: 700;
}

.side__role {
  margin: 0 0 8px;
  color: var(--name);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.side h2 {
  margin: 9px 0 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.side ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side li,
.side a {
  color: var(--side-text);
  font-size: 0.7rem;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.side li + li {
  margin-top: 3px;
}

.side .soft {
  color: color-mix(in srgb, var(--side-text) 75%, var(--cyan));
}

.main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  padding: 18px 18px 26px 20px;
}

.main h2 {
  margin: 0 0 10px;
  padding-top: 4px;
  border-top: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.main h2:first-child {
  margin-top: 0;
}

.lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: justify;
}

.job {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px 12px;
  margin: 0 0 12px;
}

.job__when {
  margin: 0;
  color: #8a8a8a;
  font-size: 0.72rem;
  line-height: 1.35;
}

.job h3 {
  margin: 0 0 2px;
  font-size: 0.92rem;
}

.job .meta {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
}

.job p,
.job li {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.job ul {
  margin: 0;
  padding-left: 1.1rem;
}

.edu-block {
  margin: 0 0 14px;
}

.edu-block strong {
  display: block;
  font-size: 0.92rem;
}

.edu-block .meta {
  margin: 2px 0 2px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 700;
}

.edu-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.bars {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.qualities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.qualities li {
  padding: 4px 10px;
  border: 1px solid var(--cyan);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.3;
}

.bar {
  min-width: 0;
}

.bar span {
  display: block;
  margin-bottom: 5px;
  font-size: 0.78rem;
  font-weight: 600;
}

.bar i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e6eef2;
}

.bar i em {
  display: block;
  width: var(--lvl, 80%);
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
  font-style: normal;
}

.sheet__bar {
  display: none;
}

.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  width: var(--side-w);
  background: var(--side);
  pointer-events: none;
}

.sheet::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 7px;
  background: linear-gradient(
    90deg,
    var(--bar),
    color-mix(in srgb, var(--bar) 55%, #c43b7a)
  );
  pointer-events: none;
}

.sheet[data-photo="square"] .side__photo {
  border-radius: 0;
}

.sheet[data-photo="soft"] .side__photo {
  border-radius: 14px;
}

.sheet[data-font="serif"] {
  font-family: Georgia, "Times New Roman", serif;
}

.sheet[data-font="tech"] {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.01em;
}

.sheet[data-layout="right"] {
  flex-direction: row-reverse;
}

.sheet[data-layout="right"]::before {
  left: auto;
  right: 0;
}

.sheet[data-layout="compact"] {
  --side-w: 56mm;
}

.sheet[data-layout="airy"] .side {
  padding: 20px 16px 26px;
}

.sheet[data-layout="airy"] .main {
  padding: 24px 22px 32px;
}

.sheet[data-layout="card"] {
  border-radius: 16px;
}

.sheet[data-layout="outline"] .side {
  background: var(--paper);
  color: var(--ink);
  border-right: 3px solid var(--cyan);
}

.sheet[data-layout="outline"]::before {
  display: none;
}

.sheet[data-layout="outline"] .side h1 span,
.sheet[data-layout="outline"] .side__role,
.sheet[data-layout="outline"] .side li,
.sheet[data-layout="outline"] .side a {
  color: var(--ink);
}

.sheet[data-layout="top"] {
  flex-direction: column;
}

.sheet[data-layout="top"]::before {
  display: none;
}

.sheet[data-layout="top"] .side {
  flex: none;
  width: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 18px;
  padding: 16px 18px 14px;
}

.sheet[data-layout="top"] .side__photo {
  margin: 0 4px 0 0;
}

.sheet[data-layout="top"] .side h1,
.sheet[data-layout="top"] .side__role {
  text-align: left;
}

.sheet[data-layout="top"] .side h1 {
  flex: 1 1 160px;
  margin: 8px 0 0;
}

.sheet[data-layout="top"] .side__role {
  flex: 1 1 100%;
  margin: 0 0 4px;
}

.sheet[data-layout="top"] .side h2 {
  flex: 1 1 calc(50% - 12px);
  margin-top: 8px;
}

.sheet[data-layout="top"] .side ul {
  flex: 1 1 calc(50% - 12px);
  max-width: none;
  margin: 0;
}

.sheet[data-layout="top"] .side li + li {
  margin-top: 2px;
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .toolbar {
    width: 100%;
    margin: 10px auto 0;
    padding: 0 12px;
    justify-content: flex-start;
  }

  .toolbar a,
  .toolbar button {
    font-size: 0.75rem;
    padding: 8px 11px;
  }

  .sheet {
    width: calc(100% - 16px);
    min-height: 0;
    flex-direction: column;
  }

  .sheet::before {
    display: none;
  }

  .sheet[data-layout="right"] {
    flex-direction: column;
  }

  .sheet[data-layout="outline"] .side {
    border-right: 0;
    border-bottom: 3px solid var(--cyan);
  }

  .side {
    flex: none;
    width: auto;
    padding: 22px 18px 20px;
    text-align: center;
  }

  .side ul {
    text-align: left;
    max-width: 280px;
    margin-inline: auto;
  }

  .main {
    padding: 20px 16px 22px;
  }

  .job {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .bars {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  html,
  body {
    background: #ffffff;
  }

  .toolbar {
    display: none;
  }

  .sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
  }

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