/* =========================================================================
   Apple-inspired theme for Chiyue Wei's homepage
   Light & airy · single-page scroll
   ========================================================================= */

:root {
  --bg:          #ffffff;
  --bg-alt:      #f5f5f7;
  --ink:         #1d1d1f;
  --ink-soft:    #6e6e73;
  --ink-faint:   #86868b;
  --accent:      #0071e3;
  --accent-ink:  #0066cc;
  --card:        #ffffff;
  --border:      rgba(0, 0, 0, 0.08);
  --shadow:      0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg:   0 18px 48px rgba(0, 0, 0, 0.12);
  --radius:      22px;
  --radius-sm:   14px;
  --nav-h:       48px;
  --maxw:        1024px;
  --ease:        cubic-bezier(0.28, 0.11, 0.32, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img { max-width: 100%; }

/* ---------------------------------------------------------------- Nav bar */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  width: 100%;
  max-width: var(--maxw);
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav__brand {
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.nav__brand:hover { text-decoration: none; }
.nav__links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.nav__links a {
  color: var(--ink);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 980px;
  opacity: 0.82;
  transition: opacity 0.2s, background 0.2s;
}
.nav__links a:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); text-decoration: none; }
.nav__social { display: flex; gap: 2px; margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--border); }
.nav__social a { display: inline-flex; padding: 6px; border-radius: 8px; opacity: 0.7; }
.nav__social a:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); }
.nav__social svg { width: 18px; height: 18px; fill: var(--ink); display: block; }

.nav__toggle { display: none; }

/* ---------------------------------------------------------------- Layout */
.section { padding: 100px 22px; }
.section--alt { background: var(--bg-alt); }
.wrap { max-width: var(--maxw); margin: 0 auto; }

.eyebrow {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-ink);
  margin: 0 0 10px;
}
.section__title {
  font-size: 44px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section__lead {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 0 44px;
}

/* ---------------------------------------------------------------- Hero */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 22px 60px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #eaf3ff 0%, rgba(234, 243, 255, 0) 60%),
    linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
}
.hero__inner { max-width: 820px; }
.hero__avatar {
  width: 148px; height: 148px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 30px;
  display: block;
  box-shadow: var(--shadow-lg);
  border: 4px solid #fff;
}
.hero__name {
  font-size: 76px;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  background: linear-gradient(90deg, #1d1d1f 0%, #434343 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__tagline {
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.hero__tagline .accent {
  background: linear-gradient(90deg, #0071e3, #42a5ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__bio {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 680px;
  margin: 0 auto 30px;
}
.hero__bio p { margin: 0 0 14px; }
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 980px;
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #0077ed; }
.btn--ghost { background: rgba(0,0,0,0.05); color: var(--ink); }
.btn--ghost:hover { background: rgba(0,0,0,0.09); }
.btn--link { color: var(--accent-ink); padding: 11px 4px; }
.btn--link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- News */
.news { display: flex; flex-direction: column; gap: 0; }
.news__item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.news__item:last-child { border-bottom: 1px solid var(--border); }
.news__date {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-faint);
  padding-top: 1px;
  white-space: nowrap;
}
.news__text { font-size: 17px; color: var(--ink); }
.news__text p { margin: 0; }
.news__text a { color: var(--accent-ink); }
.news__text em { font-style: italic; color: var(--ink); }

/* ---------------------------------------------------------------- Pub cards */
.pubs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.pub {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.pub:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pub__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 11px;
  border-radius: 980px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent-ink);
}
.tag--award { background: rgba(255, 179, 0, 0.16); color: #a05a00; }
.tag--muted { background: rgba(0,0,0,0.06); color: var(--ink-soft); }
.pub__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink);
}
.pub__authors { font-size: 15px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 18px; }
.pub__authors strong { color: var(--ink); font-weight: 600; }
.pub__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 980px;
  background: rgba(0,0,0,0.05);
  color: var(--ink);
  transition: background 0.2s;
}
.chip:hover { background: rgba(0,0,0,0.09); text-decoration: none; }
.chip svg { width: 14px; height: 14px; fill: currentColor; }
.section__cta { margin-top: 44px; text-align: center; }

