:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef4ff;
  --text: #101828;
  --muted: #667085;
  --line: #d9e2f1;
  --primary: #155eef;
  --primary-2: #0e3f9f;
  --accent: #12b76a;
  --warning: #f79009;
  --danger: #d92d20;
  --shadow: 0 18px 60px rgba(16, 24, 40, 0.10);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; }
.container { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.section { padding: 88px 0; }
.section-soft { background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%); }
.section-label {
  margin: 0 0 12px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 800;
  font-size: .78rem;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(3rem, 7vw, 6.5rem); line-height: .95; letter-spacing: -0.06em; margin-bottom: 18px; }
h2 { font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 16px; }
h3 { font-size: 1.18rem; line-height: 1.2; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--primary);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 249, 252, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(217, 226, 241, 0.75);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; }
.brand-mark, .avatar {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #155eef, #12b76a 55%, #f79009);
  box-shadow: 0 12px 30px rgba(21, 94, 239, .22);
}
.brand-mark { width: 42px; height: 42px; border-radius: 14px; }
.brand-text { letter-spacing: -0.03em; }
.nav-links { display: flex; align-items: center; gap: 26px; color: var(--muted); font-weight: 700; }
.nav-toggle { display: none; border: 0; background: var(--surface); border-radius: 12px; padding: 8px 11px; font-size: 1.2rem; box-shadow: var(--shadow); }

