/* ==========================================================================
   Haopeng Li — homepage
   Warm white · NVIDIA green · graphite. One column, list-based, quiet.
   ========================================================================== */

:root {
  --bg: #f6f4ee;
  --paper: #ffffff;
  --ink: #1b1c1e;
  --ink-2: #4f5054;
  --ink-3: #8a8a87;
  --line: #e2ded3;
  --chip: rgba(27, 28, 30, .055);
  --chip-hover: rgba(27, 28, 30, .09);
  --card: #fefdfa;
  --tray: #f1efe9;
  --fresh: #dcf2b4;
  --fresh-ink: #2e5b00;
  --green: #76b900;           /* NVIDIA green — marks, underlines */
  --green-ink: #437400;       /* readable green for text on warm white */
  --green-wash: rgba(118, 185, 0, .14);

  --display: "Bricolage Grotesque", "Geist", ui-sans-serif, -apple-system, sans-serif;
  --font: "Geist", ui-sans-serif, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141515;
    --paper: #1c1d1d;
    --ink: #ecebe6;
    --ink-2: #b2b1ac;
    --ink-3: #7c7c79;
    --line: #2c2d2d;
    --chip: rgba(236, 235, 230, .07);
    --chip-hover: rgba(236, 235, 230, .12);
    --card: #191a1a;
    --tray: #222323;
    --fresh: rgba(150, 220, 60, .18);
    --fresh-ink: #b5e86a;
    --green: #86cc0a;
    --green-ink: #9fd63e;
    --green-wash: rgba(134, 204, 10, .16);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15.5px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
svg { width: 14px; height: 14px; flex: none; }
::selection { background: var(--green); color: #10140a; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 3px; }

/* inline links in prose */
.about a {
  color: var(--ink);
  background: linear-gradient(var(--green), var(--green)) 0 100% / 100% 1px no-repeat;
  transition: color .2s, background-size .2s;
}
.about a:hover {
  color: var(--green-ink);
  background-size: 100% 2px;
}

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

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 96px) clamp(20px, 5vw, 40px) 0;
}

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

.head { display: flex; align-items: center; gap: 28px; }
.head__avatar {
  width: 112px; height: 112px;
  flex: none;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.34, 1.4, .64, 1);
}
.head__avatar:hover { transform: rotate(-6deg) scale(1.03); }
.head__name {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.head__role { margin: 6px 0 0; color: var(--ink-2); font-size: 15.5px; }
.sep { margin: 0 10px; color: var(--line); }

.head__links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.head__links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: background .2s, color .2s, transform .35s cubic-bezier(.34, 1.4, .64, 1);
}
.head__links a:hover { background: var(--fresh); color: var(--fresh-ink); transform: translateY(-1px); }
.head__links a:active { transform: scale(.97); }

/* ---------- sections ---------- */

.sec { margin-top: clamp(40px, 6vw, 56px); }
.sec__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.sec__aside { color: var(--ink-3); font-size: 13.5px; font-weight: 400; letter-spacing: 0; transition: color .2s; }
.sec__aside:hover { color: var(--green-ink); }

.about { margin: 0; font-size: 16.5px; line-height: 1.75; color: var(--ink-2); }
.about b { color: var(--ink); font-weight: 600; }

/* ---------- shared bits ---------- */

.item__title { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -0.02em; }
.item__title a { transition: color .2s; }
.item__title a:hover { color: var(--green-ink); }
.item__desc { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }

.item__links { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 12px 0 0; padding: 0; list-style: none; }
.item__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.item__links a:hover { background: var(--fresh); color: var(--fresh-ink); }
.item__links svg { width: 13px; height: 13px; }

.venue {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--fresh);
  color: var(--fresh-ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- project: Sol-Engine ---------- */

.proj {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
}
.proj__top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 14px 20px 14px 14px;
}
.proj__intro .item__desc { margin-top: 4px; font-size: 14px; }
.proj__links { margin: 0; flex-wrap: nowrap; }

/* NVIDIA × SANA lockup, after the Sol-Engine project pages */
.lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(115deg, rgba(118, 185, 0, .12), rgba(255, 255, 255, 0) 62%), var(--card);
  color: var(--ink);
  transition: border-color .25s, background .25s;
}
.lockup:hover {
  border-color: rgba(67, 116, 0, .45);
  background: linear-gradient(115deg, rgba(118, 185, 0, .18), rgba(255, 255, 255, 0) 62%), var(--card);
}
.lockup__nv { display: block; flex: none; }
.nv-logo { display: block; width: 84px; height: auto; }
.lockup__div { width: 1px; height: 30px; flex: none; background: var(--line); }
.lockup__sana { width: 62px; height: auto; flex: none; }
.lockup__word { display: flex; flex-direction: column; line-height: 1; }
.lockup__word strong { font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: -0.025em; white-space: nowrap; }
.lockup__word small { margin-top: 5px; color: var(--ink-3); font: 500 9px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }

