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

:root {
  --blue:        #003082;
  --blue-mid:    #1a4a9e;
  --blue-light:  #e8eef8;
  --blue-pale:   #f2f5fc;
  --accent:      #c8102e;
  --text:        #1a1a2e;
  --text-muted:  #5a6070;
  --border:      #d8dde8;
  --bg:          #f4f6fb;
  --white:       #ffffff;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 1px 6px rgba(0,48,130,0.09), 0 2px 14px rgba(0,48,130,0.07);
  --shadow-hover:0 4px 20px rgba(0,48,130,0.16);
  --nav-h:       60px;
  --max-w:       1060px;
  --trans:       0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
}

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

/* === Sticky Nav === */
#topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--blue);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.28);
}

#topnav .nav-brand {
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  margin-right: 28px;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

#topnav nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
#topnav nav::-webkit-scrollbar { display: none; }

#topnav nav a {
  color: rgba(255,255,255,0.72);
  font-size: 0.81rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--trans), color var(--trans);
  letter-spacing: 0.015em;
}
#topnav nav a:hover,
#topnav nav a.active {
  background: rgba(255,255,255,0.16);
  color: var(--white);
  text-decoration: none;
}

#nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
#nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--trans);
}

@media (max-width: 760px) {
  #nav-toggle { display: flex; }
  #topnav .nav-brand { margin-right: auto; }
  #topnav nav {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--blue);
    flex-direction: column;
    padding: 10px 16px 16px;
    gap: 2px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  }
  #topnav nav.open { display: flex; }
  #topnav nav a { font-size: 0.9rem; padding: 10px 12px; }
}

/* === Layout === */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px 80px;
}

section {
  padding-top: 64px;
}

/* === Section titles (top-level h2) === */
.section-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--blue);
  position: relative;
}

/* === Subsection titles (h3) === */
.subsection-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 36px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.subsection-title:first-child { margin-top: 0; }

/* === Section intro text === */
.section-intro {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* === Hero === */
#hero {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 40px;
  display: flex;
  align-items: flex-start;
  gap: 40px;
  margin-top: 36px;
}

#hero img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--blue-light);
  box-shadow: var(--shadow);
}

.hero-text h1 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.hero-title {
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3px;
}

.hero-inst {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.hero-bio {
  font-size: 0.93rem;
  line-height: 1.72;
  margin-bottom: 20px;
  max-width: 620px;
  color: var(--text);
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.hero-contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--blue-mid);
  background: var(--blue-pale);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--blue-light);
  transition: background var(--trans), border-color var(--trans);
}
.hero-contact a:hover { background: var(--blue-light); text-decoration: none; }

/* Stats bar */
.stats-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.stat-item {
  text-align: center;
  padding: 0 20px;
  border-right: 1px solid var(--border);
  flex: 1;
  min-width: 0;
}
.stat-item:first-child { padding-left: 0; }
.stat-item:last-child { border-right: none; padding-right: 0; }

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 3px;
}

@media (max-width: 620px) {
  #hero { flex-direction: column; align-items: center; padding: 28px 20px; gap: 20px; text-align: center; }
  .hero-contact { justify-content: center; }
  .stats-bar { flex-wrap: wrap; justify-content: center; gap: 16px; }
  .stat-item { border-right: none; padding: 0 8px; flex: 0 0 auto; }
  .hero-text h1 { font-size: 1.6rem; }
}

/* === Research tabs === */
.tab-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tab-btn {
  background: var(--white);
  border: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--trans);
}
.tab-btn.active,
.tab-btn:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.research-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 12px;
  border-left: 4px solid var(--blue);
  transition: box-shadow var(--trans);
}
.research-item.achievement { border-left-color: var(--accent); }
.research-item:hover { box-shadow: var(--shadow-hover); }

.research-item h4 {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 6px;
}

.research-item p {
  font-size: 0.87rem;
  color: var(--text);
  line-height: 1.65;
}

/* === Publications === */
.pub-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-bottom: 10px;
  transition: box-shadow var(--trans);
}
.pub-item:hover { box-shadow: var(--shadow-hover); }

.pub-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 6px;
}

.pub-year {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--white);
  background: var(--blue);
  padding: 2px 10px;
  border-radius: 10px;
  flex-shrink: 0;
}

.pub-journal {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--accent);
  font-style: italic;
  white-space: nowrap;
}

.pub-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.45;
}

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

/* === Projects accordion === */
.project-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  overflow: hidden;
}

.project-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.project-header:hover { background: var(--blue-pale); }

.project-period {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--white);
  background: var(--blue);
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.project-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.project-chevron {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: transform var(--trans);
  flex-shrink: 0;
}
.project-card.open .project-chevron { transform: rotate(180deg); }

.project-body {
  display: none;
  padding: 0 18px 16px;
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.project-card.open .project-body { display: block; }

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.project-tag {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--blue-light);
  color: var(--blue);
}

.project-role {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--blue);
  font-weight: 600;
}

/* === Patents === */
.patent-list { list-style: none; }

.patent-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 10px;
}

.patent-header {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 6px;
}

.patent-badge {
  background: var(--blue);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  white-space: nowrap;
}
.patent-badge.pending { background: var(--text-muted); }

.patent-number {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.patent-title {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.4;
}

.patent-authors {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.patent-note {
  font-size: 0.79rem;
  color: var(--text-muted);
  font-style: italic;
}

/* === Teaching === */
.course-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 12px;
}

.course-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 8px;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.badge {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--blue-light);
  color: var(--blue);
  padding: 3px 10px;
  border-radius: 10px;
}
.badge.accent { background: #fce8ec; color: var(--accent); }

.course-program {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.course-content {
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.6;
}

.advisory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.advisory-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: center;
}

.advisory-number {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

.advisory-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}
.advisory-label small { font-size: 0.72rem; }

/* === Two-column grid (awards, conf roles) === */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 680px) {
  .two-col-grid { grid-template-columns: 1fr 1fr; }
}

/* === Awards === */
.award-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
}

.award-year {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  background: var(--accent);
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 7px;
}

.award-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 4px;
}

.award-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* === Editorial === */
.editorial-roles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

.editorial-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.editorial-role {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.editorial-journal {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 4px;
}

.editorial-since {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.simple-list {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 24px 18px 40px;
  list-style: disc;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
}
.simple-list li { margin-bottom: 4px; }
.simple-list li:last-child { margin-bottom: 0; }

.talks-list { list-style: none; }

.talk-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 8px;
}

.talk-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 5px;
}

.talk-year {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--white);
  background: var(--blue);
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
}

.talk-event-short {
  font-size: 0.80rem;
  color: var(--text-muted);
  font-weight: 500;
}

.talk-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.4;
}

.talk-event {
  font-size: 0.80rem;
  color: var(--text-muted);
}

/* === Conference roles === */
.conf-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 8px;
}

.conf-type {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 9px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.conf-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.conf-desc {
  font-size: 0.80rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Footer === */
footer {
  background: var(--blue);
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 28px 20px;
  font-size: 0.85rem;
  margin-top: 80px;
}
footer a { color: rgba(255,255,255,0.85); }

/* === Utility === */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.93rem;
}
