:root {
  --bg: #121212;
  --text: #f1f1f1;
  --link: #888;
  --link-hover: #fff;
  --border: #333;
}

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

[data-theme="light"] {
  --bg: #f5f5f5;
  --text: #111111;
  --link: #555;
  --link-hover: #000;
  --border: #ccc;
}

body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a:hover {
  color: var(--link-hover);
}

.wrapper {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.navbar {
  background: var(--bg);
  padding: 1rem 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--text);
}

.nav-right,
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hamburger-btn,
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.hamburger-btn {
  display: none;
  color: var(--link);
  transition: color 0.2s;
}

.hamburger-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.hamburger-btn:hover {
  color: var(--link-hover);
}

.nav-links a {
  font-weight: 500;
  font-size: 1rem;
  color: var(--link);
}

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

.theme-toggle {
  display: flex;
  align-items: center;
}

.theme-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: var(--link);
  transition: fill 0.3s;
}

.theme-toggle:hover .theme-icon {
  fill: var(--link-hover);
}

.content {
  padding-top: 6rem;
  padding-bottom: 2rem;
  flex: 1 0 auto;
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  font-size: 0.875rem;
  color: var(--link);
}

.footer-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.footer-left {
  color: var(--text);
  font-weight: bold;
}

.footer-right {
  font-family: monospace;
  text-align: right;
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-contact a {
  display: flex;
  align-items: center;
}

.footer-contact svg {
  width: 1rem;
  height: 1rem;
}

/* shared secondary text size */
.project-stack, .project-award, .exp-org, .exp-dates,
.pub-venue, .pub-authors, .pub-footnote {
  font-size: 0.8rem;
}

/* projects */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 1rem;
}

.project-card img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.project-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.project-stack {
  color: var(--link);
}

.project-award,
.exp-org {
  color: var(--text);
}

.project-card p {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.project-links a,
.project-links-inline a {
  font-size: 0.85rem;
  text-decoration: underline;
}

/* list layout shared by projects, experience, publications */
.other-projects {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.other-projects li,
.pub-list li {
  margin-bottom: 1.25rem;
}

.other-projects li {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  gap: 1rem;
  margin-bottom: 0.1rem;
}

.project-name, .pub-title {
  color: var(--text);
  font-weight: 500;
}

.project-links-inline {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* tighten h3/h4 heading + list spacing */
h3, h4 {
  margin-bottom: 0.25rem;
}

h3 + ul, h4 + ul {
  margin-top: 0.25rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* experience */
.exp-dates {
  text-align: right;
  color: var(--text);
  flex-shrink: 0;
}

/* publications */
.pub-list {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.pub-list li {
  line-height: 1.5;
}

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

.pub-title a:hover {
  color: var(--link);
}

.pub-self {
  text-decoration: underline;
}

.pub-footnote {
  color: var(--link);
  margin-top: 0.5rem;
}

.pub-venue {
  color: var(--link);
  white-space: nowrap;
  flex-shrink: 0;
}

.pub-authors {
  color: var(--link);
}

/* Mobile */
@media (max-width: 600px) {

  .hamburger-btn {
    display: flex;
    align-items: center;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 3.5rem;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border);
    z-index: 999;
  }

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

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
