:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #1d4ed8;
  --border: #dbe3ee;
  --maxw: 1080px;
  --sidebar-w: 250px;
  --sidebar-offset: 3rem;
  --header-h: 65px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.site-sidebar {
  position: fixed;
  top: var(--header-h);
  left: var(--sidebar-offset);
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: var(--bg);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 4;
}

.headshot {
  width: 270px;
  height: 270px;
  border-radius: 12px;
  object-fit: cover;
}

.social-links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.social-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}

.social-link:hover,
.social-link:focus {
  color: var(--accent);
}

.social-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-block;
}

.page-shell { min-height: 100vh; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
}

.nav {
  max-width: none;
  margin: 0;
  min-height: var(--header-h);
  padding: 0.625rem calc(var(--sidebar-offset) + (var(--sidebar-w) / 2));
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  position: relative;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  position: absolute;
  left: calc(var(--sidebar-offset) + (var(--sidebar-w) / 2));
  transform: translateX(-50%);
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
  font-weight: 600;
}

nav a:hover,
nav a:focus {
  color: var(--accent);
}

main {
  max-width: var(--maxw);
  margin-left: calc(var(--sidebar-w) + var(--sidebar-offset) - 0.5rem);
  margin-right: 1.5rem;
  padding: 1.5rem 1.25rem 4rem;
}

.hero {
  max-width: 900px;
  padding: 0 2rem 1rem;
  margin-bottom: 0.1rem;
}

.section {
  max-width: 900px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.publications-hero {
  margin-bottom: 0;
}

h1, h2, h3 {
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: none;
}

.pub-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.muted {
  color: var(--muted);
}

footer {
  max-width: var(--maxw);
  margin-left: calc(var(--sidebar-w) + var(--sidebar-offset) - 0.5rem);
  margin-right: 1.5rem;
  padding: 0 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .site-sidebar {
    position: static;
    width: 100%;
    height: auto;
    left: 0;
    top: 0;
    padding: 1rem;
  }

  .nav {
    justify-content: center;
    padding: 0.625rem 1.25rem;
  }

  .brand {
    position: static;
    transform: none;
  }

  .social-links {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  main,
  footer {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 640px) {
  h1 { font-size: 1.9rem; }
  .hero, .section { padding: 1.4rem; }
  nav a { margin-left: 0.75rem; }
}
