/* ============================================================
   Qihang (Charlie) Wu — personal site
   Minimal academic style: typography-first, white ground,
   a single blue accent, generous whitespace.
   ============================================================ */

:root {
  /* color */
  --ink: #16181d;
  --ink-soft: #4b5563;
  --ink-faint: #8a93a0;
  /* ASU brand: maroon #8C1D40, gold #FFC627 */
  --accent: #8c1d40;        /* ASU maroon, links + primary */
  --accent-deep: #6b1631;
  --accent-tint: #f3dbe3;   /* pale maroon tint */
  --wash: #faf4f6;          /* pale maroon wash for panels */
  --line: #e8e4e6;
  --bg: #ffffff;
  --gold: #7a5a00;          /* award text (dark ASU gold) */
  --gold-bg: #fff3c4;       /* ASU gold tint */

  /* type */
  --serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;

  /* layout */
  --max: 1020px;
  --pad: 24px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

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

::selection { background: var(--accent-tint); color: var(--ink); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ---------------- navigation ---------------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--serif);
  font-size: 22px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none;
  display: flex; align-items: baseline; gap: 9px;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand .brand-mark { color: var(--accent); }
.brand .brand-sub {
  font-family: var(--sans); font-size: 11.5px; font-weight: 500;
  color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase;
}
.nav-links { display: flex; gap: 26px; align-items: center; list-style: none; }
.nav-links a {
  position: relative;
  font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
  letter-spacing: 0.01em; padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.18s ease;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--ink); }
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 8px; color: var(--ink);
}
.nav-toggle svg { display: block; }

/* ---------------- page scaffolding ---------------- */

main { min-height: 60vh; }

.section { padding: 56px 0 8px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 26px;
}
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 6px;
}
h1.page-title, .section-head h2 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink);
}
.section-head h2 { font-size: 30px; line-height: 1.2; }
.section-head .more { font-size: 14px; white-space: nowrap; }

.page-head { padding: 64px 0 8px; }
h1.page-title { font-size: 42px; line-height: 1.15; margin-bottom: 14px; }
.page-lede { font-size: 17.5px; color: var(--ink-soft); }

/* ---------------- home hero ---------------- */

.hero { padding: 64px 0 30px; }
/* Hero: text column + portrait column (no text wrap); stacks on phones. */
.hero-grid { display: grid; grid-template-columns: 1fr 200px; gap: 40px; align-items: start; }
.hero-portrait {
  width: 200px; height: 200px; object-fit: cover;
  border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(140, 29, 64, 0.10);
  margin-top: 8px;
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-portrait { width: 168px; height: 168px; margin-top: 0; }
}
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 5.4vw, 54px);
  line-height: 1.14; letter-spacing: -0.015em;
  margin-bottom: 22px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lede {
  font-size: 18.5px; color: var(--ink-soft); line-height: 1.7;
}
.hero .hero-meta {
  margin-top: 10px; font-size: 14px; color: var(--ink-faint); letter-spacing: 0.02em;
}
.hero-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 6px;
  font-size: 15px; font-weight: 550; letter-spacing: 0.01em;
  border: 1px solid transparent; transition: all 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--ink-faint); color: var(--ink); }

.recruit-banner {
  margin-top: 44px;
  background: var(--wash);
  border: 1px solid #ead3db;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 15px 20px;
  font-size: 15px; color: var(--ink);
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
}
.recruit-banner strong { font-weight: 650; }
.recruit-banner .recruit-link { flex-basis: 100%; font-weight: 550; }

/* ---------------- research pillars ---------------- */

.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pillar {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 26px 26px 22px; background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  display: block; color: var(--ink);
}
.pillar:hover {
  text-decoration: none; color: var(--ink);
  border-color: #d9b8c4; box-shadow: 0 6px 18px rgba(140, 29, 64, 0.08);
  transform: translateY(-2px);
}
.pillar .pillar-num {
  font-family: var(--mono); font-size: 12px; color: var(--area-color, var(--accent));
  letter-spacing: 0.1em; margin-bottom: 12px;
}
.pillar h3 {
  font-family: var(--serif); font-size: 21px; font-weight: 600;
  line-height: 1.3; margin-bottom: 10px;
}
.pillar p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.62; }

/* ---------------- research page ---------------- */

