/* =============================================================================
   LIQUID GLASS — shared design system for thejerrycheng.github.io
   Warm-paper beige base · Apple system fonts · Apple-orange accent · frosted glass
   One stylesheet, used by every page, for extreme cross-page consistency.
   ============================================================================= */

:root {
  /* --- Palette --- */
  --beige:            #F4EEE2;   /* warm paper — main background */
  --beige-2:          #FBF7EF;   /* lighter cream wash */
  --beige-3:          #EFE6D6;   /* deeper sand wash */
  --card:             rgba(255, 255, 255, 0.55);
  --card-strong:      rgba(255, 255, 255, 0.78);
  --card-border:      rgba(255, 255, 255, 0.65);
  --hairline:         rgba(60, 50, 35, 0.10);

  --text:             #1d1d1f;
  --text-2:           #6e6e73;
  --text-3:           #86868b;

  --accent:           #FF9500;   /* Apple orange */
  --accent-ink:       #C56A00;   /* readable orange for small text on beige */
  --accent-hover:     #E9850A;

  /* --- Glass --- */
  --blur:             20px;
  --blur-nav:         18px;
  --shadow:           0 8px 30px rgba(80, 60, 30, 0.09), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-hover:     0 16px 44px rgba(80, 60, 30, 0.16), 0 4px 14px rgba(0,0,0,0.07);

  /* --- Typography (Apple system fonts) --- */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
  --sans-sc: "Noto Sans SC", "PingFang SC", var(--sans);
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;

  /* --- Layout --- */
  --nav-h:      54px;
  --maxw:       1000px;
  --radius-sm:  12px;
  --radius:     18px;
  --radius-lg:  24px;
  --gap:        56px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.6;
  background: var(--beige);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: calc(var(--nav-h) + 10px);
  min-height: 100vh;
}

/* Soft warm liquid wash behind the glass — subtle, academic-calm */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  background:
    radial-gradient(40vmax 40vmax at 12% 8%,  rgba(255, 214, 158, 0.40), transparent 60%),
    radial-gradient(46vmax 46vmax at 88% 12%, rgba(255, 179, 128, 0.22), transparent 62%),
    radial-gradient(50vmax 50vmax at 78% 92%, rgba(214, 224, 255, 0.28), transparent 60%),
    radial-gradient(44vmax 44vmax at 8% 88%,  rgba(255, 235, 205, 0.45), transparent 62%),
    var(--beige);
  background-attachment: fixed;
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(1.5%,  1.5%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--sans);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}
h1 { font-size: 34px; font-weight: 700; }
h2 { font-size: 26px; font-weight: 700; margin-bottom: 18px; }
h3 { font-size: 17px; font-weight: 600; }
p  { font-size: 15px; line-height: 1.65; }
a  { color: inherit; }
strong, b { font-weight: 600; }
em { color: var(--text-2); }
img { max-width: 100%; display: block; }
code, pre, kbd { font-family: var(--mono); font-size: 0.92em; }

.accent { color: var(--accent-ink); font-weight: 600; }

/* --- Layout wrappers --- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { max-width: var(--maxw); margin: 0 auto; padding: var(--gap) 20px 0; }
.section:last-of-type { padding-bottom: var(--gap); }
[id] { scroll-margin-top: calc(var(--nav-h) + 20px); }

/* Section title with an orange tick */
.section-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
  position: relative;
  padding-left: 14px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0; top: 0.16em; bottom: 0.16em;
  width: 4px; border-radius: 4px;
  background: var(--accent);
}

/* =============================================================================
   NAV
   ============================================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: rgba(250, 246, 238, 0.72);
  backdrop-filter: saturate(180%) blur(var(--blur-nav));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-nav));
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1120px; height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
  text-decoration: none; color: var(--text); margin-right: auto;
}
.brand img { width: 24px; height: 24px; border-radius: 7px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a, .nav-links button {
  font-family: var(--sans);
  font-size: 14px; font-weight: 500; color: var(--text);
  text-decoration: none; padding: 7px 12px; border-radius: 10px;
  background: none; border: 0; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .18s ease, color .18s ease;
}
.nav-links a:hover, .nav-links button:hover { background: rgba(0,0,0,0.05); }
.nav-links a[aria-current="page"] { color: var(--accent-ink); background: rgba(255,149,0,0.10); }
.caret { font-size: 10px; opacity: .7; }

/* Robolog dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 260px; padding: 8px;
  background: var(--card-strong);
  backdrop-filter: blur(var(--blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.6);
  border: 1px solid var(--card-border); border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text);
}
.dropdown-menu a:hover { background: rgba(255,149,0,0.10); }
.dropdown-menu .ico {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  display: grid; place-items: center; font-size: 18px;
  background: rgba(255,255,255,0.7); border: 1px solid var(--hairline);
}
.dropdown-menu .label { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; }
.dropdown-menu .label small { font-weight: 400; font-size: 12px; color: var(--text-3); margin-top: 2px; }

.menu-btn {
  display: none; margin-left: auto; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--text);
  background: rgba(255,255,255,0.62); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 7px 13px;
}

/* Mobile menu sheet */
.mobile-menu {
  position: fixed; top: calc(var(--nav-h) + 8px); left: 12px; right: 12px; z-index: 1001;
  padding: 8px; border-radius: var(--radius);
  background: var(--card-strong);
  backdrop-filter: blur(var(--blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.6);
  border: 1px solid var(--card-border); box-shadow: var(--shadow-hover);
}
.mobile-menu a {
  display: block; padding: 11px 14px; border-radius: 12px;
  text-decoration: none; color: var(--text); font-size: 15px; font-weight: 500;
}
.mobile-menu a:hover { background: rgba(255,149,0,0.10); }
.mobile-menu hr { border: 0; height: 1px; background: var(--hairline); margin: 6px 4px; }
.nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.06); z-index: 1000; }
[hidden] { display: none !important; }

