*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }

:root {
  --font-serif: Georgia, 'Times New Roman', Times, serif;
  --bg: #fdfdf9;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --border: #dddddd;
  --max-width: 760px;
}

[data-theme="dark"] {
  --bg: #16161a;
  --text: #e8e6e3;
  --text-secondary: #b0aea8;
  --border: #333333;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.2s ease, color 0.2s ease;
}

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

section {
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}

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

h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.entry { margin-bottom: 24px; }
.entry:last-child { margin-bottom: 0; }
.entry-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  font-weight: bold;
}
.entry-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
  margin: 2px 0 8px;
}
.entry ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.entry ul li { margin-bottom: 4px; }
.tags {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 2px 0 8px;
}

#navbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  font-weight: bold;
  text-decoration: none;
  margin-right: auto;
  font-size: 1.1rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-block;
  padding: 8px 14px;
  background: var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

.nav-link:hover { background: var(--text-secondary); color: var(--bg); }

.nav-link.active,
.nav-link.active:hover { background: var(--text); color: var(--bg); }

.theme-toggle, .nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 22px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 20px;
    gap: 12px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
}

.hero { padding-top: 60px; }

.hero-grid {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.hero-sidebar {
  flex: 0 0 220px;
  text-align: center;
}

.hero-bio { flex: 1; padding-top: 8px; }
.hero-bio p { margin: 0 0 16px; }
.hero-bio p:last-child { margin-bottom: 0; }

.profile-photo {
  width: 200px;
  height: auto;
  border-radius: 8px;
  margin: 0 auto 20px;
  border: 1px solid var(--border);
}

.hero h1 { font-size: 1.6rem; margin: 0 0 6px; }
.hero .title { margin: 0; color: var(--text-secondary); }
.hero .research-interests { margin: 4px 0 20px; font-style: italic; }

.social-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 700px) {
  .hero-grid { flex-direction: column; }
  .hero-sidebar { flex: none; width: 100%; }
}

.social-links a {
  display: inline-flex;
  align-items: center;
  color: var(--text);
}


footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px 60px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  section { padding: 40px 0; }
  .hero { padding-top: 30px; }
  .entry-header { flex-direction: column; gap: 2px; }
}
