:root {
  --color-bg: #eef0e9;
  --color-text: #3f462a;
  --color-text-muted: #74553f;
  --color-border: #dfe1cd;
  --color-accent: #626d46;
  --color-gray: #ab998c;
  --topbar-height: 64px;
  --font-family: 'DM Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-weight: 300;
}

a {
  color: inherit;
}

/* Top bar */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--topbar-height);
  padding: 0 48px;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.logo {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  flex-direction: row;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  letter-spacing: 1px;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted);
  padding-bottom: 4px;
  transition: color 0.2s ease;
}

.external-icon {
  flex-shrink: 0;
  color: currentColor;
}

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

.nav-links a.active {
  color: var(--color-accent);
}

.burger {
  display: none;
  cursor: pointer;
  z-index: 101;
}

.burger div {
  width: 22px;
  height: 1px;
  background-color: var(--color-text);
  margin: 5px;
  transition: all 0.3s ease;
}

/* Page shell */

main {
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 40px;
}

/* About page */

.about-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 48px;
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--topbar-height));
  scroll-margin-top: var(--topbar-height);
}

.about-text {
  flex: 1;
}

.about-name {
  font-size: 40px;
  font-weight: 600;
  margin-bottom: 8px;
}

.about-title {
  font-size: 22px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.about-bio {
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.social-links {
  display: flex;
  gap: 28px;
}

.social-links a {
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

.social-links a:hover {
  border-bottom-color: var(--color-accent);
}

/* Projects page */

.projects-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 90px 48px 100px;
  border-top: 1px solid var(--color-border);
  scroll-margin-top: var(--topbar-height);
}

.project-grid {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.project-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
}

.project-image {
  display: block;
  flex: 0 0 320px;
  border-radius: 8px;
  overflow: hidden;
}

.project-image img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-width 0.15s ease;
}

.project-image:hover img {
  border-width: 3px;
}

.project-body {
  flex: 1;
  padding-top: 4px;
}

.project-title {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  margin-bottom: 10px;
}

a.project-title:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.project-award {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.project-title + .project-award {
  margin-top: -6px;
}

.project-award a {
  text-decoration: none;
}

.project-award a:hover {
  text-decoration: underline;
}

.project-description {
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.project-links-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  margin-top: 14px;
}

.project-links-list a {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}

.project-links-list a:hover {
  border-bottom-color: var(--color-accent);
}

/* Publication list */

.publication-list {
  display: flex;
  flex-direction: column;
  gap: 34px;
  list-style: none;
}

.publication-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.publication-title:hover {
  text-decoration: underline;
}

.publication-authors {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.publication-authors strong {
  font-weight: 700;
}

.publication-venue {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.publication-list .publication-venue {
  color: var(--color-gray);
}

/* Footer */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 24px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: var(--color-text-muted);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  transition: background-color 0.2s ease;
}

.footer-icon:hover {
  background-color: var(--color-accent);
}

.footer-icon-linkedin {
  -webkit-mask-image: url('./icons/linkedin.svg');
  mask-image: url('./icons/linkedin.svg');
}

.footer-icon-mail {
  -webkit-mask-image: url('./icons/mail.svg');
  mask-image: url('./icons/mail.svg');
}

/* Responsive */

@media screen and (max-width: 768px) {
  .topbar {
    padding: 0 24px;
  }

  .nav-links {
    position: fixed;
    top: var(--topbar-height);
    right: 0;
    height: calc(100vh - var(--topbar-height));
    width: 60%;
    background-color: var(--color-bg);
    border-left: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 32px;
    padding-left: 32px;
    padding-right: 24px;
    padding-top: 56px;
    transform: translateX(100%);
    transition: transform 0.4s ease-in;
  }

  .nav-links li {
    opacity: 0;
  }

  .burger {
    display: block;
  }

  .nav-active {
    transform: translateX(0%);
  }

  .about-page {
    flex-direction: column;
    text-align: left;
    padding: 60px 24px;
    gap: 40px;
  }

  .about-bio {
    max-width: 100%;
  }

  .social-links {
    justify-content: flex-start;
  }

  .projects-page {
    padding: 50px 24px 70px;
  }

  .page-title {
    font-size: 26px;
  }

  .project-card {
    flex-direction: column;
  }

  .project-image {
    flex-basis: auto;
    width: 100%;
  }
}

@keyframes navLinkFade {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0px);
  }
}

.toggle .line1 {
  transform: rotate(-45deg) translate(-4px, 5px);
}

.toggle .line2 {
  opacity: 0;
}

.toggle .line3 {
  transform: rotate(45deg) translate(-4px, -5px);
}
