/* ------------------------------------------------------------------
   Yicheng Zhang — personal academic site
   No external fonts or scripts: everything is served from this repo.
   ------------------------------------------------------------------ */

:root {
  --serif: "Charter", "Bitstream Charter", "Sitka Text", Cambria, "Noto Serif", "Source Serif Pro", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Noto Sans", Arial, sans-serif;

  --bg: #fcfcfb;
  --text: #1d2126;
  --muted: #5a626c;
  --faint: #8a929b;
  --rule: #e5e7ea;
  --accent: #1f3f8f;
  --accent-soft: #eef2fb;
  --award: #8a5a00;
  --award-bg: #fdf3d8;

  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --text: #e4e6e9;
    --muted: #a3abb4;
    --faint: #737b85;
    --rule: #262b32;
    --accent: #8fb0ff;
    --accent-soft: #1b2333;
    --award: #e8bb55;
    --award-bg: #2a2314;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: 106.25%; /* 17px */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.65;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }

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

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

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 5.5rem 1.5rem 3rem;
}

section { margin-top: 3.25rem; }

h2 {
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.hero h1 {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.012em;
}

.hero .role {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 1.4rem;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.icon {
  width: 1.05em;
  height: 1.05em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-fill { fill: currentColor; stroke: none; }

/* ---------- about ---------- */

.interests {
  margin-top: 1rem;
}
.interests li {
  position: relative;
  padding-left: 1.1rem;
  margin-top: 0.25rem;
}
.interests li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.72em;
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* ---------- news ---------- */

.news li {
  display: grid;
  grid-template-columns: 5.75rem 1fr;
  gap: 1rem;
  padding: 0.3rem 0;
}

.news time,
.when {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  padding-top: 0.2rem;
  white-space: nowrap;
}

/* ---------- publications ---------- */

.legend {
  margin: -0.6rem 0 1rem;
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--faint);
}

.pub + .pub {
  margin-top: 1.6rem;
}

.pub-title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.4;
}

.pub-authors {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.me {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.pub-venue {
  margin-top: 0.15rem;
  font-size: 0.94rem;
}

.award {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--award-bg);
  color: var(--award);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: 0.12em;
}

.pub-note {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.pill {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: border-color 0.15s, background-color 0.15s;
}
.pill:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- entries (honors, education, activities) ---------- */

.entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.35rem 0;
}
.entries.compact .entry { padding: 0.15rem 0; }

.entry .when { padding-top: 0; }

.sub {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.footer {
  margin-top: 4.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--faint);
}

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

@media (max-width: 560px) {
  html { font-size: 100%; }
  .page { padding-top: 3.25rem; }
  .hero h1 { font-size: 2.15rem; }
  section { margin-top: 2.75rem; }
  .award { margin-left: 0; }

  .news li {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0.45rem 0;
  }

  .entry {
    flex-direction: column;
    gap: 0;
  }
  .entry .when { order: -1; }
}

/* ---------- print ---------- */

@media print {
  :root { --bg: #fff; --text: #000; }
  .page { padding-top: 0; max-width: none; }
  .pub-links, .links { display: none; }
  a { color: inherit; }
}
