@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #131418;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #f0f0f0;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --accent-primary: #00dfd8;
  --accent-secondary: #007cf0;
  --accent-gradient: linear-gradient(135deg, #00dfd8 0%, #007cf0 100%);
  
  --border-light: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(0, 223, 216, 0.5);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  
  --sidebar-width: 250px;
  --content-max-width: 1000px;
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { 
  font-family: var(--font-sans); 
  background-color: var(--bg-primary); 
  color: var(--text-primary); 
  line-height: 1.6; 
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent-primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #fff; }
::selection { background: rgba(0, 223, 216, 0.2); color: #fff; }

/* LAYOUT */
.main-nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-light);
  display: flex; flex-direction: column;
  padding: 2.5rem 1.5rem;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-brand {
  margin-bottom: 3rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}

.nav-name { 
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.nav-link {
  font-weight: 500; font-size: 0.95rem; color: var(--text-secondary);
  padding: 0.75rem 1rem; border-radius: var(--border-radius-sm);
  display: flex; align-items: center; justify-content: space-between;
  transition: all 0.2s ease;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-link.active { color: #fff; background: rgba(255, 255, 255, 0.08); font-weight: 600; }

.nav-badge {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  background: var(--accent-gradient); color: #000;
  padding: 0.1rem 0.4rem; border-radius: 12px;
}

.nav-search { margin-bottom: 2rem; position: relative; }
.nav-search-input {
  width: 100%; font-family: var(--font-sans); font-size: 0.9rem;
  color: var(--text-primary); background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light); padding: 0.75rem 1rem;
  border-radius: var(--border-radius-md); outline: none; transition: all 0.2s ease;
}
.nav-search-input:focus { border-color: var(--border-focus); background: rgba(0, 223, 216, 0.03); }
.nav-search-results { position: absolute; top: calc(100% + 0.5rem); left: 0; right: 0; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--border-radius-md); max-height: 300px; overflow-y: auto; display: none; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.nav-search-results.open { display: block; }
.search-result-item { display: block; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background 0.2s; }
.search-result-item:hover { background: var(--bg-card-hover); }

/* MAIN CONTENT */
.content {
  max-width: var(--content-max-width);
  margin-left: max(var(--sidebar-width), calc((100vw + var(--sidebar-width) - var(--content-max-width)) / 2));
  padding: 4rem 2rem;
  min-height: 100vh;
}
.section.hidden { display: none; }
.section-header { margin-bottom: 3rem; }
.section-title { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.5rem; color: #fff; }
.section-subtitle { font-size: 1.1rem; color: var(--text-secondary); font-weight: 400; }

/* HOME HERO */
.home-hero { display: flex; align-items: center; gap: 5rem; margin-bottom: 4rem; }
.home-avatar { flex-shrink: 0; }
.avatar-placeholder { width: 240px; height: 240px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border-light); box-shadow: 0 10px 30px rgba(0,0,0,0.5); position: relative; }
.avatar-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.home-intro { flex: 1; }
.home-greeting { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent-primary); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 1rem; font-weight: 500; }
.home-name { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.04em; color: #fff; line-height: 1.1; margin-bottom: 0.5rem; }
.home-title { font-size: 1.25rem; color: var(--text-secondary); margin-bottom: 1.5rem; font-family: var(--font-mono); }
.home-bio { font-size: 1.1rem; color: var(--text-muted); max-width: 700px; line-height: 1.7; }


/* STATS */
.home-stats-hud { margin: 4rem 0; }
.hud-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem; }
.hud-item { background: var(--bg-card); padding: 1.5rem; border-radius: var(--border-radius-md); border: 1px solid var(--border-light); text-align: center; transition: transform 0.2s, border-color 0.2s; }
.hud-item:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.2); background: var(--bg-card-hover); }
.hud-value { display: block; font-size: 2.5rem; font-weight: 800; color: #fff; line-height: 1; margin-bottom: 0.5rem; font-family: var(--font-sans); letter-spacing: -0.03em; }
.hud-key { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); font-weight: 500; }

/* FEATURED */
.home-featured { margin: 5rem 0; }
.featured-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2rem; }
.featured-title { font-size: 1.5rem; font-weight: 700; color: #fff; }
.featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.featured-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--border-radius-md); padding: 1.5rem; transition: all 0.2s; display: flex; flex-direction: column; }
.featured-card:hover { border-color: var(--border-focus); transform: translateY(-3px); }
.fc-type { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-primary); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.fc-title { font-size: 1.1rem; font-weight: 600; color: #fff; margin-bottom: 0.75rem; line-height: 1.4; }
.fc-desc { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 1.5rem; flex: 1; }
.fc-action { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 0.25rem; }

/* RESUME */
.resume-container { display: flex; flex-direction: column; gap: 4rem; }
.block-title { font-size: 1.5rem; font-weight: 700; color: #fff; margin-bottom: 2rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light); }
.timeline-item { margin-bottom: 2.5rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.25rem; flex-wrap: wrap; gap: 0.5rem; }
.timeline-heading { font-size: 1.25rem; font-weight: 600; color: #fff; }
.timeline-date { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent-primary); }
.timeline-sub { font-size: 1rem; color: var(--text-secondary); font-weight: 500; margin-bottom: 0.75rem; }
.timeline-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }
.timeline-desc strong { color: var(--text-primary); font-weight: 500; }


.skills-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; }
.skill-tag { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-primary); font-size: 0.9rem; padding: 0.4rem 0.8rem; border-radius: 20px; font-weight: 500; transition: border-color 0.2s; }
.skill-tag:hover { border-color: rgba(255,255,255,0.3); }