.research-block {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.research-pillars { margin-bottom: 48px; }
.research-block h2 {
  font-family: var(--serif); font-size: 27px; font-weight: 600;
  line-height: 1.25; margin-bottom: 6px;
}
.research-sub {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--area-color, var(--accent)); margin-bottom: 12px;
}
.research-block .research-long { color: var(--ink-soft); margin-bottom: 16px; }
.keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.keyword {
  font-size: 12.5px; font-weight: 550; color: var(--accent-deep);
  background: var(--wash); border: 1px solid #ead3db;
  padding: 3px 11px; border-radius: 999px;
  color: var(--area-color, var(--accent-deep));
  background: color-mix(in srgb, var(--area-color, var(--accent)) 7%, #fff);
  border-color: color-mix(in srgb, var(--area-color, var(--accent)) 24%, #fff);
}
.rep-pubs { border-left: 2px solid var(--line); padding-left: 18px; display: grid; gap: 10px; }
.research-block .rep-pubs {
  border-left-color: color-mix(in srgb, var(--area-color, var(--accent)) 30%, #fff);
}
.research-more {
  display: inline-block; margin-top: 16px;
  font-size: 14px; font-weight: 550;
}
.rep-pub { font-size: 14.5px; line-height: 1.55; }
.rep-pub .rep-venue {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
  margin-left: 6px; white-space: nowrap;
}
/* ---------------- news ---------------- */

.news-list { display: grid; gap: 0; }
.news-item {
  display: grid; grid-template-columns: 92px 84px 1fr; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: 15px; align-items: baseline;
}
.news-item:last-child { border-bottom: 0; }
.news-date {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint);
  white-space: nowrap; letter-spacing: 0.02em;
}
.news-tag {
  font-size: 11px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; text-align: center;
  padding: 2px 0; border-radius: 4px;
  color: var(--accent-deep); background: var(--wash);
  align-self: start; margin-top: 2px;
}
.news-tag[data-tag="Award"], .news-tag[data-tag="Patent"] { color: var(--gold); background: var(--gold-bg); }
.news-tag[data-tag="Milestone"] { color: #fff; background: var(--accent); }
.news-text { color: var(--ink); line-height: 1.6; }
.news-text b { font-weight: 600; }

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

.pub-controls {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 18px 0 6px;
}
.pub-filter {
  font-size: 13.5px; font-weight: 550; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 15px; cursor: pointer; transition: all 0.12s ease;
  font-family: var(--sans);
}
.pub-filter:hover { border-color: var(--ink-faint); color: var(--ink); }
.pub-filter.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.pub-filter-count {
  margin-left: 7px; font-size: 11px; font-weight: 500;
  color: var(--ink-faint); letter-spacing: 0;
}
.pub-filter.active .pub-filter-count { color: rgba(255, 255, 255, 0.75); }
.pub-search {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 15px; width: 220px; background: #fff;
  transition: border-color 0.12s ease;
}
.pub-search:focus { outline: none; border-color: var(--accent); }
.pub-search::placeholder { color: var(--ink-faint); }
.pub-count { font-size: 13px; color: var(--ink-faint); margin-left: auto; }
.pub-empty { padding: 30px 0; color: var(--ink-faint); font-size: 15px; }

@media (max-width: 820px) {
  .pub-search { width: 100%; }
}

.pub-year {
  font-family: var(--serif); font-size: 24px; font-weight: 600;
  padding: 34px 0 4px; color: var(--ink);
  display: flex; align-items: center; gap: 14px;
}
.pub-year::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 0; }
.pub-year-count {
  order: 1; font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  color: var(--ink-faint); white-space: nowrap; letter-spacing: 0.02em;
}

/* Published work carries a pale accent spine; preprints a neutral one. */
.pub-item {
  padding: 16px 0 16px 16px; border-bottom: 1px solid #f0f2f5;
  border-left: 2px solid var(--accent-tint);
}
.pub-item.is-preprint { border-left-color: var(--line); }
.pub-item.is-preprint .venue-badge {
  color: var(--ink-soft); background: #f3f5f8; border-color: var(--line);
}
.pub-item:last-child { border-bottom: 0; }
.pub-title {
  font-size: 16.5px; font-weight: 600; line-height: 1.45;
  color: var(--ink); margin-bottom: 3px;
}
.pub-title a { color: var(--ink); }
.pub-title a:hover { color: var(--accent-deep); }
.pub-authors { font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.pub-authors b { color: var(--ink); font-weight: 600; }
.pub-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 7px; font-size: 13px;
}
.venue-badge {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  color: var(--accent-deep); background: var(--wash);
  border: 1px solid #ead3db; border-radius: 4px; padding: 1.5px 8px;
  letter-spacing: 0.02em; white-space: nowrap;
}
.award-badge {
  font-size: 12px; font-weight: 600; color: var(--gold);
  background: var(--gold-bg); border-radius: 4px; padding: 1.5px 9px;
}
.award-badge::before { content: "🏆 "; font-size: 11px; }
.pub-note { font-size: 12.5px; color: var(--ink-faint); font-style: italic; }
.pub-links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.pub-links a { font-weight: 550; }

/* Clickable research-area chips on each publication. */
.pub-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.area-chip {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--chip, var(--accent-deep));
  background: var(--wash);
  background: color-mix(in srgb, var(--chip, var(--accent)) 7%, #fff);
  border: 1px solid #ead3db;
  border-color: color-mix(in srgb, var(--chip, var(--accent)) 26%, #fff);
  border-radius: 999px; padding: 2px 10px;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.area-chip:hover {
  text-decoration: none;
  color: var(--chip, var(--accent-deep));
  background: color-mix(in srgb, var(--chip, var(--accent)) 13%, #fff);
  border-color: color-mix(in srgb, var(--chip, var(--accent)) 42%, #fff);
}

/* ---------------- cv ---------------- */

.table-scroll { overflow-x: auto; }
.mentee-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.mentee-table th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.mentee-table td {
  padding: 9px 10px 9px 0; border-bottom: 1px solid #f0f2f5;
  vertical-align: top; color: var(--ink-soft); line-height: 1.5;
  white-space: nowrap;
}
.mentee-table th:last-child, .mentee-table td:last-child { padding-right: 0; }
.mentee-table tr:last-child td { border-bottom: 0; }
.mentee-table .mentee-name { font-weight: 600; color: var(--ink); }
.mentee-table .mentee-years {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
}

.join-section { padding: 30px 0 4px; }
.join-section h2 {
  font-family: var(--serif); font-size: 25px; font-weight: 600; margin-bottom: 12px;
}
.join-section p, .join-section li { font-size: 15.5px; color: var(--ink-soft); }
.join-section p { margin-bottom: 12px; }
.join-section ul { padding-left: 22px; margin-bottom: 12px; }
.join-section li { margin-bottom: 7px; }
.join-section li::marker { color: var(--accent); }

/* Dated CV entries (education, research, industry, projects). */
.cv-entry { padding: 16px 0; border-bottom: 1px solid var(--line); }
.cv-entry:last-child { border-bottom: 0; }
.cv-entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.cv-entry-title { font-size: 16.5px; font-weight: 600; color: var(--ink); }
.cv-entry-dates { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.cv-entry-sub { font-size: 14.5px; color: var(--ink-soft); font-weight: 550; }
.cv-entry-meta { font-size: 13.5px; color: var(--ink-faint); }
.cv-entry-blurb { font-size: 14.5px; color: var(--ink-soft); margin-top: 8px; }
.cv-bullets { padding-left: 20px; margin-top: 8px; }
.cv-bullets li { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 5px; }
.cv-bullets li::marker { color: var(--accent); }
.cv-table td { white-space: normal; }

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

.footer {
  margin-top: 80px; border-top: 1px solid var(--line);
  background: #fafbfc;
  padding: 42px 0 34px;
}
.footer-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.footer h4 {
  font-family: var(--serif); font-size: 18px; font-weight: 600; margin-bottom: 6px;
}
.footer p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }
.footer .footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; margin-top: 8px; }
.footer .footer-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 16px; }

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

@media (max-width: 820px) {
  .pillars { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 0;
    box-shadow: 0 12px 24px rgba(20, 30, 40, 0.07);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 13px var(--pad); border-bottom: 0; font-size: 15.5px;
  }
  .nav-links a::after { display: none; }
  .nav-links a.active { background: var(--wash); border-bottom: 0; }

  .hero { padding: 56px 0 20px; }
  .cv-entry-head { flex-direction: column; gap: 2px; }
  .news-item { grid-template-columns: 84px 1fr; }
  .news-item .news-tag { display: none; }
  h1.page-title { font-size: 34px; }
}

@media (max-width: 480px) {
  .brand .brand-sub { display: none; }
  .news-item { grid-template-columns: 76px 1fr; gap: 12px; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------------- print ---------------- */
@media print {
  .nav, .footer, .hero-actions, .pub-controls { display: none; }
}
