:root {
  --bg: #ffffff;
  --text: #000000;
  --link: #0000ee;
  --link-visited: #551a8b;
  --tag-bg: #007bff;
  --tag-text: #ffffff;
  --bibtex-bg: #f8f9fa;
  --bibtex-border: #dee2e6;
  --toggle-border: #d0d0d0;
  --toggle-bg: #ffffff;
  --toggle-hover-bg: #f0f0f0;
}

:root[data-theme="dark"] {
  --bg: #131313;
  --text: #e8e6e3;
  --link: #6ea8fe;
  --link-visited: #c9a3ff;
  --tag-bg: #2f6fd6;
  --tag-text: #ffffff;
  --bibtex-bg: #1c1c1c;
  --bibtex-border: #333333;
  --toggle-border: #3a3a3a;
  --toggle-bg: #1c1c1c;
  --toggle-hover-bg: #262626;
}

html {
  margin: 0;
  background: var(--bg);
}

body {
  margin: 0;
}

.app {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem;
  line-height: 1.5;
  font-family: Arial, Helvetica, sans-serif;
}

/* Theme toggle — sun/moon switch in the top-right corner */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--toggle-border);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--text);
  cursor: pointer;
  line-height: 0;
  z-index: 100;
}

.theme-toggle:hover {
  background: var(--toggle-hover-bg);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* Show the sun in dark mode (click to go light), the moon in light mode. */
.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.main {
  max-width: 980px;
}

.header {
  margin-bottom: 2rem;
  padding: 0;
}

.app h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.app h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.app h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.app p {
  margin: 0 0 0.5rem;
}

.app a {
  color: var(--link);
  text-decoration: underline;
}

.app a:visited {
  color: var(--link-visited);
}

.app ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0.5rem 0 0;
}

.app li {
  margin-bottom: 0.25rem;
}

.section {
  margin-bottom: 2rem;
}

.publication {
  margin-bottom: 2rem;
}

.publication-title {
  font-weight: bold;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.publication-authors {
  font-style: italic;
  margin: 0;
}

.publication-authors strong {
  font-weight: 700;
}

.publication-details {
  font-size: 0.9em;
  margin: 0;
}

.publication-tag {
  background-color: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.8em;
}

.bibtex-details {
  margin-top: 0.35rem;
}

.bibtex-toggle {
  font-size: 0.8em;
  cursor: pointer;
}

.bibtex-content {
  background-color: var(--bibtex-bg);
  border: 1px solid var(--bibtex-border);
  padding: 10px;
  margin-top: 10px;
  font-size: 0.8em;
}

.bibtex-content pre {
  margin: 0;
  white-space: pre-wrap;
}

.experience {
  margin-bottom: 2rem;
  border-radius: 5px;
}

.experience h3 {
  margin-top: 0;
  margin-bottom: 0.2rem;
}

.experience-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.experience-info p {
  margin: 0;
}

.experience ul {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2.5rem;
}

.experience li {
  margin-bottom: 0.2rem;
}

.project {
  margin-bottom: 0;
  padding-bottom: 1rem;
  border-radius: 5px;
}

.project h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.project-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.project-info p {
  margin: 0;
}

.project ul {
  margin-top: 10px;
  margin-bottom: 0;
  padding-left: 2.5rem;
}

.advisor {
  font-size: 0.9em;
  font-weight: normal;
}
