/* Reset & Basic Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Montserrat', sans-serif;
  background: #0d0d0d;
  color: #fff;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Particle Overlay */
#particle-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 9999;
}
#particle-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Navigation */
.navbar {
  background: rgba(0, 0, 0, 0.8);
  padding: 15px 0;
  position: fixed;
  width: 100%;
  z-index: 100;
  top: 0;
  overflow: hidden;
}
.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent 25%, rgba(255, 255, 255, 0.3) 50%, transparent 75%);
  animation: shimmer 3s infinite linear;
  z-index: -1;
}
@keyframes shimmer {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  color: #fff;
  text-decoration: none;
  position: relative;
  animation: logoGlow 1.5s ease-in-out infinite alternate;
}
@keyframes logoGlow {
  from {
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5),
                0 0 20px rgba(255, 204, 0, 0.4);
  }
  to {
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.8),
                0 0 30px rgba(255, 204, 0, 0.6),
                0 0 40px rgba(255, 204, 0, 0.4);
  }
}
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
}
.nav-links li {
  margin-left: 20px;
}
.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
  transition: color 0.3s, background 0.3s, transform 0.3s;
}
.nav-links a:hover {
  color: #ffcc00;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

/* Active Link Styling */
.nav-links a.active {
  color: #ffcc00;
  border-bottom: 2px solid #ffcc00;
}

/* Hero Section */
.hero {
  height: 100vh;
  position: relative;
  padding-top: 80px; /* Adjusted for taller navbar on mobile */
  overflow: hidden;
  background: url('https://via.placeholder.com/1600x900?text=Astronomy+Background') no-repeat center center/cover;
}
.hero .container {
  position: relative;
  z-index: 3;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.hero-title {
  font-size: 3.5rem;
  margin-bottom: 20px;
  font-family: 'Orbitron', sans-serif;
}
.hero-descriptions {
  font-size: 1.5rem;
  margin-top: 10px;
  height: 2em;
  position: relative;
  text-align: center;
}
.desc {
  width: 100%;
  left: 0;
  top: 0;
  opacity: 0;
  text-align: center;
}

/* Projects Section */
.projects {
  padding: 40px 0;
  background: #1a1a1a;
  position: relative;
  z-index: 2;
}
.section-title {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5rem;
  font-family: 'Orbitron', sans-serif;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.project-card {
  perspective: 1000px;
  height: 300px;
}
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.project-card:hover .card-inner {
  transform: rotateY(180deg);
}
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.card-front {
  background: #262626;
}
.card-front img {
  width: 100%;
  display: block;
}
.card-front-content {
  position: absolute;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  width: 100%;
  padding: 10px;
  text-align: center;
}
.card-back {
  background: #333;
  color: #fff;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.card-back h3 {
  margin-bottom: 10px;
}
.card-back p {
  font-size: 0.9rem;
  margin-bottom: 15px;
}
.project-link {
  text-decoration: none;
  color: #ffcc00;
  font-weight: bold;
  border: 1px solid #ffcc00;
  padding: 5px 10px;
  transition: background 0.3s, color 0.3s;
}
.project-link:hover {
  background: #ffcc00;
  color: #000;
}

/* About Section */
.about {
  padding: 80px 0;
}
.about-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
}
.about-image {
  flex: 1;
  max-width: 300px;
}
.about-image img {
  width: 100%;
  border-radius: 50%;
  transition: transform 0.3s, box-shadow 0.3s;
}
.about-image img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.7);
}
.about-content {
  flex: 2;
}
.about-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 20px;
}
.about-content p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  text-align: justify;
}

/* Skills Section */
.skills-graph {
  padding: 80px 0;
  background: #1a1a1a;
}
.skills-graph .section-title {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5rem;
  font-family: 'Orbitron', sans-serif;
}
.skill-item {
  margin-bottom: 30px;
}
.skill-item h3 {
  margin-bottom: 10px;
  text-align: center;
}
.progress-bar {
  width: 100%;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
  height: 20px;
}
.progress {
  width: 0%;
  height: 100%;
  background: #ffcc00;
  transition: width 2s ease-out;
}

/* Contact Section */
.contact {
  padding: 80px 0;
}
#contact-form {
  max-width: 600px;
  margin: auto;
  background: #262626;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: transform 0.3s;
}
#contact-form:hover {
  transform: scale(1.02);
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  box-shadow: 0 0 5px #ffcc00;
}
.btn {
  display: inline-block;
  background: #ffcc00;
  color: #000;
  padding: 12px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s, transform 0.3s;
}
.btn:hover {
  background: #e6b800;
  transform: scale(1.05);
}

/* Form Feedback */
#form-feedback {
  margin-top: 10px;
  text-align: center;
  font-size: 1rem;
}

/* Footer */
.footer {
  background: #000;
  padding: 20px 0;
  text-align: center;
  font-size: 0.9rem;
}
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
  position: relative;
  z-index: 2;
}
#vanta-bg {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -3;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Responsive Breakpoints */
@media screen and (max-width: 768px) {
  .navbar {
    padding: 10px 0;
  }
  
  .navbar .container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .logo {
    margin-bottom: 10px;
    font-size: 1.5rem;
  }
  
  .nav-links {
    width: 100%;
    justify-content: space-around;
    padding: 10px 0;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(255, 204, 0, 0.3);
  }
  
  .nav-links li {
    margin: 0;
  }
  
  .nav-links a {
    font-size: 0.9rem;
    padding: 8px 12px;
    display: block;
    text-align: center;
  }
  
  .hero {
    padding-top: 100px; /* Increased to account for taller navbar */
  }
  
  #vanta-bg,
  #particle-overlay {
    display: none !important;
  }
}

@media screen and (max-width: 480px) {
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-links li {
    flex: 1 1 50%; /* Two items per row */
    margin: 5px 0;
  }
  
  .nav-links a {
    font-size: 0.8rem;
    padding: 6px 8px;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-descriptions {
    font-size: 1.1rem;
  }
}