:root {
  --navy-950: #091a38;
  --navy-900: #102d63;
  --navy-700: #2558a7;
  --gold-500: #d5a43b;
  --gold-100: #f8edcf;
  --blue-100: #e8eef8;
  --gold-300: #edcc7c;
  --ink: #17202b;
  --muted: #647083;
  --line: #dbe2ec;
  --paper: #fffefa;
  --canvas: #f4f1e9;
  --sans: "Manrope", "Aptos", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgb(37 88 167 / 12%), transparent 28rem),
    radial-gradient(circle at 94% 14%, rgb(213 164 59 / 17%), transparent 24rem),
    var(--canvas);
  font-family: var(--sans);
  font-size: 0.925rem;
  line-height: 1.6;
}

a {
  color: var(--navy-700);
  font-weight: 650;
  text-decoration-color: rgb(213 164 59 / 55%);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.15em;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

a:hover {
  color: var(--gold-500);
  text-decoration-color: currentColor;
}

.cv-actions {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  width: min(calc(100% - 2rem), 70rem);
  margin: 0 auto;
  padding: 0.8rem 0;
}

.cv-download {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 0.68rem 1.1rem;
  color: #fff;
  background: var(--navy-950);
  box-shadow: 0 0.4rem 1rem rgb(11 34 48 / 18%);
  font: 700 0.78rem/1 var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.cv-download:hover {
  color: #fff;
  background: var(--gold-500);
  transform: translateY(-1px);
}

.cv-sheet {
  width: min(calc(100% - 2rem), 70rem);
  margin: 0 auto 4rem;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgb(16 52 72 / 8%);
  border-radius: 1rem;
  box-shadow: 0 1.4rem 4rem rgb(11 34 48 / 13%);
}

.cv-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 4.6rem 4.2rem 3.8rem;
  color: #fff;
  background:
    linear-gradient(118deg, var(--navy-950) 0%, var(--navy-900) 68%, #173f78 100%);
}

.cv-hero::before,
.cv-hero::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
}

.cv-hero::before {
  top: -9rem;
  right: -4rem;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgb(255 255 255 / 14%);
  box-shadow:
    0 0 0 3.2rem rgb(255 255 255 / 3%),
    0 0 0 7rem rgb(255 255 255 / 2%);
}

.cv-hero::after {
  right: 19%;
  bottom: -7rem;
  width: 13rem;
  height: 13rem;
  background: rgb(37 88 167 / 24%);
  filter: blur(1px);
}

.cv-kicker {
  margin: 0 0 1.1rem;
  color: var(--gold-300);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cv-hero h1 {
  max-width: 45rem;
  margin: 0;
  font: 600 clamp(3.4rem, 8vw, 5.2rem) / 0.95 var(--serif);
  letter-spacing: -0.045em;
}

.cv-tagline {
  max-width: 50rem;
  margin: 1.35rem 0 0;
  color: rgb(255 255 255 / 80%);
  font-size: clamp(1rem, 2.2vw, 1.24rem);
  font-weight: 500;
  line-height: 1.55;
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 2rem;
}

.cv-contact a {
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  color: #fff;
  background: rgb(255 255 255 / 7%);
  font-size: 0.73rem;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(6px);
}

.cv-contact a:hover {
  border-color: rgb(255 255 255 / 48%);
  background: rgb(255 255 255 / 14%);
}

.cv-section {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  column-gap: 3.2rem;
  padding: 2.8rem 4.2rem;
  border-bottom: 1px solid var(--line);
}

.cv-section:last-child {
  border-bottom: 0;
}

.cv-section > h2 {
  grid-column: 1;
  align-self: start;
  margin: 0.18rem 0 0;
  color: var(--gold-500);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.cv-section > :not(h2) {
  grid-column: 2;
}

.profile {
  background: linear-gradient(105deg, #fffefa 0%, #f3f6fb 100%);
}

.profile > p {
  margin: 0;
  color: var(--navy-900);
  font: 500 clamp(1.08rem, 2vw, 1.28rem) / 1.7 var(--serif);
}

h3 {
  margin: 0;
  color: var(--navy-950);
  font-size: 0.97rem;
  font-weight: 800;
  line-height: 1.45;
}

p {
  margin: 0.35rem 0;
}

ul,
ol {
  margin: 0.45rem 0 0;
  padding-left: 1.25rem;
}

li {
  margin: 0.3rem 0;
}

.experience > h3,
.education > h3 {
  position: relative;
  padding: 0.08rem 0 0 1.45rem;
  border-left: 1px solid var(--line);
}

.experience > h3::before,
.education > h3::before {
  position: absolute;
  top: 0.35rem;
  left: -0.32rem;
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 1px var(--gold-500);
  content: "";
}

.experience > h3 + p,
.education > h3 + p {
  margin: 0;
  padding: 0.24rem 0 0.35rem 1.45rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.experience > h3 + p + ul,
.education > h3 + p + ul {
  margin: 0;
  padding: 0.35rem 0 1.25rem 2.65rem;
  border-left: 1px solid var(--line);
}

.experience > p:not(:has(+ ul)),
.education > p:not(:has(+ ul)) {
  padding-bottom: 1.4rem;
}

.publications > p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.publications > h3,
.talks > h3 {
  width: fit-content;
  margin: 1.25rem 0 0.45rem;
  border-radius: 999px;
  padding: 0.23rem 0.62rem;
  color: var(--navy-700);
  background: var(--gold-100);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.publications > p + h3,
.talks > h2 + h3 {
  margin-top: 0;
}

.publications ol {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: publication;
}

.publications ol > li {
  position: relative;
  margin: 0;
  border: 1px solid #e5ecef;
  border-radius: 0.55rem;
  padding: 0.85rem 1rem 0.85rem 3.2rem;
  background: #fbfcfc;
  counter-increment: publication;
}

.publications ol > li::before {
  position: absolute;
  top: 0.85rem;
  left: 0.9rem;
  color: var(--gold-500);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  content: counter(publication, decimal-leading-zero);
}

.publications ol > li > strong:first-child {
  color: var(--navy-700);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.publications li a {
  display: inline-block;
  margin-left: 0.1rem;
  border-radius: 999px;
  padding: 0.02rem 0.36rem;
  background: var(--blue-100);
  font-size: 0.68rem;
  text-decoration: none;
}

.software ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.software li {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.9rem 1rem;
  background: #fbfcfc;
}

.talks > ul,
.mentoring > ul {
  margin-top: 0.25rem;
}

.presentations ul,
.organization ul,
.reviewing ul,
.awards ul,
.languages ul,
.patent ul {
  margin: 0;
}

.languages ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0;
  list-style: none;
}

.languages li {
  margin: 0;
  border-radius: 0.55rem;
  padding: 0.8rem;
  background: var(--blue-100);
}

strong {
  font-weight: 800;
}

em {
  font-family: var(--serif);
}

@media (max-width: 48rem) {
  :root {
    font-size: 15px;
  }

  .cv-actions {
    width: calc(100% - 1.5rem);
  }

  .cv-sheet {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .cv-hero {
    padding: 3.4rem 1.5rem 2.8rem;
  }

  .cv-hero h1 {
    font-size: 2.8rem;
  }

  .cv-tagline {
    font-size: 0.98rem;
  }

  .cv-section {
    display: block;
    padding: 2.2rem 1.5rem;
  }

  .cv-section > h2 {
    margin-bottom: 1.2rem;
  }

  .software ul,
  .languages ul {
    grid-template-columns: 1fr;
  }
}

@page {
  size: A4;
  margin: 25mm 0 12mm;
}

@page :first {
  margin-top: 0;
}

@media print {
  :root {
    font-size: 8.5pt;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html,
  body {
    background: #fff;
  }

  body {
    color: #111820;
    line-height: 1.4;
  }

  .cv-actions {
    display: none;
  }

  .cv-sheet {
    width: auto;
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .cv-hero {
    margin: 0 0 5mm;
    padding: 15mm 18mm 11mm;
    color: #fff;
    background: linear-gradient(118deg, var(--navy-950) 0%, var(--navy-900) 68%, #173f78 100%);
    border-radius: 0;
  }

  .cv-hero::before,
  .cv-hero::after {
    display: none;
  }

  .cv-kicker {
    margin-bottom: 2mm;
    color: var(--gold-300);
  }

  .cv-hero h1 {
    color: #fff;
    font-size: 38pt;
  }

  .cv-tagline {
    max-width: 150mm;
    margin-top: 3mm;
    color: rgb(255 255 255 / 82%);
    font-size: 11pt;
  }

  .cv-contact {
    gap: 3mm;
    margin-top: 5mm;
  }

  .cv-contact a {
    border: 1px solid rgb(255 255 255 / 25%);
    padding: 0.8mm 1.6mm;
    color: #fff;
    background: rgb(255 255 255 / 8%);
    font-size: 7.5pt;
  }

  .cv-section {
    grid-template-columns: 26mm minmax(0, 1fr);
    column-gap: 6mm;
    padding: 3mm 14mm;
    break-before: auto;
  }

  .cv-section > h2 {
    break-after: avoid;
  }

  .profile > p {
    font-size: 10pt;
  }

  h3 {
    break-after: avoid;
  }

  .experience > h3 + p,
  .education > h3 + p {
    break-after: avoid;
  }

  .experience > h3 + p + ul,
  .education > h3 + p + ul {
    break-inside: avoid;
    page-break-inside: avoid;
    padding-bottom: 0.7rem;
  }

  .presentations {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .languages {
    padding-top: 1.5mm;
    padding-bottom: 1.5mm;
  }

  .publications ol {
    display: block;
    margin: 0;
  }

  .publications ol > li {
    display: table;
    width: 100%;
    margin: 0 0 0.4rem;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    border: 0.5pt solid var(--line);
    border-radius: 1.5mm;
    padding: 0.55rem 0.65rem 0.55rem 2.4rem;
    background: #f8fafb;
  }

  .publications ol > li::before {
    top: 0.55rem;
    left: 0.65rem;
  }

  .publications li a {
    padding: 0;
    background: none;
  }

  .software li {
    break-inside: avoid;
    border: 0;
    padding: 0.3rem 0;
    background: none;
  }

  .languages li {
    break-inside: avoid;
    border: 0.5pt solid var(--line);
    border-radius: 1.5mm;
    padding: 0.45rem 0.55rem;
    background: var(--blue-100);
  }

  a {
    color: var(--navy-700);
    text-decoration: none;
  }
}
