/* ==========================================================================
   Jannik Zürn — personal site theme
   Light/dark theming via CSS custom properties on html[data-theme]
   ========================================================================== */

:root,
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --text: #1a1f24;
  --text-muted: #57606a;
  --accent: #0b6e6e;
  --accent-soft: #e0f0f0;
  --border: #d8dee4;
  --shadow: rgba(27, 31, 36, 0.08);
  --code-bg: #f6f8fa;
  --link: #0b6e6e;

  --syn-comment: #6e7781;
  --syn-keyword: #cf222e;
  --syn-string: #0a3069;
  --syn-number: #0550ae;
  --syn-func: #8250df;
  --syn-name: #1a1f24;
}

html[data-theme="dark"] {
  --bg: #0e1116;
  --bg-alt: #161b22;
  --text: #e6edf3;
  --text-muted: #9aa4af;
  --accent: #4dd4c2;
  --accent-soft: #11302d;
  --border: #2d333b;
  --shadow: rgba(0, 0, 0, 0.4);
  --code-bg: #161b22;
  --link: #4dd4c2;

  --syn-comment: #8b949e;
  --syn-keyword: #ff7b72;
  --syn-string: #a5d6ff;
  --syn-number: #79c0ff;
  --syn-func: #d2a8ff;
  --syn-name: #e6edf3;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

h1, h2, h3, h4 {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.1rem; }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.4rem;
  gap: 1rem;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.92rem;
  font-weight: 500;
  flex-wrap: wrap;
}

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

#theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }

/* --------------------------------------------------------------------------
   Hero (homepage)
   -------------------------------------------------------------------------- */

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 3rem 0 1rem;
}

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

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0.2rem 0 1rem;
}

.hero-photo img {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
}

.social-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.social-links a {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 2rem;
  color: var(--text-muted);
}
.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
  background: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   About / page prose
   -------------------------------------------------------------------------- */

.about-content,
.page-content,
.post-content {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.02rem;
}

.about-content h2,
.page-content h2,
.post-content h1,
.post-content h2 {
  font-family: "Inter", sans-serif;
}

.page-intro { color: var(--text-muted); margin-top: -0.3rem; }

/* --------------------------------------------------------------------------
   News
   -------------------------------------------------------------------------- */

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-list li {
  display: flex;
  gap: 1.2rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
}
.news-list li:last-child { border-bottom: none; }

.news-date {
  flex: 0 0 5.2rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding-top: 0.1rem;
}

/* --------------------------------------------------------------------------
   Publications
   -------------------------------------------------------------------------- */

.pub-year {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

.pub {
  display: flex;
  gap: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.pub:last-of-type { border-bottom: none; }

.pub-teaser {
  flex: 0 0 150px;
  align-self: flex-start;
}

.pub-teaser img {
  width: 150px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.pub-body { flex: 1; min-width: 0; }

.pub-title { font-weight: 650; font-size: 1.02rem; }

.pub-authors {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0.15rem 0;
}
.pub-authors .me { font-weight: 650; color: var(--text); }

.pub-venue {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
}
.pub-award { color: var(--accent); font-weight: 600; font-style: normal; }

.pub-links {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.pub-links a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.pub-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.bibtex {
  margin: 0.6rem 0 0;
  padding: 0.8rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  overflow-x: auto;
}

.more-link { font-weight: 600; }

/* --------------------------------------------------------------------------
   Blog list + posts
   -------------------------------------------------------------------------- */

.blog-year {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  display: flex;
  gap: 1.2rem;
  padding: 0.4rem 0;
}

.post-date {
  flex: 0 0 4rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}

.post-header { margin: 2.5rem 0 2rem; }
.post-header h1 { font-size: 1.9rem; }
.post-meta { color: var(--text-muted); font-size: 0.9rem; }

.post-content img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 1.2rem auto;
}

.post-content table { margin: 1.2rem auto; border-collapse: collapse; }
.post-content table td, .post-content table th { padding: 0.3rem 0.6rem; }

.post-content blockquote {
  margin: 1.2rem 0;
  padding: 0.2rem 1.2rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Code
   -------------------------------------------------------------------------- */

code, pre, .highlight {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

code {
  font-size: 0.85em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.55;
}

pre code { background: none; border: none; padding: 0; font-size: inherit; }

.highlight pre { margin: 0; }
.highlight { margin: 1.2rem 0; }

/* Pygments tokens (shared palette via vars) */
.highlight .c, .highlight .c1, .highlight .cm { color: var(--syn-comment); font-style: italic; }
.highlight .k, .highlight .kn, .highlight .kd, .highlight .kc, .highlight .ow { color: var(--syn-keyword); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd { color: var(--syn-string); }
.highlight .m, .highlight .mi, .highlight .mf { color: var(--syn-number); }
.highlight .nf, .highlight .fm, .highlight .nd { color: var(--syn-func); }
.highlight .n, .highlight .nn, .highlight .nb, .highlight .nc { color: var(--syn-name); }
.highlight .o, .highlight .p { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  html { font-size: 16px; }

  .hero {
    flex-direction: column-reverse;
    text-align: center;
    margin-top: 2rem;
  }
  .hero h1 { font-size: 1.9rem; }
  .social-links { justify-content: center; }

  .pub { flex-direction: column; gap: 0.7rem; }
  .pub-teaser { flex-basis: auto; }

  .nav { height: auto; padding: 0.6rem 0; flex-wrap: wrap; }
  .news-list li { flex-direction: column; gap: 0.1rem; }
}
