* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-bg: #0a0a0a;
  --secondary-bg: #1a1a1a;
  --card-bg: #2a2a2a;
  --accent-color: #00d4ff;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--primary-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animated background particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent-color);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  z-index: 1002; /* Ensure logo is on top */
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none; /* Hidden by default on desktop */
  flex-direction: column;
  cursor: pointer;
  padding: 5px;
  z-index: 1001; /* Ensure toggle is above the mobile menu */
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Navigation - Initial State (Hidden) */
.nav-links.mobile {
  position: fixed;
  top: 0; /* Position at the top of the viewport */
  left: 0;
  width: 100%;
  height: 100vh; /* Full viewport height */
  background: rgba(26, 26, 26, 0.98);
  backdrop-filter: blur(10px);
  flex-direction: column; /* Stack items vertically */
  justify-content: center; /* Vertically center content */
  align-items: center; /* Horizontally center content */
  padding: 2rem 0; /* Add some padding top/bottom */
  transition: transform 0.3s ease-in-out, opacity 0.3s ease; /* Smooth slide and fade */
  z-index: 999; /* Below the toggle but above other content */
  transform: translateX(-100%); /* Start hidden off-screen to the left */
  display: flex; /* IMPORTANT: Always display flex for the mobile menu container */
  pointer-events: none; /* Prevents interaction when hidden */
  opacity: 0; /* Hidden initially */
}

/* Mobile Navigation - Active State (Visible) */
.nav-links.mobile.active {
  transform: translateX(0%); /* Slide into view */
  pointer-events: auto; /* Allow interaction when visible */
  opacity: 1; /* Fully visible */
}

/* Specific styling for list items and links within the mobile menu */
.nav-links.mobile li {
  margin: 0.75rem 0; /* Reduce vertical margin between items */
}

.nav-links.mobile a {
  font-size: 1.1rem; /* Slightly reduced font size for compactness */
  padding: 0.8rem 1.5rem; /* Reduced padding around links */
  display: block; /* Make the whole padding area clickable */
  text-align: center;
  border-radius: 10px;
  color: var(--text-primary); /* Ensure link color is visible */
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
}

.nav-links.mobile a:hover {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-color); /* Add hover color */
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 11rem; /* Space between content and image */
  padding: 0 2rem;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 212, 255, 0.1) 0%,
    transparent 70%
  );
}

.hero-content {
  flex: 1; /* Takes up available space */
  text-align: left; /* Align text to the left */
  max-width: 600px;
}

.hero-content h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideUp 1s ease-out;
}

.hero-content .subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  animation: slideUp 1s ease-out 0.2s both;
}

.hero-content .description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  animation: slideUp 1s ease-out 0.4s both;
}

.hero-image {
  /* height: 300px;  -- REMOVED THIS LINE */
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Adjust this max-width to control the image size on larger screens */
  max-width: 350px; /* Adjusted to make the image smaller */
}

.hero-image img {
  max-width: 100%;
  height: auto; /* Changed from 100% to auto for responsiveness */
  border-radius: 15px; /* Optional: if your 3D image has a background */
  animation: fadeIn 1.5s ease-out 0.8s both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--accent-gradient);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: slideUp 1s ease-out 0.6s both;
  border: none; /* Ensure no default button border */
  cursor: pointer; /* Indicate it's clickable */
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

/* Sections */
section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* About Section */
.about-content {
  display: flex; /* Changed to flex for single column */
  justify-content: center;
  align-items: center;
  flex-direction: column; /* Stack content vertically */
  text-align: center; /* Center the text */
}

.about-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 800px; /* Constrain width for readability */
}

.about-text p {
  margin-bottom: 1rem;
}

.about-text .cta-button {
  margin-top: 2rem; /* Space above the button */
}

/* Skills Section - New Design */
.skills-grid-new {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.skill-category {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 212, 255, 0.2);
}

.skill-category h3 {
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}

.skill-category h3 i {
  margin-right: 0.5rem;
  color: var(--text-primary);
}

.skill-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.skill-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.skill-icon-item:hover {
  transform: translateY(-5px);
  color: var(--accent-color);
}

.skill-icon-item img {
  width: 50px; /* Adjust icon size */
  height: 50px;
  margin-bottom: 0.5rem;
  border-radius: 5px; /* If icons are square images */
  object-fit: contain; /* Ensure images fit without distortion */
  filter: grayscale(100%) brightness(150%); /* Make icons white/gray */
  transition: filter 0.3s ease;
}

