/* ===== Professional page styles (Professional.html only) =====
   style.css still serves detail.html and the Personal pages. */

:root {
  --bg: #001a33;
  --bg-raised: #04223f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #F5F5F5;
  --text-muted: rgba(245, 245, 245, 0.70);
  --text-faint: rgba(245, 245, 245, 0.52);
  --accent: #6cb4ff;
  --accent-soft: rgba(108, 180, 255, 0.14);
  --accent-border: rgba(108, 180, 255, 0.38);
  --button-hover: #0059b3;
  --current: #7ee2b8;
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1080px;
  --nav-h: 60px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a, a:visited { color: inherit; }

a[x-apple-data-detectors] {
  color: inherit !important;
  text-decoration: none !important;
  font-weight: inherit !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 2000;
  background: var(--text);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ===== Page container (blurred when the mobile menu is open) ===== */
#page-container { transition: filter 0.3s ease; position: relative; z-index: 1; }
#page-container.blur { filter: blur(5px); }

/* ===== Navigation ===== */
.main-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  background-color: rgba(0, 26, 51, 0.88);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s ease-in-out;
}

.brand {
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-right { display: flex; gap: 4px; }

.nav-right .nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}

.nav-right .nav-link:hover { background-color: var(--surface-hover); color: var(--text); }
.nav-right .nav-link.active { color: var(--text); background-color: var(--accent-soft); }

body.nav-condensed .nav-right { display: none; }
body.nav-condensed .burger-menu { display: block; }

.nav-hide { transform: translateY(-150%); }

/* ===== Burger and mobile menu ===== */
.burger-menu {
  display: none;
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 1001;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 2px;
  transition: transform 0.3s ease-in-out;
}

.bar1, .bar2, .bar3 {
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background-color: var(--text);
  margin: 5px 0;
  transition: 0.4s;
}

.change .bar1 { transform: rotate(-45deg) translate(-7px, 6px); }
.change .bar2 { opacity: 0; }
.change .bar3 { transform: rotate(45deg) translate(-5px, -5px); }

.nav-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 0;
  overflow: hidden;
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 40px 0;
  background-color: #003366;
  border-radius: 15px 0 0 15px;
  transition: width 0.4s ease-out;
}

.nav-mobile-menu.show { width: 260px; }

.nav-mobile-menu .nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 12px 28px;
  font-size: 1.15rem;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.nav-mobile-menu .nav-link:hover { background-color: rgba(0, 0, 0, 0.15); }

/* ===== Layout ===== */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 24px;
}

.section + .section { border-top: 1px solid var(--border); }

.section-head { margin-bottom: 32px; }

.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.section-head p {
  margin-top: 10px;
  color: var(--text-muted);
  max-width: 64ch;
}

.subhead {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 40px 0 16px;
  color: var(--text);
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, background-color 0.2s;
}

.card:hover { border-color: var(--border-strong); }

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.text-link:visited { color: var(--accent); }
.text-link:hover { text-decoration: underline; }

/* ===== Hero ===== */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 72px) 24px 64px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  align-items: center;
}

.hero-photo img {
  width: 260px;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.hero-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px 5px 10px;
  margin-bottom: 18px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--current);
  box-shadow: 0 0 0 0 rgba(126, 226, 184, 0.6);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(126, 226, 184, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(126, 226, 184, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 226, 184, 0); }
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.btn-primary, .btn-primary:visited { background-color: var(--text); color: var(--bg); }
.btn-primary:hover { background-color: var(--button-hover); color: #FFFFFF; }

.btn-ghost, .btn-ghost:visited { color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background-color: var(--surface-hover); border-color: var(--text-faint); }

.hero-social { display: flex; gap: 4px; margin-left: 4px; }

.icon-link {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.icon-link:visited { color: var(--text-muted); }
.icon-link:hover { background-color: var(--surface-hover); color: var(--text); transform: translateY(-2px); }

.icon-inline { width: 20px; height: 20px; }

/* ===== News ===== */
.news-list { list-style: none; display: grid; gap: 2px; }

.news-list li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.news-list li:last-child { border-bottom: 0; }

.news-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.news-list p { color: var(--text-muted); }
.news-list strong { color: var(--text); font-weight: 600; }

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: start;
}

.about-text p { color: var(--text-muted); font-size: 1.05rem; }
.about-text p + p { margin-top: 16px; }
.about-text strong { color: var(--text); font-weight: 600; }

.facts { list-style: none; display: grid; gap: 16px; }
.facts li { display: grid; gap: 2px; }
.facts .label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.chip {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 3px 12px;
}

/* ===== Research ===== */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.research-card { display: flex; flex-direction: column; gap: 14px; }

.research-card h3 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.01em; }

