/* ─── Design Tokens ─── */
:root {
  --bg: #F6FAFB;
  --bg-alt: #EBF4F6;
  --text: #0C1E26;
  --text-muted: #4A7A85;
  --accent: #088395;
  --accent-hover: #09637E;
  --card-bg: #FFFFFF;
  --card-border: #D4E8EC;
  --shadow: 0 2px 12px rgba(9, 99, 126, 0.06);
  --shadow-lg: 0 8px 32px rgba(9, 99, 126, 0.1);
  --nav-bg: rgba(246, 250, 251, 0.85);
  --radius: 12px;
  --radius-sm: 8px;
  --font-heading: 'Source Serif 4', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #091A21;
  --bg-alt: #0E2730;
  --text: #E2EEF1;
  --text-muted: #7AB2B2;
  --accent: #7AB2B2;
  --accent-hover: #9DCACA;
  --card-bg: #112E38;
  --card-border: #1C4050;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(9, 26, 33, 0.85);
}

/* ─── Language Toggle ─── */
[data-lang="en"] [lang="de"] { display: none; }
[data-lang="de"] [lang="en"] { display: none; }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

/* ─── Layout ─── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 32px;
  color: var(--text);
}

/* ─── Nav ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--card-border);
  box-shadow: var(--shadow);
}

.nav-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}
.nav-name:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* ─── Hamburger ─── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Theme Toggle ─── */
.theme-toggle {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

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

/* ─── Language Toggle ─── */
.lang-toggle {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: border-color 0.2s;
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-sep { opacity: 0.3; }

[data-lang="en"] .lang-option[data-for="en"],
[data-lang="de"] .lang-option[data-for="de"] {
  color: var(--accent);
}

/* ─── Hero ─── */
.hero {
  padding: 120px 0 48px;
  text-align: center;
}

.hero-content { max-width: 600px; margin: 0 auto; }

.hero-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}

.hero-affiliation {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ─── About ─── */
.about-text p {
  margin-bottom: 16px;
  color: var(--text);
}
.about-text p:last-child { margin-bottom: 24px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

/* ─── Publications ─── */
.pub-list {
  list-style: none;
  margin-bottom: 24px;
}

.pub {
  padding: 16px 0;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pub:last-child { border-bottom: none; }

.pub-title {
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.scholar-link {
  font-weight: 500;
  font-size: 0.95rem;
}

/* ─── Projects ─── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  color: var(--text);
}
.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--text);
}

.project-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.project-tags span {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ─── Contact ─── */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 500;
  transition: color 0.2s;
}
.contact-item:hover { color: var(--accent); }
.contact-item svg { flex-shrink: 0; }

/* ─── Footer ─── */
.footer {
  padding: 32px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-legal {
  margin-top: 8px;
}

.footer-legal a {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.footer-legal a:hover { color: var(--accent); }

.footer-sep {
  margin: 0 6px;
  opacity: 0.4;
}

/* ─── Legal Pages ─── */
.legal-page {
  padding: 120px 0 80px;
}

.legal-page h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-page h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-page p {
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.7;
}

.legal-page ul {
  margin-bottom: 12px;
  padding-left: 24px;
  color: var(--text);
}

.legal-page li {
  margin-bottom: 4px;
}

.legal-page .back-link {
  margin-top: 40px;
  font-weight: 500;
}

/* ─── Fade-in Animation ─── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 32px 32px;
    gap: 20px;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open { right: 0; }

  .nav-links a { font-size: 1rem; }

  .hero h1 { font-size: 1.35rem; }
  .hero { padding: 100px 0 40px; }

  .section { padding: 60px 0; }

  .project-grid { grid-template-columns: 1fr; }

  h2 { font-size: 1.5rem; }
}
