/* Existing imports */
@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Russo+One&display=swap');

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: white;
}

body.nav-active {
  overflow: hidden;
}

.container {
  padding-inline: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.social-list {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-link {
  font-size: 2rem;
  transition: 0.25s ease;
}

.social-link:is(:hover, :focus-visible) {
  transform: translateY(-3px);
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  box-shadow: 0 0 20px hsla(216, 14%, 14%, 0.05);
  z-index: 4;
  background-color: #fff;
}

.header.active {
  background-color: #fff;
  position: fixed;
  animation: slideIn 0.5s ease forwards;
}

@keyframes slideIn {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(0);
  }
}

.nav-open-btn {
  font-size: 3.5rem;
  color: hsla(218, 22%, 26%, 1);
  margin-top: 10px;
  border: none;
  background: none;
  cursor: pointer;
}

.header.active .nav-open-btn {
  color: hsla(218, 22%, 26%, 1);
}

.logo {
  text-decoration: none;
  color: hsla(218, 22%, 26%, 1);
  font-family: "Kanit", sans-serif;
  font-weight: 800;
}

.logo.active {
  color: #fff;
}

.navbar {
  position: fixed;
  top: 0;
  left: -300px;
  background-color: rgb(64, 125, 190);
  color: #fff;
  max-width: 300px;
  width: 100%;
  height: 100vh;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  z-index: 2;
  visibility: hidden;
  transition: 0.3s ease-in-out;
}

.navbar.active {
  visibility: visible;
  transform: translateX(300px);
}

.navbar-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #fff;
  font-family: "Russo One", sans-serif;
  font-weight: 400;
  gap: 20px;
}

.navbar-link {
  text-decoration: none;
  color: #fff;
  font-size: 1.2rem;
}

.navbar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-close-btn {
  background-color: rgb(64, 125, 190);
  color: #fff;
  font-size: 2rem;
  padding: 6px;
  border: none;
  margin-top: 10px;
  margin-left: 20px;
  transition: 0.25s ease;
  cursor: pointer;
}

.nav-close-btn ion-icon {
  --ionicon-stroke-width: 50px;
}

.contact-link {
  display: block;
  text-decoration: none;
  color: #fff;
  margin-bottom: 10px;
}

.contact-link {
  background-color: rgb(255, 255, 255);
  color: rgb(0, 0, 0);
  padding: 20px;
  width: 52%;
  font-family: "Russo One", sans-serif;
  border-radius: 50px;
}

.contact-link:hover {
  background-color: rgb(0, 0, 0);
  color: rgb(255, 255, 255);
}

.social-list {
  text-decoration: none;
  list-style-type: none;
}

.social-link {
  color: #fff;
}

.social-link:hover {
  color: rgb(162, 162, 162);
}

.wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: hsla(216, 14%, 14%, 1);
  pointer-events: none;
  opacity: 0;
  transition: 0.25s ease;
}

.overlay.active {
  pointer-events: all;
  opacity: 0.8;
}

.btn {
  margin-left: 16px;
}

.hero-section {
  background-image: url('./assets/images/bg.png');
  background-repeat: no-repeat;
  background-size: cover;
  padding: 0px 20px;
  display: flex;
  font-family: "Russo One", sans-serif;
  align-items: center;
  justify-content: space-around;
}

.hero-content {
  margin-top: 170px;
}

.hero-title {
  font-size: calc(2.7rem + 1.38vw);
  font-weight: 700;
  line-height: 1.3;
  font-size: 230%;
}

.btn-wrapper {
  margin-top: 50px;
}

.btn-free {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  height: 65px;
  border-radius: 10px 50px 10px 50px;
  background-color: black;
  border: none;
  padding: 20px;
  cursor: pointer;
  text-decoration: none;
  transition: 0.25s ease;
  will-change: transform;
}

.btn-free:hover {
  background-color: transparent;
  border: 2px solid black;
  color: #000000;
  transform: translateY(-40px);
}

.btn-free:is(:hover, :focus-visible) {
  transform: translateY(-4px);
}

.hero-image {
  aspect-ratio: var(--width) / var(--height);
  overflow: hidden;
}

.hero-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-me {
  padding: 100px 15px;
}

.about-heading {
  font-size: 4rem;
  text-align: center;
  color: black;
  font-family: "Russo One", sans-serif;
}

.timeline-items {
  max-width: 1200px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  position: relative;
  margin-top: 100px;
}

.timeline-items::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 100%;
  background-color: black;
  left: calc(50% - 1px);
}

