/* Personal site layout */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f7f8fa;
  --fg: #111111;
  --body: #444444;
  --muted: #777777;
  --subtle: #aaaaaa;
  --border: #e2e5ea;
  --surface: #edf0f4;
  --link: #0066cc;
  --link-h: #004499;
  --nav-bg: rgba(247,248,250,0.9);
  --highlight-bg: rgba(0, 102, 204, 0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-w: 180px;
  --gap: 36px;
  --max-w: 920px;
}

[data-theme="dark"] {
  --bg: #111111;
  --fg: #eeeeee;
  --body: #bbbbbb;
  --muted: #888888;
  --subtle: #555555;
  --border: #282828;
  --surface: #1a1a1a;
  --link: #6699dd;
  --link-h: #88bbff;
  --nav-bg: rgba(17,17,17,0.9);
  --highlight-bg: rgba(100, 150, 230, 0.22);
}

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

ol, ul { list-style: none; }

strong { color: var(--fg); font-weight: 600; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-h); text-decoration: underline; }

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.theme-btn:hover { color: var(--fg); background: var(--surface); }

.theme-copy {
  font-size: 14px;
  letter-spacing: 0.01em;
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

.layout {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 32px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar {
  width: var(--sidebar-w);
  height: var(--sidebar-w);
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 13px;
}

.sidebar-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 3px;
  text-align: center;
}

.sidebar-role {
  font-size: 14px;
  color: var(--body);
  text-align: center;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  width: 100%;
  justify-content: center;
}

.social-icons a {
  color: var(--body);
  display: flex;
  align-items: center;
  transition: color 0.15s;
  text-decoration: none;
}

.social-icons a:hover {
  color: var(--fg);
  text-decoration: none;
}

.social-icons svg {
  width: 19px;
  height: 19px;
  display: block;
}

.social-icons svg[stroke] {
  stroke-width: 2.1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.sidebar-nav a {
  font-size: 15px;
  font-weight: 450;
  color: var(--subtle);
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.2s;
}

.sidebar-nav a:hover {
  color: var(--fg);
  text-decoration: none;
}

.sidebar-nav a.active {
  color: var(--fg);
  font-weight: 600;
}

.sidebar-controls {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.main {
  flex: 1;
  min-width: 0;
}

.intro {
  margin-bottom: 0;
}

.bio {
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--body);
  margin-bottom: 12px;
}

.bio a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.bio a:hover {
  color: var(--link-h);
  border-color: var(--link-h);
  text-decoration: none;
}

.quote {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.bio-pillars {
  padding-left: 20px;
  margin-bottom: 12px;
  list-style: none;
}

.bio-pillars li {
  font-size: 15px;
  line-height: 1.78;
  color: var(--body);
  position: relative;
  padding-left: 14px;
}

.bio-pillars li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--subtle);
}

.bio-pillars li strong {
  letter-spacing: 0.01em;
}

.summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.summary a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.summary a:hover {
  color: var(--body);
  border-color: var(--body);
  text-decoration: none;
}

/* Education */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.edu-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.edu-cap {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--subtle);
  margin-top: 2px;
}

.edu-body {
  min-width: 0;
  flex: 1;
}

