/* ============================================================
   Design tokens — edit these to re-theme the whole page
   ============================================================ */
:root {
  --accent: #2a6f97;          /* primary accent color */
  --accent-soft: #e6f0f5;     /* light accent background */
  --text: #1f2933;            /* main text */
  --text-muted: #5c6b7a;      /* secondary text */
  --surface: #ffffff;         /* card / page background */
  --bg: #fafbfc;              /* page background */
  --border: #e3e8ee;          /* hairlines */
  --maxw: 800px;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); }

/* ============================================================
   Hero / header
   ============================================================ */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 40px;
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.hero__avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 4px solid var(--accent-soft);
  background: var(--accent-soft);
}

.hero__text { min-width: 0; }

.hero__name {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.hero__role {
  margin: 4px 0 0;
  color: var(--accent);
  font-weight: 600;
}

.hero__bio {
  margin: 12px 0 18px;
  color: var(--text-muted);
  text-align: justify;
}

/* Social icons */
.social { display: flex; gap: 14px; }

.social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}

.social__link:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Email tooltip */
.social__email-wrap {
  position: relative;
  display: inline-flex;
}

.email-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scale(0.92);
  background: var(--text);
  color: #fff;
  font-size: 0.82rem;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 100;
}

.email-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}

.email-tooltip.is-visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

/* ============================================================
   Sticky section nav
   ============================================================ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.topnav__inner {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.topnav a {
  padding: 14px 12px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
}

.topnav a:hover { color: var(--text); }

.topnav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 64px;
}

.section:last-of-type { border-bottom: none; }

.section__title {
  margin: 0 0 20px;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

#about p { text-align: justify; }

.section__title::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 8px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================================================
   Timeline (experience + education)
   ============================================================ */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline__item {
  position: relative;
  padding: 0 0 24px 22px;
  border-left: 2px solid var(--border);
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}

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

.timeline__role { margin: 0; font-size: 1.1rem; }

.timeline__dates {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.timeline__org-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 10px;
}

.org-logo {
  height: 32px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
  background: transparent;
}

.timeline__org {
  color: var(--accent);
  font-weight: 500;
  margin: 0;
}

.timeline__points {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.timeline__note {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* ============================================================
   Projects
   ============================================================ */
.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.project-item {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.project-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(42, 111, 151, 0.1);
}

.project-item__title {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--text);
}

.project-item__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============================================================
   Publications
   ============================================================ */
.pub-scholar-note {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
}

.pub {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.pub--text { border-left: 3px solid var(--accent-soft); padding-left: 16px; }

.pub__thumb {
  width: 130px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--accent-soft);
}

.pub__body { min-width: 0; }

.pub__title { margin: 0 0 4px; font-size: 1.08rem; }

.pub__authors { margin: 0; color: var(--text); }

.pub__venue { margin: 2px 0 6px; color: var(--text-muted); font-style: italic; }

.pub__links { margin: 0; }

.pub__doi-link {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  display: inline-block;
}

.pub__doi-link:hover { text-decoration: underline; }

/* ============================================================
   Skills
   ============================================================ */
.skills { display: grid; gap: 18px; }

.skills__label {
  margin: 0 0 8px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 28px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  .hero { padding: 36px 0 28px; }
  .hero__inner { flex-direction: column; text-align: center; gap: 18px; }
  .social { justify-content: center; }
  .hero__name { font-size: 1.7rem; }
  .topnav__inner { justify-content: center; }
  .pub { flex-direction: column; }
  .pub__thumb { width: 100%; height: 160px; }
}

/* ============================================================
   Print — page doubles as a printable CV
   ============================================================ */
@media print {
  .topnav, .social { display: none; }
  body { background: #fff; font-size: 12pt; }
  .hero, .section { border: none; }
  a { color: var(--text); text-decoration: none; }
}
