/* ===== DESIGN TOKENS ===== */
:root {
  /* Brand */
  --accent: #2ab4a0;            /* decorative fills, borders, dots */
  --accent-ink: #0c7d6e;        /* teal for TEXT — meets 4.5:1 on light bg */
  --accent-soft: #e9f9f5;
  --accent-grad: linear-gradient(135deg, #2ab4a0 0%, #1c8f9e 100%);

  /* Surfaces */
  --bg: #ffffff;
  --surface: #fbfcfd;
  --surface-hover: #f5f7f9;
  --surface-2: #f1f4f7;

  /* Lines */
  --border: #e6eaef;
  --border-subtle: #eef1f4;

  /* Text */
  --text: #3d4654;
  --text-strong: #0d1117;
  --text-muted: #677084;
  --text-faint: #98a1b0;

  /* Sidebar (always dark) */
  --sb-bg: #0f1117;
  --sb-surface: #1a2030;
  --sb-border: #232b3a;
  --sb-text: #f5f7fa;
  --sb-muted: #9aa4b5;
  --sb-faint: #6b7589;

  /* Radii */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(13, 17, 23, .04), 0 1px 3px rgba(13, 17, 23, .05);
  --shadow-md: 0 6px 16px rgba(13, 17, 23, .08), 0 2px 6px rgba(13, 17, 23, .05);

  /* Fonts */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font-body);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.16s;
  --t-med: 0.28s;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }

/* Visible focus for keyboard users (was missing) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ===== UTILITIES ===== */
.mt-section { margin-top: 48px; }
.meta-note { color: var(--text-faint); font-size: 0.85em; font-weight: 400; }
.accent-ink { color: var(--accent-ink); }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--sb-bg);
  color: var(--sb-text);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 40px 26px;
  overflow-y: auto;
  z-index: 100;
  border-right: 1px solid var(--sb-border);
}
.sidebar-photo {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  padding: 3px;
  background: var(--accent-grad);
  overflow: hidden;
  margin-bottom: 22px;
  flex-shrink: 0;
}
.sidebar-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.sidebar h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 6px;
}
.sidebar .subtitle {
  font-size: 12px;
  color: var(--sb-muted);
  line-height: 1.7;
  margin-bottom: 30px;
}
.sidebar .subtitle span { color: var(--accent); font-weight: 500; }

/* ===== NAV ===== */
nav { display: flex; flex-direction: column; gap: 2px; }
nav a {
  position: relative;
  display: block;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--sb-muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
nav a:hover { background: var(--sb-surface); color: #fff; }
nav a.active {
  background: var(--sb-surface);
  color: #fff;
  font-weight: 600;
}
nav a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 17px;
  border-radius: var(--r-pill);
  background: var(--accent-grad);
}

/* ===== SIDEBAR LINKS ===== */
.sidebar-links {
  margin-top: auto;
  padding-top: 26px;
  border-top: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.sidebar-links a {
  font-size: 12px;
  color: var(--sb-faint);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: color var(--t-fast) var(--ease);
}
.sidebar-links a:hover { color: var(--accent); }
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ===== MAIN CONTENT ===== */
.main {
  margin-left: 280px;
  flex: 1;
  padding: 60px 64px;
  max-width: 920px;
}

/* ===== TYPOGRAPHY ===== */
.section-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  color: var(--accent-ink);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  line-height: 1.25;
  margin-bottom: 20px;
}
.page-title em {
  font-style: normal;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent-ink);
}
.lead {
  font-size: 15.5px;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 36px;
  max-width: 660px;
}
.lead strong { color: var(--text-strong); font-weight: 600; }

/* ===== BADGES ===== */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 44px; }
.badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.badge:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

