/* ===== VARIABLES — Anthropic-inspired palette ===== */
:root {
  --bg: #F9F6F1;
  --bg-elevated: #EEEAE3;
  --bg-card: #FFFFFF;
  --text: #1A1A1D;
  --text-secondary: #5C5C66;
  --text-tertiary: #8E8E99;
  --accent: #C45B3C;
  --accent-hover: #A8462A;
  --accent-subtle: rgba(196, 91, 60, 0.06);
  --accent-light: rgba(196, 91, 60, 0.12);
  --border: #E4DFD7;
  --border-light: #EDEBE6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-display: 'Newsreader', 'Georgia', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; -webkit-font-smoothing:antialiased; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration:none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width:100%; display:block; }
::selection { background: var(--accent-light); color: var(--text); }

/* ===== LAYOUT ===== */
.container { max-width:880px; margin:0 auto; padding:0 32px; }
section { padding:72px 0; }

/* ===== NAV ===== */
.nav {
  position:fixed; top:0; left:0; right:0; z-index:100;
  background: rgba(249,246,241,0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease;
}
.nav.scrolled { border-bottom-color: var(--border-light); }
.nav-inner {
  max-width:880px; margin:0 auto; padding:0 32px;
  height:60px; display:flex; align-items:center; justify-content:space-between;
}
.nav-name {
  font-family: var(--font-display);
  font-size:22px; font-weight:500; color: var(--text); letter-spacing:-0.02em;
}
.nav-name:hover { color: var(--accent); }
.nav-links { display:flex; gap:32px; align-items:center; }
.nav-links a {
  font-size:14px; font-weight:500; color: var(--text-secondary);
  letter-spacing:0.01em; position:relative; padding-bottom:2px;
}
.nav-links a::after {
  content:''; position:absolute; bottom:-2px; left:0;
  width:0; height:1.5px; background: var(--accent);
  transition: width 0.35s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width:100%; }

/* ===== HERO ===== */
.hero { padding:140px 0 48px; }
.hero-content { display:flex; align-items:center; gap:56px; }
.hero-text { flex:1; }
.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 54px);
  font-weight:400; line-height:1.08; letter-spacing:-0.03em;
  color: var(--text); margin-bottom:16px;
}
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.2vw, 20px);
  font-style:italic; color: var(--text-secondary);
  margin-bottom:28px; line-height:1.5;
}
.hero-bio {
  font-size:15px; color: var(--text-secondary);
  line-height:1.8; margin-bottom:36px;
}
.hero-bio a { color: var(--accent); font-weight:500; }
.hero-links { display:flex; flex-wrap:wrap; gap:10px; }
.hero-links a {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 20px; font-size:13px; font-weight:600;
  letter-spacing:0.02em; border:1.5px solid var(--border);
  border-radius: var(--radius-full); color: var(--text);
  background:transparent; transition: all var(--transition);
}
.hero-links a:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-subtle); transform:translateY(-1px);
}
.hero-links a svg { width:14px; height:14px; flex-shrink:0; }
.hero-photo { flex-shrink:0; width:220px; height:220px; position:relative; }
.hero-photo::before {
  content:''; position:absolute; inset:-10px; border-radius:50%;
  background: conic-gradient(from 180deg, rgba(196,91,60,0.18), rgba(196,91,60,0.04) 120deg, transparent 180deg, rgba(196,91,60,0.08) 300deg, rgba(196,91,60,0.18));
  z-index:0; animation: glow-rotate 12s linear infinite;
}
@keyframes glow-rotate { to { transform:rotate(360deg); } }
.hero-photo img {
  width:100%; height:100%; object-fit:cover; border-radius:50%;
  position:relative; z-index:1; border:4px solid var(--bg);
  box-shadow: var(--shadow-lg); transition: transform 0.5s var(--ease);
}
.hero-photo:hover img { transform:scale(1.03); }

/* ===== SECTION HEADERS ===== */
.section-header { margin-bottom:44px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight:400; letter-spacing:-0.02em; color: var(--text);
  position:relative; display:inline-block; padding-bottom:12px;
}
.section-header h2::after {
  content:''; position:absolute; bottom:0; left:0;
  width:36px; height:2.5px; background: var(--accent);
  border-radius:2px; transition: width 0.7s var(--ease);
}
.section-header.visible h2::after { width:100%; }

