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

:root {
  --nav-h: 62px;
  --bg: #f9f8f5;
  --surface: #ffffff;
  --border: #e4e1da;
  --text: #1c1c1e;
  --text-muted: #6b6b72;
  --accent: #2c5f8a;
  --accent-light: #d6e6f5;
  --granted: #1a6b3c;
  --granted-bg: #e6f4ed;
  --pending: #7a4f00;
  --pending-bg: #fdf3dc;
  --font-serif: 'Crimson Pro', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

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

/* ── Navbar ─────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.nav-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  text-decoration: none;
}
.nav-link.active {
  font-weight: 500;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* ── Sections ───────────────────────────────────────────────── */
#content {
  margin-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h) - 48px);
}

.page {
  display: none;
  padding: 3.5rem 2rem 5rem;
  max-width: 860px;
  margin: 0 auto;
}
.page.active { display: block; }

/* ── Home layout ─────────────────────────────────────────────── */
.home-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.avatar-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 160px;
}

.avatar-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
}

.avatar-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  border: 2px solid var(--border);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
  font-size: 0.8rem;
}
.contact-links a { color: var(--text-muted); }
.contact-links a:hover { color: var(--accent); }

/* ── Bio ─────────────────────────────────────────────────────── */
.bio-col h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.title-line {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

.bio {
  color: var(--text);
  font-size: 0.975rem;
  margin-bottom: 1rem;
}

.interests {
  margin-top: 1.8rem;
}
.interests h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.interests ul {
  list-style: none;
  padding: 0;
}
.interests ul li {
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent-light);
  margin-bottom: 0.4rem;
}

/* ── Page inner (Publications / Patents) ─────────────────────── */
.page-inner h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.section-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* ── Publications ─────────────────────────────────────────────── */
.pub-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  position: sticky;
  top: var(--nav-h);
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0 0;
  margin-bottom: 1.75rem;
}

.pub-subnav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0;
  margin-right: 1.5rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.pub-subnav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.pub-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: calc(var(--nav-h) + 4rem);
}

.pub-section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent-light);
}

.pub-year-group {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.pub-year-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.year-label {
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 48px;
  padding-top: 0.15rem;
}

.pub-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.pub-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

a.pub-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  text-decoration: none;
}
a.pub-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.cite-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  white-space: nowrap;
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.pub-venue {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pub-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.4rem;
}
.pub-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.2rem 0.65rem;
  border-radius: 3px;
  text-transform: uppercase;
}
.pub-links a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ── Patents ─────────────────────────────────────────────────── */
.patent-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.patent-item {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.patent-item:first-child { border-top: 1px solid var(--border); }

.patent-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.patent-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.patent-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.patent-status.granted {
  color: var(--granted);
  background: var(--granted-bg);
}
.patent-status.pending {
  color: var(--pending);
  background: var(--pending-bg);
}

.patent-number {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-family: var(--font-sans);
}

.patent-desc {
  font-size: 0.9rem;
  color: var(--text);
}

/* ── Experience timeline ─────────────────────────────────────── */
.timeline {
  margin-top: 2.2rem;
}

.timeline-heading {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.2rem;
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-item {
  position: relative;
  padding-left: 1.85rem;
  padding-bottom: 1.5rem;
}
.timeline-item:last-child {
  padding-bottom: 0;
}

/* connecting line from this dot to the next */
.timeline-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.55rem;
  bottom: -0.1rem;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg);
  z-index: 1;
}

.timeline-item.current .timeline-dot {
  background: var(--granted);
  animation: timeline-pulse 1.8s ease-in-out infinite;
}

@keyframes timeline-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(26, 107, 60, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(26, 107, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 107, 60, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-item.current .timeline-dot { animation: none; }
}

.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.timeline-employer {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.timeline-dates {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-role {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.05rem;
}

.timeline-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 0.1rem;
}

.timeline-sublist {
  list-style: disc;
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}
.timeline-sublist li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.15rem;
}
.timeline-sublist li:last-child {
  margin-bottom: 0;
}

/* ── Home timeline (enlarged: sole content on homepage) ──────── */
#home .timeline {
  margin-top: 2rem;
}
#home .timeline-item {
  padding-left: 2.2rem;
  padding-bottom: 2.1rem;
}
#home .timeline-dot {
  width: 15px;
  height: 15px;
  top: 0.5rem;
}
#home .timeline-item::before {
  left: 6.5px;
  top: 0.7rem;
}
#home .timeline-employer {
  font-size: 1.4rem;
}
#home .timeline-dates {
  font-size: 0.95rem;
}
#home .timeline-role {
  font-size: 0.95rem;
  margin-top: 0.15rem;
}
#home .timeline-desc {
  font-size: 0.92rem;
}
#home .timeline-sublist li {
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
}

/* ── Footer ─────────────────────────────────────────────────── */
#footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 620px) {
  .home-layout {
    flex-direction: column;
    align-items: center;
  }
  .avatar-col { width: auto; }
  .bio-col h1 { font-size: 1.9rem; }
  .pub-year-group { flex-direction: column; gap: 1rem; }
  .nav-name { display: none; }
}
