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

:root {
  --bg:          #ffffff;
  --bg-alt:      #f7f7f5;
  --surface:     #ffffff;
  --border:      #e5e5e3;
  --text:        #1a1a1a;
  --text-muted:  #6b6b6b;
  --accent:      #2563eb;
  --accent-soft: #dbeafe;
  --accent-dark: #1d4ed8;
  --radius:      10px;
  --nav-h:       60px;
  --transition:  200ms ease;
}

[data-theme="dark"] {
  --bg:          #0f0f0f;
  --bg-alt:      #161616;
  --surface:     #1c1c1c;
  --border:      #2e2e2e;
  --text:        #f0f0f0;
  --text-muted:  #888888;
  --accent:      #3b82f6;
  --accent-soft: #1e3a5f;
  --accent-dark: #60a5fa;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

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

/* ── Nav ──────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

#navbar.scrolled { box-shadow: 0 1px 16px rgba(0,0,0,.08); }

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-name {
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-name:hover { color: var(--accent); text-decoration: none; }

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

.nav-links a {
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); text-decoration: none; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .35rem .45rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon,
:not([data-theme]) .icon-moon { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 4rem) 2rem 4rem;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  opacity: .4;
  pointer-events: none;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

.hero-label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}

.hero h1 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: .75rem;
  color: var(--text);
}

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

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.hero-bio {
  font-size: .97rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: .6rem 1.4rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* Canvas sphere */
.hero-visual { flex-shrink: 0; }
#sphereCanvas { width: 240px; height: 240px; display: block; }

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(5px); }
}

/* ── Sections ─────────────────────────────────────────────── */
.section       { padding: 5rem 2rem; background: var(--bg); }
.section-alt   { background: var(--bg-alt); }

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 500;
  margin-bottom: 2.5rem;
  color: var(--text);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 2.5rem;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── About ────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-bio p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.about-bio strong { color: var(--text); }

.about-cards { display: flex; flex-direction: column; gap: 1rem; }

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.info-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.info-card-icon { font-size: 1.4rem; flex-shrink: 0; }

.info-card strong {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

.info-card ul { list-style: none; }
.info-card li {
  font-size: .875rem;
  color: var(--text-muted);
  padding: .15rem 0;
}
.info-card p { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }

/* ── Research ─────────────────────────────────────────────── */
.research-para {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.85;
  max-width: 780px;
}

/* theme-card styles removed */

/* ── Publications ─────────────────────────────────────────── */
.pub-filter {
  display: flex;
  gap: .5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: .4rem 1rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pub-group { margin-bottom: 2.5rem; }

.pub-group-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.pub-item {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border);
  transition: opacity var(--transition);
}

.pub-item.hidden { display: none; }

.pub-year {
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: .15rem;
}

.pub-title {
  font-weight: 500;
  font-size: .95rem;
  color: var(--text);
  margin-bottom: .3rem;
  line-height: 1.55;
}

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

/* journal & badge sit inline inside .pub-title */
.pub-journal {
  font-size: .82rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: .35rem;
}

.pub-badge {
  display: inline-block;
  vertical-align: middle;
  font-size: .67rem;
  font-weight: 600;
  padding: .12rem .5rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-left: .4rem;
  position: relative;
  top: -1px;
}

.pub-badge.submitted { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .pub-badge.submitted { background: #422006; color: #fde68a; }

/* ── Talks ────────────────────────────────────────────────── */
.talks-grid { display: flex; flex-direction: column; gap: 0; }

.talk-item {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}

.talk-year {
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: .1rem;
}

.talk-title {
  font-weight: 500;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: .2rem;
}

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

/* ── Teaching ─────────────────────────────────────────────── */
.teaching-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 2.5rem;
}

.teaching-item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}

.teaching-year {
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: .1rem;
}

.teaching-title {
  font-weight: 500;
  font-size: .95rem;
  color: var(--text);
  margin-bottom: .2rem;
}

.teaching-meta {
  font-size: .85rem;
  color: var(--text-muted);
}

.students-block h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .75rem;
  color: var(--text);
}

.students-block ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.students-block li { font-size: .875rem; color: var(--text-muted); }

/* ── Contact ──────────────────────────────────────────────── */
.contact-container { text-align: center; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 680px;
  margin: 0 auto;
}

.contact-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .9rem;
  color: var(--text-muted);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-item svg { color: var(--accent); flex-shrink: 0; }
.contact-item a { color: var(--text-muted); }
.contact-item a:hover { color: var(--accent); text-decoration: none; }

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

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-visual  { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .nav-links    { gap: 1rem; }
}

@media (max-width: 640px) {
  .themes-grid    { grid-template-columns: 1fr; }
  .nav-links      { display: none; }
  .pub-item       { grid-template-columns: 1fr; }
  .teaching-item  { grid-template-columns: 1fr; }
  .pub-year, .teaching-year { font-size: .75rem; }
}

/* ── Scroll-reveal ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