.timeline-item {
  margin-bottom: 40px;
  color: #fff;
  width: 100%;
  position: relative;
  font-family: "Russo One", sans-serif;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item:nth-child(odd) {
  padding-right: calc(50% + 30px);
  text-align: right;
}

.timeline-item:nth-child(even) {
  padding-left: calc(50% + 30px);
}

.timeline-dot {
  height: 21px;
  width: 21px;
  background-color: rgb(64, 125, 190);
  box-shadow: 0 0 25px rgb(64, 125, 190);
  position: absolute;
  left: calc(50% - 8px);
  border-radius: 50%;
  top: 10px;
}

.timeline-date {
  font-size: 20px;
  font-weight: 800;
  color: rgb(255, 255, 255);
  margin-bottom: 15px;
}

.timeline-content {
  background-color: #606060;
  border: 2px solid rgb(64, 125, 190);
  border-radius: 20px;
  padding: 20px 40px;
  cursor: pointer;
}

.timeline-content h3 {
  margin-bottom: 20px;
  font-size: 140%;
}

.timeline-content:hover {
  transform: translateY(-10px);
  box-shadow: 0 0 25px rgb(64, 125, 190);
}

.technologies-section {
  width: 100%;
  display: grid;
  place-items: center;
  background: #ffffff;
  font-family: "Russo One", sans-serif;
}

.technologies-div {
  width: 90%;
  height: auto;
  text-align: center;
}

.technologies-div h1 {
  font-size: 3rem;
  text-align: center;
  color: black;
  font-family: "Russo One", sans-serif;
  margin-bottom: 50px;
}

.technologies-loop {
  width: 100%;
  height: auto;
  margin-bottom: 70px;
}

.technologies-loop ul {
  width: 100%;
  height: auto;
}

.technologies-loop ul li {
  list-style: none;
  display: inline-block;
  width: 125px;
  height: 100px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  margin: 10px;
  border: 0.5px solid #555;
  box-shadow: 0px 0px 0px 1px #555;
  transition: 0.5s;
}

.technologies-loop ul li img {
  width: 100px;
  height: 100px;
  padding: 10px;
}

.technologies-loop ul li img:nth-child(1) {
  transform: translateY(0);
  transition: 0.5s;
}

.technologies-loop ul li img:nth-child(2) {
  transform: translateY(0);
  transition: 0.5s;
}

.technologies-loop ul li:hover img:nth-child(1) {
  transform: translateY(-100%);
  transition: 0.5s;
}

.technologies-loop ul li:hover img:nth-child(2) {
  transform: translateY(-100%);
  transition: 0.5s;
}

.contact h1 {
  font-family: "Russo One", sans-serif;
  color: #000000;
  text-align: center;
  font-size: 3rem;
  margin-bottom: 50px;
}

.contact form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin: 5rem auto;
  text-align: center;
  padding-left: 20px;
  padding-right: 20px;
}

.contact form .input-box {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.contact form .input-box input,
.contact form textarea {
  width: 100%;
  padding: 1rem;
  font-size: 0.8rem;
  color: black;
  background: #dad9d9;
  border-radius: 1rem;
  border: 2px solid black;
  margin: 1.5rem 0;
  resize: none;
}

.contact form textarea {
  height: 280px;
}

.contact form .the-btn {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  height: 65px;
  border-radius: 10px 50px 10px 50px;
  background-color: black;
  border: none;
  padding: 20px;
  cursor: pointer;
  text-decoration: none;
  transition: 0.25s ease;
  will-change: transform;
}

.contact form .the-btn:hover {
  background-color: transparent;
  border: 2px solid black;
  color: #000000;
  transform: translateY(-40px);
}

.contact form .the-btn:is(:hover, :focus-visible) {
  transform: translateY(-4px);
}

.portfolio-image {
  aspect-ratio: var(--width) / var(--height);
  overflow: hidden;
}

.the-port-img {
  width: 500px;
  height: 300px;
  padding-left: 30px;
  padding-right: 30px;
}

.portfolio-title {
  font-family: "Russo One", sans-serif;
  color: #000000;
  text-align: center;
  font-size: 3rem;
  margin-bottom: 50px;
}

.portfolio-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding-left: 20px;
  padding-right: 20px;
  gap: 20px;
  margin-bottom: 70px;
}

.portfolio-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 1 100%; 
  box-sizing: border-box;
  border: 3px solid rgb(0, 0, 0);
  border-radius: 20px;
  padding: 16px;
}

.portfolio-desc-one {
  margin-bottom: 10px;
  color: rgb(0, 127, 0);
}

