/* Theme variables */
:root {
  --accent: #c05a2c;
  --accent-light: #e8734a;
  --bg: #fafaf9;
  --bg-card: #ffffff;
  --bg-nav: rgba(250, 250, 249, 0.9);
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --border: #e8e5e0;
  --border-light: #f0ede8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --accent: #e8734a;
  --accent-light: #f09070;
  --bg: #1a1a1a;
  --bg-card: #242424;
  --bg-nav: rgba(26, 26, 26, 0.9);
  --text: #e8e5e0;
  --text-secondary: #b0aca6;
  --text-muted: #787470;
  --border: #333;
  --border-light: #2a2a2a;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: var(--bg);
  transition: background 0.3s, color 0.3s;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Nav */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}

.nav-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-name:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-links a {
  margin-left: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

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

.nav-links a:hover::after {
  width: 100%;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  margin-left: 1.2rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

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

/* Main */
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 5rem 1.5rem 2rem;
}

/* Fade-in animation */
section {
  margin-bottom: 3.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border-light);
  color: var(--text);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.8rem 0 0.8rem;
  color: var(--text);
}

/* About / Profile */
.about {
  margin-top: 1rem;
}

.profile {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.profile-photo img {
  width: 180px;
  height: 180px;
  border-radius: 42% 58% 52% 48% / 46% 52% 48% 54%;
  object-fit: cover;
  transition: border-radius 0.5s ease;
  box-shadow: var(--shadow-hover);
}

.profile-photo img:hover {
  border-radius: 50%;
}

.photo-placeholder {
  width: 180px;
  height: 180px;
  border-radius: 42% 58% 52% 48% / 46% 52% 48% 54%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-hover);
}

.profile-info h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.affiliation {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.25s;
}

.contact-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.contact-links svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.bio {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.bio p {
  margin-bottom: 0.6rem;
}

/* News */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.news-item {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.news-item:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.news-date {
  flex-shrink: 0;
  width: 90px;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}

.news-text {
  color: var(--text-secondary);
}

/* Publications */
.pub-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.pub-list {
  list-style: none;
  padding-left: 0;
  counter-reset: pub-counter 12;
}

.pub-list li {
  counter-increment: pub-counter -1;
  margin-bottom: 0.5rem;
}

.pub-entry {
  padding: 1rem 1.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.25s;
  position: relative;
}

.pub-entry::before {
  content: counter(pub-counter);
  position: absolute;
  left: -2rem;
  top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pub-entry:hover {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.pub-title {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

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

.pub-venue {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.pub-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 12px;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.pub-badge.journal {
  background: rgba(192, 90, 44, 0.12);
  color: var(--accent);
}

.pub-badge.preprint {
  background: rgba(100, 100, 100, 0.1);
  color: var(--text-muted);
}

.pub-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.pub-links a {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.pub-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* CV */
.cv-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cv-item {
  display: flex;
  gap: 1.5rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.cv-item:hover {
  background: var(--bg-card);
}

.cv-left {
  flex-shrink: 0;
  width: 140px;
}

.cv-year {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cv-right {
  flex: 1;
}

.cv-title {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
}

.cv-detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Footer */
footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: border-color 0.3s;
}

/* Mobile */
@media (max-width: 640px) {
  .profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .contact-links {
    justify-content: center;
  }

  .profile-info h1 {
    font-size: 1.5rem;
  }

  .news-item {
    flex-direction: column;
    gap: 0.1rem;
  }

  .news-date {
    width: auto;
  }

  .cv-item {
    flex-direction: column;
    gap: 0.2rem;
  }

  .cv-left {
    width: auto;
  }

  .nav-links a {
    margin-left: 0.8rem;
    font-size: 0.85rem;
  }

  .pub-entry::before {
    display: none;
  }

  .pub-list {
    padding-left: 0;
  }

  .pub-entry {
    padding: 0.8rem;
  }
}
