:root {
  --page-bg: #fbfbfa;
  --text: #202020;
  --muted: #686868;
  --line: #dededb;
  --soft: #f2f2ef;
  --content-width: 760px;
  --wide-width: 1120px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.72;
}

a {
  color: inherit;
  text-decoration-color: #a1a19d;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.06em;
}

a:hover,
a:focus {
  color: #000;
  text-decoration-color: #000;
}

h1,
h2,
h3,
.navbar-brand {
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.018em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4.15rem);
  line-height: 1.02;
  margin-bottom: 1.5rem;
}

h2 {
  border-bottom: 1px solid var(--line);
  font-size: 1.55rem;
  margin-top: 3.4rem;
  padding-bottom: 0.55rem;
}

h3 {
  font-size: 1.23rem;
  margin-top: 2.35rem;
}

.navbar {
  background: rgba(251, 251, 250, 0.96) !important;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  padding-bottom: 0.65rem;
  padding-top: 0.65rem;
}

.navbar-brand {
  font-size: 1.16rem;
}

.navbar .nav-link {
  color: var(--text) !important;
  font-size: 0.94rem;
  margin-left: 0.45rem;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  text-decoration: underline;
  text-decoration-color: #8d8d89;
  text-underline-offset: 0.35em;
}

#quarto-content {
  min-height: calc(100vh - 155px);
}

main.content {
  margin-left: auto;
  margin-right: auto;
  max-width: var(--content-width);
  padding-bottom: 4.5rem;
  padding-top: 2.9rem;
}

.quarto-title-block .quarto-title-banner,
.quarto-title-block .quarto-title {
  margin-bottom: 2.1rem;
}

.quarto-title h1.title {
  font-size: clamp(2.2rem, 4.8vw, 3.7rem);
}

.home-hero {
  align-items: center;
  display: grid;
  gap: clamp(2.5rem, 7vw, 7rem);
  grid-template-columns: minmax(250px, 0.82fr) minmax(340px, 1.18fr);
  margin: 4.5rem auto 2rem;
  max-width: var(--wide-width);
  width: min(var(--wide-width), calc(100vw - 3rem));
  margin-left: 50%;
  transform: translateX(-50%);
  min-height: min(680px, calc(100vh - 170px));
}

.home-photo-wrap {
  justify-self: end;
  max-width: 410px;
  width: 100%;
}


.home-photo-wrap figure {
  margin: 0;
}

.home-photo {
  aspect-ratio: 4 / 5;
  display: block;
  height: auto;
  object-fit: cover;
  object-position: center 38%;
  width: 100%;
}

.home-copy {
  max-width: 660px;
}

.home-copy h1 {
  margin-top: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.81rem;
  font-weight: 600;
  letter-spacing: 0.085em;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.home-lead {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(1.2rem, 2.2vw, 1.48rem);
  line-height: 1.55;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.35rem;
  margin-top: 2rem;
}

.home-links a {
  font-size: 0.92rem;
  font-weight: 600;
}

.page-intro,
.cv-intro {
  color: var(--muted);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.18rem;
  line-height: 1.6;
}

.cv-row {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 100px minmax(0, 1fr);
  margin: 1.55rem 0;
}

.cv-date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.button {
  border: 1px solid var(--text);
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  text-decoration: none;
}

.button:hover {
  background: var(--text);
  color: var(--page-bg);
}

.photo-grid {
  column-count: 2;
  column-gap: 1.1rem;
  margin-top: 2.2rem;
  width: min(1050px, calc(100vw - 3rem));
  margin-left: 50%;
  transform: translateX(-50%);
}

.photo-grid figure {
  break-inside: avoid;
  display: inline-block;
  margin: 0 0 1.5rem;
  width: 100%;
}

.photo-grid img {
  display: block;
  height: auto;
  transition: opacity 150ms ease;
  width: 100%;
}

.photo-grid a:hover img {
  opacity: 0.88;
}

.photo-grid figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.025em;
  margin-top: 0.45rem;
}

.nav-footer {
  background: transparent;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  padding-bottom: 1.4rem;
  padding-top: 1.4rem;
}

@media (max-width: 800px) {
  main.content {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .home-hero {
    gap: 2.3rem;
    grid-template-columns: 1fr;
    margin-top: 2rem;
    min-height: auto;
  }

  .home-photo-wrap {
    justify-self: start;
    max-width: 330px;
  }

  .home-copy h1 {
    font-size: clamp(2.8rem, 13vw, 4rem);
  }
}

@media (max-width: 620px) {
  body {
    font-size: 0.98rem;
  }

  .photo-grid {
    column-count: 1;
    width: min(100%, calc(100vw - 2rem));
  }

  .cv-row {
    gap: 0.35rem;
    grid-template-columns: 1fr;
  }

  .navbar .nav-link {
    margin-left: 0;
  }
}

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

  .photo-grid img {
    transition: none;
  }
}

/* Links attached to an individual research paper. */
.paper-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 1.1rem 0 2rem;
}

.paper-links p {
  display: contents;
}

.paper-links a:not(.button) {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Pandoc wraps Markdown content inside fenced divs in paragraphs. */
.home-photo-wrap p,
.eyebrow,
.home-lead,
.home-links p,
.cv-row p,
.cv-intro p,
.page-intro p {
  margin-top: 0;
}

.home-photo-wrap p,
.home-links p,
.cv-row p,
.cv-intro p,
.page-intro p {
  margin-bottom: 0;
}

.home-links p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.35rem;
}

.cv-entry p {
  margin: 0;
}
