*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --dark-navy: #0a192f;
  --navy: #112240;
  --light-navy: #233554;
  --lightest-navy: #303c55;
  --navy-shadow: rgba(2, 12, 27, 0.7);
  --slate: #a8b2d1; /* Changed from #8892b0 for better visibility */
  --light-slate: #a8b2d1;
  --lightest-slate: #ccd6f6;
  --white: #e6f1ff;
  --vibrant-pink: #f92056;
  --vibrant-purple: #7d42c2;
  --vibrant-teal: #64ffda;
  --gradient: linear-gradient(135deg, var(--vibrant-pink), var(--vibrant-purple));

  --font-sans: "Calibre", "Inter", "San Francisco", "SF Pro Text", -apple-system,
    system-ui, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

body {
  background-color: var(--dark-navy);
  color: var(--slate);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

header {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 15px 50px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  transition: top 0.3s;
  box-shadow: 0 2px 4px var(--navy-shadow);
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .logo a {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  font-family: var(--font-mono);
  font-size: 24px;
  text-decoration: none;
  font-weight: bold;
  transition: opacity 0.3s;
}

header .logo a:hover {
  opacity: 0.8;
}

header nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

header nav ul li {
  margin: 0 20px;
  font-family: var(--font-mono);
}

header nav ul li a {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  font-weight: bold;
  text-decoration: none;
  transition: opacity 0.3s;
}

header nav ul li a:hover {
  opacity: 0.8;
}

.btn {
  background: var(--gradient);
  border: none;
  border-radius: 4px;
  color: var(--white);
  padding: 12px 20px;
  text-decoration: none;
  font-family: var(--font-mono);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

main {
  padding: 0 150px;
}

section {
  padding: 100px 0;
  max-width: 1000px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
}

.hero-text {
  max-width: 60%;
}

.hero-content-wrapper {
  width: 100%;
}

.hero .intro {
  color: var(--vibrant-teal);
  font-family: var(--font-mono);
  font-size: 16px;
  margin-bottom: 20px;
  font-weight: 600;
  margin: 0;
  margin-top: 10px;
}

.hero .name {
  color: var(--slate);
  font-size: 72px;
  font-weight: 600;
  margin: 0;
}

.hero .subtitle {
  color: var(--slate);
  font-size: 30px;
  font-weight: 600;
  margin-top: 10px;
}

.hero .description {
  max-width: 540px;
  margin-top: 25px;
  color: var(--slate);
}

.hero .btn {
  margin-top: 50px;
  padding: 18px 28px;
  font-size: 16px;
}

.hero-image-container {
  position: absolute;
  right: 0;
  top: 25%;
  transform: translateY(-50%);
  width: 25%;
  perspective: 1000px;
}

@keyframes spin-coin {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

.hero-image-flipper {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  animation: spin-coin 10s linear infinite;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  backface-visibility: hidden;
}

.hero-image.back {
  transform: rotateY(180deg);
}

.section-title {
  color: var(--slate);
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
}

.section-title::after {
  content: "";
  display: block;
  position: relative;
  top: 0;
  width: 300px;
  height: 1px;
  margin-left: 20px;
  background-color: var(--light-navy);
}

.about-me .about-content {
  display: flex;
  gap: 50px;
}

.about-me .about-text {
  flex: 3;
}

.about-me .skills-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 200px));
  gap: 0 10px;
  padding: 0;
  margin: 20px 0 0 0;
  overflow: hidden;
  list-style: none;
}

.about-me .skills-list li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 20px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.about-me .skills-list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--vibrant-pink);
  font-size: 14px;
  line-height: 1;
}

.about-me .profile-pic-container {
  flex: 2;
  position: relative;
}

.about-me .profile-pic {
  width: 100%;
  border-radius: 4px;
  position: relative;
  z-index: 1;
}

.about-me .profile-pic-container::before {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: var(--gradient);
  top: 0;
  left: 0;
  z-index: 0;
  opacity: 0.2;
}

.about-me .profile-pic-container::after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid var(--vibrant-pink);
  border-radius: 4px;
  top: 20px;
  left: 20px;
  z-index: 0;
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.about-me .profile-pic-container:hover::after {
  top: 15px;
  left: 15px;
}

.experience .experience-tabs {
  display: flex;
  gap: 40px;
}

.experience .tab-buttons {
  display: flex;
  flex-direction: column;
}

.experience .tab-btn {
  background-color: transparent;
  border: none;
  border-left: 2px solid var(--light-navy);
  color: var(--slate);
  padding: 15px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-mono);
  font-weight: 600;
}

.experience .tab-btn:hover,
.experience .tab-btn.active {
  color: #64ffda; /* Keep teal for this section */
  background-color: var(--light-navy);
}

.experience .tab-content {
  flex: 1;
}

.experience-item {
  display: none;
}

.experience-item.active {
  display: block;
}

.experience-item h3 {
  color: var(--slate);
  font-size: 22px;
  font-weight: 500;
}

.experience-item h3 span {
  color: var(--vibrant-pink);
}

.experience-item .duration {
  font-family: var(--font-mono);
  font-size: 14px;
  margin: 5px 0 20px;
}

