/* ===== Theme tokens ===== */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --text: #1c1d1f;
  --text-muted: #6b7077;
  --accent: #b71c1c; /* al-folio-ish red */
  --border: #e7e8ea;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  --maxw: 920px;
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --bg-soft: #161922;
  --text: #e6e7e9;
  --text-muted: #9aa0a8;
  --accent: #ff6b6b;
  --border: #262b36;
  --card: #161922;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ===== Navbar ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: "Lora", serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
  color: var(--accent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
}
.theme-toggle:hover {
  color: var(--accent);
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  align-items: start;
  padding: 64px 0 48px;
}
.name {
  font-family: "Lora", serif;
  font-size: 2.8rem;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}
.tagline {
  font-size: 1.15rem;
  margin: 0 0 4px;
  color: var(--text);
  font-weight: 500;
}
.affiliation {
  color: var(--text-muted);
  margin: 0 0 18px;
  font-size: 0.98rem;
}
.social {
  display: flex;
  gap: 16px;
  font-size: 1.3rem;
  margin-bottom: 24px;
}
.social a {
  color: var(--text-muted);
  transition: color 0.15s ease, transform 0.15s ease;
}
.social a:hover {
  color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.bio p {
  margin: 0 0 14px;
}

.hero-photo {
  text-align: center;
}
.hero-photo img {
  width: 100%;
  border-radius: 14px;
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.photo-caption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-word;
}

/* ===== Sections ===== */
.section {
  padding: 36px 0;
  border-top: 1px solid var(--border);
}
.section-title {
  font-family: "Lora", serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 22px;
}
.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* News */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-list li {
  display: flex;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.news-list li:last-child {
  border-bottom: none;
}
.news-date {
  flex: 0 0 110px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}
.news-body {
  color: var(--text);
}

/* Publications */
.pub-list {
  margin: 0;
  padding-left: 20px;
}
.pub {
  margin-bottom: 22px;
}
.pub-title {
  font-weight: 600;
  font-size: 1.05rem;
}
.pub-authors {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.pub-venue {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.pub-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 2px;
}
.pub-links {
  margin-top: 6px;
  display: flex;
  gap: 10px;
}
.pub-links a {
  font-size: 0.82rem;
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 999px;
  color: var(--accent);
}
.pub-links a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
}
.card h3 {
  margin: 0 0 8px;
  font-family: "Lora", serif;
  font-size: 1.2rem;
}
.card p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.card-link {
  font-weight: 500;
  font-size: 0.9rem;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 0 32px;
  }
  .hero-photo {
    order: -1;
    max-width: 200px;
    margin: 0 auto;
  }
  .name {
    font-size: 2.2rem;
  }
  .nav-links {
    gap: 14px;
  }
  .nav-links a {
    font-size: 0.9rem;
  }
}