/* ===== PROJECTS ===== */
.projects-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.proj-card {
  padding:28px 24px; background: var(--bg-card);
  border:1px solid var(--border-light); border-radius: var(--radius-lg);
  transition: all var(--transition); display:flex; flex-direction:column;
  position:relative; overflow:hidden;
}
.proj-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background: var(--accent); transform:scaleX(0); transform-origin:left;
  transition: transform 0.4s var(--ease);
}
.proj-card:hover { border-color: var(--border); transform:translateY(-3px); box-shadow: var(--shadow-md); }
.proj-card:hover::before { transform:scaleX(1); }
.proj-card h3 { font-family: var(--font-display); font-size:18px; font-weight:500; margin-bottom:6px; line-height:1.3; }
.proj-card h3 a { color: var(--text); }
.proj-card h3 a:hover { color: var(--accent); }
.proj-status {
  display:inline-block; font-size:10px; font-weight:700; padding:3px 10px;
  border-radius: var(--radius-full); margin-bottom:14px;
  letter-spacing:0.06em; text-transform:uppercase; width:fit-content;
}
.proj-status.active { color:#1B7340; background:#DCFCE7; }
.proj-status.coming { color: var(--text-tertiary); background: var(--bg-elevated); }
.proj-desc { font-size:13.5px; color: var(--text-secondary); line-height:1.65; margin-bottom:18px; flex:1; }
.proj-tags { display:flex; flex-wrap:wrap; gap:6px; }
.proj-tags span {
  font-size:11px; font-weight:500; color: var(--text-tertiary);
  background: var(--bg-elevated); padding:4px 11px;
  border-radius: var(--radius-full); letter-spacing:0.02em; transition: all var(--transition);
}
.proj-card:hover .proj-tags span { background: var(--accent-subtle); color: var(--accent); }
@media (max-width:768px) { .projects-grid { grid-template-columns:1fr; } }

/* ===== RESEARCH CATEGORY TABS ===== */
.research-tabs {
  display:flex; gap:8px; margin-bottom:32px; flex-wrap:wrap;
}
.research-tab {
  padding:8px 20px; font-size:13px; font-weight:600;
  letter-spacing:0.04em; text-transform:uppercase;
  border:1.5px solid var(--border); border-radius: var(--radius-full);
  background:transparent; color: var(--text-secondary);
  cursor:pointer; transition: all var(--transition);
  font-family: var(--font-body);
}
.research-tab:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-subtle);
}
.research-tab.active {
  border-color: var(--accent); color:#fff;
  background: var(--accent);
}
.research-category { display:none; }
.research-category.active { display:block; }

/* ===== PAPER CARDS ===== */
.papers { display:flex; flex-direction:column; gap:20px; }
.paper-card {
  display:flex; gap:28px; padding:28px;
  background: var(--bg-card); border:1px solid var(--border-light);
  border-radius: var(--radius-lg); transition: all var(--transition);
  position:relative; overflow:hidden;
}
.paper-card::after {
  content:''; position:absolute; bottom:0; left:0;
  width:0; height:2.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.5s var(--ease);
}
.paper-card:hover {
  border-color: var(--border); box-shadow: var(--shadow-md);
  transform:translateY(-2px);
}
.paper-card:hover::after { width:100%; }
.paper-icon {
  flex-shrink:0; width:64px; height:64px;
  display:flex; align-items:center; justify-content:center;
  background: var(--accent-subtle); border-radius: var(--radius-md);
  font-size:28px; align-self:flex-start;
}
.paper-info { flex:1; display:flex; flex-direction:column; min-width:0; }
.paper-title {
  font-family: var(--font-display);
  font-size:17px; font-weight:500; line-height:1.4;
  color: var(--text); margin-bottom:10px; transition: color var(--transition);
}
a.paper-title:hover { color: var(--accent); }
.paper-authors {
  font-size:13.5px; color: var(--text-secondary);
  margin-bottom:6px; line-height:1.6;
}
.paper-authors .me { color: var(--text); font-weight:600; }
.authors-toggle { cursor:pointer; }
.authors-toggle .authors-hidden { display:none; }
.authors-toggle .authors-ellipsis { color: var(--accent); font-weight:500; }
.authors-toggle.expanded .authors-hidden { display:inline; }
.authors-toggle.expanded .authors-ellipsis { display:none; }
.paper-venue {
  font-family: var(--font-display);
  font-size:14px; font-style:italic; color: var(--accent);
  font-weight:500; margin-bottom:14px;
}
.paper-links { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.paper-links a {
  font-size:12px; font-weight:600; padding:5px 14px;
  border:1.5px solid var(--border); border-radius: var(--radius-full);
  color: var(--text-secondary); transition: all var(--transition);
  letter-spacing:0.02em;
}
.paper-links a:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-subtle);
}
.paper-desc {
  font-size:13px; color: var(--text-tertiary); line-height:1.7;
}
.paper-desc strong { color: var(--text-secondary); font-weight:600; }

