/* Base */

:root {
  color-scheme: light;

  --background: #faf9f6;
  --text: #30332f;
  --muted: #73786f;
  --accent: #567d65;
  --accent-hover: #304d3b;
  --border: #e2e4dc;
  --selection: #dce6d9;
  --on-solid: #ffffff;

  --font-body:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif;

  --font-heading:
    "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Georgia, serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #202021;
  --text: #e5e9e4;
  --muted: #a3aaa3;
  --accent: #91bea2;
  --accent-hover: #b9d9c2;
  --border: #373d38;
  --selection: #385040;
  --on-solid: #000000;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --background: #202021;
    --text: #e5e9e4;
    --muted: #a3aaa3;
    --accent: #91bea2;
    --accent-hover: #b9d9c2;
    --border: #373d38;
    --selection: #385040;
    --on-solid: #000000;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--selection);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 4px;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}

img {
  display: block;
  max-width: 100%;
}

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

strong {
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--text);
  color: var(--on-solid);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--on-solid);
}


/* Layout */

.page-layout {
  --profile-width: 240px;
  --page-top: 72px;
  display: grid;
  grid-template-columns: var(--profile-width) minmax(0, 1fr);
  align-items: start;
  gap: 80px;

  width: min(1080px, calc(100% - 80px));
  margin: 0 auto;
  padding: var(--page-top) 0 32px;
}

.main-content {
  grid-column: 2;
  min-width: 0;
}

.main-content section + section {
  margin-top: 44px;
}

.main-content h2 {
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.main-content section > p + p {
  margin-top: 12px;
}


/* Profile */

.profile {
  position: fixed;
  top: var(--page-top);
  width: var(--profile-width);
  max-height: calc(100dvh - var(--page-top) - 32px);
  overflow-y: auto;
}

.portrait-link {
  display: block;
  width: fit-content;
  margin-bottom: 22px;
  border-radius: 8px;
}

.portrait {
  width: 200px;
  height: 300px;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
}

.profile h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.8px;
}

.profile-affiliation {
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.8;
}

.email-link {
  display: inline-block;
  margin-top: 15px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 12px;
  font-size: 13px;
}

.theme-toggle {
  margin-top: 18px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}


/* Publications */

.publication-list {
  display: grid;
  gap: 28px;
}

.publication-title {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.publication-title a {
  color: var(--text);
}

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

.publication-authors {
  font-size: 14px;
}

.publication-venue {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 13px;
}


/* Education */

.education-list {
  display: grid;
  gap: 22px;
}

.education-item h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.education-item > p {
  margin-top: 3px;
  font-size: 14px;
}

.education-item .entry-date {
  color: var(--muted);
  font-size: 13px;
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;

  margin-top: 60px;
  padding-top: 18px;
  border-top: 1px solid var(--border);

  color: var(--muted);
  font-size: 12px;
}


/* Tablet */

@media (max-width: 1000px) {
  .page-layout {
    --profile-width: 210px;
    --page-top: 48px;
    gap: 48px;
    width: calc(100% - 64px);
  }
}

/* Mobile */

@media (max-width: 760px) {
  .page-layout {
    --page-top: 32px;
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    width: calc(100% - 40px);
    max-width: 600px;
  }

  .profile {
    position: static;
    width: auto;
    max-height: none;
    overflow-y: visible;
  }

  .main-content {
    grid-column: 1;
  }

  .portrait {
    width: 128px;
    height: 152px;
  }

  .portrait-link {
    margin-bottom: 18px;
  }

  .profile h1 {
    font-size: 30px;
  }

  .profile-affiliation {
    margin-top: 14px;
  }

  .site-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 22px;
    padding-top: 16px;
  }

  .main-content section + section {
    margin-top: 36px;
  }

  .main-content h2 {
    font-size: 24px;
  }


  .site-footer {
    margin-top: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