.hero { padding: 96px 0 72px; background: radial-gradient(circle at 8% 8%, rgba(21,94,239,.16), transparent 35%), radial-gradient(circle at 90% 20%, rgba(18,183,106,.18), transparent 32%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) 390px; gap: 42px; align-items: center; }
.eyebrow { color: var(--primary); font-weight: 900; letter-spacing: .12em; text-transform: uppercase; font-size: .82rem; margin-bottom: 22px; }
.hero-title { font-size: clamp(1.25rem, 2.2vw, 2rem); color: #26364f; font-weight: 800; max-width: 840px; margin-bottom: 18px; }
.hero-summary { color: var(--muted); font-size: 1.08rem; max-width: 850px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-actions.compact { margin-top: 0; justify-content: flex-end; }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 850;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.primary-button { background: var(--primary); color: #fff; box-shadow: 0 14px 26px rgba(21, 94, 239, .24); }
.primary-button:hover { color: #fff; background: var(--primary-2); transform: translateY(-1px); }
.secondary-button { background: var(--surface); color: var(--text); border-color: var(--line); }
.secondary-button:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(16, 24, 40, .08); }

.profile-card {
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
}
.avatar { width: 112px; height: 112px; border-radius: 36px; font-size: 2.25rem; font-weight: 950; margin-bottom: 22px; }
.avatar-photo { border: 4px solid #fff; overflow: hidden; background-color: #eaf1ff; }
.profile-card h2 { font-size: 1.75rem; margin-bottom: 8px; }
.profile-card p { color: var(--muted); }
.meta-list { display: grid; gap: 12px; margin: 24px 0; }
.meta-item { display: grid; grid-template-columns: 86px 1fr; gap: 10px; color: #334155; }
.meta-item strong { color: var(--text); }
.quick-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric { background: var(--surface-2); border-radius: 18px; padding: 14px; border: 1px solid #dbe8ff; }
.metric strong { display: block; font-size: 1.4rem; line-height: 1; }
.metric span { color: var(--muted); font-size: .82rem; font-weight: 700; }

.two-col { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 54px; align-items: start; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.tag, .rank-badge, .type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 850;
  border: 1px solid transparent;
}
.tag { background: #eaf1ff; color: #194185; border-color: #c7d7fe; }
.section-head { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 28px; }
.section-note { max-width: 480px; color: var(--muted); margin: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.info-card, .project-card, .publication-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .06);
}
.info-card p, .project-card p { color: var(--muted); margin-bottom: 0; }
.project-card .stack { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.stack span { font-size: .75rem; font-weight: 800; padding: 5px 9px; border-radius: 999px; background: #f2f4f7; color: #344054; }


.gallery-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  gap: 44px;
  align-items: center;
}
.gallery-stage-card {
  overflow: hidden;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.gallery-stage {
  position: relative;
  overflow: hidden;
  background: #0b1220;
  aspect-ratio: 4 / 3;
}
.gallery-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .82);
  color: #101828;
  box-shadow: 0 10px 26px rgba(16, 24, 40, .22);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.gallery-nav:hover { background: #fff; transform: translateY(-50%) scale(1.04); }
.gallery-nav-prev { left: 16px; }
.gallery-nav-next { right: 16px; }
.gallery-caption {
  min-height: 38px;
  padding: 10px 18px 0;
  color: var(--muted);
  font-size: .92rem;
}
.gallery-caption:empty { display: none; }
.gallery-thumbs-wrap {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px 16px;
  background: #f8fbff;
}
.gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  padding: 4px 2px 8px;
}
.gallery-thumb {
  flex: 0 0 84px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #eaf1ff;
  opacity: .62;
  cursor: pointer;
  transition: opacity .16s ease, transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(21, 94, 239, .22);
}
.gallery-thumb-scroll {
  width: 34px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(21, 94, 239, .10);
  color: var(--primary);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}
.gallery-thumb-scroll:hover { background: rgba(21, 94, 239, .16); }
.gallery-copy {
  min-width: 0;
}
.gallery-copy .section-note {
  margin-bottom: 18px;
  max-width: 620px;
}
.gallery-note {
  color: var(--muted);
  margin-bottom: 20px;
  max-width: 620px;
}
.gallery-counter {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: #eaf1ff;
  border: 1px solid #c7d7fe;
  color: #194185;
  font-weight: 900;
  font-size: .84rem;
}

.toolbar { display: grid; grid-template-columns: 1fr 180px auto; gap: 12px; margin-bottom: 18px; }
.toolbar input, .toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
.rank-note { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.publication-list { display: grid; gap: 16px; }
.publication-card { display: grid; gap: 12px; }
.publication-title { font-size: 1.12rem; font-weight: 900; line-height: 1.35; }
.publication-authors { color: #475467; }
.publication-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.type-badge { background: #f2f4f7; color: #344054; }
.rank-badge.rank-a-star, .rank-badge.rank-a, .rank-badge.rank-q1 { background: #dcfae6; color: #05603a; border-color: #a6f4c5; }
.rank-badge.rank-b, .rank-badge.rank-q2 { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.rank-badge.rank-c, .rank-badge.rank-q3 { background: #fff6d6; color: #854d0e; border-color: #fedf89; }
.rank-badge.rank-d, .rank-badge.rank-q4, .rank-badge.rank-unranked { background: #fee4e2; color: #912018; border-color: #fecdca; }
.rank-badge.rank-na { background: #f2f4f7; color: #475467; border-color: #eaecf0; }
.publication-links { display: flex; flex-wrap: wrap; gap: 10px; }
.publication-links a { color: var(--primary); font-weight: 850; }

.resume-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 34px; }
.timeline { display: grid; gap: 14px; }
.timeline-item { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px 18px 18px 22px; }
.timeline-item:before { content: ""; position: absolute; left: 0; top: 22px; width: 5px; height: 42px; border-radius: 999px; background: var(--primary); }
.timeline-item .period { color: var(--primary); font-weight: 900; font-size: .83rem; }
.timeline-item p { color: var(--muted); margin-bottom: 0; }
.skills-title { margin-top: 28px; }
.skill-groups { display: grid; gap: 12px; }
.skill-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px; }
.skill-group strong { display: block; margin-bottom: 10px; }
.skill-group div { display: flex; flex-wrap: wrap; gap: 8px; }

.contact-section { background: radial-gradient(circle at 20% 0%, rgba(21,94,239,.15), transparent 30%), #0b1220; color: #fff; }
.contact-section .section-label { color: #8ec5ff; }
.contact-card { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius-lg); padding: 36px; }
.contact-card p { color: #cbd5e1; }
.contact-links { display: grid; gap: 12px; }
.contact-links a { display: flex; justify-content: space-between; gap: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 16px; font-weight: 850; }
.contact-links a:hover { color: #fff; background: rgba(255,255,255,.13); }

.site-footer { background: #060b14; color: #cbd5e1; padding: 24px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.footer-inner p { margin: 0; }

@media (max-width: 920px) {
  .nav-toggle { display: inline-flex; }
  .nav-links { position: absolute; inset: 76px 20px auto 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; display: none; flex-direction: column; align-items: flex-start; }
  .nav-links.open { display: flex; }
  .hero-grid, .two-col, .resume-grid, .contact-card, .gallery-showcase { grid-template-columns: 1fr; }
  .profile-card { order: -1; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { align-items: flex-start; flex-direction: column; }
  .hero-actions.compact { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .container { width: min(var(--max), calc(100% - 28px)); }
  .section { padding: 64px 0; }
  .hero { padding-top: 64px; }
  .card-grid, .toolbar { grid-template-columns: 1fr; }
  .gallery-stage { aspect-ratio: 3 / 2; }
  .gallery-nav { width: 36px; height: 36px; font-size: 1.65rem; }
  .gallery-thumb { flex-basis: 72px; height: 56px; }
  .gallery-thumbs-wrap { grid-template-columns: 30px 1fr 30px; padding-inline: 10px; }
  .meta-item { grid-template-columns: 1fr; gap: 2px; }
  .quick-metrics { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