.research-card p { color: var(--text-muted); font-size: 0.97rem; }

.stat {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-label { font-size: 0.88rem; color: var(--text-muted); line-height: 1.4; }

.research-card .tags { margin-top: auto; padding-top: 4px; font-size: 0.82rem; color: var(--text-faint); }

/* ===== Publications ===== */
.scholar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 8px 24px;
  padding: 20px 24px;
  margin-bottom: 40px;
}

.scholar-metric { display: grid; gap: 0; }
.scholar-metric .num {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.scholar-metric .lbl { font-size: 0.85rem; color: var(--text-muted); }

.scholar-footer { display: grid; justify-items: end; gap: 2px; font-size: 0.85rem; }
.scholar-updated { color: var(--text-faint); }

.pub-year {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 32px 0 12px;
}
.pub-year:first-of-type { margin-top: 0; }

.pub-list { list-style: none; display: grid; gap: 14px; }

.pub {
  padding: 20px 24px;
}

.pub-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.badge-peer { color: var(--current); border-color: rgba(126, 226, 184, 0.4); background: rgba(126, 226, 184, 0.08); }
.badge-journal { color: #ffd27a; border-color: rgba(255, 210, 122, 0.4); background: rgba(255, 210, 122, 0.08); }
.badge-preprint { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }

.pub h3 { font-size: 1.06rem; line-height: 1.4; font-weight: 650; letter-spacing: -0.005em; }

.pub-authors { margin-top: 6px; font-size: 0.92rem; color: var(--text-muted); }
.pub-authors .me { color: var(--text); font-weight: 600; }

.pub-venue { margin-top: 4px; font-size: 0.92rem; font-style: italic; color: var(--text-muted); }

.pub-note { margin-top: 4px; font-size: 0.85rem; color: var(--text-faint); }

.pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.pub-links a, .pub-links a:visited {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}
.pub-links a:hover { background-color: var(--accent-soft); color: var(--text); }

.talks { list-style: none; display: grid; gap: 12px; }
.talks li { display: grid; grid-template-columns: 96px 1fr; gap: 20px; color: var(--text-muted); }
.talks .when { font-size: 0.85rem; font-weight: 600; color: var(--text-faint); padding-top: 2px; }
.talks strong { color: var(--text); font-weight: 600; }

/* ===== Experience timeline ===== */
.timeline { list-style: none; position: relative; display: grid; gap: 20px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}

.tl-item { position: relative; padding-left: 36px; }

.tl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
}

.tl-item.current::before { border-color: var(--current); background: var(--current); box-shadow: 0 0 0 4px rgba(126, 226, 184, 0.15); }

.tl-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
}

.tl-head h3 { font-size: 1.1rem; letter-spacing: -0.01em; }

.tl-dates {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tl-org { color: var(--accent); font-weight: 500; font-size: 0.97rem; margin-top: 2px; }

.tl-item ul { margin: 12px 0 0 18px; display: grid; gap: 6px; color: var(--text-muted); font-size: 0.97rem; }
.tl-item li::marker { color: var(--text-faint); }

.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.compact h3 { font-size: 1rem; }
.compact .tl-org { font-size: 0.92rem; }
.compact p { margin-top: 8px; color: var(--text-muted); font-size: 0.93rem; }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill-group h3 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.skill-group p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Education ===== */
.edu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.edu h3 { font-size: 1.1rem; }
.edu .degree { color: var(--accent); font-weight: 500; margin-top: 2px; }
.edu .meta { margin-top: 10px; font-size: 0.88rem; color: var(--text-faint); font-weight: 600; }
.edu .thesis { margin-top: 10px; color: var(--text-muted); font-size: 0.95rem; }

/* ===== Contact ===== */
.contact { text-align: center; }
.contact .section-head p { margin-left: auto; margin-right: auto; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 28px 24px 40px;
  color: var(--text-faint);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ===== Reveal on scroll (only after script.js has set it up) ===== */
.reveal-ready .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-ready .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-ready .reveal { opacity: 1; transform: none; transition: none; }
  .pulse { animation: none; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .research-grid, .edu-grid, .compact-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .scholar-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scholar-footer { grid-column: 1 / -1; justify-items: start; }
}

@media (max-width: 720px) {
  .main-nav { padding: 0 16px; }
  .section { padding: 56px 16px; }
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: calc(var(--nav-h) + 40px) 16px 48px;
  }
  .hero-photo img { width: 140px; border-radius: 16px; }
  .skills-grid { grid-template-columns: 1fr; }
  .card, .pub { padding: 18px; }
  .news-list li, .talks li { grid-template-columns: 1fr; gap: 2px; }
  .stat { flex-direction: column; gap: 2px; }
  .scholar-metric .num { font-size: 1.5rem; }
}
