body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  /* UPDATED: Layered backgrounds - background_of_background.png fills entire view, background_idea.png sits on top */
  background: 
    url('images/background_of_background.png') no-repeat center center fixed;
  background-size: cover; /* contain for main image, cover for background layer */
  background-color: #fefefa; /* fallback color */
  color: #222;
  /* FIXED: Remove the duplicate padding-top and set correct value */
  padding-top: 70px; /* Increased to account for navbar height + some buffer */
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #0a3d62;
  padding: 0.5rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  z-index: 1000;
  box-sizing: border-box;
}

.navbar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.navbar li {
  margin: 0 2rem;
}

.navbar a {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  transition: color 0.2s;
}

.navbar a:hover {
  color: #38ada9;
}

/* REMOVED: Duplicate body padding-top rule */

.main-title-card, .projects-title-card {
  background: rgba(255,255,255,0.85);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(10,61,98,0.08);
  padding: 0.5rem 1.5rem;
  margin-bottom: 1rem;
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
  max-width: 90vw;
  box-sizing: border-box;
}

.about-card {
  background: rgba(255,255,255,0.85);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(10,61,98,0.08);
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.centered-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 20vh;
  text-align: center;
  margin-top: 2rem;
}

.projects-title-card {
  margin-bottom: 2rem;
  /* REMOVED: conflicting scroll-margin-top */
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 0;
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding: 0 1rem;
}

.project-card {
  background: rgba(255,255,255,0.85);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(10,61,98,0.08);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
  min-height: 0;
  margin: 0;
  box-sizing: border-box;
}

.project-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 8px 24px rgba(56,173,169,0.15);
}

.project-card h2 {
  color: #0a3d62;
  margin-bottom: 0.5rem;
}

.project-card p {
  color: #222;
  margin-bottom: 1rem;
}

.tags {
  margin-bottom: 1rem;
}

.tags span {
  display: inline-block;
  background: #38ada9;
  color: #fff;
  border-radius: 12px;
  padding: 0.2rem 0.8rem;
  margin: 0 0.2rem;
  margin-top: 0.2rem;
  margin-right: 0.2rem;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}





.project-card button {
  background: #0a3d62;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.project-card button:hover {
  background: #38ada9;
}

body::after {
  content: '';
  display: block;
  height: 10vh;
}

/* Modern responsive design using container queries and clamp() */
@media (max-width: 1200px) {
  .projects-grid {
    padding: 0 2rem;
  }
}

@media (max-width: 1000px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
    padding: 0 1.5rem;
  }
}

@media (max-width: 700px) {
  body {
    padding-top: 80px; /* FIXED: Increased for mobile */
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 0 1rem;
  }
  
  .main-title-card, 
  .projects-title-card, 
  .about-card, 
  .project-card {
    max-width: calc(100vw - 2rem);
    margin-left: 1rem;
    margin-right: 1rem;
    padding: clamp(1rem, 4vw, 2rem);
  }
  
  .centered-section {
    margin-top: 1rem;
    min-height: unset;
    padding: 0 1rem;
  }
  
  .navbar ul {
    padding: 0 1rem;
    justify-content: space-around;
  }
  
  .navbar li {
    margin: 0 0.5rem;
  }
  
  .navbar a {
    font-size: clamp(1rem, 3vw, 1.2rem);
  }
  
  /* REMOVED: conflicting projects-title-card scroll-margin-top */
}

@media (max-width: 480px) {
  .navbar li {
    margin: 0 0.3rem;
  }
  
  .navbar a {
    font-size: 1rem;
  }
  
  .projects-grid {
    padding: 0 0.5rem;
  }
  
  .main-title-card, 
  .projects-title-card, 
  .about-card, 
  .project-card {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    max-width: calc(100vw - 1rem);
  }
}

/* FIXED: Ensure both sections scroll to proper positions */
#about, #projects {
  scroll-margin-top: 0;
}

/* FIXED: Add scroll padding to html for global smooth scrolling offset */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px; /* This ensures all scroll targets account for navbar */
}