:root {
  --primary-text: #1a1a1a;
  --secondary-text: #666;
  --accent-color: #2563eb;
  --background: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --hover: #f1f5f9;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-large: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Universal box-sizing for consistent layout */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

/* Base body styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--primary-text);
  background-color: var(--background);
  font-weight: 300;
  overflow-x: hidden; /* Prevent horizontal scroll bar */
}

/* Header Styles */
header {
  position: fixed; /* Fixed at the top */
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95); /* Semi-transparent background */
  backdrop-filter: blur(20px); /* Frosted glass effect */
  z-index: 1000; /* Ensure header is on top */
  border-bottom: 1px solid rgba(226, 232, 240, 0.5); /* Subtle bottom border */
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth transition for scroll effects */
}

.header-container {
  max-width: 1600px; /* Max width for content within header */
  margin: 0 auto; /* Center the header content */
  padding: 1rem 3rem; /* Vertical and horizontal padding */
  display: flex;
  justify-content: space-between; /* Space logo and nav apart */
  align-items: center; /* Vertically align items */
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-text);
  text-decoration: none;
  transition: color 0.3s ease-out;
}

.logo:hover {
  color: var(--accent-color);
}

nav {
  display: flex;
  gap: 2rem; /* Space between nav links */
  align-items: center;
}

nav a {
  color: var(--secondary-text);
  text-decoration: none;
  font-weight: 400;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  padding: 0.5rem 0;
}

nav a:hover {
  color: var(--accent-color);
  transform: translateY(-2px); /* Slight lift on hover */
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Underline animation */
}

nav a:hover::after {
  width: 100%;
}

.resume-btn {
  background: var(--accent-color);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--shadow-light);
}

.resume-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px) scale(1.02); /* More pronounced lift and scale */
  box-shadow: var(--shadow-medium);
  color: white;
}

.resume-btn::after {
  display: none; /* Hide default underline for button */
}

/* Hero Section Styles */
.hero {
  min-height: 90vh; /* Minimum height for hero section */
  display: flex; /* Use flex to align items vertically */
  align-items: center; /* Center content vertically */
  padding: 8rem 3rem 2rem; /* Top, horizontal, and reduced bottom padding */
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e2e8f0' fill-opacity='0.3'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none; /* Allows clicks to pass through */
  opacity: 0.6; /* Subtle background pattern */
}

.hero-container {
  max-width: 1600px; /* Max width for content within hero */
  margin: 0 auto; /* Center the hero content */
  display: grid; /* Use grid for content and image columns */
  grid-template-columns: 1fr 350px; /* Content takes available space, image is fixed width */
  gap: 4rem; /* Gap between grid columns */
  align-items: center; /* Vertically align items in the grid */
  position: relative;
  z-index: 1; /* Ensure content is above background pattern */
  padding: 0; /* Remove inner padding, padding handled by .hero */
}

.hero-content {
  max-width: 100%; /* Allow content to fill its grid column */
  padding: 0; /* No specific padding within this div */
  text-align: left; /* Text alignment within hero content */
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text; /* Clip background to text shape */
  -webkit-text-fill-color: transparent; /* Make text transparent to show background */
  background-clip: text;
  line-height: 1.2;
}

.hero-content .subtitle {
  font-size: 1.25rem;
  color: var(--secondary-text);
  margin-bottom: 2rem;
  font-weight: 400;
  opacity: 0.8; /* Subtle subtitle */
}

.hero-content .description {
  font-size: 1.1rem;
  color: var(--secondary-text);
  margin-bottom: 2.5rem;
  line-height: 1.7;
  max-width: 700px; /* Limit description width for readability */
  margin-left: 0;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap; /* Allow buttons to wrap */
  justify-content: flex-start; /* Align buttons to the left */
}

/* Call to Action Buttons (shared styles) */
.btn-primary {
  background: var(--accent-color);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--shadow-light);
  display: inline-flex; /* Allows icon and text to sit together */
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-medium);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--secondary-text);
  padding: 0.75rem 2rem;
  border: 2px solid var(--border);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-2px) scale(1.02);
  background-color: var(--hover);
}

/* Profile Image Holder Styles */
.hero-image {
  position: relative;
  display: flex; /* Use flex to center image within its div */
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically */
}

.hero-image img {
  width: 100%;
  max-width: 350px; /* Max width of the image itself */
  border-radius: 20px;
  box-shadow: var(--shadow-large);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease-out;
}