/* ===== EXPERIENCE ===== */
.timeline {
  display:flex; flex-direction:column; position:relative; padding-left:36px;
}
.timeline::before {
  content:''; position:absolute; left:7px; top:12px; bottom:12px;
  width:1.5px; background: var(--border);
}
.timeline-item { position:relative; padding:8px 0 40px; }
.timeline-item:last-child { padding-bottom:0; }
.timeline-item::before {
  content:''; position:absolute; left:-36px; top:20px;
  width:15px; height:15px; border-radius:50%;
  border:2.5px solid var(--accent); background: var(--bg);
  z-index:1; transition: all var(--transition);
}
.timeline-item:hover::before {
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-subtle);
}
.timeline-item-header { display:flex; align-items:center; gap:16px; margin-bottom:6px; }
.timeline-info h3 {
  font-family: var(--font-display);
  font-size:19px; font-weight:500; color: var(--text); line-height:1.3;
}
.timeline-role { font-size:14px; color: var(--text-secondary); margin-top:2px; }
.timeline-period { font-size:13px; color: var(--text-tertiary); font-weight:500; margin-top:1px; }

/* ===== INTERESTS ===== */
.interests-content {
  font-size:15px; color: var(--text-secondary); line-height:1.85;
  padding:24px 28px; background: var(--bg-card);
  border:1px solid var(--border-light); border-radius: var(--radius-lg);
  border-left:3px solid var(--accent); transition: all var(--transition);
}
.interests-content:hover { box-shadow: var(--shadow-sm); }
.interests-content a { font-weight:500; }

/* ===== FOOTER ===== */
.footer {
  padding:48px 0 64px; border-top:1px solid var(--border); text-align:center;
}
.footer p { font-size:13px; color: var(--text-tertiary); line-height:1.8; }
.footer a { color: var(--text-secondary); transition: color var(--transition); }
.footer a:hover { color: var(--accent); }

/* ===== ANIMATIONS ===== */
.fade-up {
  opacity:0; transform:translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease);
}
.fade-up.visible { opacity:1; transform:translateY(0); }
.stagger-1 { transition-delay:0.05s; }
.stagger-2 { transition-delay:0.1s; }
.stagger-3 { transition-delay:0.15s; }

.hero-enter {
  opacity:0; transform:translateY(20px);
  animation: hero-fade-in 0.9s var(--ease) forwards;
}
.hero-enter.delay-1 { animation-delay:0.1s; }
.hero-enter.delay-2 { animation-delay:0.2s; }
.hero-enter.delay-3 { animation-delay:0.35s; }
.hero-enter.delay-4 { animation-delay:0.5s; }
.hero-enter.delay-5 { animation-delay:0.65s; }
@keyframes hero-fade-in { to { opacity:1; transform:translateY(0); } }

/* ===== RESPONSIVE ===== */
@media (max-width:768px) {
  .container { padding:0 24px; }
  .nav-inner { padding:0 24px; }
  .hero { padding:110px 0 32px; }
  .hero-content { flex-direction:column-reverse; gap:28px; text-align:center; }
  .hero-photo { width:170px; height:170px; }
  .hero-bio { text-align:left; }
  .hero-links { justify-content:center; }
  .nav-links { gap:20px; }
  .nav-links a { font-size:13px; }
  .paper-card { flex-direction:column; padding:20px; gap:16px; }
  .paper-icon { width:48px; height:48px; font-size:22px; }
  section { padding:52px 0; }
  .section-header { margin-bottom:32px; }
  .timeline { padding-left:30px; }
}
@media (max-width:480px) {
  .container { padding:0 18px; }
  .nav-inner { padding:0 18px; height:52px; }
  .nav-links { gap:14px; }
  .nav-links a { font-size:12px; }
  .hero { padding:90px 0 24px; }
  .hero-links a { padding:7px 14px; font-size:12px; }
  .hero-photo { width:140px; height:140px; }
}
@media (prefers-reduced-motion:reduce) {
  .fade-up { opacity:1; transform:none; transition:none; }
  .hero-enter { opacity:1; transform:none; animation:none; }
  html { scroll-behavior:auto; }
}
