body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  line-height: 1.6;
  color: #f1f1f1; /* Light grey text */
  background-color: #333; /* Dark grey background */
}

header {
  background-color: rgba(68, 68, 68, 0.9); /* Slightly lighter grey background with transparency */
  color: #f1f1f1; /* Light grey text */
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed; /* Fix the header at the top */
  width: 100%; /* Ensure the header takes the full width */
  z-index: 1000; /* Ensure the header is above other content */
}

header .logo {
  font-size: 2rem; /* Make the logo bigger */
  font-family: 'Niagara', art deco; /* Use a cursive-like font */
  color: #ffffff; /* Make the logo white */
}

header .main-nav ul {
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 15px;
  margin: 0;
  flex-wrap: wrap; /* Allow items to wrap to the next line if necessary */
}

header .main-nav a {
  color: #f1f1f1; /* Light grey text */
  text-decoration: none;
  font-weight: 400;
  padding: 10px 15px; /* Add padding to ensure clickable area */
}

header .main-nav a:hover {
  color: #b0b0b0; /* Grey color on hover */
}

.hero {
  position: relative;
  min-height: 80vh; /* Ensure the hero section has a defined height but is flexible */
  display: flex;
  justify-content: center;
  align-items: center;
  color: #f1f1f1; /* Light grey text */
  text-align: center;
  padding-top: 80px; /* Add padding to avoid overlap with fixed header */
}

#particles-js {
  /* Ensure the hero container stays in the document flow so following
     sections (like About) sit below it instead of overlapping. The
     particles library can render into this element when it's positioned
     relatively and has an explicit height. */
  position: relative;
  width: 100%;
  min-height: 80vh; /* reserve space for the hero */
  top: 0;
  left: 0;
  z-index: 1;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  animation: fadeIn 2s ease-in-out; /* Add fade-in effect */
  transition: opacity 0.6s ease-out, transform 0.6s ease-out; /* Add transition for hiding */
}

.hero-content.hidden {
  opacity: 0;
  transform: translate(-50%, -60%);
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.cta-button {
  background-color: #555; /* Medium grey background */
  color: #f1f1f1; /* Light grey text */
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  display: inline-block;
  text-align: center;
  width: fit-content; /* Ensure the button width fits the text */
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.cta-button-secondary {
  background-color: transparent;
  border: 1px solid #8a8a8a;
}

.cta-button-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.cta-button:hover {
  background-color: #777; /* Slightly lighter grey */
}

.content {
  padding-top: 40px; /* reduced padding; hero is tall so content will sit below it */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  z-index: 2;
}

.content.visible {
  opacity: 1;
  transform: translateY(0);
}

section {
  padding: 60px 20px;
  background-color: #444; /* Slightly lighter grey background */
  width: 80%; /* Adjust width to be smaller */
  margin: 0 auto; /* Center the content */
  z-index: 2;
}

h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  text-align: center;
  color: #f1f1f1; /* Light grey text */
}

.projects-container {
  display: flex;
  flex-direction: column;
  gap: 20px; /* Add gap between projects */
  width: 100%; /* Ensure the project container fits within the content section */
}

.project {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background-color: #555; /* Medium grey background */
  margin-bottom: 20px;
  width: 96%; /* Take up the full width of the container */
}

.project:nth-child(even) {
  flex-direction: row-reverse;
}

.project-image {
  width: 50%;
  height: auto;
  max-width: 100%;
  display: block;
}

.project-details {
  width: 50%;
  padding: 20px;
  color: #f1f1f1; /* Light grey text */
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.project-description {
  font-size: 1rem;
  color: #ddd; /* Lighter grey text */
}

.project-placeholder {
  width: 50%;
  min-height: 180px;
  background: linear-gradient(135deg, #4a4a4a, #606060);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.experience-container {
  position: relative;
  margin: 0 auto;
  padding: 20px 0;
  width: 70%; /* Make the container smaller */
}

.experience-container::after {
  content: '';
  position: absolute;
  width: 3px; /* Make the line thinner */
  background-color: #555;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1.5px; /* Adjust for thinner line */
}

.experience-item {
  padding: 10px 20px; /* Reduce padding */
  position: relative;
  background-color: inherit;
  width: 45%; /* Make the items smaller */
}

.experience-item::after {
  content: '';
  position: absolute;
  width: 15px; /* Make the circle smaller */
  height: 15px;
  right: -10px;
  background-color: #555;
  border: 4px solid #444;
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.experience-item.left {
  left: 0;
}

.experience-item.right {
  left: 55%; /* Adjust for smaller items */
}

.experience-item.right::after {
  left: -10px; /* Adjust for smaller circle */
}

.experience-item h3, .experience-item p, .experience-item ul {
  margin: 0;
  padding: 0;
  color: #f1f1f1; /* Light grey text */
}

.experience-item ul {
  list-style: none;
  padding-left: 20px;
  display: none; /* Hide by default */
}

.experience-item ul li {
  margin-bottom: 10px;
}

.experience-item.active ul {
  display: block; /* Show when active */
}

.experience-item .toggle-description {
  background: none;
  color: #f1f1f1; /* Light grey text */
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 0;
}

.experience-item .toggle-description .chevron {
  border: solid #f1f1f1; /* Light grey color */
  border-width: 0 3px 3px 0;
  display: inline-block;
  padding: 3px;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.experience-item.active .toggle-description .chevron {
  transform: rotate(-135deg);
}

.education-container {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 24px auto 0;
  text-align: left;
}

.education-item {
  display: flex;
  gap: 32px;
  align-items: baseline;
  padding: 22px 4px;
  border-top: 1px solid #4a4a4a;
  background-color: transparent;
  transition: background-color 0.25s ease;
}

.education-item:last-child {
  border-bottom: 1px solid #4a4a4a;
}

.education-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.education-dates {
  flex: 0 0 190px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #9a9a9a;
  white-space: nowrap;
}

.education-detail {
  flex: 1;
}

.education-item h3 {
  margin: 0 0 4px;
  padding: 0;
  color: #f1f1f1;
  font-size: 1.15rem;
  font-weight: 600;
}

.education-item p {
  margin: 0;
  padding: 0;
  color: #ccc;
  font-size: 0.95rem;
}

.education-item .education-meta {
  margin-top: 4px;
  color: #9a9a9a;
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .education-item {
    flex-direction: column;
    gap: 6px;
    padding: 18px 4px;
  }

  .education-dates {
    flex: none;
  }
}

.honors-container {
  max-width: 700px;
  margin: 28px auto 0;
}

.honors-container h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #f1f1f1;
}

#about {
  margin-top: 0; /* Reset margin */
  padding-top: 100px; /* Add padding to ensure it is below the hero section */
  text-align: center; /* Center the text */
}

#about .cta-button {
  display: block;
  margin: 20px auto; /* Center the button */
}

.skills-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  color: #f1f1f1;
}

.skills-list li {
  color: #f1f1f1;
  font-size: 1rem;
}

.skills-marquees {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 32px auto 0;
  max-width: 900px;
  text-align: left;
}

.skills-row-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 8px;
  padding-left: 4px;
}