.portfolio-desc-two {
  margin-bottom: 10px;
  color: rgb(237, 2, 2);
}

.portfolio-text {
  font-family: "Russo One", sans-serif;
}

.portfolio-text h3 {
  font-size: 140%;
  margin-bottom: 10px;
}

.portfolio-text p {
  margin-bottom: 15px;
}

.portfolio-image img {
  width: 100%;
  height: auto;
}

.portfolio-text a {
  background-color: #000000; 
  border: none; 
  color: white; 
  padding: 15px 32px; 
  text-align: center; 
  text-decoration: none; 
  display: inline-block; 
  font-size: 16px; 
  cursor: pointer; 
  border-radius: 8px; 
  transition: background-color 0.3s, color 0.3s, border-color 0.3s; /* Added color and border-color transition */
  box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

.portfolio-text a:hover {
  background-color: #ffffff; 
  color: #000000; 
  border: 1px solid #000000; 
}

.footer {
  position: relative;
  width: 100%;
  background-color: #d7d7d7;
  min-height: 100px;
  padding: 20px 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-family: "Russo One", sans-serif;
}

.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 10px 5px;
  flex-wrap: wrap;
}

.icon-elem {
  list-style: none;
}

.icon {
  color: rgb(0, 0, 0);
  font-size: 32px;
  display: inline-block;
  margin: 0 10px;
}

.icon:hover {
  color: rgb(120, 120, 120);
}

.menu {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 10px 5px;
  flex-wrap: wrap;
}

.menu-elem {
  list-style: none;
}

.menu-icon {
  color: rgb(0, 0, 0);
  font-size: 18px;
  display: inline-block;
  text-decoration: none;
  margin: 0 10px;
  margin-bottom: 10px;
}

.menu-icon:hover {
  color: rgb(120, 120, 120);
}

.scrollTop {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 10px 15px;
  background-color: #000;
  color: #ffffff;
  border-radius: 5px;
  border-radius: 1px solid #fff;
  cursor: pointer;
  transition: all 0.5s ease;
}

.scrollTop:hover {
  background-color: #dbdbdb;
  color: #000;
}

.arrow-up {
  font-size: 150%;
}

@media screen and (min-width: 1024px) {
  .portfolio-box {
    flex: 1 1 calc(50% - 20px); 
    max-width: calc(50% - 20px); 
  }
}

@media screen and (min-width: 992px) {
  .hero-section {
    text-align: left;
    margin-top: -85px;
  }

  .hero-content {
    display: grid; 
    grid-template-columns: 1fr 0.8fr; 
    align-items: center; 
    gap: 20px; 
  }

  .hero-things {
    grid-column: 1 / 2; 
  }

  .hero-image {
    grid-column: 2 / 3;
    justify-self: end; 
  }

  .container {
    max-width: 960px;
    display: flex; 
    align-items: center; 
  }

  .nav-open-btn,
  .navbar > *:not(.navbar-list),
  .overlay {
    display: none;
  }

  .navbar {
    all: unset; 
    display: flex; 
    margin-inline: auto;
    align-items: center; 
  }

  .navbar-list {
    display: flex;
    gap: 50px;
    margin-left: auto; 
    flex-direction: row; 
    align-items: center;
    margin-top: -45px;
    margin-right: 15px;
  }

  .navbar-link {
    color: #000000;
    text-decoration: none;
  }

  .navbar-link:hover {
    background-color: #000;
    color: #fff;
    padding: 10px;
    border-radius: 10px;
  }
}

@media screen and (max-width: 768px) {
  .the-port-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

@media screen and (max-width: 650px) {
  .timeline-items::before {
    left: 10px; 
  }

  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    padding-left: 30px;
    padding-right: 30px;
    text-align: left; 
  }

  .timeline-dot {
    left: 12.5px; 
    right: auto;
    transform: translateX(-50%);
  }

  .contact form {
    flex-direction: column;
  }

  .contact form textarea {
    width: 80%;
    margin-top: -20px;
    margin-bottom: 40px;
  }

}

@media screen and (max-width: 575px) {
  .container {
    max-width: 540px;
    width: 100%;
    margin-inline: auto;
  }
}

@media screen and (max-width: 400px) {
  .logo {
    font-size: 70%;
  }

  .technologies-div h1 { 
    font-size: 2rem;
  }

  .contact h1 {
    font-size: 2rem;
  }

  .portfolio-title {
    font-size: 2rem;
  }
}

@media screen and (max-width: 390px) {
  .contact form textarea {
    width: 100%;
  }
}