:root {
  --paper: #f2f1ec;
  --sheet: #fff;
  --ink: #171918;
  --muted: #646a65;
  --line: #d8dad5;
  --accent: #2e5bff;
  --sans: "Aptos", "Segoe UI Variable Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: #aeb3ad;
  text-underline-offset: 3px;
}

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

p,
h1,
h2,
h3 {
  margin-top: 0;
}

sup {
  font-size: 0.65em;
  line-height: 0;
}

.cv-actions {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  width: min(calc(100% - 32px), 850px);
  margin: 16px auto 0;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 10px;
  backdrop-filter: blur(12px);
}

.cv-actions div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-actions a,
.cv-actions button {
  padding: 7px 10px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.cv-actions button {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.cv-page {
  width: min(calc(100% - 32px), 850px);
  margin: 16px auto 60px;
  padding: 52px 56px 42px;
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(22, 25, 23, 0.09);
}

.cv-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.document-id {
  margin-bottom: 13px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cv-header h1 {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.role {
  margin-bottom: 18px;
  color: #353a36;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.cv-section {
  margin-top: 28px;
}

.cv-section h2 {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
  color: #303530;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.cv-section h2::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--line);
}

.cv-section > p {
  max-width: 710px;
  margin-bottom: 0;
  color: #343936;
  font-size: 12.5px;
  line-height: 1.72;
}

.cv-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.cv-entry + .cv-entry {
  margin-top: 15px;
}

.entry-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.entry-heading h3 {
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 680;
}

.entry-heading span {
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.cv-entry p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
}

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

.publication-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  gap: 12px;
  break-inside: avoid;
}

.publication-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.publication-year {
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.publication-list h3 {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.4;
}

.publication-list p {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.publication-list .venue {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-list article {
  padding-top: 11px;
  border-top: 2px solid var(--ink);
}

.project-list h3 {
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1.45;
}

.project-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.earlier-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 9px;
  color: #3f4440;
  font-size: 10.5px;
  list-style: none;
}

.earlier-list li {
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.cv-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 34px;
  padding-top: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  .cv-page {
    margin-top: 12px;
    padding: 32px 24px 28px;
  }

  .cv-header h1 {
    font-size: 38px;
  }

  .cv-columns,
  .project-list {
    grid-template-columns: 1fr;
  }
}

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

@media print {
  html,
  body {
    background: #fff;
    font-size: 10.5px;
    line-height: 1.45;
  }

  .cv-actions {
    display: none;
  }

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

  .cv-header {
    padding-bottom: 18px;
  }

  .cv-header h1 {
    font-size: 38px;
  }

  .role {
    margin-bottom: 12px;
    font-size: 12.5px;
  }

  .contact-row {
    font-size: 8px;
  }

  .cv-section {
    margin-top: 18px;
  }

  .cv-section h2 {
    margin-bottom: 9px;
  }

  .cv-section > p {
    font-size: 10.2px;
    line-height: 1.55;
  }

  .cv-columns {
    gap: 28px;
  }

  .cv-entry + .cv-entry {
    margin-top: 10px;
  }

  .entry-heading h3 {
    font-size: 11.5px;
  }

  .cv-entry p {
    font-size: 9.5px;
  }

  .publication-list li {
    padding: 7px 0;
  }

  .publication-year,
  .publication-list .venue {
    font-size: 8px;
  }

  .publication-list h3 {
    font-size: 10.5px;
  }

  .publication-list p {
    font-size: 8.8px;
  }

  .project-list {
    gap: 14px;
  }

  .project-list h3 {
    font-size: 10px;
  }

  .project-list p,
  .earlier-list {
    font-size: 8.8px;
  }

  .earlier-list {
    gap: 6px;
  }

  .cv-footer {
    margin-top: 18px;
    padding-top: 10px;
  }

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

  .cv-section,
  .publication-list li,
  .project-list article {
    break-inside: avoid;
  }
}