.experience-item ul {
  list-style: none;
  padding: 0;
}

.experience-item ul li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
}

.experience-item ul li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: #64ffda; /* Keep teal for this section */
}

.portfolio .project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  list-style: none;
  padding: 0;
}

.portfolio .project-item {
  background-color: var(--lightest-navy);
  border-radius: 4px;
  box-shadow: 0 10px 30px -15px var(--navy-shadow);
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
  border: 1px solid var(--light-navy);
}

.portfolio .project-item:hover {
  transform: translateY(-7px);
}

.portfolio .project-content {
  padding: 2rem 1.75rem;
}

.portfolio .project-overline {
  color: var(--vibrant-teal);
  font-family: var(--font-mono);
  font-size: 18px;
}

.portfolio .project-title {
  color: var(--slate);
  font-size: 24px;
  margin: 0 0 10px;
}

.portfolio .project-description {
  color: var(--slate);
  font-size: 17px;
}

.portfolio .project-tech-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.portfolio .project-tech-list li {
  margin-right: 15px;
  margin-bottom: 7px;
}

.portfolio .project-links {
  margin-top: 10px;
}

.portfolio .project-links a {
  color: var(--slate);
  font-size: 22px;
  margin-right: 15px;
  transition: color 0.3s;
}

.portfolio .project-links a:hover {
  color: #64ffda; /* Keep teal for this section */
}

.contact {
  text-align: center;
}

.contact .section-title {
  justify-content: center;
}

.contact .section-title::after {
  display: none;
}

.contact .contact-text {
  max-width: 600px;
  margin: 0 auto 40px;
}

.contact .btn {
  font-size: 16px;
  padding: 18px 28px;
}

.social-links {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.social-links a {
  color: var(--light-slate);
  font-size: 24px;
  margin: 0 15px;
  transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
  color: var(--vibrant-pink);
  transform: translateY(-3px);
}

/* Certifications Section */
.certifications .certification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 50px;
}

.certification-item {
  background-color: var(--light-navy);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.certification-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

.certification-item img {
  max-width: 100%;
  height: auto;
  margin-bottom: 15px;
}

.certification-title {
  color: var(--light-slate);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.3;
}

footer {
  text-align: center;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--light-slate);
}

.mobile-nav-toggle {
  display: none;
  color: var(--vibrant-pink);
  font-size: 24px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 75%;
  height: 100vh;
  background-color: var(--lightest-navy);
  z-index: 99;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.mobile-nav.active {
  transform: translateX(0);
}

.mobile-nav ul {
  list-style: none;
  padding: 0;
  text-align: center;
}

.mobile-nav ul li {
  margin: 20px 0;
}

.mobile-nav ul li a {
  color: var(--slate);
  text-decoration: none;
  font-size: 20px;
  font-family: var(--font-mono);
}

.mobile-nav ul li a.btn {
  margin-top: 20px;
  display: inline-block;
}

/* Blog Page Styles */
.blog-list-section {
  opacity: 1;
  transform: none;
  padding: 100px 0;
  max-width: 800px;
  margin: 0 auto;
}

.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.blog-post {
  background: var(--lightest-navy);
  padding: 25px;
  border-radius: 5px;
  transition: transform 0.3s ease;
  border: 1px solid var(--light-navy);
}

.blog-post:hover {
  transform: translateY(-5px);
}

.blog-post h3 a {
  color: var(--slate);
  text-decoration: none;
  font-size: 1.5rem;
}

.blog-post h3 a:hover {
  color: var(--vibrant-pink);
}

.medium-link-container {
  text-align: center;
  margin-bottom: 40px;
}

.blog-post .post-meta {
  font-size: 0.85rem;
  color: var(--slate);
  margin-bottom: 15px;
}

@media (max-width: 1080px) {
  main {
    padding: 0 100px;
  }
}

@media (max-width: 768px) {
  main {
    padding: 0 50px;
  }

  .section-title::after {
    width: 150px;
  }

  .about-me .about-content {
    flex-direction: column;
  }

  .experience .experience-tabs {
    flex-direction: column;
  }

  .experience .tab-buttons {
    flex-direction: row;
    overflow-x: auto;
  }

  header nav ul {
    display: none;
  }

  .mobile-nav-toggle {
    display: block;
  }

  .mobile-nav {
    display: flex;
  }

  .hero {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding-top: 100px; /* Add padding to avoid overlap with header */
  }

  .hero-text {
    max-width: 100%;
    order: 2; /* Ensure text comes after the image if needed, or adjust as necessary */
  }

  .hero-image-container {
    position: relative; /* Change from absolute to relative */
    width: 50%; /* Adjust width for mobile */
    max-width: 200px; /* Max width for the image */
    order: 1; /* Image appears before the text */
    margin: 0 auto 30px; /* Center the container and add space below */
    top: auto; /* Reset positioning */
    right: auto;
    transform: none; /* Reset transform */
  }
}

@media (max-width: 480px) {
  main {
    padding: 0 25px;
  }

  header nav ul {
    display: none; /* Simple responsive nav for now */
  }
}
