:root {
  --primary-color: #3b38a0;
  --secondary-color: #7a85c1;
  --primary-color-transparent: #3b38a082;
  --background-color: #f4f7fc;
  --text-color: #333;
  --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  letter-spacing: 0.03em;
  background-color: var(--background-color);
  color: var(--text-color);
}

li {
  list-style: none;
}

/*  ========== Section Styling  ==========*/
nav,
section {
  width: 70%;
  margin: 0 auto;
}
section {
  padding: 5em 0;
  text-align: left;
}

#home {
  padding-top: 10em;
}

section h2 {
  font-size: 3em;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5em;
  text-transform: uppercase;
}
section h2::after {
  content: "";
  display: block;
  width: 75px;
  height: 5px;
  background-color: var(--secondary-color);
}

main > div:nth-child(2n) {
  background-color: var(--primary-color);
}

main > div:nth-child(2n) section {
  padding: 5em 0;
}

main > div:nth-child(2n) h2,
main > div:nth-child(2n) .section-title p {
  color: #fff;
}
main > div:nth-child(2n) h2::after {
  background-color: #fff;
}

section > p,
.section-title p {
  font-size: 1.2em;
  font-weight: 400;
  margin-bottom: 4em;
  color: var(--primary-color);
  width: 70%;
  line-height: 1.6;
  letter-spacing: 0.1em;
}
/* ========== End Section Styling */

/*========== Navbar Styling ==========*/
nav {
  margin: 10px auto;
  padding: 0.9em 2em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--primary-color-transparent);
  backdrop-filter: blur(10px);
  border-radius: 100px;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  font-size: 1.2em;
}

nav ul {
  display: flex;
  align-items: center;
}

.logo {
  font-size: 1em;
  font-weight: 900;
  color: #fff;
}

nav ul li {
  padding: 0 0.9em;
  font-size: 0.8em;
}

a {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: var(--secondary-color);
}
/* ========== End Navbar Styling ========== */

/* ========== Hero Section ========== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.hero-content {
  flex: 3;
  padding-right: 5em;
}

.hero-section h1 {
  font-size: 2.5em;
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: 0.5em;
}

.hero-section p {
  font-size: 1em;
  margin-bottom: 2em;
  text-align: justify;
  line-height: 1.6;
}

.hero-image {
  flex: 1;
}

.hero-section img {
  max-width: 120%;
  height: auto;
  background-color: var(--primary-color);
  border-radius: 50% 0 50% 0;
}
/* ========== End Hero Section ========== */

/* ========== Education / Timeline Section ==========*/
.timeline-container {
  max-width: 800px;
  margin: auto;
}

.timeline-list {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 4px;
  background-color: var(--secondary-color);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 2em;
  padding-left: 35px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: 3px solid #fff;
  z-index: 1;
}

.timeline-content {
  background-color: #fff;
  padding: 1.5em;
  border-radius: 0 20px 20px 20px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 2em;
}

.timeline-content:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.timeline-date {
  display: block;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5em;
  font-size: 0.9em;
}

.timeline-content h3 {
  margin: 0 0 0.5em 0;
  font-size: 1.2em;
  color: var(--text-color);
}

.timeline-content p {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.5;
}
.timeline-img img {
  width: 80px;
  height: auto;
}
/* ========== End Education Section ========== */

/* ========== Skills Section ==========*/
.skills-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2em;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8em;
  padding: 1.5em;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex: auto;
}

.skill-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.skill-item img {
  width: 50px;
  height: 50px;
}

.skill-item p {
  font-weight: 600;
}

.caption {
  font-size: 0.7em;
  font-weight: 400;
  color: var(--secondary-color);
  margin-top: 0.2em;
}
/* ========== End Education Section ========== */

/* ========== Projects Section ==========*/
.projects-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  justify-content: center;
}

.project-item {
  background-color: #fff;
  padding: 1.5em;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 30%;
  display: flex;
  flex-direction: column;
  gap: 1em;
  flex-basis: 30%;
  align-items: center;
  text-align: center;
}

.project-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.project-item img {
  width: 100%;
  height: 70%;
  object-fit: cover;
  border-radius: 8px;
}
/* ========== End Projects Section ========== */

/* ========== Gallery Section ========== */

.images-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5em;
  justify-items: center;
  align-items: center;
}
.images-container img {
  max-width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  border: dashed 2px var(--primary-color);
  box-sizing: border-box;
  transition: all ease 0.5s;
}

.images-container img:hover {
  transform: scale(125%);
}
/* ========== End Gallery Section ========== */

/* ========== Contacts Section ==========*/
#contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
}

#contact .section-title {
  width: 50%;
}
.contact-container {
  display: flex;
  flex-direction: column;
  align-items: right;
  gap: 2em;
  width: 50%;
}

.contact-item {
  background-color: #fff;
  padding: 1.7em;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2em;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  transition: all ease 0.3s;
  min-width: 300px;
  flex: 1;
}

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.contact-item svg {
  width: 2em;
  height: 2em;
}

.contact-item .btn {
  margin-left: auto;
}

.contact-item a {
  color: var(--text-color);
  text-decoration: underline;
}

.contact-item a:hover {
  color: var(--secondary-color);
}
/* ========== End Contact Section ========== */

