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

/* Theme Variables */
:root {
  --bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e7eb;
  --card-bg: #f9fafb;
  --nav-bg: rgba(255, 255, 255, 0.9);
  --badge-bg: #e0e7ff;
  --badge-text: #3730a3;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --border: #21262d;
  --card-bg: #161b22;
  --nav-bg: rgba(13, 17, 23, 0.9);
  --badge-bg: #1c2f4a;
  --badge-text: #58a6ff;
}

/* Base */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s, color 0.2s;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* Nav */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

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

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
}

.hamburger svg {
  width: 24px;
  height: 24px;
}

/* Main */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-photo {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.hero-text h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.hero-text p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* About */
.about {
  margin-bottom: 2rem;
}

.about p {
  margin-bottom: 1rem;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-links a {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.social-links svg {
  width: 20px;
  height: 20px;
}

/* Publications */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  transition: background 0.2s, border-color 0.2s;
}

.pub-thumb {
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--border);
}

.pub-details h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.pub-details h3 a {
  color: var(--text);
}

.pub-details h3 a:hover {
  color: var(--accent);
}

.pub-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.pub-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: var(--badge-bg);
  color: var(--badge-text);
}

/* Blog placeholder */
.placeholder {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-secondary);
}

.placeholder h2 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Section heading */
.section-heading {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Mobile */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }

  .nav-links.open {
    display: flex;
  }

  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero-photo {
    width: 140px;
    height: 140px;
  }

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

  .pub-card {
    flex-direction: column;
  }

  .pub-thumb {
    width: 100%;
    height: 140px;
  }
}