/* =============================================================================
   GLASS CARD + BUTTONS
   ============================================================================= */
.card {
  background: var(--card);
  backdrop-filter: blur(var(--blur)) saturate(1.7);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.7);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 26px 24px; }
a.card-hover, .card-hover { transition: transform .22s ease, box-shadow .22s ease, background .22s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); background: var(--card-strong); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 980px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--text); text-decoration: none; cursor: pointer;
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { background: rgba(255,255,255,0.92); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn { white-space: nowrap; }
.btn img, .btn svg { width: 17px; height: 17px; opacity: 0.9; flex: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* Consistent social button set (Email · GitHub · X · CV · Scholar) — equal size, one row */
.btn-row-social { gap: 8px; margin-top: 24px; }
.btn-row-social .btn { min-width: 92px; padding: 10px 14px; }

/* Small text link chips (paper links / project links) */
.links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.links a {
  font-size: 13px; font-weight: 600; color: var(--accent-ink); text-decoration: none;
  display: inline-flex; align-items: center;
}
.links a::before { content: "↗"; margin-right: 4px; font-size: 11px; opacity: .7; }
.links a:hover { text-decoration: underline; }

/* =============================================================================
   HERO / ABOUT
   ============================================================================= */
.hero { display: grid; grid-template-columns: 1.7fr 1fr; gap: 34px; align-items: center; }
.hero .name { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.hero .name-sc { font-family: var(--sans-sc); font-size: 22px; font-weight: 500; color: var(--text-2); }
.hero .lead { font-size: 16px; line-height: 1.62; margin-top: 12px; }
.hero .subhead { font-size: 20px; font-weight: 700; margin: 18px 0 6px; letter-spacing: -0.01em; }
.hero .vision { font-size: 15px; line-height: 1.55; margin-bottom: 14px; }
.hero .bullets p { font-size: 14px; line-height: 1.55; color: var(--text-2); margin: 7px 0; }
.hero-photo img { width: 100%; border-radius: 24px; box-shadow: var(--shadow); }
.social-links { margin-top: 22px; font-size: 15px; }
.social-links a { text-decoration: none; color: var(--accent-ink); font-weight: 600; }
.social-links a + a::before { content: "·"; color: var(--text-3); margin: 0 10px; font-weight: 400; }
.last-updated { text-align: center; font-size: 12px; color: var(--text-3); margin: 26px 0 0; }

/* =============================================================================
   CONNECT / COFFEE CHAT
   ============================================================================= */
.connect-card { text-align: center; padding: 34px 24px; }
.connect-card p { max-width: 620px; margin: 0 auto; }
.connect-card .muted { font-size: 13px; color: var(--text-2); margin: 8px auto 22px; }

/* =============================================================================
   EDUCATION
   ============================================================================= */
.edu-row { display: flex; align-items: flex-start; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--hairline); }
.edu-row:first-child { padding-top: 0; }
.edu-row:last-child { border-bottom: none; padding-bottom: 0; }
.edu-logo { flex: none; width: 46px; height: 46px; border-radius: 12px; overflow: hidden;
  background: #fff; border: 1px solid var(--hairline); display: grid; place-items: center; }
.edu-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.edu-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.edu-head a { text-decoration: none; color: var(--text); font-weight: 600; }
.edu-head a:hover { color: var(--accent-ink); }
.edu-sub { font-size: 14px; line-height: 1.45; color: var(--text-2); margin-top: 2px; }
.edu-date { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* =============================================================================
   PUBLICATIONS + PROJECTS (shared "media row" layout)
   ============================================================================= */
.pub-list { display: flex; flex-direction: column; gap: 18px; }
.pub {
  display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: center;
  padding: 18px; border-radius: var(--radius);
}
.pub-thumb {
  position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 2;
  background: rgba(255,255,255,0.5); border: 1px solid var(--hairline);
}
.pub-thumb img, .pub-thumb video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.pub-thumb .hover-video { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; }
.pub:hover .hover-video { opacity: 1; }
.papertitle { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
a .papertitle:hover { color: var(--accent-ink); }
.pub-meta a { text-decoration: none; }
.pub-meta { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.pub-meta .authors { display: block; margin: 4px 0 2px; color: var(--text); }
.pub-meta .venue { color: var(--text-2); }
.pub-desc { font-size: 13.5px; line-height: 1.5; color: var(--text-3); margin-top: 8px; }
.proj-year { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent-ink);
  background: rgba(255,149,0,0.12); padding: 2px 9px; border-radius: 980px; margin-left: 8px; }
.proj-body { font-size: 14px; line-height: 1.55; color: var(--text-2); margin-top: 8px; }
.proj-body em { color: var(--text-3); font-style: italic; }

/* Publication mini carousel (locomotion survey) */
.pub-carousel { position: absolute; inset: 0; }
.carousel-track { display: flex; height: 100%; transition: transform .35s ease; }
.carousel-track > .slide, .carousel-track > div { flex: 0 0 100%; height: 100%; position: relative; }
.carousel-track img { width: 100%; height: 100%; object-fit: contain; }
.c-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.85); color: #333; font-size: 16px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  opacity: 0; transition: opacity .2s;
}
.pub-thumb:hover .c-btn, .news-media:hover .c-btn { opacity: 1; }
.c-btn.prev { left: 6px; } .c-btn.next { right: 6px; }
.c-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* =============================================================================
   NEWS
   ============================================================================= */
.news-scroll {
  display: flex; gap: 18px; overflow-x: auto; padding: 4px 4px 18px; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.news-scroll::-webkit-scrollbar { height: 8px; }
.news-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.14); border-radius: 8px; }
.news-card {
  flex: 0 0 320px; scroll-snap-align: start; overflow: hidden;
  display: flex; flex-direction: column;
}
.news-text { padding: 18px 20px 14px; }
.news-text p { font-size: 14.5px; line-height: 1.55; }
.news-text a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.news-text a:hover { text-decoration: underline; }
.lead a, .vision a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.lead a:hover, .vision a:hover { text-decoration: underline; }
.news-media { position: relative; aspect-ratio: 4 / 3; background: rgba(255,255,255,0.4); }
.news-media .carousel-track { height: 100%; }
.news-media img { width: 100%; height: 100%; object-fit: contain; }
.news-timeline { display: flex; justify-content: space-between; gap: 6px; max-width: 760px;
  margin: 22px auto 0; padding: 0 8px; }
.timeline-item { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: 1; }
.news-dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(0,0,0,0.18); cursor: pointer; transition: .2s; }
.news-dot.active { background: var(--accent); transform: scale(1.25); }
.timeline-label { font-size: 11px; color: var(--text-3); }

/* ---- Home "sneak peek" cards (Research + Projects) ---- */
.peek-card { display: block; padding: 18px; text-decoration: none; color: inherit; }
.peek-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.peek-card .pub-desc { margin: 8px 0 0; }
.peek-cta { color: var(--accent-ink); font-weight: 700; font-size: 14px; white-space: nowrap; }
.peek-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.peek-strip img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 10px;
  border: 1px solid var(--hairline); background: rgba(255,255,255,0.55); display: block; }
