/* =========================================================
   Yinxian Zhang — Personal Website
   Aesthetic references: lkcao.github.io, lauraknelson.com
   Clean academic sans-serif, generous whitespace, minimal
   accent palette, content-first.
   ========================================================= */

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

:root {
  /* Palette */
  --bg: #ffffff;
  --bg-soft: #f6f5f1;        /* warm off-white for cards */
  --text: #1d1d1f;
  --text-soft: #3b3b3f;
  --muted: #6a6a70;
  --muted-light: #9a9aa0;
  --border: #e6e4dc;
  --border-strong: #d4d2c8;

  /* Accent — scholarly green, clearly readable against near-black text */
  --accent: #1f7a4d;         /* saturated medium green */
  --accent-hover: #155f3a;
  --accent-soft: #e3f1ea;
  --accent-line: #a8ccba;

  /* Layout */
  --nav-h: 64px;
  --max-width: 880px;
  --max-width-wide: 1040px;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1, 'ss01' 1;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

em { font-style: italic; }
strong { font-weight: 600; color: var(--text); }

/* =========================================================
   Navigation
   ========================================================= */

#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--text);
}

.nav-name:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.1rem;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0;
  border-bottom: 1.5px solid transparent;
}

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

.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* =========================================================
   Main / Tab panels
   ========================================================= */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 2rem 4rem;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.28s ease-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Panel headers (Pubs / Ongoing / Contact) */
.panel-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.panel-lede {
  font-size: 0.98rem;
  color: var(--muted);
  max-width: 56ch;
}

/* =========================================================
   HOME — Hero
   ========================================================= */

.hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 4rem;
}

.hero-photo-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.headshot {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.contact-card {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

.contact-line {
  margin-bottom: 0.05rem;
}

.contact-line.email {
  margin-top: 0.55rem;
  word-break: break-word;
}

.contact-line.email a {
  color: var(--accent);
  font-weight: 500;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

.quick-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* Hero text */
.hero-text-col h1 {
  font-family: var(--font-serif);
  font-size: 2.9rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 1.3rem;
  color: var(--text);
}

.hero-text-col p {
  margin-bottom: 1.1rem;
  color: var(--text-soft);
}

.name-pron {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-top: -0.7rem;
  margin-bottom: 1.3rem;
}

.hero-text-col p.lede {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text);
}

.hero-text-col p:last-child {
  margin-bottom: 0;
}

/* =========================================================
   HOME — content blocks (Research, News)
   ========================================================= */

.home-block {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.block-heading {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

/* Research cards */
.research-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.research-card {
  padding: 1.25rem 1.4rem;
  background: var(--bg-soft);
  border-left: 2px solid var(--accent-line);
  border-radius: 2px;
}

.research-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: -0.005em;
}

.research-card p {
  font-size: 0.96rem;
  color: var(--text-soft);
  line-height: 1.65;
}

.research-card .card-related {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 0.7rem;
}

.cr-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-right: 0.5rem;
}

.research-card .card-related a {
  color: var(--accent);
}

.keywords {
  font-size: 0.88rem;
  color: var(--muted);
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  line-height: 1.7;
}

.kw-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  margin-right: 0.6rem;
}

/* News list */
.news-list {
  list-style: none;
}

.news-list li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1.2rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.96rem;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-date {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.news-body {
  color: var(--text-soft);
}

/* =========================================================
   PUBLICATIONS
   ========================================================= */

.pub-category {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.pub-entry {
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent-line);
}

.pub-citation {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.pub-citation em {
  color: var(--text);
}

.pub-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.7rem;
}

.grad-mark {
  color: var(--accent);
  font-weight: 700;
}

.pub-award {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.pub-links {
  display: flex;
  gap: 0.85rem;
  margin-top: 0.4rem;
}

.pub-links a {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--accent-line);
  border-radius: 3px;
}

.pub-links a:hover {
  background: var(--accent-soft);
  text-decoration: none;
  border-color: var(--accent);
}

/* =========================================================
   ONGOING PROJECTS
   ========================================================= */

.project-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-entry {
  padding: 1.5rem 1.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-entry:hover {
  border-color: var(--border-strong);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.03);
}

.project-status {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.85rem;
}

.status-book {
  background: var(--accent);
  color: #fff;
}

.status-review {
  background: #f4ead6;
  color: #7a5b1a;
}

.status-progress {
  background: var(--accent-soft);
  color: var(--accent);
}

.project-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.005em;
}

.project-byline {
  font-size: 0.86rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.85rem;
}

.project-desc {
  font-size: 0.96rem;
  color: var(--text-soft);
  line-height: 1.65;
}

/* =========================================================
   CONTACT
   ========================================================= */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
}

.contact-block-title {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.contact-block p {
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.contact-block a {
  color: var(--accent);
}

/* =========================================================
   Footer
   ========================================================= */

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem 3rem;
  font-size: 0.78rem;
  color: var(--muted-light);
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* =========================================================
   Responsive
   ========================================================= */

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

  main { padding: 2.5rem 1.25rem 3rem; }

  .nav-inner {
    padding: 0 1.25rem;
  }

  .nav-name {
    font-size: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  /* Hero collapses to single column; photo + card side-by-side */
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-photo-col {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .headshot {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
  }

  .hero-text-col h1 {
    font-size: 2.1rem;
  }

  .hero-text-col p.lede {
    font-size: 1rem;
  }

  .panel-title {
    font-size: 1.9rem;
  }

  .project-entry {
    padding: 1.2rem 1.1rem;
  }

  .project-title {
    font-size: 1.15rem;
  }

  .news-list li {
    grid-template-columns: 60px 1fr;
    gap: 0.8rem;
  }
}

@media (max-width: 420px) {
  .nav-links {
    gap: 0.7rem;
  }
  .nav-links a {
    font-size: 0.68rem;
  }
}
