@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

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

:root {
  --bg: #FAF9F6;
  --text: #1a1a1a;
  --text-secondary: #555;
  --accent: #3a6b8a;
  --accent-hover: #2d5570;
  --border: #e8e5de;
  --max-width: 700px;
  --nav-height: 60px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* Particle background canvas */
#particle-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Navigation — semi-transparent over particles */
nav {
  position: sticky;
  top: 0;
  background: rgba(250, 249, 246, 0.85);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 0 2rem;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

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

.nav-name:hover {
  text-decoration: none;
}

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

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

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* Main content — card over particles */
main {
  flex: 1;
  max-width: var(--max-width);
  width: calc(100% - 2rem);
  margin: 1.5rem auto;
  padding: 3rem 2rem;
  background: var(--bg);
  border-radius: 6px;
  position: relative;
  z-index: 1;
}

/* Hero (home page) */
.hero {
  padding: 2rem 0 1rem;
}

.hero-photo {
  width: 160px;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1rem;
  margin-bottom: 1rem;
  max-width: 600px;
}

/* Social links (horizontal, icon + text) */
.social-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

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

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

.social-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Page headings */
h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.35rem;
}

p {
  margin-bottom: 0.85rem;
}

p:last-child {
  margin-bottom: 0;
}

/* Publications */
.publication {
  margin-bottom: 1.75rem;
}

.publication h3 {
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

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

.publication p:last-child {
  margin-bottom: 0;
}

/* Project sections (collaboration page) */
.project {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.project:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.project h2 {
  margin-top: 0;
}

.project .tech {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Project images */
.project-images {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.project-images img {
  flex: 1;
  min-width: 0;
  max-height: 300px;
  border-radius: 4px;
  object-fit: contain;
}

.project-images--wide {
  flex-direction: column;
  gap: 1rem;
  max-width: 70%;
}

.project-images--wide img {
  max-height: none;
  width: 100%;
}

/* PDF embed */
.pdf-embed {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 1rem;
}

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

.contact-page h1 {
  margin-bottom: 1rem;
}

.contact-email {
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

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

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

.contact-links svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* Button */
.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: #ccc;
  text-decoration: none;
}

/* Footer — solid over particles */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

/* Responsive */
@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(250, 249, 246, 0.92);
    flex-direction: column;
    padding: 1rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
  }

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

  main {
    padding: 2rem 1.5rem;
    margin: 1rem auto;
    width: calc(100% - 1.5rem);
    border-radius: 4px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  .social-links {
    flex-wrap: wrap;
  }

  .pdf-embed {
    height: 60vh;
  }
}
