:root {
  /* Modern Clean Palette */
  --bg-body: #ffffff;
  --bg-sidebar: #f9fafb;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  
  --accent-primary: #2563eb; /* Royal Blue */
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --sidebar-width: 280px;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

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

/* Layout */
.layout-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling Updates */
#sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(to bottom, #ffffff, #f9fafb);
  border-right: 1px solid var(--border-color);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding: 2.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 1px 0 4px rgba(0, 0, 0, 0.02);
}

#sidebar .logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

#sidebar .logo img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

#sidebar .logo span {
  font-family: var(--font-display, var(--font-sans)); /* Fallback to sans */
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Navigation */
.top-level-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.top-level-menu > li > a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.top-level-menu > li > a:hover {
  background-color: white;
  color: var(--accent-primary);
  transform: translateX(4px);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.top-level-menu > li > a.active-post {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  border-color: rgba(37, 99, 235, 0.1);
}

/* Section Headers (Papers, etc) */
.menu-item-link.no-nav {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

/* Submenu / Papers Tree */
.submenu {
  list-style: none;
  padding-left: 0;
  margin: 0;
  border-left: 2px solid #f3f4f6; /* Softer guide line */
  margin-left: 0.75rem;
}

/* Conference Group Highlight */
.submenu > li {
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem; /* Add breathing room */
}

.submenu > li:hover {
    background-color: rgba(243, 244, 246, 0.6); /* Very subtle gray highlight */
}

/* Ensure the header text gets a bit darker/stronger on group hover */
.submenu > li:hover .menu-item-link.no-nav {
    color: var(--text-primary);
}

.submenu .menu-item-link.no-nav {
    /* Sub-headers like 'EMNLP 2024' */
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.85rem;
    padding-left: 1rem;
    transition: color 0.2s ease;
}

.post-item .menu-item-link {
  display: flex;
  flex-direction: column; /* Stack title and workshop */
  gap: 0.1rem;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  line-height: 1.4;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.post-item .menu-item-link:hover {
  color: var(--accent-primary);
  background-color: white;
  transform: translateX(4px);
  border-left-color: var(--accent-primary); /* Left accent on hover */
  box-shadow: var(--shadow-sm);
}

.post-item .menu-item-link .paper-title {
  font-weight: 500;
}

.post-item .menu-item-link .workshop {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* Active State for Posts */
.post-item .menu-item-link.active-post {
    background-color: white;
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Main Content */
#content {
  flex: 1;
  padding: 3rem 4rem;
  max-width: 1000px; /* Optimal reading width + padding */
  margin: 0 auto;
}

/* Content Typography & Elements */
#content h1, #content h2, #content h3 {
  color: var(--text-primary);
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

#content h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.025em; margin-top: 0; }
#content h2 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.025em; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
#content h3 { font-size: 1.4rem; font-weight: 600; }

#content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

#content a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

#content a:hover {
  text-decoration: underline;
}

#content ul, #content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

#content li {
  margin-bottom: 0.5rem;
}

#content blockquote {
  border-left: 4px solid var(--accent-primary);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background-color: var(--bg-sidebar);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-primary);
}

#content pre {
  background-color: #1e293b; /* Dark slate */
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin: 1.5rem 0;
}

#content code {
  font-family: var(--font-mono);
  background-color: var(--bg-sidebar);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent-primary);
}

#content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

/* Home Page specific */
.home-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

section.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(to bottom right, #f0f9ff, #e0f2fe); /* Subtle blue gradient */
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

section.hero h2 {
  font-size: 2.25rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  border-bottom: none !important;
}

section.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 9999px;
  background-color: var(--accent-primary);
  color: white !important;
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  border: none;
  cursor: pointer;
}

.button:hover, button:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.1);
}

/* Cards (Teaching, Collaborators) */
.teaching-grid, .collaborator-grid, .advisor-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.teaching-card, .collaborator-card, .advisor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.teaching-card:hover, .collaborator-card:hover, .advisor-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.teaching-card img {
  border-radius: var(--radius-md);
  width: 100%;
  height: auto;
}

.collaborator-card img, .advisor-card img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto;
  object-fit: cover;
}

.card-link {
  text-align: center;
}

.card-link h3 {
  margin: 0.5rem 0 0.25rem 0 !important;
  font-size: 1.1rem !important;
}

.card-link p {
  font-size: 0.9rem !important;
  color: var(--text-tertiary) !important;
  margin-bottom: 0 !important;
}

/* About Section */
.about-card {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.headshot {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin: 1.5rem auto;
  border: 4px solid white;
  box-shadow: var(--shadow-md);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--accent-primary) !important;
  font-weight: 500;
  margin-top: -0.5rem;
}

/* Contact Form */
.contact-form {
  display: grid;
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-field input, .form-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.form-field input:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Responsive */
@media (max-width: 1024px) {
  .layout-container {
    flex-direction: column;
  }
  
  #sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  #content {
    padding: 2rem;
  }
}

@media (max-width: 640px) {
  #content {
    padding: 1.5rem 1rem;
  }
  
  section.hero {
    padding: 2rem 1rem;
  }
  
  .teaching-grid, .collaborator-grid {
    grid-template-columns: 1fr;
  }
}