.hero-image::before {
  content: '';
  position: absolute;
  inset: -10px; /* Creates a border-like effect outside the image */
  background: var(--gradient);
  border-radius: 30px;
  z-index: -1;
  opacity: 0.1;
  transition: opacity 0.4s ease-out;
}

.hero-image:hover img {
  transform: translateY(-10px) scale(1.03); /* Lifts and slightly scales */
  box-shadow: var(--shadow-large);
}
.hero-image:hover::before {
  opacity: 0.2; /* Makes gradient more visible */
}


/* Section General Styles */
.section {
  padding: 2rem 3rem 5rem; /* Reduced top padding, standard bottom padding */
  max-width: 1600px; /* Max width for content within sections */
  margin: 0 auto; /* Center the section content */
}

.section-title {
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  color: var(--primary-text);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%); /* Center the underline */
  width: 60px;
  height: 3px;
  background: var(--gradient);
  border-radius: 3px;
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Responsive grid */
  gap: 2rem;
  margin-top: 3rem;
}

.project-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease-out;
}

.project-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-large);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary-text);
}

.project-card p {
  color: var(--secondary-text);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-btn {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(37, 99, 235, 0.1);
}

.project-btn:hover {
  background: rgba(37, 99, 235, 0.2);
  transform: translateY(-2px);
}

/* Specific styling for the 'Learn More' button now that it's an anchor */
.project-btn.learn-more-btn {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-color);
}
.project-btn.learn-more-btn:hover {
  background: rgba(37, 99, 235, 0.2);
}


/* Skills Section */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 3rem;
}

.skill-tag {
  background: white;
  color: var(--primary-text);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 500;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.skill-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient);
  transition: left 0.3s ease-out;
  z-index: -1;
  border-radius: 50px;
}

.skill-tag:hover {
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-medium);
}

.skill-tag:hover::before {
  left: 0;
}

/* Experience Section Styles */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.experience-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.experience-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease-out;
}

.experience-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-medium);
}

.experience-card:hover::before {
  transform: scaleX(1);
}

.experience-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-text);
  margin-bottom: 0.5rem;
}

.experience-card .experience-meta {
  font-size: 0.95rem;
  color: var(--secondary-text);
  margin-bottom: 1rem;
  font-weight: 400;
}

.experience-card .experience-description {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 0;
}

.experience-card .experience-description li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--secondary-text);
  line-height: 1.6;
}

.experience-card .experience-description li::before {
  content: "•";
  color: var(--accent-color);
  font-size: 1.2rem;
  position: absolute;
  left: 0;
  top: 0;
}


/* Contact Section */
.contact-container {
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.contact-item {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-align: center;
}

.contact-item:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-medium);
}

.contact-item .contact-link {
  display: flex;
  flex-direction: row; /* Ensure icon and text are inline */
  align-items: center; /* Vertically center items */
  justify-content: center; /* Horizontally center content in the link */
  text-decoration: none;
  color: var(--primary-text);
  transition: color 0.3s ease-out;
}

.contact-item .contact-link:hover {
  color: var(--accent-color);
}

.contact-item i {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 0; /* No bottom margin as elements are in a row */
  margin-right: 1rem; /* Space between icon and text */
  transition: transform 0.3s ease-out;
}

.contact-item:hover i {
  transform: scale(1.1);
}

.contact-item p {
  color: var(--primary-text);
  font-weight: 500;
  white-space: nowrap; /* Prevent text from wrapping onto a new line */
  transition: color 0.3s ease-out;
}

.contact-item:hover p {
  color: var(--accent-color);
}

/* Footer Styles */
footer {
  background: var(--surface);
  padding: 2rem;
  text-align: center;
  color: var(--secondary-text);
  border-top: 1px solid var(--border);
}

footer .container {
  max-width: 1600px; /* Align with global max-width */
  margin: 0 auto;
  padding: 0 3rem; /* Consistent padding */
}


/* Media Queries for Responsiveness */

/* Large screens (just below max-width) */
@media (max-width: 1650px) {
  .header-container,
  .hero-container,
  .section,
  footer .container {
    padding: 0 2.5rem; /* Reduce padding slightly */
  }
  .hero {
    padding: 8rem 2.5rem 2rem; /* Adjusted for this breakpoint */
  }
}