.marquee {
  overflow: hidden;
  /* fade the chips out at both edges so the loop has no visible seam */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  animation: marquee-left 90s linear infinite;
}

.skills-row[data-direction="right"] .marquee-track {
  animation-name: marquee-right;
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes marquee-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid #4f4f4f;
  border-radius: 999px;
  background-color: rgba(85, 85, 85, 0.45);
  color: #f1f1f1;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.skill-chip:hover {
  background-color: rgba(120, 120, 120, 0.6);
  border-color: #8a8a8a;
  transform: translateY(-2px);
}

.skill-logo {
  width: 20px;
  height: 20px;
  opacity: 0.85;
  transition: opacity 0.25s ease;
}

.skill-chip:hover .skill-logo {
  opacity: 1;
}

/* chips for skills with no brand logo get a small dot instead */
.skill-chip.no-logo::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #9a9a9a;
}

@media (max-width: 600px) {
  .skill-chip {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .skill-logo {
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .marquee-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }
}

/* Contact form styles */
.contact-form {
  max-width: 700px;
  margin: 16px auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.contact-form label {
  font-weight: 600;
  font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #666;
  background: #3b3b3b;
  color: #fff;
  font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid #999;
}

.contact-form .form-status {
  margin-top: 8px;
  color: #e0e0e0;
}

#contact {
  text-align: center; /* Center the text */
}

#contact p {
  font-size: 1.2rem;
  color: #f1f1f1; /* Light grey text */
}

#contact .cta-button {
  display: block;
  margin: 20px auto; /* Center the button */
}

footer {
  background-color: #1a1a1a; /* Darker background */
  color: #f1f1f1; /* Light grey text */
  text-align: center;
  padding: 10px;
  position: relative;
}

.social-media {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background-color: transparent; /* Make background transparent */
  border-radius: 0 5px 5px 0;
  z-index: 1000; /* Ensure the social media icons are above other content */
}

.social-media a {
  color: #fff; /* White text */
  font-size: 32px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.social-media a:hover {
  color: #b0b0b0; /* Grey color on hover */
}

/* Skip link visible only when focused */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 10px;
  top: 10px;
  width: auto;
  height: auto;
  background: #fff;
  color: #000;
  padding: 8px 12px;
  z-index: 2000;
  border-radius: 4px;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

#about .cta-button {
  display: block;
  margin: 20px auto; /* Center the button */
}

.moving-element {
  position: relative;
  animation: fadeInEffect 2s ease-in-out;
}

@keyframes fadeInEffect {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive: stack project cards on smaller screens */
@media (max-width: 800px) {
  .project {
    flex-direction: column;
    gap: 12px;
  }

  .project-image,
  .project-placeholder,
  .project-details {
    width: 100%;
  }

  header .main-nav ul {
    gap: 6px;
    padding: 8px;
  }
}