/* GRID LISTS (Awards, Projects) */
.grid-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.card-item { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--border-radius-md); padding: 1.5rem; transition: background 0.2s; }
.card-item:hover { background: var(--bg-card-hover); }
.card-title { font-weight: 600; color: #fff; margin-bottom: 0.25rem; font-size: 1.05rem; }
.card-sub { font-size: 0.85rem; font-family: var(--font-mono); color: var(--accent-primary); margin-bottom: 0.75rem; display: flex; justify-content: space-between; }
.card-desc { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* PAPERS */
.papers-controls { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 2rem; }
.retro-input { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border-light); color: #fff; padding: 1rem 1rem 1rem 3rem; border-radius: var(--border-radius-md); font-family: var(--font-sans); font-size: 1rem; transition: border-color 0.2s; }
.retro-input:focus { border-color: var(--border-focus); outline: none; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-secondary); padding: 0.5rem 1rem; border-radius: 20px; font-weight: 500; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.filter-btn:hover, .filter-btn.active { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }

.paper-tags-container { margin-bottom: 2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ptc-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.paper-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; max-height: 40px; overflow: hidden; transition: max-height 0.3s ease; }
.paper-tags.expanded { max-height: 1000px; }
.paper-tag { font-family: var(--font-mono); font-size: 0.75rem; background: transparent; border: 1px solid var(--border-light); color: var(--text-muted); padding: 0.2rem 0.6rem; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.paper-tag:hover, .paper-tag.active { border-color: var(--accent-primary); color: var(--accent-primary); background: rgba(0, 223, 216, 0.05); }
.toggle-tags-btn { background: none; border: none; font-size: 0.8rem; color: var(--accent-secondary); cursor: pointer; font-weight: 500; }

.papers-list { display: flex; flex-direction: column; gap: 1.5rem; }
.paper-card { padding: 1.5rem; border: 1px solid var(--border-light); background: var(--bg-card); border-radius: var(--border-radius-md); cursor: pointer; transition: all 0.2s; }
.paper-card:hover { border-color: var(--border-focus); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.paper-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; font-family: var(--font-mono); font-size: 0.8rem; }
.paper-year { color: var(--accent-primary); font-weight: 500; }
.paper-category { color: var(--text-muted); padding: 0.1rem 0.5rem; border: 1px solid var(--border-light); border-radius: 4px; }
.paper-award-badge { color: #f59e0b; padding: 0.1rem 0.5rem; border: 1px solid rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.05); border-radius: 4px; display: inline-flex; align-items: center; gap: 0.3rem; }
.paper-title { font-size: 1.25rem; font-weight: 600; color: #fff; margin-bottom: 0.5rem; line-height: 1.3; }
.paper-authors { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.paper-venue { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }

/* PAPER DETAIL */
.paper-detail { display: flex; flex-direction: column; gap: 2rem; max-width: 800px; margin: 0 auto; }
.pd-back { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 2rem; cursor: pointer; transition: color 0.2s; }
.pd-back:hover { color: #fff; }
.pd-title { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 1rem; letter-spacing: -0.02em; }
.pd-authors { font-size: 1.1rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.pd-venue { font-size: 1rem; color: var(--text-secondary); }
.pd-abstract { font-size: 1.05rem; color: var(--text-muted); line-height: 1.8; margin: 2rem 0; }
.pd-links-grid { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.pd-link { padding: 0.5rem 1rem; border-radius: var(--border-radius-sm); background: var(--bg-card); border: 1px solid var(--border-light); font-weight: 500; font-size: 0.9rem; color: #fff; display: inline-flex; align-items: center; gap: 0.5rem; transition: background 0.2s; }
.pd-link:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.2); }
.pd-cite-box { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--border-radius-md); padding: 1.5rem; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-secondary); overflow-x: auto; position: relative; display: none; }
.pd-cite-box.active { display: block; }
.pd-cite-tabs { display: flex; gap: 1rem; margin-bottom: 1rem; }
.pd-cite-tab { background: none; border: none; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); cursor: pointer; padding-bottom: 0.5rem; border-bottom: 2px solid transparent; }
.pd-cite-tab.active { color: #fff; border-bottom-color: var(--accent-primary); }



/* RESPONSIVE */
.nav-toggle {
  display: none;
  position: fixed; top: 1.5rem; right: 1.5rem; z-index: 1001;
  width: 44px; height: 44px; background: rgba(255,255,255,0.1); border-radius: 50%;
  border: 1px solid var(--border-light); backdrop-filter: blur(10px); color: #fff;
  align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .content { margin-left: 0; padding: 5rem 1.5rem 2rem 1.5rem; }
  .main-nav { transform: translateX(-100%); }
  .main-nav.open { transform: translateX(0); }
  .home-hero { flex-direction: column; text-align: center; gap: 2rem; }

  .home-avatar { margin: 0 auto; }
}
