/* ── Design System ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600&family=Outfit:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface2: #f0ede8;
  --border: #e2ddd8;
  --text: #1c1917;
  --text2: #57534e;
  --muted: #a8a29e;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-light: #eff6ff;
  --accent2: #dc2626;
  --accent2-light: #fef2f2;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* ── Noise texture overlay ─────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Layout ────────────────────────────────────────── */
.wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ───────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 40px;
}

/* Avatar */
.avatar-wrap {
  width: 190px;
  height: 190px;
  border-radius: 20px;
  overflow: hidden;
  margin: 0 auto 24px;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
  transition: var(--transition);
}

.avatar-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
  pointer-events: none;
}

.avatar-wrap:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease;
}

.avatar-wrap:hover img { transform: scale(1.04); }

/* Name & Role */
.sidebar h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar .role {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 20px;
  text-align: center;
}

.sidebar .role a {
  color: var(--accent);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.sidebar .role a:hover {
  border-bottom-color: var(--accent);
}

/* Social Links */
.social-links {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  justify-content: center;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text2);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.social-links a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-light);
  transform: translateY(100%);
  transition: transform 0.2s ease;
}

.social-links a:hover::before { transform: translateY(0); }

.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(29,78,216,0.15);
  transform: translateY(-1px);
}

.social-links a svg,
.social-links a span { position: relative; z-index: 1; }

/* Stats Grid */
.sidebar-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: default;
}

.stat-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), var(--shadow);
  transform: translateY(-1px);
}

.stat-icon { font-size: 1.1rem; flex-shrink: 0; }

.stat-value {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.2;
}

/* ── Tabs ──────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 36px;
  position: relative;
}

.tab-btn {
  padding: 9px 20px;
  border: none;
  background: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  border-radius: 6px 6px 0 0;
  position: relative;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface2);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: fadeSlideUp 0.3s ease forwards;
}

/* ── Section Title ─────────────────────────────────── */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  letter-spacing: -0.01em;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── About Text ────────────────────────────────────── */
.about-text {
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--text2);
  margin-bottom: 22px;
  max-width: 700px;
}

.about-text strong { color: var(--text); font-weight: 600; }

.about-text a {
  color: var(--accent);
  font-weight: 500;
  border-bottom: 1px dotted var(--accent);
  transition: var(--transition);
}

.about-text a:hover {
  border-bottom-style: solid;
  color: var(--accent-hover);
}

/* ── Experience Grid ───────────────────────────────── */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 36px;
}

.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.exp-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.exp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.exp-card:hover::before { transform: scaleX(1); }

.exp-logo { font-size: 1.9rem; margin-bottom: 10px; display: block; }
.exp-role { font-size: 0.79rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.exp-org { font-size: 0.74rem; color: var(--accent); font-weight: 500; margin-bottom: 3px; }
.exp-dates { font-size: 0.68rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* ── Project Cards ─────────────────────────────────── */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), #7c3aed);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: top;
}

.project-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.project-card:hover::after { transform: scaleY(1); }

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.project-name {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text);
  line-height: 1.4;
}

.project-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 3px;
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 4px;
}

.project-desc {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.65;
  margin-bottom: 12px;
}

/* ── Tags ──────────────────────────────────────────── */
.project-tags, .interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  font-size: 0.69rem;
  padding: 3px 9px;
  background: var(--surface2);
  border-radius: 999px;
  color: var(--text2);
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
}

.tag:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.tag.blue {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(29,78,216,0.15);
}

.interest-tags .tag {
  font-size: 0.8rem;
  padding: 5px 14px;
}

/* ── Project Links ─────────────────────────────────── */
.project-links { display: flex; gap: 8px; }

.project-links a {
  font-size: 0.74rem;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-weight: 500;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.project-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(29,78,216,0.12);
}

.live-badge {
  font-size: 0.62rem;
  padding: 2px 7px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 999px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 7px;
  border: 1px solid rgba(22,163,74,0.2);
  animation: pulse-green 2s ease infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.3); }
  50% { box-shadow: 0 0 0 4px rgba(22,163,74,0); }
}

/* ── Publications ──────────────────────────────────── */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: var(--transition);
}

.pub-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(29,78,216,0.2);
}

.pub-badge {
  min-width: 54px;
  height: 54px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  line-height: 1.3;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  border: 1px solid rgba(29,78,216,0.1);
}

.pub-badge.orange {
  background: var(--accent2-light);
  color: var(--accent2);
  border-color: rgba(220,38,38,0.1);
}

.pub-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.4;
}

.pub-venue {
  font-size: 0.77rem;
  color: var(--text2);
  margin-bottom: 4px;
  line-height: 1.5;
}

.pub-venue strong { color: var(--accent2); }

.pub-authors {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-style: italic;
}

.pub-role {
  display: inline-block;
  font-size: 0.67rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.pub-role.first {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid rgba(194,65,12,0.2);
}

.pub-role.co {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}

/* ── Services ──────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.service-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.service-block:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.service-block h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'JetBrains Mono', monospace;
}

.service-block ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.service-block li {
  font-size: 0.79rem;
  color: var(--text2);
  padding-left: 14px;
  position: relative;
  line-height: 1.4;
}

.service-block li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
}

/* ── Animations ────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.sidebar.fade-in { animation-delay: 0.1s; }
.main.fade-in { animation-delay: 0.2s; }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 800px) {
  .wrapper { grid-template-columns: 1fr; padding-top: 24px; gap: 32px; }
  .sidebar { position: static; }
  .services-grid { grid-template-columns: 1fr; }
  .exp-grid { grid-template-columns: repeat(2, 1fr); }
}