/* ===== HIGHLIGHT CARDS ===== */
.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 52px;
}
.highlight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.highlight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.highlight-card .num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
  margin-bottom: 6px;
}
.highlight-card .desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ===== RECENT HIGHLIGHTS ===== */
.recent-section { margin-bottom: 52px; }
.recent-section h3 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.recent-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.recent-item:last-child { border-bottom: none; }
.recent-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  margin-top: 2px;
  flex-shrink: 0;
}
.tag-press { background: #fef3c7; color: #92400e; }
.tag-research { background: #ede9fe; color: #5b21b6; }
.tag-project { background: #d1fae5; color: #065f46; }
.recent-item .item-text { font-size: 14px; color: var(--text); line-height: 1.55; }
.recent-item .item-text a { color: var(--accent-ink); font-weight: 500; }
.recent-item .item-text a:hover { text-decoration: underline; }
.recent-item .item-date { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }

/* ===== TIMELINE (Work Experience) ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 24px;
  padding-bottom: 36px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 1;
}
.timeline-dot.active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-body { flex: 1; }
.timeline-role {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin-bottom: 3px;
}
.timeline-company {
  font-size: 13px;
  color: var(--accent-ink);
  font-weight: 600;
  margin-bottom: 3px;
}
.timeline-date {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.timeline-body ul {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-body li { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.timeline-body li::marker { color: var(--accent); }

/* ===== SECTION TITLES (unified: publications + press) ===== */
.pub-section, .press-section { margin-bottom: 40px; }
.pub-section-title, .press-section-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-bottom: 18px;
  padding-bottom: 10px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.pub-section-title::after, .press-section-title::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 40px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--accent-grad);
}

/* ===== PUBLICATIONS ===== */
.featured-paper {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  padding: 22px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.featured-paper .paper-badge {
  display: inline-block;
  background: var(--accent-grad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  margin-bottom: 12px;
}
.featured-paper .paper-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.4;
  margin-bottom: 7px;
}
.featured-paper .paper-authors {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.featured-paper .paper-meta { font-size: 12px; color: var(--text); }
.featured-paper .paper-meta a { color: var(--accent-ink); font-weight: 500; text-decoration: underline; }
.pub-entry {
  padding: 15px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.pub-entry:last-child { border-bottom: none; }
.pub-entry .pub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 4px;
  font-style: italic;
}
.pub-entry .pub-authors { font-size: 12.5px; color: var(--text-muted); margin-bottom: 3px; }
.pub-entry .pub-venue { font-size: 12px; color: var(--text-faint); }

/* ===== TABLES (teaching / awards) ===== */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
.awards-table tbody tr { transition: background var(--t-fast) var(--ease); }
.awards-table tbody tr:hover td { background: var(--surface-hover); }

/* ===== PROJECT CARDS ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 52px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.project-card .project-tag {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-ink);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.project-card .project-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin-bottom: 9px;
  line-height: 1.35;
}
.project-card .project-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.project-links a {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  padding: 4px 11px;
  border-radius: var(--r-pill);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.project-links a:hover { background: var(--accent); color: #fff; }
.project-card .project-image {
  height: 220px;
  margin: 20px -24px -24px -24px;
  overflow: hidden;
}
.project-card .project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}
.project-card:hover .project-image img { transform: scale(1.04); }

/* ===== PRESS ===== */
.press-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.press-item:last-child { border-bottom: none; }
.press-year {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  min-width: 40px;
  margin-top: 2px;
}
.press-outlet { font-size: 14px; font-weight: 600; color: var(--text-strong); margin-bottom: 3px; }
.press-outlet a { color: var(--accent-ink); }
.press-outlet a:hover { text-decoration: underline; }
.press-topic { font-size: 13px; color: var(--text-muted); font-style: italic; }

/* ===== CONTACT ===== */
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 460px;
  margin-bottom: 40px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease);
}
.contact-item:hover { background: var(--surface-hover); }
.contact-item .contact-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  min-width: 72px;
}
.contact-item a { color: var(--accent-ink); font-weight: 500; }
.contact-item a:hover { text-decoration: underline; }

/* ===== ENTRANCE MOTION ===== */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .main > * { animation: fadeUp 0.5s var(--ease) both; }
  .main > *:nth-child(1) { animation-delay: 0.02s; }
  .main > *:nth-child(2) { animation-delay: 0.07s; }
  .main > *:nth-child(3) { animation-delay: 0.12s; }
  .main > *:nth-child(4) { animation-delay: 0.17s; }
  .main > *:nth-child(5) { animation-delay: 0.22s; }
  .main > *:nth-child(6) { animation-delay: 0.27s; }
  .main > *:nth-child(n+7) { animation-delay: 0.3s; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  body { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    padding: 22px 20px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    border-right: none;
    border-bottom: 1px solid var(--sb-border);
  }
  .sidebar-photo { width: 60px; height: 60px; margin-bottom: 0; padding: 2px; }
  .sidebar h1 { font-size: 16px; margin-bottom: 2px; }
  .sidebar .subtitle { display: none; }
  nav { flex-direction: row; flex-wrap: wrap; gap: 4px; width: 100%; }
  nav a { padding: 7px 12px; }
  nav a.active::before { display: none; }
  .sidebar-links { display: none; }
  .main { margin-left: 0; padding: 36px 22px; max-width: 100%; }
  .page-title { font-size: 25px; }
  .highlights { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .highlights { gap: 12px; }
  .main { padding: 48px 40px; }
}
