/* Qiushi Wu — academic homepage. System fonts only, no external assets, no JS.
   Mobile-first: single stacked column on phones; at >= 64rem the sidebar
   (photo, identity, links, section nav) docks left and stays sticky while
   the content column uses the remaining width. */

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #555555;
  --link: #004682;
  --rule: #d8d8d8;
  --rule-soft: rgba(26, 26, 26, 0.15);
  --placeholder-bg: #eef2f6;
  --placeholder-fg: #4a5b6d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --text: #d9dde2;
    --muted: #9aa2ab;
    --link: #6aa5d8;
    --rule: #3a3d42;
    --rule-soft: rgba(217, 221, 226, 0.2);
    --placeholder-bg: #24282e;
    --placeholder-fg: #9db2c6;
  }
}

* {
  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", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.layout {
  max-width: 46rem;
  margin: 0 auto;
  padding-inline: 1.25rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  font-size: 1.7rem;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.6rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule-soft);
}

main > section:first-child h2 {
  margin-top: 1.75rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.4rem;
}

p {
  margin: 0.5rem 0;
}

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

a:hover,
a:focus {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

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

/* Skip link */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg);
  padding: 0.4rem 0.8rem;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  z-index: 10;
}

/* Sidebar (stacked header on mobile) */

.sidebar {
  padding-top: 1.75rem;
}

.title-line {
  margin: 0.15rem 0 0.1rem;
  color: var(--muted);
}

.tagline {
  margin: 0 0 0.6rem;
  color: var(--muted);
}

.profile-links {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  font-size: 0.97rem;
}

.profile-links li {
  display: inline;
  margin: 0;
}

.profile-links li + li::before {
  content: "\00B7";
  color: var(--muted);
  margin: 0 0.4rem;
}

/* Plain-text email: one click/tap selects the whole address for copying */

.email-text {
  -webkit-user-select: all;
  user-select: all;
}

/* Section navigation: inline row on mobile, vertical list on desktop */

.site-nav {
  margin-top: 0.75rem;
  font-size: 0.97rem;
}

.site-nav a {
  display: inline-block;
  margin: 0 1rem 0.25rem 0;
  padding: 0.35rem 0;
}

/* Featured side project card in the sidebar */

.side-project {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.92rem;
  max-width: 24rem;
}

.side-project p {
  margin: 0.25rem 0;
}

.side-project-title {
  font-weight: 600;
}

.side-project-desc {
  color: var(--muted);
  line-height: 1.5;
}

/* Photo / placeholder — rounded rect; layout identical for div and img */

.photo,
.photo-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 8px;
}

.photo {
  object-fit: cover;
}

.photo-placeholder {
  background: var(--placeholder-bg);
  color: var(--placeholder-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  letter-spacing: 0.05em;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .photo {
    border: 1px solid var(--rule);
  }
}

/* News */

.news {
  margin: 0.4rem 0 0.8rem;
}

.news dt {
  color: var(--muted);
  font-size: 0.95rem;
  padding-top: 0.1rem;
}

.news dd {
  margin: 0 0 0.55rem 0;
}

@media (min-width: 40rem) {
  .news dt {
    float: left;
    clear: left;
    width: 6rem;
  }

  .news dd {
    margin: 0 0 0.55rem 6.5rem;
  }
}

/* Lists */

ul,
ol {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.4rem;
}

li {
  margin: 0.45rem 0;
}

/* Publications */

.pub-list {
  list-style: none;
  padding-left: 0;
}

.pub-list li {
  margin: 0 0 1rem;
}

.pub-title {
  font-weight: 600;
}

.pub-venue,
.pub-links {
  font-size: 0.92rem;
}

.pub-venue .muted {
  font-size: 0.92em;
}

.pub-links a {
  margin-right: 0.35rem;
}

/* Footer */

footer {
  margin-top: 3rem;
  padding-top: 0.75rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--rule-soft);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Desktop: two-column layout with a sticky sidebar */

@media (min-width: 64rem) {
  .layout {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    gap: 4rem;
    max-width: 74rem;
    padding-inline: 2rem;
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding-top: 2.75rem;
    padding-bottom: 1.5rem;
  }

  main {
    padding-top: 1rem;
    min-width: 0;
  }

  h1 {
    font-size: 2rem;
    margin-top: 1.1rem;
  }

  .photo,
  .photo-placeholder {
    width: 180px;
    height: 180px;
  }

  .photo-placeholder {
    font-size: 2.4rem;
  }

  .profile-links li {
    display: block;
    margin: 0.25rem 0;
  }

  .profile-links li + li::before {
    content: none;
  }

  .site-nav {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--rule-soft);
  }

  .site-nav a {
    display: block;
    margin: 0;
    padding: 0.28rem 0;
  }
}