.edu-school {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.edu-years {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.edu-degree {
  font-size: 13px;
  color: var(--body);
  line-height: 1.5;
  margin-top: 1px;
}

.edu-degree em {
  font-style: italic;
}

.edu-minor {
  color: var(--muted);
  font-style: normal;
}

.edu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.edu-tag {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--bg);
  background: var(--link);
  border-radius: 100px;
  padding: 1px 8px;
  white-space: nowrap;
  line-height: 1.6;
}



.edu-advisor {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.edu-advisor a {
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.edu-advisor a:hover {
  color: var(--body);
  border-color: var(--body);
  text-decoration: none;
}

/* Experience */
.exp-list {
  display: flex;
  flex-direction: column;
}

.exp-entry {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.exp-entry:first-child {
  border-top: none;
  padding-top: 0;
}

.exp-logo {
  width: 52px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
}

.exp-body {
  flex: 1;
  min-width: 0;
}

.exp-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.exp-org {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.exp-org a {
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.exp-org a:hover {
  color: var(--link);
  border-color: var(--link);
  text-decoration: none;
}

.exp-location {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-left: 3px;
}

.exp-dates {
  font-size: 11.5px;
  color: var(--subtle);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.exp-role {
  font-size: 13px;
  color: var(--body);
  line-height: 1.5;
  margin-top: 1px;
}

.exp-desc {
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  margin-top: 2px;
}

#education, #experience, #preprints, #research, #projects, #awards {
  margin-top: 40px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 21px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0;
}

.section-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: none;
}

.section-link:hover {
  color: var(--fg);
  text-decoration: none;
}

.papers {
  display: flex;
  flex-direction: column;
}

.paper {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.paper:first-child { border-top: none; padding-top: 0; }

.paper-img {
  grid-column: 2;
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  display: block;
  transition: opacity 0.2s;
  -webkit-user-drag: none;
  user-select: none;
}

.paper:hover .paper-img { opacity: 1; }

.paper-video-wrap {
  grid-column: 2;
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 6px;
  overflow: hidden;
}

.paper-video-wrap .paper-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.paper-video-caption {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  text-align: center;
  font-size: 10px;
  font-style: italic;
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 4px;
  padding: 3px 5px;
  line-height: 1.4;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.paper-media {
  grid-column: 2;
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}

.paper-media-layer {
  position: absolute;
  inset: 0;
}

.paper-media-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.paper-media-label {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(16, 20, 31, 0.62);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.paper-media-swap .is-before {
  z-index: 1;
  transition: opacity 0.28s ease;
}

.paper-media-swap .is-after {
  z-index: 0;
}

.paper-media-swap:hover .is-before {
  opacity: 0;
}


.paper-body {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.paper-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.paper-venue {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--link);
  border: 1px solid var(--link);
  border-radius: 100px;
  padding: 1px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge.oral {
  background: var(--link);
  color: var(--bg);
}

.paper-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 7px;
}

.insight {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.65;
  margin-bottom: 8px;
}

.authors {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 9px;
}

.authors strong {
  color: var(--body);
}

.paper-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.paper-links a {
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
}

.paper-links a:hover {
  color: var(--link-h);
  text-decoration: underline;
}

.awards-list {
  display: flex;
  flex-direction: column;
}

.awards-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 13.5px;
  line-height: 1.55;
}

.awards-list li strong {
  flex-shrink: 0;
}

.award-detail::before {
  content: "·";
  margin-right: 8px;
}

.award-detail {
  color: var(--muted);
  flex: 1;
  min-width: 0;
}

.award-year {
  font-size: 12px;
  color: var(--subtle);
  flex-shrink: 0;
}

/* Projects */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-auto-rows: 210px;
  gap: 10px;
}

.proj-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  cursor: default;
  text-decoration: none;
  display: block;
}

a.proj-card { cursor: pointer; }
a.proj-card:hover { text-decoration: none; }

.proj-card--lg  { grid-column: span 6; }
.proj-card--sm  { grid-column: span 4; }
.proj-card--md  { grid-column: span 5; }
.proj-card--full { grid-column: 1 / -1; }

.proj-card > video,
.proj-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.proj-card:hover > video,
.proj-card:hover > img {
  transform: scale(1.03);
}

.proj-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 16px;
  gap: 6px;
}

.proj-tag {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 100px;
  padding: 2px 9px;
  line-height: 1.5;
}

.proj-title {
  font-size: 18px;
  font-weight: 650;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.proj-award {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  font-weight: 600;
  color: #111;
  background: rgba(255,255,255,0.88);
  border-radius: 100px;
  padding: 2px 9px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .proj-card {
  border: 1px solid var(--border);
}

footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 12px;
  color: var(--subtle);
}

@media (max-width: 640px) {
  .layout {
    flex-direction: column;
    gap: 40px;
    padding: 40px 20px 60px;
  }

  .sidebar {
    position: static;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .avatar {
    width: 96px;
    height: 96px;
    margin-bottom: 0;
  }

  .sidebar-name {
    font-size: 20px;
    text-align: center;
  }

  .sidebar-role {
    margin-bottom: 0;
    text-align: center;
  }

  .social-icons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 0;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 4px;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    justify-content: center;
  }

  .sidebar-controls {
    width: auto;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  /* Publications: compact 2-col cards */
  .paper {
    grid-template-columns: 72px 1fr;
    gap: 10px;
    padding: 12px 0;
  }

  .paper-body {
    grid-column: 2;
    grid-row: 1;
  }

  .paper-title {
    font-size: 14px;
    margin-bottom: 5px;
  }

  .insight { display: none; }
  .authors { display: none; }

  .paper-img {
    grid-column: 1;
    grid-row: 1;
    width: 72px;
    height: 72px;
    border-radius: 5px;
  }

  .paper-video-wrap {
    grid-column: 1;
    grid-row: 1;
    width: 72px;
    height: 72px;
    border-radius: 5px;
  }

  .paper-video-caption { display: none; }

  .paper-media {
    grid-column: 1;
    grid-row: 1;
    width: 72px;
    height: 72px;
    border-radius: 5px;
  }

  .paper-footer { gap: 8px; }
  .paper-links { gap: 8px; }

  /* Projects: single column on mobile */
  .proj-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .proj-card--lg,
  .proj-card--sm,
  .proj-card--md,
  .proj-card--full {
    grid-column: span 1;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
  }

  .proj-title { font-size: 15px; }
  .proj-tag { font-size: 9.5px; }

  .award-detail-long { display: none; }

  /* Experience: stack header on mobile */
  .exp-header {
    flex-direction: column;
    gap: 0;
  }
  .exp-desc { display: none; }
  .exp-logo {
    width: 44px;
    height: 30px;
  }
}
