/* =========================================================
   Apple-inspired personal academic site
   - System sans-serif font stack, no external font requests
   - White / light-gray surfaces, purple accent
   - Large headlines, rounded cards, frosted navigation
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #86868b;
  --line: #d2d2d7;
  --line-soft: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.22);
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #f3e8ff;
  --button-bg: #7c3aed;
  --button-hover: #6d28d9;
  --green: #00a862;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.09);
  --shadow-soft: 0 4px 22px rgba(0, 0, 0, 0.055);
  --radius: 24px;
  --max-width: 1120px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: var(--font-sans);
  --font-mono: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #0b0b0c;
  --surface: #1d1d1f;
  --surface-2: #2c2c2e;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --muted-2: #86868b;
  --line: #38383a;
  --line-soft: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --accent: #c4b5fd;
  --accent-hover: #ddd6fe;
  --accent-soft: #2a1a4a;
  --green: #30d158;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 4px 22px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.container {
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 980px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: none;
}

/* ---------------- Navigation ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .site-header {
  background: rgba(0, 0, 0, 0.78);
}

@supports (backdrop-filter: blur(1px)) {
  .site-header {
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  padding: 4px 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.82;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.site-nav a:hover {
  color: var(--accent);
  opacity: 1;
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.icon-button:hover {
  background: var(--bg-alt);
  color: var(--accent);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* ---------------- Shared type & buttons ---------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 980px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.button-primary {
  background: var(--button-bg);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

.button-ghost {
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: var(--accent);
}

.button-ghost:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button-large {
  min-height: 50px;
  padding: 0 28px;
  font-size: 17px;
}

.arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

a:hover .arrow {
  transform: translateX(2px);
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 64px 0 56px;
  background: var(--bg);
}

[data-theme="dark"] .hero {
  background: var(--bg);
}

.hero-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  align-items: start;
  gap: 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  align-items: center;
  gap: 80px;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.hero h1 em {
  display: block;
  margin-top: 12px;
  padding: 0;
  background: none;
  color: var(--accent);
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  font-style: normal;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-about {
  max-width: 660px;
  margin-top: 28px;
}

.hero-about h2 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-about p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-about a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.hero-about .inst {
  color: var(--accent);
  font-weight: 600;
}

.hero-about a:hover {
  color: var(--accent-hover);
}

.hero-about a.about-more {
  text-decoration: none;
  white-space: nowrap;
}

.hero-about a.about-more span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.hero-about a.about-more:hover span {
  transform: translateX(3px);
}

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding-top: 8px;
}

.hero-photo-frame {
  width: 100%;
  max-width: 340px;
}

.hero-photo,
.hero-photo-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 5;
  place-items: center;
  border-radius: 28px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

.hero-photo-placeholder {
  background: linear-gradient(145deg, #5b21b6, #a78bfa 62%, #ddd6fe);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 72px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero-icon-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.hero-icon-link {
  display: flex;
  min-width: 72px;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero-icon-link svg {
  width: 24px;
  height: 24px;
  padding: 13px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  box-sizing: content-box;
  transition: color 0.2s ease, transform 0.2s ease;
}

.hero-icon-link:hover {
  color: var(--accent);
}

.hero-icon-link:hover svg {
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-lead {
  max-width: 32em;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.5;
  letter-spacing: -0.012em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 30px 0 0;
  color: var(--muted-2);
  font-size: 13px;
}

.status-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 168, 98, 0.15);
}

.profile-card {
  position: relative;
  padding: 32px;
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.avatar {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b21b6, #a78bfa);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 34px;
  font-weight: 600;
  object-fit: cover;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 980px;
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.profile-name {
  margin-top: 26px;
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.profile-role {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.profile-divider {
  height: 1px;
  margin: 24px 0;
  background: var(--line);
}

.profile-facts {
  display: grid;
  gap: 14px;
  margin: 0;
}

.profile-facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.profile-facts dt {
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.profile-facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}

.profile-facts a {
  color: var(--ink);
  text-decoration: none;
}

.profile-facts a:hover {
  color: var(--accent);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.profile-tags span {
  padding: 7px 12px;
  border-radius: 980px;
  background: var(--bg-alt);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.profile-links a {
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}

.profile-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- Sections ---------------- */

.section {
  padding: 36px 0 56px;
  background: var(--bg);
}

