:root {
  --bg-color: #F7F7F8; /* Off-white background */
  --bg-gradient: linear-gradient(135deg, #F7F7F8 0%, #f0f9ff 100%); /* Subtle gradient from new bg */
  --card-bg: rgba(255, 255, 255, 0.9); /* Slightly transparent white for cards */
  --text-color: #111; /* New primary text color */
  --text-dim: #777; /* New secondary text color */
  --accent-color: #4F6EF7; /* New accent blue */
  --accent-hover: #829eff; /* Lighter shade for hover */
  --accent-gradient: linear-gradient(to right, #4F6EF7, #829eff); /* New accent gradient */
  --border-color: #ECECEC; /* New subtle border color */
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #F7F7F8;
    --bg-gradient: linear-gradient(135deg, #F7F7F8 0%, #f0f9ff 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-color: #111;
    --text-dim: #777;
    --accent-color: #4F6EF7;
    --accent-hover: #829eff;
    --accent-gradient: linear-gradient(to right, #4F6EF7, #829eff);
    --border-color: #ECECEC;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 300;
  background: var(--bg-color); /* Use the new background color variable */
  background-attachment: fixed;
  color: var(--text-color);
  line-height: 1.6;
  padding: 4rem 2rem; /* Increased top padding for section spacing */
  max-width: 1000px;
  margin: 0 auto;
  min-height: 100vh;
}

header {
  margin-bottom: 4rem; /* Reduced from 8rem */
  border-bottom: none; 
  padding-bottom: 0; 
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-profile {
  display: flex;
  align-items: center; 
  gap: 1.5rem; 
  flex-direction: row; 
}

.profile-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

h1 { 
  font-size: 48px; /* Reduced from 56px */
  font-weight: 500; 
  letter-spacing: -0.01em; 
  color: var(--text-color); 
  margin-bottom: -0.5rem; 
}

h1 + p {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 300;
  margin-top: -0.5rem; 
  margin-bottom: 1.5rem; 
}

h2 { 
  font-size: 1.8rem; /* Reduced from 2rem */
  font-weight: 500; 
  letter-spacing: -0.01em; 
  margin-top: 3rem; /* Reduced from 5rem */
  margin-bottom: 1rem; /* Reduced from 2rem */
  color: var(--text-color);
  border-left: 6px solid var(--accent-color);
  padding-left: 1rem;
}

p { margin-bottom: 1rem; color: var(--text-dim); font-weight: 300; }

nav a {
  color: var(--text-dim); /* Secondary text color */
  font-weight: 400; /* Lighter weight */
  font-size: 0.9rem; /* Keep size */
  text-transform: none; /* Remove uppercase */
  padding: 0; /* Remove padding */
  border: none; /* Remove border */
  margin-left: 0; /* Remove left margin */
  margin-right: 1.5rem; /* Add right margin for spacing */
  transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out; /* For fade-in underline */
  border-bottom: 1px solid transparent; /* For underline effect */
}

nav a:hover { 
  color: var(--accent-color); 
  border-bottom-color: var(--accent-color); /* Underline appears on hover */
}

/* Styles for Publications List */
.publication-list {
  margin-top: 3rem; /* Space above the list */
}

.publication-item {
  margin-bottom: 2rem; /* Spacing between papers */
  padding-bottom: 2rem; /* Padding below each item */
  border-bottom: 1px solid var(--border-color); /* Subtle separator */
}

.publication-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.publication-title {
  font-weight: 500;
  color: var(--text-color);
  font-size: 1.3rem;
  margin-bottom: 0.5rem; /* Space between title and meta */
}

.publication-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem; /* Space between meta and links */
}

.publication-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.publication-link {
  font-weight: 300;
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
  border-bottom: 1px solid transparent;
}

.publication-link:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

.card {
  background: var(--card-bg);
  padding: 2rem; /* Generous padding as requested */
  border-radius: 8px; /* Max 8px radius */
  border: 1px solid var(--border-color); /* Subtle border */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Keep transition for smooth effects */
  position: relative;
  overflow: hidden;
  box-shadow: none; /* Remove default shadow */
}

.card::before { /* Keep accent line, but ensure it uses updated accent color */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient); /* Updated accent gradient */
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  transform: none; /* Remove transform */
  box-shadow: none; /* Remove box-shadow */
  border-color: var(--accent-color); /* Use updated accent color for border */
}

.card h3 { 
  color: var(--accent-color); 
  margin-bottom: 0.75rem; 
  font-size: 1.5rem;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.card p { font-size: 0.95rem; color: var(--text-dim); flex-grow: 1; }

.card-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.card-links a {
  display: inline-block;
  margin-top: 0;
  padding: 0.6rem 1.2rem;
  background: var(--accent-gradient);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 0.85rem;
  flex: 1;
  text-align: center;
  min-width: 120px;
}

.card-links a.secondary {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}

.card-links a:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.card-links a.secondary:hover {
  background: var(--accent-color);
  color: white;
}

.cta-container {
  text-align: center;
  margin: 4rem 0;
  padding: 3rem;
  background: var(--card-bg);
  border-radius: 20px;
  border: 2px dashed var(--border-color);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--accent-color); /* Changed from gradient to solid accent color */
  color: white !important;
  font-weight: 500; /* Adjusted weight for consistency */
  text-transform: none; /* Removed uppercase */
  letter-spacing: normal; /* Removed letter spacing */
  border-radius: 8px; /* Reduced radius for subtlety */
  transition: background-color 0.3s ease, box-shadow 0.3s ease; /* Simplified transition */
  box-shadow: 0 5px 10px rgba(79, 110, 247, 0.3); /* Softened shadow with accent color */
}

.cta-button:hover {
  text-decoration: none !important;
  background-color: var(--accent-hover); /* Use hover accent color */
  box-shadow: 0 8px 15px rgba(79, 110, 247, 0.4); /* Slightly stronger shadow on hover */
}

footer {
  margin-top: 6rem;
  padding: 4rem 0;
  border-top: 2px solid var(--border-color);
  color: var(--text-dim);
}

.footer-section h4 {
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  font-weight: 800;
}

.footer-grid {
  display: flex; /* Changed to flex for simpler row layout */
  justify-content: space-between; /* Space out items */
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 2rem; /* Add gap for spacing when wrapping */
}

.footer-section ul {
  list-style: none;
  padding: 0; /* Remove default padding */
  margin: 0; /* Remove default margin */
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  opacity: 0.7;
}

a { color: var(--accent-color); text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--accent-hover); }

/* Responsive adjustments */
@media (max-width: 768px) {
  body { padding: 2rem 1.25rem; }
  header { 
    margin-bottom: 3rem; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
  }
  .header-profile { 
    flex-direction: column; 
    gap: 1rem; 
  }
  .profile-img { width: 100px; height: 100px; }
  nav { margin-top: 1.5rem; }
  nav a { margin: 0 0.75rem; }

  h1 { font-size: 2.5rem; }
  h2 { 
    font-size: 1.6rem; 
    margin-top: 3rem; 
    margin-bottom: 1.5rem; 
    padding-left: 0.75rem;
    border-left-width: 4px;
  }

  .grid { gap: 1.5rem; grid-template-columns: 1fr; }
  .card { padding: 1.25rem; }
  .card h3 { font-size: 1.25rem; }
  .card img { height: 180px; margin-bottom: 1rem; }
  .card p { font-size: 0.9rem; }
  .card-links { margin-top: 1.25rem; gap: 0.5rem; }
  .card-links a { padding: 0.5rem 0.75rem; font-size: 0.8rem; min-width: 110px; }

  .cta-container { margin: 2rem 0; padding: 1.5rem; }
  .cta-button { padding: 0.75rem 1.25rem; font-size: 0.9rem; }
  
  footer { margin-top: 3rem; padding: 2rem 0; }
  .footer-grid { flex-direction: column; text-align: center; gap: 1.5rem; }
}
