/* Qihang Zhang — plain-text homepage */

:root {
  --ink: #111;
  --faint: #888;
  --rule: #e5e5e5;
}

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

html {
  font-size: 14px;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  line-height: 1.65;
  display: flex;
  min-height: 100vh;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

nav {
  width: 255px;
  flex-shrink: 0;
  padding: 3.5rem 0 3rem 5.5rem;
}

nav .name {
  font-weight: 700;
  margin-bottom: 3rem;
}

nav ul {
  list-style: none;
}

nav li {
  margin-bottom: 0.35rem;
}

nav a.here {
  text-decoration: underline;
  text-underline-offset: 3px;
}

nav .contact {
  margin-top: 3rem;
}

nav .contact li {
  margin-bottom: 0.35rem;
}

/* ---- main column ---- */

main {
  max-width: 600px;
  padding: 3.5rem 3rem 6rem 3rem;
}

main .pagetitle {
  margin-bottom: 3rem;
}

main p {
  margin-bottom: 1.4rem;
}

main section {
  margin-bottom: 3.5rem;
}

h2 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--faint);
  margin-bottom: 1.4rem;
}

/* publications */

.year {
  color: var(--faint);
  margin: 2.4rem 0 1.2rem;
}

.year:first-of-type {
  margin-top: 0;
}

main.wide {
  max-width: 740px;
}

.pub {
  margin-bottom: 1.8rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.pub img {
  width: 225px;
  flex-shrink: 0;
  display: block;
}

.pub .text {
  flex: 1;
}

.pub .title {
  display: block;
}

.pub .authors {
  display: block;
  color: var(--faint);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-top: 0.15rem;
}

.pub .authors b {
  font-weight: 400;
  color: var(--ink);
}

.pub .meta {
  display: block;
  margin-top: 0.3rem;
}

.pub .meta a {
  margin-left: 1rem;
  color: var(--faint);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}

.pub .meta a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* selected publications on the index page */

.selected {
  margin-top: 3.5rem;
}

.selected .pub img {
  width: 170px;
}

main.wide .pagetitle {
  margin-bottom: 0.3rem;
}

.footnote {
  color: var(--faint);
  font-size: 0.88rem;
  margin-bottom: 3rem;
}

/* misc lists */

.plain {
  list-style: none;
  margin-bottom: 1.4rem;
}

.plain li {
  margin-bottom: 0.35rem;
}

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

@media (max-width: 640px) {
  body {
    display: block;
  }

  nav {
    width: auto;
    padding: 2rem 1.5rem 0;
  }

  nav .name {
    margin-bottom: 1.5rem;
  }

  nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
  }

  nav .contact {
    margin-top: 0.75rem;
  }

  main {
    padding: 2.5rem 1.5rem 4rem;
  }

  .pub {
    flex-direction: column;
    gap: 0.5rem;
  }

  .pub img {
    width: 100%;
    max-width: 320px;
  }
}