.section-alt {
  background: var(--bg-alt);
}

#news {
  padding: 36px 0;
}

#news .section-head {
  margin-bottom: 16px;
}

#news .section-head h2 {
  font-size: clamp(2rem, 3.2vw, 2.8rem);
}

#news .section-note {
  font-size: 16px;
}

#news .news-toolbar {
  margin-bottom: 6px;
}

#news .news-card {
  min-height: 104px;
  padding: 12px 16px;
}

#news .news-card-top {
  margin-bottom: 6px;
}

#news .news-card h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

#news .news-card p {
  font-size: 14px;
  line-height: 1.4;
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.section-note {
  max-width: 32em;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.section-note a {
  color: var(--accent);
  text-decoration: none;
}

.section-note a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- Subpage hero ---------------- */

.page-hero {
  padding: 52px 0 40px;
  background: var(--bg-alt);
}

.page-hero h1 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(3.2rem, 6.5vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.page-lead {
  max-width: 42em;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.5;
  letter-spacing: -0.012em;
}

.page-lead a,
.page-note a {
  color: var(--accent);
  text-decoration: none;
}

.page-lead a:hover,
.page-note a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- Research detail rows ---------------- */

.topic-list {
  border-top: 1px solid var(--line);
}

.topic-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.topic-index {
  color: var(--muted-2);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.topic-body h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.topic-body p {
  max-width: 46em;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 6px;
}

.topic-links a {
  color: var(--accent);
  font-size: 15px;
  text-decoration: none;
}

.topic-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- Talks / service lists ---------------- */

.talk-list {
  padding: 0 28px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.talk-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.talk-item:first-child {
  border-top: 0;
}

.talk-item time {
  padding-top: 2px;
  color: var(--muted-2);
  font-size: 14px;
  white-space: nowrap;
}

.talk-item p {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
}

.talk-item a {
  color: var(--accent);
  text-decoration: none;
}

.talk-item a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-note {
  max-width: 40em;
  margin: 24px 0 0;
  color: var(--muted-2);
  font-size: 15px;
  line-height: 1.6;
}

.cv-block {
  margin-bottom: 44px;
}

.cv-block:last-child {
  margin-bottom: 0;
}

.cv-block > h2 {
  margin: 0 0 22px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* ---------------- Subpage CTA ---------------- */

.page-cta {
  background: var(--bg-alt);
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.cta-inner h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.cta-inner p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* ---------------- About ---------------- */

.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: start;
  gap: 80px;
}

.about-body p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.about-body .lead {
  margin-bottom: 28px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.32;
}

.about-body a {
  color: var(--accent);
  text-decoration: none;
}

.about-body a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.interest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
  margin: 24px 0 32px;
  padding: 0;
  list-style: none;
}

.interest-list li {
  position: relative;
  padding-left: 20px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

.interest-list li::before {
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.zh-note {
  margin-top: 32px;
  padding: 24px 28px;
  border-radius: 18px;
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.zh-note strong {
  color: var(--ink);
}

.about-photo {
  margin: 0 0 26px;
}

.about-photo img {
  display: block;
  width: 100%;
  border-radius: 24px;
}

.about-photo figcaption {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 13px;
}

/* ---------------- Research ---------------- */

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.topic-card-wrap {
  position: relative;
  padding: 0 0 24px 24px;
}

.topic-number {
  position: absolute;
  right: 16px;
  bottom: 0;
  z-index: 0;
  color: #2c2c2e;
  font-family: var(--font-sans);
  font-size: 88px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 0.8;
  pointer-events: none;
}

[data-theme="dark"] .topic-number {
  color: #2b2b2e;
}

.topic-number--icon {
  letter-spacing: 0;
  line-height: 0;
}

.topic-number--icon svg {
  display: block;
  width: 116px;
  height: 53px;
  transform: skewX(-6deg);
}

.research-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 16px 24px 38px;
  border-radius: 24px;
  background: #1d1d1f;
  box-shadow: var(--shadow-soft);
  color: #f5f5f7;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-index {
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.card-photo {
  width: 100%;
  margin-bottom: 24px;
  border-radius: 18px;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  object-fit: cover;
}

.research-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  color: #f5f5f7;
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.research-card p {
  position: relative;
  z-index: 1;
  flex: 1;
  margin: 0;
  color: #a1a1a6;
  font-size: 16px;
  line-height: 1.6;
}

.card-link {
  color: var(--accent);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-block {
  margin-top: 44px;
}

.subheading {
  margin: 0 0 24px;
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.project-list {
  padding: 0 28px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.project-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.project-item:first-child {
  border-top: 0;
}

.project-item:hover {
  color: var(--accent);
}

.project-year {
  color: var(--muted-2);
  font-size: 14px;
}

.project-title {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.project-meta {
  color: var(--muted-2);
  font-size: 14px;
}

.project-showcase {
  position: relative;
}

.project-track {
  --project-card-w: min(44vw, 500px);
  --project-card-half: min(22vw, 250px);
  display: flex;
  gap: 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 8px calc(50% - var(--project-card-half));
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
}

.project-track::-webkit-scrollbar {
  display: none;
}

.project-track:focus-visible {
  border-radius: 28px;
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.project-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.project-card.project-cover .project-media img {
  object-position: center 62%;
}

.project-card {
  flex: 0 0 var(--project-card-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  opacity: 0.45;
  scroll-snap-align: center;
  text-decoration: none;
  transform: scale(0.68);
  transition: transform 0.35s ease, opacity 0.35s ease, box-shadow 0.35s ease;
}

.project-card.is-active {
  box-shadow: var(--shadow);
  opacity: 1;
  transform: scale(1);
}

.project-card:hover:not(.is-active) {
  opacity: 0.72;
}

.project-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--surface-2);
}

.project-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.project-card:hover .project-media img {
  transform: scale(1.03);
}

.project-journal {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.92);
  color: #1d1d1f;
  font-size: 11px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.project-content {
  padding: 12px 16px 14px;
  text-align: center;
}

.project-content h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.project-content p {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-content .project-venue {
  display: block;
  overflow: visible;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  -webkit-line-clamp: unset;
}

.project-content .project-venue em {
  color: var(--ink);
  font-style: italic;
  font-weight: 600;
}

.project-content .project-venue span {
  color: var(--muted-2);
  font-style: normal;
}

.project-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.project-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.project-control svg {
  width: 16px;
  height: 16px;
}

.project-control:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.project-side {
  position: absolute;
  top: 42%;
  z-index: 4;
  box-shadow: var(--shadow-soft);
}

.project-side-prev {
  left: -6px;
}

.project-side-next {
  right: -6px;
}

.project-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.project-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-strong);
  opacity: 0.65;
  cursor: pointer;
  transition: width 0.25s ease, background-color 0.25s ease, opacity 0.25s ease;
}

.project-dot:hover {
  background: var(--accent);
  opacity: 1;
}

.project-dot.is-active {
  width: 22px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 1;
}

.project-dot:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---------------- Publications ---------------- */

.pub-groups {
  display: grid;
  gap: 24px;
}

.pub-group {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.pub-year {
  margin: 0;
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pub-items {
  display: grid;
  gap: 14px;
}

.pub-item {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.pub-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pub-title {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.pub-title a {
  text-decoration: none;
}

.pub-title a:hover {
  color: var(--accent);
}

.pub-authors {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.pub-venue {
  margin: 0;
  color: var(--muted-2);
  font-size: 15px;
}

.pub-venue em {
  color: var(--accent);
  font-style: italic;
  font-weight: 600;
}

.self-author {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------- News ---------------- */

.news-feed {
  max-height: 264px;
  overflow-y: auto;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 60, 67, 0.28) transparent;
}

.news-feed::-webkit-scrollbar {
  width: 10px;
}

.news-feed::-webkit-scrollbar-track {
  background: transparent;
}

.news-feed::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.3);
  background-clip: content-box;
}

.news-feed::-webkit-scrollbar-thumb:hover {
  background: rgba(60, 60, 67, 0.48);
  background-clip: content-box;
}

[data-theme="dark"] .news-feed {
  scrollbar-color: rgba(235, 235, 245, 0.3) transparent;
}

[data-theme="dark"] .news-feed::-webkit-scrollbar-thumb {
  background: rgba(235, 235, 245, 0.3);
  background-clip: content-box;
}

.news-feed:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.news-row {
  display: grid;
  grid-template-columns: 100px 100px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
}

.news-row:first-child {
  border-top: 0;
}

.news-row time {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 13px;
}

.news-category {
  justify-self: start;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3e8ff;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 600;
}

[data-theme="dark"] .news-category {
  background: #2a1a4a;
  color: #c4b5fd;
}

.news-row p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

.news-row strong {
  font-weight: 400;
}

.news-row a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.news-row a:hover {
  color: var(--accent);
}

.news-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 8px;
}

.news-hint {
  margin: 0;
  color: var(--muted-2);
  font-size: 14px;
}

.news-controls {
  display: flex;
  gap: 8px;
}

.news-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.news-control svg {
  width: 16px;
  height: 16px;
}

.news-control:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.news-control:disabled {
  opacity: 0.3;
  cursor: default;
}

.news-track {
  display: flex;
  gap: 16px;
  margin: 0 -4px;
  padding: 4px 4px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  cursor: grab;
}

.news-track::-webkit-scrollbar {
  display: none;
}

.news-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.news-track:focus-visible {
  border-radius: 24px;
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.news-card {
  display: flex;
  flex: 0 0 320px;
  flex-direction: column;
  min-height: 128px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: #1d1d1f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  color: #f5f5f7;
  scroll-snap-align: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

[data-theme="dark"] .news-card {
  background: #2c2c2e;
  border-color: rgba(255, 255, 255, 0.08);
}

.news-card:hover {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  transform: translateY(-3px);
}

.news-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.news-card time {
  color: #a1a1a6;
  font-size: 14px;
  white-space: nowrap;
}

.news-tag {
  padding: 5px 9px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
  font-size: 12px;
  font-weight: 500;
}

.news-card h3 {
  margin: 0 0 6px;
  color: #f5f5f7;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.news-card p {
  margin: 0;
  color: #a1a1a6;
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-card a {
  color: #c4b5fd;
  text-decoration: none;
}

.news-card a:hover {
  color: #ddd6fe;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- CV ---------------- */

.timeline {
  margin-left: 6px;
  border-left: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 24px;
  padding: 0 0 32px 28px;
}

.timeline-item::before {
  position: absolute;
  top: 6px;
  left: -4.5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
  content: "";
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-date {
  padding-top: 2px;
  color: var(--muted-2);
  font-size: 14px;
}

.timeline-item h3 {
  margin: 0 0 6px;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.cv-note {
  margin-top: 30px;
  color: var(--muted);
  font-size: 15px;
}

.cv-note a {
  color: var(--accent);
  text-decoration: none;
}

.cv-note a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- Contact ---------------- */

.contact-section {
  padding: 0;
  background: #000000;
  color: #f5f5f7;
}

.contact-section .container {
  max-width: 900px;
}

.contact-panel {
  padding: 72px 24px;
  background: radial-gradient(600px 300px at 50% 0%, rgba(124, 58, 237, 0.38), transparent 70%);
  text-align: center;
}

.contact-panel .eyebrow {
  justify-content: center;
  color: #c4b5fd;
}

.contact-panel .eyebrow span {
  background: #c4b5fd;
}

.contact-panel h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: #f5f5f7;
}

.contact-panel > p:not(.eyebrow) {
  max-width: 34em;
  margin: 24px auto 0;
  color: #a1a1a6;
  font-size: 19px;
  line-height: 1.5;
}

.contact-panel .button {
  margin-top: 32px;
  background: var(--button-bg);
  color: #ffffff;
}

.contact-panel .button:hover {
  background: var(--button-hover);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 28px;
  margin-top: 36px;
}

.contact-links a {
  color: #a1a1a6;
  font-size: 15px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-links a:hover {
  color: #f5f5f7;
}

/* ---------------- Footer ---------------- */

.site-footer {
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted-2);
  font-size: 13px;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.footer-inner a {
  color: var(--muted-2);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--accent);
}

/* ---------------- 404 ---------------- */

.not-found {
  display: flex;
  min-height: calc(100vh - 52px);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-top: 64px;
  padding-bottom: 96px;
}

.not-found h1 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.not-found p:not(.eyebrow) {
  max-width: 30em;
  margin: 20px 0 32px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

/* ---------------- Reveal animation ---------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1024px) {
  .hero-intro-grid {
    gap: 48px;
  }

  .hero-grid {
    gap: 48px;
  }

  .research-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero-intro-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .hero-side {
    align-items: flex-start;
  }

  .hero-photo-frame {
    max-width: 320px;
  }

  .profile-card {
    max-width: 560px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .section-head-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

@media (max-width: 760px) {
  .container {
    width: calc(100% - 40px);
  }

  .header-inner {
    height: 52px;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 20px 40px -30px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  [data-theme="dark"] .site-nav {
    background: rgba(0, 0, 0, 0.97);
  }

  .site-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .site-nav a {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    font-weight: 600;
    opacity: 1;
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero {
    padding: 48px 0 56px;
  }

  .hero h1 {
    font-size: clamp(3rem, 13vw, 4rem);
  }

  .hero-lead {
    font-size: 18px;
  }

  .hero-about {
    margin-top: 24px;
  }

  .hero-about h2 {
    font-size: 20px;
  }

  .hero-about p {
    font-size: 16px;
  }

  .hero-photo-frame {
    max-width: 300px;
  }

  .hero-icon-links {
    justify-content: flex-start;
  }

  .hero-actions {
    gap: 20px;
  }

  .profile-card {
    padding: 26px;
    border-radius: 26px;
  }

  .section {
    padding: 28px 0 44px;
  }

  #news {
    padding: 28px 0;
  }

  #news .section-head {
    margin-bottom: 14px;
  }

  #news .section-head h2 {
    font-size: clamp(1.9rem, 8vw, 2.3rem);
  }

  #news .news-feed {
    max-height: 300px;
  }

  .news-row {
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: start;
    gap: 6px 12px;
    padding: 12px 16px;
  }

  .news-row time {
    grid-column: 1;
    grid-row: 1;
  }

  .news-category {
    grid-column: 1;
    grid-row: 2;
  }

  .news-row p {
    grid-column: 2;
    grid-row: 1 / span 2;
    font-size: 14px;
  }

  .section-head {
    margin-bottom: 24px;
  }

  .section-head h2 {
    font-size: clamp(2.1rem, 9vw, 2.8rem);
  }

  .section-note {
    font-size: 15px;
  }

  .page-hero {
    padding: 40px 0 32px;
  }

  .page-hero h1 {
    font-size: clamp(2.8rem, 12vw, 3.6rem);
  }

  .page-lead {
    font-size: 18px;
  }

  .topic-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 0;
  }

  .topic-body h2 {
    font-size: 24px;
  }

  .talk-list {
    padding: 0 20px;
  }

  .talk-item {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 16px 0;
  }

  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px;
  }

  .cv-block {
    margin-bottom: 32px;
  }

  .about-body .lead {
    font-size: 24px;
  }

  .interest-list {
    grid-template-columns: 1fr;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }

  .topic-card-wrap {
    padding: 0 0 18px 18px;
  }

  .topic-number {
    right: 12px;
    font-size: 72px;
  }

  .topic-number--icon svg {
    width: 92px;
    height: 42px;
  }

  .research-card {
    padding: 14px 20px 34px;
  }

  .project-block {
    margin-top: 56px;
  }

  .project-list {
    padding: 0 20px;
  }

  .project-track {
    --project-card-w: 76vw;
    --project-card-half: 38vw;
    gap: 16px;
    padding: 8px calc(50% - var(--project-card-half));
  }

  .project-card {
    flex-basis: var(--project-card-w);
    transform: scale(0.78);
  }

  .project-card.is-active {
    transform: scale(1);
  }

  .project-side {
    top: 32%;
    width: 34px;
    height: 34px;
  }

  .project-side-prev {
    left: 0;
  }

  .project-side-next {
    right: 0;
  }

  .project-content {
    padding: 14px 16px 16px;
  }

  .project-item {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 16px 0;
  }

  .project-meta {
    grid-column: 1;
  }

  .pub-group {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pub-year {
    font-size: 17px;
  }

  .pub-title {
    font-size: 19px;
  }

  .news-toolbar {
    gap: 16px;
  }

  .news-hint {
    max-width: 21em;
    font-size: 12px;
  }

  .news-track {
    gap: 14px;
    padding-bottom: 8px;
  }

  .news-card {
    flex-basis: 270px;
    min-height: 0;
    padding: 14px 16px;
  }

  .news-card h3 {
    font-size: 18px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-left: 22px;
  }

  .timeline-date {
    padding-top: 0;
  }

  .contact-panel {
    padding: 64px 20px;
  }

  .contact-panel > p:not(.eyebrow) {
    font-size: 17px;
  }

  .contact-links {
    gap: 12px 20px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .not-found {
    min-height: calc(100vh - 52px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
