/* Basic Reset & Global Styles */
:root {
  --background-dark: #121212; /* Deeper dark */
  --primary-color: #1a1a1a; /* Slightly lighter for elements */
  --secondary-color: #007bff; /* A vibrant blue for accents */
  --text-light: #e0e0e0;
  --text-dark: #b0b0b0;
  --card-background: #1f1f1f;
  --border-color: #333333;
  --highlight-color: #00c4ff; /* A bright cyan/blue for highlights */
  --button-hover: #0056b3; /* Darker blue for button hover */
  --transition-speed: 0.3s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--background-dark);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--highlight-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--secondary-color);
}

/* Header & Navigation */
.header {
  background-color: var(--primary-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.nav-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 1px;
  text-shadow: 0 0 5px rgba(0, 196, 255, 0.3);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-light);
  font-weight: 600;
  font-size: 1.1rem;
  position: relative;
  padding-bottom: 5px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--highlight-color);
  transition: width var(--transition-speed);
}

.nav-links a:hover::after {
  width: 100%;
}

.burger-menu {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.burger-menu div {
  width: 25px;
  height: 3px;
  background-color: var(--text-light);
  transition: all 0.3s ease;
}

/* Hero Section */
.hero-section {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: linear-gradient(45deg, var(--background-dark) 0%, #0a0a0a 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0, 196, 255, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: background-pan 60s linear infinite;
  opacity: 0.15;
}

@keyframes background-pan {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -3000px -3000px;
  }
}

.hero-content {
  z-index: 1;
  animation: fadeInScale 1.2s ease-out forwards;
  padding: 0 20px;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.hero-title {
  font-size: 4.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
  color: var(--text-light);
  text-shadow: 0 0 15px rgba(0, 196, 255, 0.5), 0 0 25px rgba(0, 196, 255, 0.3);
}

.hero-title .highlight {
  color: var(--highlight-color);
}

.hero-subtitle {
  font-size: 2.2rem;
  font-weight: 300;
  margin-bottom: 2.5rem;
  color: var(--text-dark);
  text-shadow: 0 0 8px rgba(0, 196, 255, 0.2);
}

/* Typewriter effect for JS */
.typewriter {
  border-right: 3px solid var(--highlight-color);
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  vertical-align: bottom;
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: var(--highlight-color);
  }
}

/* Scroll Down Indicator */
.scroll-down-indicator {
  position: absolute;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-dark);
  font-size: 0.9rem;
  animation: bounce 2s infinite;
  z-index: 2;
}

.scroll-down-indicator span {
  margin-bottom: 5px;
}

