/* Eric Hou: minimal academic homepage */

:root {
  --bg: #fbfbf9;
  --fg: #21252b;
  --muted: #707782;
  --rule: #e7e6e1;
  --link: #1f5fa8;
  --link-hover: #143f73;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #e3e4e2;
    --muted: #969ca5;
    --rule: #2a2d31;
    --link: #82b4ff;
    --link-hover: #abccff;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Charter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 1.5rem clamp(2.5rem, 5vw, 4rem);
}

/* Nav */
.nav {
  margin-bottom: 2.4rem;
  font-size: 0.92rem;
}

.nav a {
  margin-right: 1.3rem;
  color: var(--muted);
}

.nav a:hover {
  color: var(--link);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Header */
.intro {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-bottom: 2.6rem;
}

.intro-text {
  flex: 1 1 auto;
  min-width: 0;
}

.photo {
  flex: none;
  display: block;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--rule);
  box-shadow: 0 0 0 1px var(--rule);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.9);
  transform-origin: center 35%;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.lead {
  margin: 0 0 0.7rem;
}

.contact {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.contact .sep {
  margin: 0 0.2rem;
  color: var(--muted);
}

/* Sections */
h2 {
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
}

h3 {
  margin: 1.25rem 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

p {
  margin: 0 0 0.95rem;
}

b {
  font-weight: 600;
}

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

/* Lists */
ul {
  margin: 0 0 0.95rem;
  padding-left: 1.15rem;
}

li {
  margin-bottom: 0.3rem;
}

li::marker {
  color: var(--muted);
}

/* Awards: tighter spacing within the grouped section */
.awards ul {
  margin-bottom: 0.6rem;
}

.awards h3:first-child {
  margin-top: 0.4rem;
}

/* Footer */
footer {
  margin-top: 2.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

/* Blog listing */
.posts {
  list-style: none;
  padding: 0;
  margin: 1.8rem 0 0;
}

.posts li {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  margin-bottom: 0.85rem;
}

.post-date {
  flex: none;
  width: 5.5rem;
  font-size: 0.9rem;
}

/* Blog post */
.post {
  margin-bottom: 2.5rem;
}

.post h1 {
  margin-bottom: 0.25rem;
}

.post-meta {
  margin: 0 0 1.6rem;
  font-size: 0.92rem;
}

.back {
  font-size: 0.92rem;
}

/* Small screens */
@media (max-width: 480px) {
  html {
    font-size: 17px;
  }

  .intro {
    gap: 1.1rem;
  }

  .photo {
    width: 128px;
    height: 128px;
  }
}
