:root {
  color-scheme: light;
  --ink: #171713;
  --muted-ink: #5d5b53;
  --paper: #fffefa;
  --canvas: #f4f1e9;
  --rule: #d7d1c4;
  --accent: #3158d7;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  padding: clamp(1rem, 5vw, 4.5rem);
  background:
    linear-gradient(90deg, transparent 0 49.95%, rgb(49 88 215 / 4%) 50%, transparent 50.05%),
    var(--canvas);
}

.cv {
  width: min(100%, 58rem);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 7vw, 5.75rem);
  border: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: 0 1.5rem 4rem rgb(44 39 28 / 8%);
}

.masthead {
  margin-bottom: clamp(3rem, 8vw, 5.5rem);
  text-align: center;
}

.portrait {
  display: block;
  width: clamp(9rem, 28vw, 13rem);
  height: auto;
  margin: 0 auto 2rem;
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  object-fit: cover;
  filter: saturate(0.82) contrast(1.04);
}

h1,
h2,
.identity,
strong {
  font-family: Arial, Helvetica, sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.65rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.identity {
  margin: 0.85rem 0 0;
  color: var(--muted-ink);
  font-size: clamp(1rem, 2.7vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

address {
  margin-top: 1.35rem;
  font-style: normal;
}

.links {
  margin: 0.45rem auto 0;
  color: var(--muted-ink);
}

a {
  color: inherit;
  text-decoration-color: rgb(49 88 215 / 55%);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

a:focus-visible {
  border-radius: 0.12rem;
  outline: 3px solid rgb(49 88 215 / 30%);
  outline-offset: 3px;
}

section {
  margin-top: 2.75rem;
}

h2 {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0 0 1.25rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

h2::after {
  height: 1px;
  flex: 1;
  background: var(--rule);
  content: "";
}

p {
  margin: 0 0 1rem;
}

strong {
  font-weight: 700;
}

.entry + .entry {
  margin-top: 1.75rem;
}

ul {
  margin: 0;
  padding-left: 1.35rem;
}

li {
  margin-bottom: 1.15rem;
  padding-left: 0.45rem;
}

li::marker,
.interests span {
  color: var(--accent);
}

.interests {
  margin-bottom: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.8;
}

.interests span {
  padding: 0 0.25rem;
}

@media (max-width: 38rem) {
  body {
    padding: 0;
    background: var(--paper);
  }

  .cv {
    padding: 2.75rem 1.25rem 3.5rem;
    border: 0;
    box-shadow: none;
  }

  .masthead {
    margin-bottom: 3.5rem;
  }

  .portrait {
    width: min(68vw, 15rem);
    margin-bottom: 1.75rem;
  }

  .links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.4rem;
    justify-content: center;
  }

  section {
    margin-top: 2.35rem;
  }
}

@media print {
  @page {
    size: A4;
    margin: 13mm 15mm;
  }

  html {
    font-size: 9pt;
  }

  body {
    padding: 0;
    background: white;
  }

  .cv {
    width: auto;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .masthead {
    display: block;
    margin-bottom: 1.5rem;
  }

  .portrait {
    display: none;
  }

  h1 {
    font-size: 24pt;
  }

  section {
    margin-top: 1.35rem;
    break-inside: avoid;
  }

  h2 {
    margin-bottom: 0.65rem;
  }

  p {
    margin-bottom: 0.55rem;
  }

  li {
    margin-bottom: 0.55rem;
  }

  a {
    text-decoration: none;
  }
}
