/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
  font-size: 16px;
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 1.5rem 2rem 1.5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header and navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  z-index: 1000;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid #e8e8e8;
  padding: 1.2rem 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 3px 0;
  transition: 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.nav-menu {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-menu a {
  color: #0066cc;
  text-decoration: none;
  margin: 0 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.75px;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-menu a:hover {
  color: #004499;
  background-color: #f8f9fa;
  text-decoration: none;
}

.nav-menu a.active {
  color: #333;
  background-color: #f0f0f0;
  text-decoration: none;
}

.nav-menu a:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* Mobile navigation */
@media (max-width: 768px) {
  body {
    padding-top: 8rem;
  }
  
  main {
    margin-top: 2rem;
  }
  
  header {
    padding: 0.8rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    z-index: 1000;
    border-bottom: 1px solid #e8e8e8;
    max-width: 100%;
    margin: 0;
  }
  
  .nav-toggle {
    display: flex;
    position: absolute;
    right: 0;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: #fff;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease;
    z-index: 1001;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu a {
    font-size: 1.2rem;
    margin: 1rem 0;
    padding: 1rem 2rem;
  }
}

/* Typography */
h1 {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.9rem;
  font-weight: 600;
  margin: 3rem 0 1.5rem 0;
  color: #333;
  border-bottom: 2px solid #e8e8e8;
  padding-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem 0;
  color: #444;
  line-height: 1.3;
}

p {
  margin-bottom: 1.25rem;
  color: #555;
  line-height: 1.7;
  max-width: 70ch;
}

/* Links */
a {
  color: #0066cc;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #004499;
  text-decoration: underline;
}

a:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Main content sections */
.intro {
  margin-bottom: 3.5rem;
}

.intro-content {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.intro-left {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro-text {
  flex: 1;
  text-align: justify;
}

.intro-text h1 {
  margin-bottom: 1.25rem;
  text-align: left;
}

.intro-text p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #444;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

.intro-photo {
  width: 200px;
  margin-bottom: 1.5rem;
}

.intro-photo img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Contact and social section under photo */
.contact-social {
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: left;
  width: 100%;
}

.contact-info-inline {
  margin-bottom: 0.75rem;
  color: #555;
  line-height: 1.4;
  text-align: left;
}

.contact-info-inline strong {
  display: inline-block;
  margin-right: 0.5rem;
  font-weight: 900;
  font-size: 1rem;
  color: #000;
}

.contact-info-inline a {
  color: #0066cc;
  text-decoration: none;
}

.contact-info-inline a:hover {
  text-decoration: underline;
}

.social-links-inline {
  color: #555;
  font-size: 0.9rem;
}

.social-links-inline a {
  color: #0066cc;
  text-decoration: none;
  margin: 0 0.2rem;
}

.social-links-inline a:hover {
  text-decoration: underline;
}

/* Responsive design for intro section */
@media (max-width: 768px) {
  .intro-content {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  
  .intro-left {
    width: 160px;
    order: -1;
  }
  
  .intro-photo {
    width: 160px;
    margin-bottom: 1rem;
  }
  
  .intro-photo img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
  }
  
  .intro-text {
    order: 1;
    width: 100%;
  }
  
  .intro-text p {
    text-align: left;
  }
  
  .contact-social {
    font-size: 0.8rem;
  }
  
  .contact-info-inline {
    text-align: left;
    margin-bottom: 1rem;
  }
  
  .contact-info-inline strong {
    display: inline-block;
    margin-right: 0.5rem;
    font-weight: 900;
    font-size: 1rem;
    color: #000;
  }
  
  .contact-info-inline a,
  .contact-info-inline span {
    display: block;
    margin-bottom: 0.2rem;
  }
}

/* Contact section */
.contact {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 2px solid #e8e8e8;
}

.contact-info {
  margin-bottom: 1.75rem;
}

.contact-item {
  margin-bottom: 1rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-item strong {
  display: inline-block;
  min-width: 85px;
  color: #333;
  font-weight: 600;
}

.social-links {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.social-links a {
  color: #666;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.social-links a:hover {
  color: #333;
  background-color: #f8f9fa;
  border-color: #bbb;
  text-decoration: none;
}

/* Project and publication styles */
.project, .publication {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.project:last-child, .publication:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.project:hover, .publication:hover {
  padding-left: 1rem;
  border-left: 3px solid #0066cc;
}

.project-title, .publication-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
  line-height: 1.4;
}

.project-description, .publication-description {
  color: #666;
  margin-bottom: 1.25rem;
  line-height: 1.65;
}

.project-links, .publication-links {
  margin: 1.25rem 0 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-links a, .publication-links a {
  font-size: 0.9rem;
  color: #0066cc;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border: 1px solid #0066cc;
  border-radius: 5px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.project-links a:hover, .publication-links a:hover {
  background-color: #0066cc;
  color: white;
  text-decoration: none;
}

.tech-stack {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: #777;
  font-style: italic;
  background-color: #f8f9fa;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border-left: 3px solid #e9ecef;
}

.tech-stack strong {
  color: #555;
  font-weight: 600;
  font-style: normal;
}

.project-date, .publication-date {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.75rem;
  font-weight: 500;
  font-style: italic;
}

/* News/Updates section */
.latest-news {
  margin-bottom: 3rem;
}

.news-item {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #f5f5f5;
  transition: all 0.2s ease;
}

.news-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.news-item:hover {
  padding-left: 1rem;
  border-left: 3px solid #0066cc;
}

.news-date {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-content {
  color: #555;
  line-height: 1.65;
}

/* Lists */
ul {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
  color: #555;
  line-height: 1.6;
}

/* Focus and accessibility improvements */
*:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem;
    font-size: 15px;
    max-width: 100%;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  h2 {
    font-size: 1.6rem;
  }
  
  h3 {
    font-size: 1.2rem;
  }
  
  .intro p {
    font-size: 1.05rem;
  }
  
  nav {
    gap: 0.5rem;
  }
  
  nav a {
    margin: 0 0.25rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
  
  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .contact-item strong {
    min-width: auto;
    width: auto;
  }
  
  .project-links, .publication-links {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .project-links a, .publication-links a {
    text-align: center;
  }
  
  .social-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .social-links a {
    text-align: center;
  }
  
  .tech-stack {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem;
  }
  
  h1 {
    font-size: 1.9rem;
  }
  
  nav a {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }
  
  .project, .publication {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
  }
  
  .news-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }
}

/* Print styles */
@media print {
  body {
    max-width: none;
    padding: 0;
    font-size: 12pt;
  }
  
  nav a {
    color: #333 !important;
    text-decoration: none !important;
  }
  
  .project:hover, .publication:hover, .news-item:hover {
    padding-left: 0;
    border-left: none;
  }
  
  .project-links a, .publication-links a {
    border: 1px solid #333;
    color: #333;
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: #666;
}

.small {
  font-size: 0.9rem;
}

.mb-small {
  margin-bottom: 0.75rem;
}

.mb-medium {
  margin-bottom: 1.25rem;
}

.mb-large {
  margin-bottom: 2.5rem;
}

/* Loading animation for smooth page transitions */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

main {
  animation: fadeIn 0.3s ease-out;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid #e8e8e8;
  text-align: center;
}

.footer-links {
  font-size: 0.9rem;
}

.footer-links a {
  color: #666;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.footer-links a:hover {
  color: #0066cc;
  background-color: #f8f9fa;
  text-decoration: none;
}