/* Personal site. Layout and type follow rhizaresearch.org/seer-explorer;
   Klein blue is the one highlight color. */

:root {
  --bg: #f6eee0;
  --ink: #242c38;
  --body: #454c58;
  --ink-soft: #5d636d;
  --rule: #e3d7c1;
  --blue: #002fa7; /* Klein blue */
  --blue-tint: color-mix(in srgb, var(--blue) 9%, transparent);
  --blue-line: color-mix(in srgb, var(--blue) 35%, transparent);
  --blue-rule: color-mix(in srgb, var(--blue) 22%, transparent);
  --font-body: Karla, system-ui, sans-serif;
  --font-display: var(--font-body);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 300 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

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

/* links that lead somewhere else get a trailing ">>" */
a.more::after {
  content: "\00a0>>";
}

.more-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin-top: 4px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

strong {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- header ---------- */

.site-header {
  position: relative;
  padding: 20px 32px 0;
}

.portrait-link {
  display: inline-block;
  line-height: 0;
}

.portrait {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 25%;
}

.site-links {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  gap: 10px;
}

.site-links a {
  font: 500 17px/1.2 var(--font-display);
  text-decoration: none;
  color: var(--blue);
  padding: 4px 12px;
  border-radius: 4px;
}

.site-links a:hover,
.site-links a[aria-current="page"] {
  background: var(--blue-tint);
}

/* ---------- page ---------- */

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 24px 48px;
}

.page-head {
  padding-top: 8px;
}

.site-name {
  font: 500 22px/1 var(--font-display);
  margin: 24px 0 6px;
}

.site-name a {
  color: var(--blue);
  text-decoration: none;
}

.page h1 {
  font-size: 46px;
  line-height: 1.1;
  margin: 0 0 8px;
}

.page-head:not(:has(.site-name)) h1 {
  margin-top: 28px;
}

.page h1 .first {
  color: var(--blue);
}

.lede {
  color: var(--ink-soft);
  font-size: 19px;
  margin: 0;
}

/* ---------- contents sidebar ---------- */

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 18px 0 0;
}

.toc a {
  font: 400 15px/1.3 var(--font-body);
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
}

.toc a:hover {
  color: var(--ink);
}

.toc a.active {
  color: var(--blue);
  background: var(--blue-tint);
}

.toc a.sub {
  display: none;
}

@media (min-width: 1100px) {
  .page.has-toc {
    max-width: 1084px;
    display: grid;
    grid-template-columns: 180px minmax(0, 820px);
    column-gap: 36px;
  }

  .page.has-toc > .page-head {
    grid-column: 2;
    grid-row: 1;
  }

  .page.has-toc > .toc {
    grid-column: 1;
    grid-row: 2;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    position: sticky;
    top: 24px;
    align-self: start;
    margin-top: 40px;
  }

  .page.has-toc > article {
    grid-column: 2;
    grid-row: 2;
  }

  .toc a.sub {
    display: block;
    margin-left: 14px;
    padding: 4px 10px;
    font-size: 14px;
  }
}

/* ---------- article ---------- */

/* a light blue rule separates the main sections of a page */
article h2 {
  font-size: 26px;
  line-height: 1.2;
  margin: 56px 0 8px;
  padding-top: 36px;
  border-top: 1px solid var(--blue-rule);
  scroll-margin-top: 24px;
}

article > h2:first-child {
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
}

article h3 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  margin: 32px 0 4px;
  scroll-margin-top: 24px;
}

article p {
  margin: 0 0 14px;
}

article ul.links {
  margin: 8px 0 14px;
  padding-left: 1.1em;
}

article ul.links li {
  margin-bottom: 4px;
}

/* ---------- entries (experience, publications) ---------- */

.entries {
  margin-top: 8px;
}

.entry {
  padding: 16px 0 6px;
  border-top: 1px solid var(--rule);
}

.entries > .entry:first-child {
  border-top: 0;
  padding-top: 8px;
}

.entry p {
  margin: 0 0 8px;
}

.entries.with-logos .entry {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 20px;
}

.entries.with-logos .entry-body {
  grid-column: 2;
}

.logo-slot {
  grid-column: 1;
  padding-top: 3px;
}

.logo {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  object-position: left top;
  mix-blend-mode: multiply; /* white logo backgrounds melt into the cream page */
}

.entry .role {
  font-weight: 600;
  font-size: 17.5px;
  color: var(--ink);
  margin: 0;
}

.entry .org {
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}

.entry .meta {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 2px 0 8px;
}

.entry .tags {
  font-size: 14.5px;
  color: var(--ink-soft);
}

.entry blockquote {
  margin: 0 0 12px;
  padding-left: 14px;
  border-left: 2px solid var(--rule);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
}

/* publications */

.pub .title {
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 2px;
}

.pub .title a {
  color: inherit;
}

.pub .authors,
.pub .venue {
  margin: 0 0 4px;
  font-size: 16px;
}

.pub .venue {
  color: var(--ink-soft);
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border: 1px solid var(--blue);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  color: var(--blue);
  vertical-align: 1px;
  white-space: nowrap;
}

/* skills */

.facts {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
}

.facts dt {
  font-weight: 500;
  color: var(--ink);
}

.facts dd {
  margin: 0;
}

/* ---------- figures ---------- */

figure {
  margin: 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.figure-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0 6px;
  align-items: start;
}

figure.wide {
  margin: 20px 0 6px;
}

.caption,
figcaption {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 6px 0 20px;
}

/* ---------- footer ---------- */

.site-footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--ink-soft);
}

.site-footer p {
  margin: 0;
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .site-header {
    padding: 16px 16px 0;
  }

  .site-links {
    top: 16px;
    right: 16px;
    gap: 6px;
  }

  .site-links a {
    padding: 3px 8px;
    font-size: 16px;
  }

  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page h1 {
    font-size: 34px;
  }

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

  .entries.with-logos .entry {
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 14px;
  }

  .logo {
    width: 44px;
    height: 44px;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .facts dd {
    margin-bottom: 10px;
  }

  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}