/* ---------------------------------------------------------------- Experience */
.timeline { position: relative; }
.tl {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
  padding: 26px 0;
  border-top: 1px solid var(--border);
}
.tl:last-child { border-bottom: 1px solid var(--border); }
.tl__period { font-size: 15px; font-weight: 600; color: var(--ink-faint); }
.tl__role { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 2px; }
.tl__org { font-size: 16px; color: var(--accent-ink); font-weight: 500; margin: 0 0 8px; }
.tl__org .loc { color: var(--ink-faint); font-weight: 400; }
.tl__detail { font-size: 15.5px; color: var(--ink-soft); margin: 0; line-height: 1.55; }

/* ---------------------------------------------------------------- Services */
.cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.panel h3 { font-size: 20px; font-weight: 600; margin: 0 0 16px; letter-spacing: -0.01em; }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li { font-size: 15.5px; color: var(--ink-soft); padding: 8px 0; border-top: 1px solid var(--border); line-height: 1.5; }
.panel li:first-child { border-top: none; }
.awards { display: flex; flex-direction: column; gap: 10px; }
.award {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.award:first-child { border-top: none; }
.award__name { font-size: 15.5px; color: var(--ink); font-weight: 500; }
.award__year { font-size: 14px; color: var(--ink-faint); font-weight: 600; }
.edu { list-style: none; margin: 0; padding: 0; }
.edu li { padding: 10px 0; border-top: 1px solid var(--border); }
.edu li:first-child { border-top: none; }
.edu .deg { display: block; font-size: 16px; font-weight: 600; color: var(--ink); }
.edu .meta { font-size: 14px; color: var(--ink-faint); }

/* ---------------------------------------------------------------- Footer */
.foot {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 44px 22px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}
.foot__social { display: flex; gap: 18px; justify-content: center; margin-bottom: 18px; }
.foot__social a { color: var(--ink-soft); display: inline-flex; }
.foot__social svg { width: 22px; height: 22px; fill: currentColor; }
.foot__social a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- Full publications page */
.pubpage { padding: calc(var(--nav-h) + 70px) 22px 90px; }
.pubpage__head { max-width: var(--maxw); margin: 0 auto 44px; }
.pubgroup { max-width: var(--maxw); margin: 0 auto 40px; }
.pubgroup__year {
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); margin: 0 0 4px; padding-bottom: 10px;
}
.pubrow {
  display: grid; grid-template-columns: 92px 1fr; gap: 20px;
  padding: 22px 0; border-top: 1px solid var(--border);
  align-items: start;
}
.pubrow__venue {
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--accent-ink); text-transform: uppercase; padding-top: 3px;
}
.pubrow__title { font-size: 18px; font-weight: 600; line-height: 1.32; margin: 0 0 6px; color: var(--ink); }
.pubrow__authors { font-size: 15px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.5; }
.pubrow__authors strong { color: var(--ink); }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 860px) {
  .pubs { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .hero__name { font-size: 52px; }
  .hero__tagline { font-size: 22px; }
  .section { padding: 72px 20px; }
  .section__title { font-size: 34px; }
  .tl { grid-template-columns: 1fr; gap: 8px; }
  .news__item { grid-template-columns: 96px 1fr; gap: 16px; }
  .nav__links a { padding: 6px 8px; font-size: 13px; }
}
@media (max-width: 620px) {
  .nav__desktop { display: none; }
  .news__item { grid-template-columns: 1fr; gap: 4px; }
  .news__date { color: var(--accent-ink); }
  .pubrow { grid-template-columns: 1fr; gap: 6px; }
  .hero__name { font-size: 42px; }
}