@media (max-width: 640px) { .peek-strip { grid-template-columns: repeat(3, 1fr); } }

/* =============================================================================
   STARTUPS + SKILLS
   ============================================================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mini-card { padding: 22px 22px; }
.mini-card h3 { font-size: 16px; margin-bottom: 4px; }
.mini-card .meta { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.mini-card p { font-size: 14px; color: var(--text-2); }
.skills p { font-size: 15px; line-height: 1.9; }

/* =============================================================================
   BLOG
   ============================================================================= */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.blog-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--text); }
.blog-card .card-media { display: block; aspect-ratio: 16 / 9; background: rgba(255,255,255,0.4); }
.blog-card .card-media img { width: 100%; height: 100%; object-fit: contain; }
.blog-card .card-body { padding: 18px 20px 22px; }
.blog-card .card-body h3 { font-size: 17px; margin-bottom: 6px; letter-spacing: -0.01em; }
.blog-card .meta { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.blog-card .card-body p { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.blog-card:hover .card-body h3 { color: var(--accent-ink); }

/* =============================================================================
   FOOTER
   ============================================================================= */
.site-footer {
  margin-top: 90px; padding: 54px 0 40px;
  background: rgba(250, 246, 238, 0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--hairline);
}
.site-footer .wrap { display: flex; flex-direction: column; gap: 22px; }
.footer-name { font-size: 21px; font-weight: 600; }
.footer-note { font-family: var(--mono); font-size: 12px; color: var(--text-3); text-align: right; opacity: .9; }
.footer-rule { height: 1px; background: var(--hairline); }
.footer-credit { text-align: center; font-size: 11px; color: var(--text-3); }
.footer-credit a { color: var(--accent-ink); text-decoration: none; }
.footer-copy { font-size: 10px; color: var(--text-3); }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .hero-photo { order: -1; max-width: 220px; margin: 0 auto; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .pub { grid-template-columns: 1fr; gap: 14px; }
  .pub-thumb { max-width: 100%; }
  h2, .section-title { font-size: 22px; }
  .hero .name { font-size: 27px; }
  .section { padding-top: 40px; }
}