/* Medium screens (e.g., desktops, large tablets) */
@media (max-width: 1024px) {
  .header-container,
  .hero-container,
  .section,
  footer .container {
    padding: 0 2rem; /* Common padding for medium screens */
  }
  .hero {
    padding: 7rem 2rem 2rem; /* Adjusted for medium screens */
  }
  .section-title {
    font-size: 2.2rem; /* Slightly smaller title */
  }
}

/* Small screens (e.g., tablets, mobile landscape) */
@media (max-width: 768px) {
  .header-container {
    padding: 1rem 1.5rem; /* Tighten header padding for mobile */
  }

  nav {
    gap: 1rem;
  }

  nav a {
    font-size: 0.9rem;
  }

  .hero-container {
    grid-template-columns: 1fr; /* Stack content and image vertically */
    gap: 3rem; /* Add gap when stacked */
    text-align: center; /* Center text when stacked */
    padding: 2rem 0; /* Add some vertical padding */
  }
  .hero-content {
    order: 2; /* Put content below image on mobile */
    text-align: center; /* Center text on mobile */
    margin-left: auto;
    margin-right: auto;
  }
  .hero-content .description {
    text-align: center; /* Center description on mobile */
    margin-left: auto;
    margin-right: auto;
  }
  .cta-buttons {
    justify-content: center; /* Center buttons on mobile */
  }
  .hero-image {
    order: 1; /* Put image above content on mobile */
  }
  .hero-image img {
    max-width: 250px; /* Adjust image size for mobile */
  }

  .hero {
    padding: 6rem 1.5rem 2rem; /* Further adjusted hero padding for mobile */
  }
  
  .projects-grid {
    grid-template-columns: 1fr; /* Single column for projects on mobile */
    gap: 1.5rem;
  }

  .project-card {
    padding: 1.5rem;
  }

  .section {
    padding: 2rem 1.5rem 3rem; /* Reduced padding for mobile sections */
  }

  .section-title {
    font-size: 2rem;
    text-align: center; /* Center section titles on mobile */
    margin-left: auto;
    margin-right: auto;
  }
  .section-title::after {
    left: 50%; /* Center underline with text */
    transform: translateX(-50%);
  }

  .contact-grid {
    grid-template-columns: 1fr; /* Single column for contact items on mobile */
    gap: 1rem;
  }

  /* Adjust contact items for smaller mobile screens if needed,
     though `white-space: nowrap` might make them overflow.
     Consider removing `white-space: nowrap` for `.contact-item p`
     in this breakpoint if horizontal space is a critical issue. */
  .contact-item .contact-link {
    flex-direction: row; /* Keep inline layout for contact items */
    margin-bottom: 0;
  }
  .contact-item i {
    margin-right: 1rem; /* Keep spacing */
    margin-bottom: 0;
  }
  .contact-item p {
    white-space: nowrap; /* Keep text inline, may cause overflow on very small screens */
  }

  .experience-grid {
    grid-template-columns: 1fr; /* Single column for experience cards on mobile */
    gap: 1.5rem;
  }
}

/* Very small screens (e.g., older phones) */
@media (max-width: 480px) {
  .resume-btn {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content .subtitle {
    font-size: 1.1rem;
  }
}

/* Keyframe for fade-in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none; /* Hidden by default on larger screens */
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-text);
  cursor: pointer;
}

/* Mobile navigation overlay */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block; /* Show toggle button on mobile */
  }

  nav {
    position: absolute; /* Position relative to header */
    top: 100%; /* Below the header */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column; /* Stack nav links vertically */
    padding: 1rem;
    border-top: 1px solid var(--border);
    transform: translateY(-100%); /* Start off-screen above */
    opacity: 0;
    visibility: hidden; /* Hide completely */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  nav.active {
    transform: translateY(0); /* Slide in */
    opacity: 1;
    visibility: visible;
  }

  nav a {
    padding: 0.75rem 0;
    width: 100%;
    text-align: center;
  }
}

/*fossclub button*/
.link-btn-small {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.4rem 0.8rem;
      font-size: 0.85rem;
      font-weight: 500;
      text-decoration: none;
      color: var(--accent-color);
      background: rgba(37, 99, 235, 0.08); /* A very light accent background */
      border-radius: 10px;
      transition: all 0.2s ease-in-out;
      margin-top: 1rem; /* Add some space above the button */
    }

    .link-btn-small:hover {
      background: rgba(37, 99, 235, 0.15); /* Slightly darker on hover */
      color: var(--accent-color);
      transform: translateY(-1px);
    }