/* ============================================================
   Hongye Liu — personal homepage
   ============================================================ */

:root {
  --bg:        #fbfaf8;
  --surface:   #ffffff;
  --alt:       #f4f2ee;
  --ink:       #1c1b19;
  --muted:     #6b675f;
  --line:      #e7e3db;
  --accent:    #8a5a2b;      /* warm sienna */
  --accent-2:  #b07b45;
  --shadow:    0 1px 2px rgba(28,27,25,.05), 0 8px 24px rgba(28,27,25,.06);
  --radius:    16px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --maxw: 780px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #14130f;
    --surface: #1c1b17;
    --alt:     #1f1d18;
    --ink:     #ece7dd;
    --muted:   #a49e91;
    --line:    #2e2b24;
    --accent:  #d9a566;
    --accent-2:#e7bd85;
    --shadow:  0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a.subtle { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a.subtle:hover { text-decoration-color: var(--accent); }

strong { font-weight: 600; }
.muted { color: var(--muted); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-family: var(--serif);
  font-weight: 600; font-size: 1.15rem;
  color: var(--ink);
}
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  color: var(--muted); font-size: .92rem; font-weight: 500;
  position: relative;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 2px; background: var(--accent);
  transition: width .2s ease;
}
.nav-links a:hover::after { width: 100%; }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.section.alt {
  /* full-bleed tinted band */
  background: var(--alt);
  margin: 0 calc(50% - 50vw);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
  border-bottom: 1px solid var(--line);
}
/* re-center content inside full-bleed alt bands */
.section.alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

h2 {
  font-family: var(--serif);
  font-size: 1.7rem; font-weight: 600;
  margin: 0 0 20px;
  letter-spacing: -.01em;
}
h2.mt { margin-top: 44px; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 0; }

/* ---------- Hero ---------- */
.hero { padding: 60px 0 44px; }
.hero-grid {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 36px;
  align-items: center;
}
.hero-photo {
  position: relative;
  width: 168px; height: 168px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.hero-initials {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 3.4rem; font-weight: 600; color: #fff;
  z-index: 0;
}
.hero-body h1 {
  font-family: var(--serif);
  font-size: 2.9rem; font-weight: 600;
  margin: 0; letter-spacing: -.02em; line-height: 1.05;
}
.tagline {
  margin: 6px 0 14px;
  color: var(--accent);
  font-weight: 600; font-size: 1.02rem;
  letter-spacing: .01em;
}
.lede { margin: 0 0 20px; color: var(--ink); }

/* ---------- Link buttons ---------- */
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .9rem; font-weight: 500;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.link-btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.link-btn .ico { font-size: 1rem; line-height: 1; }
.link-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.link-btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

/* ---------- Tags ---------- */
.tags { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: .82rem; font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ---------- News ---------- */
.news { list-style: none; padding: 0; margin: 0; }
.news li {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.news li:first-child { border-top: none; }
.news .date { color: var(--accent); font-weight: 600; font-size: .9rem; }

/* ---------- Publications ---------- */
.pubs { list-style: none; padding: 0; margin: 20px 0 0; counter-reset: pub; }
.pubs li {
  position: relative;
  padding: 18px 0 18px 44px;
  border-top: 1px solid var(--line);
}
.pubs li::before {
  counter-increment: pub;
  content: counter(pub);
  position: absolute; left: 0; top: 18px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}
.pub-title { margin: 0 0 4px; font-family: var(--serif); font-size: 1.12rem; font-weight: 600; line-height: 1.35; }
.pub-authors { margin: 0 0 6px; color: var(--muted); font-size: .95rem; }
.pub-venue { margin: 0; }
.badge {
  display: inline-block;
  font-size: .78rem; font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.badge.review { background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--muted); border-color: var(--line); }

.more { margin-top: 24px; }
.more summary {
  cursor: pointer; font-weight: 600; color: var(--accent);
  padding: 10px 0; list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "＋ "; }
.more[open] summary::before { content: "－ "; }
.patents { margin: 6px 0 0; padding-left: 20px; }
.patents li { margin: 6px 0; }

/* ---------- Timeline ---------- */
.timeline { margin-top: 8px; }
.tl-item {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.tl-item:first-child { border-top: none; }
.tl-when { color: var(--accent); font-weight: 600; font-size: .9rem; padding-top: 2px; }
.tl-meta { margin: 3px 0 8px; color: var(--muted); font-size: .9rem; }
.tl-what ul { margin: 0; padding-left: 18px; }
.tl-what li { margin: 4px 0; }

/* ---------- Education ---------- */
.edu-item { padding: 16px 0; border-top: 1px solid var(--line); }
.edu-item:first-child { border-top: none; }
.edu-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.edu-when { color: var(--accent); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.edu-deg { margin: 3px 0 4px; font-weight: 500; }

.awards { margin: 8px 0 0; padding-left: 20px; }
.awards li { margin: 6px 0; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 36px 24px 56px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}
.footer p { margin: 4px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 20px; }
  .hero-body h1 { font-size: 2.3rem; }
  .links { justify-content: center; }
  .tags { justify-content: center; }
  .news li { grid-template-columns: 54px 1fr; gap: 12px; }
  .tl-item { grid-template-columns: 1fr; gap: 6px; }
  .tl-when { font-size: .85rem; }
}
