:root {
  --bg: #070b12;
  --bg-elev: #0d1420;
  --text: #e8edf5;
  --muted: #9fb0c7;
  --primary: #64a7ff;
  --primary-strong: #8ec2ff;
  --border: #203147;
  --max-width: 1160px;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html[data-theme='light'] {
  --bg: #f4f7fb;
  --bg-elev: #ffffff;
  --text: #1c2b3d;
  --muted: #5f6f84;
  --primary: #66adff;
  --primary-strong: #9bcbff;
  --border: #c8d2e2;
  --shadow: 0 14px 32px rgba(60, 76, 95, 0.16);
}
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
.container { width: min(100% - 2rem, var(--max-width)); margin-inline: auto; }
.section { padding: 3rem 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.logo { font-weight: 700; color: var(--text); }
.desktop-nav { display: none; }
.desktop-nav ul { display: flex; gap: 1rem; list-style: none; padding: 0; margin: 0; }
.desktop-nav a { color: var(--muted); font-size: 1.1rem; }
.desktop-nav a.active, .desktop-nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.language-switch {
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
}
.theme-toggle {
  position: relative;
  width: 92px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.58rem;
  cursor: pointer;
}
.theme-toggle[data-initialized='true'] {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.theme-toggle__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 8px 16px rgba(100, 167, 255, 0.34);
}
.theme-toggle[data-initialized='true'] .theme-toggle__thumb {
  transition: transform 180ms ease;
}
.theme-toggle__icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-flex;
  z-index: 1;
}
html[data-theme='light'] .theme-toggle--slider .theme-toggle__thumb {
  transform: translateX(46px);
}

.theme-toggle.theme-toggle--static .theme-toggle__thumb {
  opacity: 0;
  transform: none;
}
.theme-toggle.theme-toggle--static[data-initialized='true'] .theme-toggle__thumb {
  transition: none;
}
.theme-toggle.theme-toggle--static .theme-toggle__icon {
  color: var(--muted);
  border-radius: 999px;
  padding: 0.2rem;
  transition: color 180ms ease, opacity 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
html[data-theme='light'] .theme-toggle.theme-toggle--static {
  background: color-mix(in srgb, var(--primary) 20%, var(--bg-elev));
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
}
html[data-theme='light'] .theme-toggle.theme-toggle--static .theme-toggle__icon--sun {
  color: var(--primary-strong);
  opacity: 1;
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 55%, var(--border));
}
html[data-theme='light'] .theme-toggle.theme-toggle--static .theme-toggle__icon--moon {
  opacity: 0.45;
}
html:not([data-theme='light']) .theme-toggle.theme-toggle--static .theme-toggle__icon--moon {
  color: var(--text);
  opacity: 1;
  background: color-mix(in srgb, var(--text) 14%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 40%, var(--border));
}
html:not([data-theme='light']) .theme-toggle.theme-toggle--static .theme-toggle__icon--sun {
  opacity: 0.45;
}
html[data-theme='light'] .theme-toggle--slider .theme-toggle__icon--sun,
html:not([data-theme='light']) .theme-toggle--slider .theme-toggle__icon--moon {
  color: #ffffff;
}
.menu-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.menu-toggle span { display: block; width: 18px; height: 2px; margin: 0 auto; background: var(--text); }
.mobile-nav { border-top: 1px solid var(--border); background: var(--bg-elev); }
.mobile-nav ul { list-style: none; margin: 0; padding: 0.75rem 1rem 1rem; }
.mobile-nav a { display: block; padding: 0.6rem 0; color: var(--text); font-size: 1.1rem; }

.hero {
  min-height: 72vh;
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image-wrap {
  position: absolute;
  inset: 0;
  margin: 0;
}
.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5, 8, 14, 0.2), rgba(7, 11, 18, 0.76) 72%, var(--bg));
}
.hero-vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 220px rgba(0, 0, 0, 0.52);
}
.hero-content { position: relative; z-index: 2; padding-block: 6rem 4rem; max-width: 760px; }
.hero-eyebrow { color: var(--primary-strong); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; }
.hero h1 { margin: 0.2rem 0 1rem; font-size: clamp(1.9rem, 5vw, 3.4rem); line-height: 1.1; color: color-mix(in srgb, var(--text) 78%, var(--primary-strong)); }
.hero-subtitle { color: var(--muted); max-width: 62ch; }

html[data-theme='light'] .hero h1 {
  color: color-mix(in srgb, #ffffff 86%, var(--primary-strong));
  text-shadow: 0 2px 16px rgba(9, 18, 30, 0.38);
}
html[data-theme='light'] .hero-eyebrow {
  color: color-mix(in srgb, #ffffff 78%, var(--primary-strong));
  text-shadow: 0 1px 10px rgba(9, 18, 30, 0.34);
}
html[data-theme='light'] .hero-subtitle {
  color: color-mix(in srgb, #ffffff 72%, #d7e8ff);
  text-shadow: 0 1px 10px rgba(9, 18, 30, 0.3);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.button { border: 1px solid var(--border); border-radius: 999px; padding: 0.55rem 1rem; font-weight: 600; }
.button-primary { background: var(--primary); color: #04101f; border-color: transparent; }
.button-secondary { color: var(--text); }

.publications-list { display: grid; gap: 1.25rem; }
.pub-block { display: grid; gap: 1rem; }
.pub-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  padding: 1rem;
}
.pub-item.highlight { border-color: var(--primary); box-shadow: var(--shadow); }
.pub-item h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.pub-item p { margin: 0.2rem 0; color: var(--muted); }
.pub-doi { font-family: ui-monospace, Menlo, monospace; font-size: 0.82rem; }
.pub-figure { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-bottom: 0.75rem; }
details { margin-top: 0.6rem; }
summary { cursor: pointer; color: var(--text); }

.data-code-block { margin-top: 1.5rem; }
.data-code-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.data-code-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  padding: 0.9rem 1rem;
}
.data-code-item h3 { margin: 0; font-size: 1rem; }
.data-code-meta { margin: 0.35rem 0 0; color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem 0; color: var(--muted); font-size: 0.9rem; }

@media (min-width: 900px) {
  .desktop-nav { display: block; }
  .menu-toggle, .mobile-nav { display: none !important; }
}
