* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #124734;
  --secondary-color: #2d5a47;
  --accent-color: #ffd700;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-accent: #f0f8f4;
  --border-color: #e5e7eb;
  --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);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  max-width: 100vw;
}

.serif {
  font-family: 'Source Serif Pro', serif;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--secondary-color);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  min-height: 70vh;
  background: linear-gradient(135deg, var(--bg-accent) 0%, var(--bg-secondary) 100%);
  display: flex;
  align-items: flex-start;
  padding: 10rem 2rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e5e7eb" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.5;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text {
  background: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.hero-text p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease 0.2s forwards;
}

.hero .section-bg-video {
  z-index: 0;
}

.hero .section-bg-video.active {
  opacity: 0.7;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease 0.4s forwards;
}

.btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-block;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease 0.6s forwards;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Section Styles */
.section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: hidden;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Research Areas - Side by Side Layout */
.research-areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.research-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
}

.research-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.research-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.research-card p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.project-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  width: 100%;
  height: 200px;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 3rem;
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* People Grid */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.person-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
}

.person-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.person-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-accent);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.person-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.person-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.person-role {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Publications - Side by Side Layout */
.publications-container {
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-top: 3rem;
}

.publications-header {
  background: var(--bg-accent);
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.publications-list {
  max-height: 500px;
  overflow-y: auto;
  padding: 0;
}

.publication-item {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: background-color 0.3s ease;
}

.publication-item:hover {
  background: var(--bg-secondary);
}

.publication-item:last-child {
  border-bottom: none;
}

.publication-access {
  flex-shrink: 0;
}

.publication-access a {
  background: var(--secondary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.publication-access a:hover {
  background: var(--primary-color);
}

.publication-content {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Contact Section - Side by Side Layout */
.contact-section {
  background: var(--bg-secondary);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.contact-item-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.contact-item-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.contact-item-content p {
  color: var(--text-secondary);
  margin: 0;
}

.contact-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.contact-form {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Form Messages */
.form-success,
.form-error {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
  display: none;
}

.form-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Footer */
.footer {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 2rem;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--secondary-color);
  z-index: 1001;
  transition: width 0.1s ease;
}

/* Background Animations */
.section-bg-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  opacity: 0;
  transition: opacity 1s ease;
}

.section-bg-animation.active {
  opacity: 1;
}

.section-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.section-bg-video.active {
  opacity: 1;
}

.section-bg-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#about .section-bg-video {
  display: none;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #eee;
  position: relative;
}

.modal-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 20px;
}

.modal-title-section h3 {
  margin: 0 0 5px 0;
  font-size: 1.5rem;
  color: #333;
}

.modal-role {
  color: #666;
  font-size: 1rem;
  margin: 0;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  color: #333;
}

.modal-body {
  padding: 24px;
}

.modal-bio {
  line-height: 1.6;
  margin-bottom: 20px;
  color: #444;
}

.modal-email {
  margin-bottom: 20px;
  color: #666;
}

.modal-expertise {
  margin-top: 20px;
}

.expertise-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.expertise-tag {
  background-color: #f0f0f0;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #666;
}

.modal-links {
  margin: 20px 0;
}

.profile-links {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.profile-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.lattes-link {
  background-color: #1e40af;
  color: white;
}

.lattes-link:hover {
  background-color: #1e3a8a;
  transform: translateY(-1px);
}

.scholar-link {
  background-color: #4285f4;
  color: white;
}

.scholar-link:hover {
  background-color: #3367d6;
  transform: translateY(-1px);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  width: 24px;
  height: 3px;
  background: var(--primary-color);
  transition: all 0.3s ease;
  transform-origin: center;
}

#menuToggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#menuToggle.open span:nth-child(2) {
  opacity: 0;
}

#menuToggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Animations */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 250px;
    flex-direction: column;
    background: #fff;
    padding-top: 5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-container {
    padding: 1rem 1rem;
    max-width: 100%;
  }
  
  .hero {
    padding: 8rem 1rem 2rem 1rem;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .section {
    padding: 3rem 1rem;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
  }

  .modal-title-section h3 {
    font-size: 1.3rem;
  }

  .modal-body {
    padding: 16px;
  }
}