:root {
  color-scheme: light;
  font-family: "Michroma", sans-serif;
  background: #fff;
  color: #080808;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #fff;
}

.cv-page {
  padding: 2.5rem 1.5rem;
}

.cv-page main {
  display: flex;
  justify-content: center;
}

.cv-back {
  position: fixed;
  z-index: 1;
  top: 1rem;
  left: 1rem;
  padding: 0.65rem 0.9rem;
  background: #fff;
  color: #171717;
  font: 0.75rem/1.3 Arial, sans-serif;
  text-decoration: none;
}

.cv-back:hover {
  text-decoration: underline;
}

.cv-back:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 3px;
}

.cv-sheet {
  --orange: #e87524;
  position: relative;
  display: grid;
  width: min(100%, 760px);
  aspect-ratio: 595 / 842;
  overflow: hidden;
  grid-template-columns: 9.24% 29.92% 30.08% 30.76%;
  grid-template-rows: 14.37% 29.93% 55.7%;
  background: #fff;
  box-shadow: 0 0.6rem 2.5rem rgb(0 0 0 / 10%);
  container-type: inline-size;
}

.cv-name {
  position: relative;
  z-index: 1;
  grid-column: 2 / 4;
  grid-row: 1;
  margin: 0;
}

.cv-name::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  background: var(--orange);
  content: "";
}

.cv-name h1 {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  margin: 0;
  grid-template-columns: 1fr 1fr;
  font-size: 2.7cqw;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.cv-name__first {
  align-self: center;
  justify-self: end;
  transform: translateY(18%);
}

.cv-name__last {
  align-self: end;
  justify-self: start;
  margin: 0 0 0.4cqw 0.8cqw;
}

.cv-portrait {
  grid-column: 2;
  grid-row: 2;
  background-image: url("./portfolio/CV.jpg");
  background-position: 13.2% 20.7%;
  background-size: 334.3% 334.4%;
}

.cv-contact {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 2.5cqw;
  padding: 3.2cqw 1cqw 0;
  grid-column: 2;
  grid-row: 3;
  text-align: center;
}

.cv-contact h2,
.cv-studies h2,
.cv-experience h2,
.cv-extras h2 {
  margin: 0;
  font-size: 2.1cqw;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.cv-contact a {
  color: inherit;
  font-size: 1.6cqw;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.cv-contact a:last-child {
  font-size: 1.27cqw;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.cv-introduction {
  display: flex;
  align-items: center;
  padding: 1.1cqw;
  grid-column: 3;
  grid-row: 2;
  text-align: justify;
  text-align-last: center;
}

.cv-introduction p {
  margin: 0;
  font-size: 1.72cqw;
  letter-spacing: 0.06em;
  line-height: 1.48;
  text-transform: uppercase;
}

.cv-orange {
  background: var(--orange);
}

.cv-studies {
  padding: 2.3cqw 1.7cqw;
  grid-column: 4;
  grid-row: 2;
}

.cv-studies h2,
.cv-experience h2 {
  text-align: center;
}

.cv-studies ul,
.cv-experience ul {
  margin: 1cqw 0 0;
  padding-left: 2.5cqw;
  font-size: 1.55cqw;
  letter-spacing: 0.035em;
  line-height: 1.48;
  text-transform: uppercase;
}

.cv-studies li + li,
.cv-experience li + li {
  margin-top: 0.25cqw;
}

.cv-studies strong {
  display: block;
  font-weight: 400;
}

.cv-experience {
  padding: 1.4cqw 1.6cqw;
  grid-column: 3;
  grid-row: 3;
  overflow-wrap: anywhere;
}

.cv-experience ul {
  margin-top: 2.4cqw;
}

.cv-extras {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 3.4cqw;
  padding: 4.2cqw 1cqw;
  grid-column: 4;
  grid-row: 3;
  text-align: center;
}

.cv-extras p {
  margin: 0.5cqw 0 0;
  font-size: 1.7cqw;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: capitalize;
}

@media (max-width: 520px) {
  .cv-page {
    padding: 4rem 0.5rem 1rem;
  }
}

@media print {
  @page {
    margin: 0;
    size: A4 portrait;
  }

  .cv-page {
    padding: 0;
  }

  .cv-back {
    display: none;
  }

  .cv-sheet {
    width: 100%;
    box-shadow: none;
    break-inside: avoid;
  }
}
