:root {
  --ink: #17212b;
  --ink-soft: #52606d;
  --paper: #ffffff;
  --surface: #eef1f3;
  --line: #d8dde1;
  --accent: #8f3429;
  --accent-dark: #6f251d;
  --navy: #17334a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(143, 52, 41, 0.35);
  outline-offset: 3px;
}

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

h1,
h2,
h3 {
  line-height: 1.2;
}

.shell {
  width: min(920px, calc(100% - 36px));
  margin-inline: auto;
}

.cv-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-block: 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.cv-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.back-link {
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}

.print-button {
  padding: 9px 15px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.print-button:hover {
  background: var(--accent-dark);
}

.cv-document {
  width: min(920px, calc(100% - 32px));
  margin: 40px auto;
  padding: clamp(34px, 6vw, 70px);
  background: var(--paper);
  box-shadow: 0 10px 34px rgba(30, 39, 47, 0.1);
}

.cv-header {
  padding-bottom: 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid var(--navy);
}

.cv-header h1 {
  margin-bottom: 6px;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.75rem;
}

.cv-header p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.cv-contact {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 3px;
  font-size: 0.84rem;
}

.cv-section {
  padding-top: 27px;
}

.cv-section h2 {
  margin-bottom: 15px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-dark);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cv-entry {
  margin-bottom: 17px;
}

.cv-entry:last-child {
  margin-bottom: 0;
}

.cv-entry-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
}

.cv-entry h3 {
  margin-bottom: 3px;
  color: var(--navy);
  font-size: 0.98rem;
}

.cv-date {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.cv-entry p {
  margin-bottom: 3px;
  font-size: 0.88rem;
}

.cv-publication-list {
  margin: 0;
  padding-left: 22px;
}

.cv-publication-list li {
  margin-bottom: 13px;
  padding-left: 5px;
  font-size: 0.86rem;
}

.cv-publication-list li:last-child {
  margin-bottom: 0;
}

.cv-compact-list {
  margin: 0;
  padding-left: 19px;
}

.cv-compact-list li {
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.small {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .cv-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .cv-contact {
    align-items: flex-start;
  }

  .cv-entry-heading {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

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

  body {
    background: #fff;
  }

  .cv-toolbar {
    display: none;
  }

  .cv-document {
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .cv-header h1 {
    font-size: 2.2rem;
  }

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

  .cv-entry,
  .cv-publication-list li {
    break-inside: avoid;
  }

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