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

:root {
  --bg:        #ffffff;
  --text:      #111111;
  --muted:     #555555;
  --faint:     #aaaaaa;
  --border:    #e4e4e4;
  --hover-bg:  #f4f4f4;
  --topbar-h:  64px;
  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:      ui-monospace, "SF Mono", Menlo, "Consolas", monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 19px;
  line-height: 1.85;
  min-height: 100vh;
}

/* ════════════════════════════════
   TOP NAV BAR
════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2.5rem;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1300px;
}

.topbar-name {
  font-size: 1.35rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar-nav {
  display: flex;
  gap: 0.2rem;
  list-style: none;
  align-items: center;
}

.topbar-nav a {
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--muted);
  padding: 0.3rem 1rem;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.topbar-nav a:hover,
.topbar-nav a.active {
  background: var(--hover-bg);
  color: var(--text);
}

/* ════════════════════════════════
   HAMBURGER (mobile only)
════════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  flex-direction: column;
  padding: 0.5rem 1.5rem 1rem;
  /* smooth open/close */
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mobile-nav.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-nav a {
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--muted);
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}

.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover,
.mobile-nav a.active { color: var(--text); }

/* ════════════════════════════════
   PAGE SHELL
════════════════════════════════ */
.page-shell {
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  justify-content: center;
  padding: 0 2.5rem;
}

.page-inner {
  display: flex;
  flex-direction: row;
  gap: 5rem;
  width: 100%;
  max-width: 1300px;
  align-items: flex-start;
}

/* ════════════════════════════════
   LEFT SIDEBAR
════════════════════════════════ */
.sidebar {
  width: 260px;
  min-width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-h) + 3rem);
  padding-top: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.6rem;
}

.sidebar-photo {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
}

.sidebar-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-photo-placeholder {
  width: 100%; height: 100%;
  background: var(--hover-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}

.sidebar-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.sidebar-role {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 0.2rem;
}

.socials {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.2rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1rem;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s;
}

.social-link:hover { color: var(--text); }
.social-link svg { flex-shrink: 0; opacity: 0.55; }
.social-link:hover svg { opacity: 1; }

/* ════════════════════════════════
   MAIN CONTENT
════════════════════════════════ */
.main {
  flex: 1;
  min-width: 0;
  padding: 3.5rem 0 6rem;
}

  to   { opacity: 1; transform: translateY(0); }
}

.page-title {
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 2rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}

/* ── BIO ── */
.bio {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.9;
}

.bio p { margin-bottom: 1.15rem; }
.bio p:last-child { margin-bottom: 0; }
.bio a { color: var(--text); text-underline-offset: 3px; }
.bio em { font-style: italic; color: var(--text); }

.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 2rem;
}

.interest-tag {
  font-size: 0.9rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
}

/* ── GROUPS ── */
.group { margin-bottom: 3.2rem; }

.group-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── ITEMS ── */
.item {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}

.item:last-child { border-bottom: none; }

.item-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.28rem;
}

.item-authors {
  font-size: 0.97rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.item-authors strong { color: var(--text); font-weight: 500; }

.item-venue {
  font-size: 0.92rem;
  color: var(--faint);
  font-style: italic;
  margin-bottom: 0.65rem;
}

.item-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }

.item-link {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.item-link:hover { color: var(--text); border-color: var(--text); }

/* ── PROJECTS ── */
.project-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.project-item:last-child { border-bottom: none; }

.project-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.project-desc {
  font-size: 0.98rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.65rem; }

.project-tag {
  font-size: 0.8rem;
  padding: 0.17rem 0.62rem;
  background: var(--hover-bg);
  color: var(--faint);
  border-radius: 3px;
  font-family: var(--mono);
}

/* ── CV ── */
.cv-section { margin-bottom: 3rem; }

.cv-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.1rem;
}

.cv-row {
  display: grid;
  grid-template-columns: 135px 1fr;
  gap: 1.4rem;
  padding: 0.82rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  font-size: 1rem;
}

.cv-row:last-child { border-bottom: none; }

.cv-date {
  font-size: 0.86rem;
  color: var(--faint);
  font-family: var(--mono);
  padding-top: 0.1rem;
}

.cv-entry strong { font-weight: 600; color: var(--text); }
.cv-entry span { display: block; color: var(--muted); font-size: 0.93rem; }
.cv-entry em { color: #777777; font-style: normal; font-size: 0.88rem; display: block; }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 820px) {
  :root { --topbar-h: 58px; }

  /* Hide desktop nav, show hamburger */
  .topbar-nav { display: none; }
  .hamburger { display: flex; }
  .topbar-name { font-size: 1.1rem; }

  .page-shell { padding: 0 1.5rem; }
  .page-inner { flex-direction: column; gap: 0; }

  .sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    padding-top: 2rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.4rem;
    padding-bottom: 1.8rem;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-photo { width: 90px; height: 90px; }
  .socials { flex-direction: row; flex-wrap: wrap; gap: 0.9rem; margin-top: 0; }
  .main { padding: 2rem 0 4rem; }
  .cv-row { grid-template-columns: 1fr; gap: 0.1rem; }
}

@media (max-width: 520px) {
  .topbar-name { font-size: 0.95rem; }
}