.skill-icon-item:hover img {
  filter: grayscale(0%) brightness(100%); /* Color on hover */
}

/* Experience Section - Timeline */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  width: 4px;
  background: var(--accent-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
}

.timeline-item {
  padding: 10px 0;
  position: relative;
  width: 50%;
}

.timeline-item:nth-child(odd) {
  left: 0;
  padding-right: 30px;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 30px;
}

.timeline-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--accent-gradient);
  border-radius: 50%;
  top: 23px;
  z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -8px;
}

.timeline-content {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.timeline-content h3 {
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.timeline-content .timeline-date {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 1rem;
}

.timeline-content ul {
  list-style: none;
  padding-left: 0;
  text-align: left; /* Ensure list items align left */
  color: var(--text-secondary);
}

.timeline-content ul li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.2rem;
}

.timeline-content ul li::before {
  content: "•"; /* Bullet point */
  color: var(--accent-color);
  position: absolute;
  left: 0;
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card.hidden {
  display: none;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px rgba(0, 212, 255, 0.3);
}

.project-image {
  height: 200px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
}

.project-info {
  padding: 1.5rem;
}

.project-info h3 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  background: rgba(0, 212, 255, 0.2);
  color: var(--accent-color);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  border: 1px solid var(--accent-color);
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.project-link {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.project-link:hover {
  color: var(--text-primary);
}

.load-more-container {
  text-align: center;
  margin-top: 3rem;
}

/* Footer - Now handles Get In Touch */
footer {
  background: var(--secondary-bg);
  text-align: center;
  padding: 4rem 2rem 2rem; /* More top padding for the section title */
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

footer .section-title {
  margin-bottom: 1.5rem; /* Adjust title spacing for footer */
  font-size: 2rem; /* Slightly smaller for footer */
}

.footer-link{
  color: inherit;
  text-decoration: none;
}

.contact-tagline {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 600px;
  color: var(--text-secondary);
}

.contact-info-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 900px; /* Constrain width for the contact items */
  margin-bottom: 2rem;
}

.contact-info-footer .contact-item {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 15px;
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center; /* Ensure items are centered */
}

.contact-info-footer .contact-item:hover {
  transform: translateY(-5px);
}

.contact-info-footer .contact-item i {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.contact-info-footer .contact-item h3 {
  color: var(--text-primary); /* Keep headings visible */
  margin-bottom: 0.5rem;
}

.contact-info-footer .contact-item p {
  color: var(--text-secondary);
}

.copyright {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 992px) {
  .hero {
    flex-direction: column;
    text-align: center;
    height: auto;
    padding: 10rem 2rem 5rem; /* Adjust padding for smaller screens */
  }

  .hero-content {
    text-align: center;
  }

  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-content .subtitle {
    font-size: 1.3rem;
  }

  .hero-image {
    order: 1; /* Move image above text on smaller screens */
    margin-bottom: 2rem;
    /* Make the image even smaller on tablets/mobile */
    max-width: 250px; /* Reduced for smaller screens */
  }

  .timeline::before {
    left: 18px; /* Adjust for mobile */
  }

  .timeline-item {
    width: 100%;
    padding-left: 50px;
    padding-right: 10px;
  }

  .timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 10px;
    text-align: left; /* Align text left for both */
  }

  .timeline-item:nth-child(even) {
    left: 0; /* Align both to left */
  }

  .timeline-item:nth-child(odd) .timeline-dot {
    right: auto;
    left: 10px; /* Align dots to left */
  }

  .timeline-item:nth-child(even) .timeline-dot {
    left: 10px; /* Align dots to left */
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 1rem;
  }

  .nav-links {
    display: none; /* This hides the *original* nav links on small screens */
  }

  .menu-toggle {
    display: flex; /* This shows the hamburger icon */
  }

  .section-title {
    font-size: 2rem;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .skills-grid-new,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  section {
    padding: 3rem 1rem;
  }

  .contact-info-footer {
    grid-template-columns: 1fr; /* Stack contact items vertically on small screens */
  }
}

/* Scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Project cards interactivity */
.project-card {
  cursor: pointer; /* Indicate clickable */
}