/* ============================================================
   Self-hosted fonts (no external dependency on Google Fonts)
   ============================================================ */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family:'Newsreader'; font-style:normal; font-weight:400; font-display:swap; src:url('../fonts/newsreader-400.woff2') format('woff2'); }
@font-face { font-family:'Newsreader'; font-style:normal; font-weight:500; font-display:swap; src:url('../fonts/newsreader-500.woff2') format('woff2'); }
@font-face { font-family:'Newsreader'; font-style:normal; font-weight:600; font-display:swap; src:url('../fonts/newsreader-600.woff2') format('woff2'); }

/* ============================================================
   Yihang SU — personal site. Clean academic theme.
   Mobile-first, responsive.
   ============================================================ */

:root {
  --bg: #ffffff;
  --surface: #f7f7f5;
  --border: #e7e5e0;
  --text: #1f2328;
  --muted: #6b6f76;
  --accent: #7c3f2e;        /* warm academic maroon */
  --accent-soft: #f2e9e6;
  --max: 820px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --surface: #1e2127;
    --border: #2b2f36;
    --text: #e7e9ec;
    --muted: #a2a8b2;
    --accent: #d59a86;
    --accent-soft: #2a221f;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
}
.nav__links {
  list-style: none;
  display: flex;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
}
.nav__links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav__links a:hover { color: var(--accent); text-decoration: none; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.2s;
}

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.section { padding: 3rem 0; border-top: 1px solid var(--border); }
.section__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}
.subhead {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 2rem 0 0.75rem;
}

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 3rem; }
.hero__grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.2rem;
  align-items: start;
}
.hero__photo img {
  width: 180px;
  height: auto;                  /* keep the full portrait — no head-only crop */
  aspect-ratio: 2 / 3;           /* matches the original photo's proportions */
  object-fit: cover;
  border-radius: 14px;           /* rounded rectangle instead of a circle */
  border: 1px solid var(--border);
  background: var(--surface);
}
.hero__photo img.is-missing {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
  padding: 1rem;
  line-height: 1.3;
}
.hero__name {
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}
.hero__role { font-size: 1.15rem; font-weight: 500; margin: 0.3rem 0 0.2rem; }
.hero__affil { color: var(--muted); margin: 0 0 1.2rem; }
.hero__bio { margin: 0 0 1.5rem; max-width: 60ch; }

/* ---------- Links row ---------- */
.links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin: 0;
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: 0.15s;
}
.links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.links__icon { font-size: 0.9rem; }

/* ---------- Cards (research) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
}
.card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Publications ---------- */
.pubs { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.2rem; }
.pub {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.2rem;
  align-items: start;
}
.pub__venue {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  padding-top: 0.15rem;
}
.pub__venue span { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.pub__title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin: 0 0 0.3rem; }
.pub__authors { margin: 0 0 0.3rem; color: var(--muted); font-size: 0.92rem; }
.pub__meta { margin: 0 0 0.3rem; color: var(--muted); font-size: 0.85rem; font-style: italic; }
.pub__links { margin: 0; font-size: 0.9rem; }
.pub__tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.4rem; }
.timeline li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.2rem;
}
.timeline__date { color: var(--muted); font-size: 0.9rem; font-weight: 500; padding-top: 0.15rem; }
.timeline__title { font-weight: 600; margin: 0; }
.timeline__org { color: var(--muted); margin: 0.1rem 0 0.3rem; font-size: 0.95rem; }
.timeline__note { margin: 0; font-size: 0.95rem; }

/* ---------- Awards & Beyond ---------- */
.awards { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.awards li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  align-items: baseline;
}
.awards__year {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
}
.beyond__lead { color: var(--muted); margin: 0 0 1.2rem; }
.beyond__lang { margin: 1.6rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.footer p { margin: 0.2rem 0; }

/* ============================================================
   RESPONSIVE — tablet
   ============================================================ */
@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   RESPONSIVE — mobile
   ============================================================ */
@media (max-width: 560px) {
  body { font-size: 16px; }

  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav__links.is-open { max-height: 320px; }
  .nav__links li { border-top: 1px solid var(--border); }
  .nav__links a { display: block; padding: 0.9rem 1.25rem; }

  .hero { padding: 2.2rem 0; }
  .hero__grid { grid-template-columns: 1fr; gap: 1.4rem; text-align: center; }
  .hero__photo { margin: 0 auto; }
  .hero__bio { margin-left: auto; margin-right: auto; }
  .links { justify-content: center; }

  .hero__name { font-size: 2.1rem; }

  .cards { grid-template-columns: 1fr; }

  .pub, .timeline li { grid-template-columns: 1fr; gap: 0.35rem; }
  .pub__venue { padding-top: 0; }

  .awards li { grid-template-columns: 70px 1fr; gap: 0.7rem; }
}