.arrow-down {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid var(--highlight-color);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: all var(--transition-speed);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.primary-btn {
  background-color: var(--highlight-color);
  color: var(--background-dark);
}

.primary-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.secondary-btn {
  background-color: transparent;
  color: var(--highlight-color);
  border: 2px solid var(--highlight-color);
}

.secondary-btn:hover {
  background-color: var(--highlight-color);
  color: var(--background-dark);
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Sections */
.section {
  padding: 100px 0;
  text-align: center;
  opacity: 0; /* Initial state for fade-in animation */
  transform: translateY(30px); /* Initial state for slide-up animation */
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section.fade-in.active {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-size: 3.5rem;
  margin-bottom: 4.5rem;
  position: relative;
  display: inline-block;
  color: var(--text-light);
  text-shadow: 0 0 10px rgba(0, 196, 255, 0.3);
}

.section-title::after {
  content: "";
  position: absolute;
  width: 70%;
  height: 5px;
  background-color: var(--highlight-color);
  bottom: -15px;
  left: 15%;
  border-radius: 3px;
}

/* About Section */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--text-dark);
}

.about-content p {
  margin-bottom: 1.5rem;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.skill-card {
  background-color: var(--card-background);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  text-align: left;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color
    var(--transition-speed);
  border: 1px solid var(--border-color);
}

.skill-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  border-color: var(--highlight-color);
}

.skill-card h3 {
  font-size: 1.9rem;
  color: var(--highlight-color);
  margin-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.skill-card ul {
  list-style: none;
}

.skill-card li {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--text-dark);
  position: relative;
  padding-left: 25px;
}

.skill-card li::before {
  content: "•";
  color: var(--secondary-color);
  font-size: 1.5rem;
  position: absolute;
  left: 0;
  top: -2px;
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.project-card {
  background-color: var(--card-background);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  text-align: left;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color
    var(--transition-speed);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  border-color: var(--highlight-color);
}

.project-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.project-card h3 {
  font-size: 1.8rem;
  color: var(--highlight-color);
  margin: 20px 20px 10px;
}

.project-card p {
  font-size: 1rem;
  color: var(--text-dark);
  margin: 0 20px 20px;
  flex-grow: 1; /* Ensures content pushes links to bottom */
}

.project-links {
  display: flex;
  justify-content: center; /* Center the single button */
  gap: 15px;
  padding: 0 20px 20px;
  margin-top: auto; /* Pushes links to the bottom */
}

/* Timeline Section */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  width: 4px;
  background-color: var(--border-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
}

.timeline-item {
  padding: 10px 0;
  position: relative;
  width: 50%;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.timeline-item.active {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:nth-child(odd) {
  left: 0;
  padding-right: 60px;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 60px;
  text-align: left;
}

.timeline-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  background-color: var(--highlight-color);
  border-radius: 50%;
  top: 20px;
  z-index: 1;
  border: 4px solid var(--background-dark);
  box-shadow: 0 0 10px rgba(0, 196, 255, 0.5);
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -9px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -9px;
}

.timeline-content {
  background-color: var(--card-background);
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color
    var(--transition-speed);
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  border-color: var(--highlight-color);
}

.timeline-content h3 {
  font-size: 1.6rem;
  color: var(--highlight-color);
  margin-bottom: 10px;
}

.timeline-content p {
  font-size: 1rem;
  color: var(--text-dark);
}

/* Contact Section */
.contact-intro {
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-bottom: 3rem;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto 3rem;
  text-align: left;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-light);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background-color: var(--primary-color);
  color: var(--text-light);
  font-size: 1rem;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--highlight-color);
  box-shadow: 0 0 0 3px rgba(0, 196, 255, 0.3);
}

.form-group textarea {
  resize: vertical;
}

.contact-form .primary-btn {
  width: auto;
  padding: 12px 30px;
  display: block;
  margin: 0 auto;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 3rem;
}

.social-links a img {
  width: 36px; /* Slightly larger icon */
  height: 36px;
  filter: grayscale(100%) brightness(0.8); /* Make icons light grey */
  transition: filter var(--transition-speed), transform var(--transition-speed);
}

.social-links a:hover img {
  filter: grayscale(0) brightness(1) drop-shadow(0 0 8px var(--highlight-color)); /* Full color with glow */
  transform: translateY(-7px) scale(1.15);
}

/* Footer */
.footer {
  background-color: var(--primary-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-dark);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 992px) {
  .hero-title {
    font-size: 3.8rem;
  }
  .hero-subtitle {
    font-size: 1.8rem;
  }
  .nav-links {
    gap: 1.5rem;
  }
  .section-title {
    font-size: 2.8rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-logo {
    margin-bottom: 1rem;
  }
  .nav-links {
    display: none; /* Hidden by default for mobile */
    flex-direction: column;
    width: 100%;
    text-align: center;
    background-color: var(--primary-color);
    padding: 1rem 0;
    position: absolute;
    top: 70px; /* Adjust based on header height */
    left: 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
  }
  .nav-links.active {
    display: flex;
  }
  .nav-links li {
    margin: 10px 0;
  }
  .burger-menu {
    display: flex;
    position: absolute;
    right: 20px;
    top: 25px;
  }

  .burger-menu.active .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  .burger-menu.active .line2 {
    opacity: 0;
  }
  .burger-menu.active .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
  }

  .hero-title {
    font-size: 3rem;
  }
  .hero-subtitle {
    font-size: 1.5rem;
  }
  .section {
    padding: 80px 0;
  }
  .section-title {
    font-size: 2.2rem;
    margin-bottom: 3.5rem;
  }
  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .timeline::before {
    left: 20px; /* Adjust timeline line for smaller screens */
  }
  .timeline-item {
    width: 100%;
    padding-left: 60px;
    padding-right: 20px;
    text-align: left;
  }
  .timeline-item:nth-child(odd) {
    padding-right: 20px;
    text-align: left;
  }
  .timeline-item:nth-child(even) {
    left: 0;
  }
  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 12px;
    right: auto;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.2rem;
  }
  .btn {
    padding: 0.7rem 1.8rem;
    font-size: 0.9rem;
  }
  .section-title {
    font-size: 2rem;
  }
  .about-content,
  .contact-intro {
    font-size: 1rem;
  }
  .skill-card h3,
  .project-card h3 {
    font-size: 1.6rem;
  }
  .timeline-content h3 {
    font-size: 1.4rem;
  }
}
