:root {
  --primary-color: #252839;
  --secondary-color: #2b2e3f;
  --border-color: #4b4e5f;
  --text-color1: #fefefe;
  --text-color2: #f6f6f6;
  --gradient1: #00000080;
  --gradient2: #000000cc;
  --online-status: #31cc46;
  --themes: #4b4e5f;
  --diagonal-gradient: linear-gradient(
    to bottom right,
    var(--gradient2) 5%,
    var(--gradient1) 40%,
    transparent
  );
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  font-size: clamp(0.8rem, 2vw, 14px);
  text-align: left;
  text-decoration: none;
  color: var(--text-color2);
}
body {
  position: relative;
  width: 90vw;
  max-width: 1150px;
  margin: 0 auto;
  background-color: var(--primary-color);
}

/* Particles background */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  background-color: var(--primary-color);
}

/* General typography */
h1,
h2 {
  font-family: "Montserrat", sans-serif;
  color: var(--text-color1);
}
h1 {
  font-size: clamp(2rem, 5vw, 2.5rem);
}
h2,
.toast {
  font-size: clamp(0.9rem, 3vw, 1.05rem);
}
p,
li {
  font-weight: 300;
}

/* Sections */
section {
  margin-bottom: 5px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: clamp(10px, 2vw, 20px);
  background-color: var(--secondary-color);
}

/* Themes */
#mobile-theme-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40%;
  min-width: 136px;
  max-width: 200px;
  height: auto;
  margin-left: auto;
  border: 2px solid var(--border-color);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  padding: 12px 0;
  background-color: var(--secondary-color);
  box-shadow: 0 2px 5px var(--gradient1);
}
#desktop-theme-bar {
  display: none;
}
.themes {
  border-radius: 50%;
  background-color: #ccc;
  cursor: pointer;
}

/* Intro section */
#hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  margin-top: 10px;
}
#hero * {
  padding: 2px 0;
}
#intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#intro h2 {
  font-size: clamp(1rem, 3vw, 1.1rem);
  font-weight: 400;
}
#intro p,
#social-links a {
  font-size: clamp(0.9rem, 2vw, 16px);
}
#intro #name,
#intro #emoji {
  font-size: clamp(1.1rem, 3vw, 1.2rem);
  font-weight: 700;
}
#status {
  position: relative;
  aspect-ratio: 1 / 1;
  width: clamp(100px, 30vw, 200px);
  margin: 0 auto;
  padding-left: 5%;
}
#profile-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  border: 3px solid var(--themes);
  border-radius: 50%;
  padding: 0;
}
#online {
  position: absolute;
  bottom: 10%;
  right: 10%;
  aspect-ratio: 1 / 1;
  width: 12%;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  background-color: var(--online-status);
  box-shadow: 0 0 0 rgba(49, 162, 76, 0.7);
  animation: pulse 1s infinite;
}

/* About me */
#about * {
  text-align: left;
}
#about p,
#skills ul li {
  line-height: 1.3;
}

/* Skills */
#skills ul {
  list-style-position: outside;
  padding-left: 15px;
}
#skills ul li {
  margin-bottom: 10px;
}
#skills ul li span {
  font-weight: 700;
}

/* Works section */
#works {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 5px;
  border: 0;
  padding: 0;
  background-color: transparent;
}
.my-works {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 3;
  width: 100%;
  height: 100%;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--secondary-color);
}
.my-works h2 {
  position: relative;
  z-index: 2;
  padding: clamp(10px, 2vw, 20px);
}

/* .my-works background */
#projects::before,
#certifications::before,
#artworks::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  width: 101%;
  height: 101%;
  border-radius: 8px;
  padding: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
}
#projects::before {
  background-image: var(--diagonal-gradient),
    url("/assets/images/backgrounds/projects-background.png");
}
#certifications::before {
  background-image: var(--diagonal-gradient),
    url("/assets/images/backgrounds/certifications-background.png");
}
#artworks::before {
  width: 170%;
  height: 170%;
  transform: translate(-50%, -50%) rotate(-35deg);
  background-image: var(--diagonal-gradient),
    url("/assets/images/backgrounds/artworks-background.png");
  background-size: 250px 250px;
  background-repeat: repeat;
}
#testing {
  background: var(--diagonal-gradient), var(--secondary-color);
  position: relative;
}
#bug {
  position: absolute;
  bottom: clamp(-31px, -2.5vw, -15px);
  right: clamp(-31px, -2.5vw, -15px);
  transform: rotate(-45deg);
  font-size: clamp(5rem, 12vw, 10rem);
  color: var(--border-color);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  border: 1px solid var(--themes);
  border-radius: 8px;
  padding: 10px 20px;
  color: var(--text-color1);
  background-color: var(--secondary-color);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

/* Contacts section */
#contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
#contact i {
  margin-right: 10px;
}
#social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 0.8rem, 15px);
  width: 100%;
  margin-top: 10px;
}
#social-links a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50%;
  max-width: 100px;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 5px;
}
#social-links a i {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin: 0 auto;
}
#social-links a:hover:active {
  box-shadow: 0 1px;
}
#social-links a:active {
  transform: translate(1px, 2px);
}

/* Download resume */
#download {
  position: relative;
  width: 50%;
  margin: 0 auto;
  margin-bottom: 20px;
}
#download:active {
  box-shadow: 1px 2px;
  transform: translate(2px, 3px);
}
#download * {
  position: relative;
  z-index: 1;
}
#download-resume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
}
#download-icon {
  color: var(--text-color1);
}

/* Scroll-to-top */
#back-to-top {
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#back-to-top.show {
  opacity: 1;
  visibility: visible;
}
#arrow-circle {
  border-radius: 50%;
  font-size: clamp(2.8rem, 5vw, 3rem);
  color: var(--text-color2);
  background-color: var(--primary-color);
  opacity: 0.75;
}
#arrow-circle:hover {
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(49, 162, 76, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(49, 162, 76, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(49, 162, 76, 0);
  }
}

/* Responsiveness */
@media (min-width: 768px) {
  section {
    margin-bottom: 0;
  }

  #hero,
  #download {
    margin: 0;
  }
  #hero {
    grid-area: hero;
  }

  #themes-about {
    grid-area: themes-about;
  }
  #about {
    min-height: 100%;
  }

  #skills {
    grid-area: skills;
  }

  #works {
    grid-area: works;
    gap: 12px;
    margin-bottom: 20px;
  }

  #contact-download {
    grid-area: contact-download;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  #download {
    width: 100%;
  }

  #grid-layout {
    display: grid;
    grid-template-areas:
      "hero hero hero hero hero"
      "themes-about themes-about skills skills contact-download"
      "works works works works contact-download";
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 12px;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
  }
}
@media (min-width: 1280px) {
  body {
    padding: 0;
  }

  #grid-layout {
    grid-template-areas:
      "hero hero hero themes-about"
      "skills works works themes-about"
      "skills works works contact-download";
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }

  #themes-about {
    display: grid;
    grid-template-rows: 11% auto;
    gap: 12px;
  }

  #desktop-theme-bar {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #works {
    margin-bottom: 0;
  }
  .my-works {
    aspect-ratio: 0;
  }

  #back-to-top,
  #mobile-theme-bar {
    display: none;
  }
}
