:root {
  --bg: #f8f7f3;
  --paper: #ffffff;
  --text: #202020;
  --muted: #64635f;
  --line: #d8d2c5;
  --accent: #006f86;
  --accent-dark: #004b5b;
  --soft: #edf5f6;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--text);
  background: var(--bg);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(248, 247, 243, 0.78), rgba(248, 247, 243, 0.84)),
    url("mountains.png") center top / cover fixed no-repeat;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

.site-header {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 48px, 1160px);
  max-width: none;
  margin: 0 auto;
  padding: 18px 0;
  gap: 24px;
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-right: 173px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-links a[aria-current="page"],
.nav-links a:hover {
  color: var(--text);
}

.page {
  flex: 1 0 auto;
  width: min(100% - 48px, 1160px);
  max-width: none;
  margin: 0 auto;
  padding: 52px 0 72px;
}

.cv-page {
  width: min(100% - 48px, 1240px);
  max-width: none;
  padding-top: 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 760px) 185px;
  gap: 42px;
  align-items: start;
  justify-content: start;
  padding: 10px 0 0;
}

.hero > div {
  min-width: 0;
}

.profile-photo {
  display: block;
  justify-self: end;
  width: 185px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 48% 42%;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 10px;
  font-size: 2.25rem;
}

h2 {
  margin: 34px 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 1.35rem;
}

h3 {
  margin: 22px 0 6px;
  font-size: 1.05rem;
}

.lead {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.lead a,
.footer a {
  overflow-wrap: break-word;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.contact-link:hover {
  color: var(--accent-dark);
}

.contact-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0, 111, 134, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  color: var(--accent-dark);
  flex: 0 0 28px;
}

.contact-link:hover .contact-icon-box {
  border-color: rgba(0, 111, 134, 0.55);
  background: rgba(237, 245, 246, 0.92);
}

.contact-icon-box i {
  display: block;
  width: 16px;
  height: 16px;
  font-size: 16px;
  line-height: 16px;
  text-align: center;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--accent-dark);
  text-decoration: none;
  font-size: 0.95rem;
}

.button:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.pdf-viewer {
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 920px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.list {
  padding-left: 1.25em;
}

.list li {
  margin: 6px 0;
}

.paper-list {
  list-style: decimal;
  padding-left: 1.35em;
}

.paper {
  margin: 0 0 28px;
}

.paper-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.paper-meta {
  margin: 4px 0 10px;
  color: var(--muted);
}

.paper-meta a {
  color: inherit;
  text-decoration: none;
}

.paper-meta a:hover {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
}

.paper-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.paper-links a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 1px 8px 2px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.36);
}

.paper-links a:hover {
  color: var(--muted);
  border-color: var(--muted);
  text-decoration-line: underline;
  text-decoration-style: dotted;
}

details {
  margin-top: 10px;
}

summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
}

details p {
  margin: 10px 0 0;
}

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

.cv-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  margin: 14px 0;
}

.cv-entry strong,
.cv-entry em {
  display: block;
}

.cv-entry .where {
  text-align: right;
  color: var(--muted);
}

.small {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer {
  flex: 0 0 auto;
  width: min(100% - 48px, 1160px);
  max-width: none;
  margin: 0 auto;
  padding: 26px 0 34px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  html {
    font-size: 16px;
  }

  .page {
    width: 100%;
    padding: 34px 20px 48px;
  }

  .footer {
    width: 100%;
    padding: 22px 20px 28px;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
    padding: 18px 20px;
  }

  .nav-links {
    margin-right: 0;
  }

  .hero {
    display: block;
  }

  .hero > div {
    width: 100%;
    max-width: calc(100vw - 40px);
  }

  .profile-photo {
    justify-self: start;
    width: 155px;
    margin-top: 28px;
  }

  .lead {
    width: 100%;
    max-width: calc(100vw - 40px);
    overflow-wrap: anywhere;
  }

  .contact {
    width: 100%;
    max-width: calc(100vw - 40px);
  }

  .contact-link {
    min-width: 0;
    white-space: normal;
  }

  .grid {
    grid-template-columns: 1fr;
  }

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

  .cv-entry .where {
    text-align: left;
  }

  .cv-page {
    padding-top: 24px;
  }

  .pdf-viewer {
    height: 76vh;
    min-height: 620px;
  }
}