/*========== Footer ==========  */
footer {
  text-align: center;
  padding: 2em;
  background-color: var(--text-color);
  color: white;
}

/* ========== Utility ========== */
.btn {
  padding: 0.8em 1.8em;
  border-radius: 100px;
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  transition: background-color 0.3s ease;
  text-align: center;
  display: inline-block;
}

.btn:hover {
  background-color: var(--secondary-color);
}

.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
}

/* Badges Color */
.unity {
  background-color: #333;
}
.postgresql {
  background-color: #336791;
}
.html {
  background-color: #e34c26;
}
.css {
  background-color: #264de4;
}
.js {
  background-color: #f7df1e;
}
.c {
  background-color: #00599c;
}
.raylib {
  background-color: #ff7f50;
}
.go {
  background-color: #00add8;
}

/* Floating Shapes Decoration */
.shape-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.floating-shape {
  position: absolute;
  display: block;
  list-style: none;
  background-color: var(--primary-color-transparent);
  animation: float 20s infinite linear;
  transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
}
.shape1 {
  left: 10%;
  width: 80px;
  height: 80px;
  bottom: -150px;
  animation-duration: 18s;
  border-radius: 50%;
  background-color: transparent;
  border: solid 5px var(--primary-color-transparent);
}
.shape2 {
  left: 25%;
  width: 40px;
  height: 40px;
  bottom: -150px;
  animation-duration: 22s;
  animation-delay: 3s;
  background-color: transparent;
  border: solid 5px var(--primary-color-transparent);
}
.shape3 {
  left: 40%;
  width: 25px;
  height: 25px;
  bottom: -150px;
  animation-duration: 25s;
  animation-delay: 1s;
  border-radius: 50%;
}
.shape4 {
  left: 60%;
  width: 100px;
  height: 100px;
  bottom: -150px;
  animation-duration: 15s;
  animation-delay: 5s;
}
.shape5 {
  left: 75%;
  width: 50px;
  height: 50px;
  bottom: -150px;
  animation-duration: 20s;
  animation-delay: 2s;
  border-radius: 50%;
}
.shape6 {
  left: 85%;
  width: 120px;
  height: 120px;
  bottom: -150px;
  animation-duration: 16s;
  animation-delay: 7s;
  background-color: transparent;
  border: solid 5px var(--primary-color-transparent);
}
.shape7 {
  left: 5%;
  width: 20px;
  height: 20px;
  bottom: -150px;
  animation-duration: 30s;
  animation-delay: 4s;
}
.shape8 {
  left: 90%;
  width: 35px;
  height: 35px;
  bottom: -150px;
  animation-duration: 28s;
  animation-delay: 6s;
  border-radius: 50%;
}

/* Shape Animation */
@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-120vh) rotate(720deg);
    opacity: 0;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  section,
  nav {
    width: 85%;
  }
  .project-item {
    flex-basis: 45%;
  }
}

@media (max-width: 768px) {
  /* Common styling */
  nav,
  section {
    width: 90%;
  }
  h2 {
    font-size: 1.8em;
  }
  section > p,
  .section-title p {
    text-align: center;
    margin: 2em auto;
    width: 90%;
  }

  #education,
  #skills,
  #projects,
  #contact {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .section-title {
    margin: auto;
  }
  /* Utility */

  .badge {
    padding: 0.5em 1em;
  }

  /* Navbar */
  nav {
    flex-direction: column;
  }

  nav ul {
    display: none;
  }

  nav ul li {
    padding: 0 0.5em;
  }

  /* Hero Section */
  .hero-section {
    flex-direction: column-reverse;
    text-align: center;
    justify-content: space-evenly;
    align-items: center;
    height: auto;
    min-height: auto;
    padding-top: 8em;
  }

  .hero-content {
    padding-right: 0;
  }

  .hero-section p {
    text-align: center;
  }

  .hero-image {
    margin-bottom: 2em;
  }

  .hero-section img {
    width: 60%;
  }
  section h2 {
    text-align: center;
  }

  section h2::after {
    margin: auto;
  }

  /* Education */
  .timeline-item {
    padding-left: 25px;
  }
  .timeline-list::before {
    left: 4px;
  }
  .timeline-item::before {
    width: 12px;
    height: 12px;
  }
  .projects-container {
    width: 75%;
    margin: auto;
  }
  /* Projects */
  .project-item {
    flex-basis: 100%;
  }
  .project-item img {
    width: 80%;
    height: auto;
  }
  /* Gallery */
  .images-container {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .images-container img {
    width: 150px;
    height: 150px;
  }
  /* Contact */

  #contact .section-title {
    width: 100%;
  }
  .contact-container {
    flex-direction: column;
    width: 100%;
  }
  .contact-item {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 2em;
    gap: 1em;
  }
}

@media (max-width: 576px) {
  .project-item {
    flex-basis: 90%;
  }
}

@media (max-width: 480px) {
  section {
    width: 95%;
    padding: 3em 0;
  }

  #home {
    padding-top: 8em;
  }

  .hero-section h1 {
    font-size: 2em;
  }
  h2 {
    font-size: 1.2em;
  }

  .btn {
    font-size: 0.9em;
  }
  .projects-container {
    width: 100%;
  }
}

/* Animation */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
body {
  animation: fadeIn 0.5s ease-in-out;
}