/* updates as a left-to-right timeline */
.updates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
}
.updates li { position: relative; }
.updates li::before {                /* the axis, drawn per column so it reads as one line */
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 27px;
  height: 1px;
  background: var(--line);
}
.updates li:first-child::before { left: 22px; }
.updates li:last-child::before { right: auto; width: 22px; }
.update {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 18px 14px 22px;
  border-radius: 12px;
  transition: background .2s;
}
.update { isolation: isolate; }
.update::after {                     /* hover highlight sits below the axis only */
  content: "";
  position: absolute;
  z-index: -1;
  top: 34px; bottom: 4px;
  left: 10px; right: 8px;
  border-radius: 10px;
  background: transparent;
  transition: background .2s;
}
.update:hover::after { background: color-mix(in srgb, var(--fresh) 40%, transparent); }
.update time {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding-right: 10px;
  background: var(--card);
  color: var(--ink-3);
  font: 400 11.5px/22px var(--mono);
}
.update time::before {               /* node */
  content: "";
  width: 9px; height: 9px;
  flex: none;
  margin-left: -4px;
  border: 1.5px solid var(--ink-3);
  border-radius: 50%;
  background: var(--card);
  transition: border-color .2s, background .2s;
}
.updates li:last-child .update time::before { border-color: var(--green); background: var(--green); box-shadow: 0 0 0 4px var(--fresh); }
.updates li:last-child .update time { color: var(--green-ink); font-weight: 500; }
.update:hover time::before { border-color: var(--green); }
.update__title { margin-top: 6px; font-size: 14px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; transition: color .2s; }
.update:hover .update__title { color: var(--green-ink); }
.update__desc { margin-top: 3px; color: var(--ink-2); font-size: 13px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- publications: two-column horizontal cards ----------
   Portrait page on the left (papers are portrait), text on the right.
   Equal-height cards; links pinned to the bottom so rows line up. */

.pubs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.pub {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 20px;
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  scroll-margin-top: 24px;
  transition: border-color .25s, box-shadow .35s;
}
.pub:hover {
  border-color: color-mix(in srgb, var(--ink) 24%, var(--line));
  box-shadow: 0 16px 34px -24px rgba(27, 28, 30, .45);
}
.pub__body { display: flex; flex-direction: column; min-width: 0; padding: 6px 0 4px; }

/* first page fills the frame; bottom cropped, hover scrolls the page */
.pub__thumb {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.pub__thumb img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: auto;
  transition: transform 2.4s cubic-bezier(.45, .05, .35, 1);
}
.pub:hover .pub__thumb img { transform: translateY(var(--pan, 0px)); }

.pub .item__title { font-size: 16.5px; line-height: 1.38; }
.pub__authors { margin: 8px 0 0; color: var(--ink-3); font-size: 13.5px; line-height: 1.55; }
.pub .item__links { margin-top: auto; padding-top: 14px; }
.pub__authors.is-folded .au-mid { display: none; }
.au-more {
  display: none;
  margin: 0 6px 0 0;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink-2);
  font: 500 11.5px/1.7 var(--mono);
  cursor: pointer;
  vertical-align: 1px;
  transition: background .2s, color .2s;
}
.pub__authors.is-folded .au-more { display: inline-block; }
.au-more:hover { background: var(--fresh); color: var(--fresh-ink); }
.me { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

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

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(48px, 7vw, 72px);
  padding: 20px 0 calc(32px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}

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

@media (max-width: 1040px) {
  .proj__top { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px; }
  .lockup { justify-self: start; }
  .updates { grid-template-columns: minmax(0, 1fr); padding: 6px 0 8px; }
  .updates li::before, .updates li:first-child::before, .updates li:last-child::before {
    left: 22px; right: auto; width: 1px; height: auto; top: 0; bottom: 0;
  }
  .updates li:first-child::before { top: 27px; }
  .updates li:last-child::before { bottom: auto; height: 27px; }
  .update { padding: 14px 18px 14px 22px; }
  .update__title, .update__desc { padding-left: 19px; }
  .update time, .update:hover time { background: transparent; }
  .update::after { left: 32px; top: 32px; }
  .pubs { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .pub { grid-template-columns: 104px minmax(0, 1fr); gap: 14px; padding: 10px 14px 10px 10px; }
  .pub .item__title { font-size: 15.5px; }
  .update__desc { white-space: normal; }
  .head { align-items: flex-start; gap: 18px; }
  .head__avatar { width: 80px; height: 80px; border-radius: 22px; }
  .head__name { font-size: 26px; }
  .head__role { font-size: 14.5px; }
  .sep { display: block; height: 0; overflow: hidden; margin: 0; }
  .lockup { gap: 10px; padding: 12px 14px; }
  .nv-logo { width: 72px; }
  .lockup__sana { width: 54px; }
}
