/* ==========================================================================
   Yonghong Zhang — academic homepage
   Two columns: a profile sidebar and the main text column.
   Light only — no dark theme, matching the plain academic pages this follows.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface-2: #f2f8f4;
  --text: #1b2622;
  --text-2: #33423b;
  --muted: #6b7a72;
  --line: #e2e9e4;
  --line-strong: #ccd8d1;
  /* Sage green: light enough to read as green, dark enough to pass AA on white
     (4.7:1) since links and the paper-status line use it as text. */
  --accent: #3f7f66;
  --accent-soft: #eaf4ee;

  --sidebar: 244px;
  --gap: clamp(40px, 5vw, 68px);
  --gutter: clamp(22px, 5vw, 44px);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin-top: 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(100% - (var(--gutter) * 2), 1180px);
  min-height: 66px;
  margin-inline: auto;
}

.brand {
  flex: none;
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 700;
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 26px;
  margin-left: 26px;
}

.nav-links a {
  color: var(--text-2);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--accent);
}

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: var(--gap);
  width: min(100% - (var(--gutter) * 2), 1180px);
  margin-inline: auto;
  padding: clamp(32px, 5vw, 52px) 0 0;
}

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

.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
}

.avatar {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 232px;
  aspect-ratio: 1;
  margin: 0 auto 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.side-name {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
}

.side-keywords {
  margin-bottom: 20px;
  color: var(--text-2);
  font-size: 0.97rem;
  line-height: 1.55;
}

.side-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-links li {
  margin-bottom: 9px;
}

.side-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-2);
  font-size: 0.97rem;
  text-decoration: none;
}

.side-links a:hover {
  color: var(--accent);
}

.side-links svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

h1 {
  margin-bottom: 4px;
  color: var(--text);
  font-size: clamp(2.2rem, 4.4vw, 3.05rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.role {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.6vw, 1.32rem);
}

.intro p {
  margin-bottom: 20px;
}

.intro p.summary {
  margin-bottom: 0;
}

.intro hr {
  margin: 26px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Awards & news: the placement column carries the signal, so it gets the accent. */

.group {
  margin: 26px 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.record {
  margin: 0;
  padding: 0;
  list-style: none;
}

.record li {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px;
  padding: 8px 0;
}

.record .rank {
  color: var(--accent);
  font-size: 0.93rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.record .what {
  font-size: 0.98rem;
}

.record .what b {
  color: var(--text);
  font-weight: 600;
}

/* -------------------------------------------------------------- sections */

.section {
  padding: clamp(36px, 4vw, 48px) 0 0;
}

h2 {
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  color: var(--text);
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Papers */

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

.pub {
  margin-bottom: 26px;
}

.pub:last-child {
  margin-bottom: 0;
}

.pub h3 {
  margin-bottom: 5px;
}

.pub-authors {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.96rem;
}

.pub-authors strong {
  color: var(--text-2);
  font-weight: 600;
}

.pub-abstract {
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.pub-status {
  margin-bottom: 0;
  color: var(--accent);
  font-size: 0.92rem;
}

/* Projects */

.project-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-list li {
  margin-bottom: 20px;
}

.project-list li:last-child {
  margin-bottom: 0;
}

.project-list h3 {
  margin-bottom: 4px;
}

.project-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.aux {
  white-space: nowrap;
  font-size: 0.92em;
}

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

.site-footer {
  margin-top: clamp(40px, 5vw, 60px);
  padding: 24px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer p {
  margin-bottom: 3px;
}

.footer-meta {
  font-size: 0.88rem;
}

/* ------------------------------------------------------------ responsive */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    column-gap: 24px;
  }

  .avatar {
    grid-row: 1 / span 3;
    margin: 0;
  }

  .side-name,
  .side-keywords {
    margin-bottom: 8px;
  }

  .side-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
  }

  .side-links li {
    margin-bottom: 0;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .nav {
    gap: 12px;
  }

  .nav-links {
    gap: 15px;
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    font-size: 0.92rem;
  }

  .brand {
    display: none;
  }

  .sidebar {
    grid-template-columns: 96px minmax(0, 1fr);
    column-gap: 18px;
  }

  .record li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
