:root {
  --bg: #ffffff;
  --text: #37352f;
  --muted: #787774;
  --rule: #e9e9e7;
  --hover: rgba(55, 53, 47, 0.06);
  --max-width: 900px;
  --nav-h: 3.75rem;
}

/* dark mode disabled for now, forcing light:
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --text: #e9e9e7;
    --muted: #979a9b;
    --rule: #2f2f2f;
    --hover: rgba(255, 255, 255, 0.055);
  }
}
*/

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
}

main.home {
  padding-top: 0;
}

a {
  color: inherit;
}

a:not(.plain) {
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

a:not(.plain):hover {
  text-decoration-color: currentColor;
}

.plain {
  text-decoration: none;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.site-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
}

.site-nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.92rem;
}

.site-nav nav a {
  padding: 0.4rem 0.65rem;
  border-radius: 5px;
  text-decoration: none;
}

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

.intro {
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2.25rem;
  margin-bottom: 0;
}

.avatar {
  width: 220px;
  height: 294px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.intro-body {
  min-width: 0;
}

@media (max-width: 560px) {
  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .avatar {
    width: 160px;
    height: 214px;
  }
}

h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.intro h1 {
  font-size: 2.3rem;
}

.tagline {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 1.02rem;
}

.intro .tagline {
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 1rem 0 1.75rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}

section {
  scroll-margin-top: calc(var(--nav-h) + 1rem);
  margin-bottom: 3rem;
}

h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}

.entry {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.6rem;
  margin: 0 -0.6rem;
  border-radius: 6px;
  transition: background-color 0.12s ease;
}

.entry:hover {
  background: var(--hover);
}

.entry-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--rule);
}

.entry-body {
  min-width: 0;
  flex: 1;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.entry-org {
  font-weight: 600;
}

a.entry-org {
  text-decoration: none;
}

a.entry-org:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.entry-meta {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.entry-role {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.15rem 0 0.4rem;
}

.entry p.desc {
  margin: 0;
}

.figures {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 2.5rem;
  margin: 1rem 0 0.5rem;
}

.figures figure {
  margin: 0;
}

.figures img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 160px;
  mix-blend-mode: multiply;
}

.figures figcaption {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.entry p.credit {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.project-link {
  display: block;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}

.project-link:first-of-type {
  border-top: 1px solid var(--rule);
}

.project-link:last-of-type {
  border-bottom: 1px solid var(--rule);
}

.project-title {
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.project-desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* project pages */

.back {
  display: inline-block;
  margin-bottom: 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

article header {
  margin-bottom: 2rem;
}

article h1 {
  font-size: 1.55rem;
  margin-bottom: 0.4rem;
}

.meta-line {
  color: var(--muted);
  font-size: 0.92rem;
}

article p {
  margin: 0 0 1.25rem;
}

article h2 {
  font-size: 1.15rem;
  margin: 2.5rem 0 0.9rem;
}

article .eq {
  padding-left: 1.5rem;
}

article .note {
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
  background: var(--hover);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--hover);
}

sup,
sub {
  line-height: 0;
}

article .stats {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.25rem;
}

article .stats li {
  border-top: 1px solid var(--rule);
  padding-top: 0.6rem;
}

.stat-num {
  display: block;
  font-size: 1.3rem;
  font-weight: 600;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}
