@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap");
@import url("colors.css");

h1,
h2 {
  font-size: clamp(1.5rem, 3vw, 4rem);
  font-weight: 300;
}

p {
  line-height: 1.5;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
}

h1::selection,
h2::selection,
p::selection,
span::selection,
li::selection,
img::selection,
a::selection {
  background-color: var(--mocha-mauve);
  color: var(--mocha-surface0);
}

body {
  font-family: "Fira Code";
  background-color: var(--mocha-crust);
  color: var(--mocha-text);
  height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

a,
#contact-button {
  color: var(--mocha-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover,
#contact-button:hover,
.popup-gitrepo-link:hover {
  color: var(--mocha-sapphire);
  text-decoration: underline;
  cursor: pointer;
}

#mailto-link {
  color: var(--mocha-subtext1);
}

#mailto-link:hover {
  color: var(--mocha-lavender);
}

#smallfetch-container {
  max-width: 3000px;
  min-width: fit-content;
  max-height: fit-content;
  display: flex;
  flex-direction: column;
}

#p2p-chat-container {
  max-width: 3000px;
  min-width: fit-content;
  min-height: fit-content;
  display: flex;
  flex-direction: column;
}

#desc-techstack-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 5px;
  margin: 5px;
}

#tech-stack-used {
  display: flex;
  flex-direction: column;
}

.smallfetch-popup img {
  max-width: 100%;
  max-height: 100%;
}

.p2p-chat-popup img {
  max-width: 100%;
  max-height: 100%;
}

.project-desc {
  max-width: 60ch;
  margin: 0 auto;
  text-align: center;
}

.popup {
  font-size: clamp(0.8rem, 1vw, 1.1rem);
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 500;
}

.popup-content {
  background: var(--mocha-mantle);
  border: 0.5px solid var(--mocha-surface0);
  border-radius: 8px;
  padding: 20px;
  text-align: left;
  max-width: 820px;
  width: calc(100% - 48px);
  box-sizing: border-box;
  position: relative;
}

.close-btn {
  top: 10px;
  left: 10px;
  cursor: pointer;
  color: var(--mocha-red);
  font-weight: 700;
  background: none;
  border: none;
  font-size: 16px;
}

.popup-title {
  font-size: clamp(1.5rem, 2.5vw, 1.8rem);
  font-weight: 600;
  color: var(--mocha-sapphire);
}

.popup-gitrepo-link {
  font-size: clamp(0.8rem, 1vw, 1.1rem);
  color: var(--mocha-pink);
  margin-bottom: 10px;
  font-weight: bold;
}

.popup-subtitle {
  font-size: clamp(1.1rem, 1.9vw, 1.5rem);
  color: var(--mocha-sapphire);
  margin-bottom: 10px;
  font-weight: 700;
}

ul {
  list-style: none;
  padding: 0;
  font-size: clamp(0.8rem, 1.3vw, 1.1rem);
}

ul li {
  padding: 8px 0;
}

ul li:first-child {
  padding-top: 0;
}

ul li:last-child {
  padding-bottom: 0;
}

.top-bar {
  position: fixed;
  background-color: var(--mocha-mantle);
  margin-top: 10px;
  height: clamp(40px, 4vh, 60px);
  font-size: clamp(0.8rem, 1.5vw, 1.2rem);
  width: 98.5%;
  gap: 1px;
  margin: 10px;
  padding-left: 5px;
  border-radius: 10px;
  text-align: center;
  display: flex;
  align-items: center;
  z-index: 100;
}

.top-bar a {
  margin-left: 5px;
}

.site-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--mocha-pink);
  transition: filter 0.5s ease;
  height: 100vh;
}

.title,
.subtitle {
  display: inline-block;
  overflow: hidden;
  border-right: 0.05em solid var(--mocha-pink);
  white-space: nowrap;
  margin: 0 auto;
  font-size: 8vw;
  letter-spacing: 0.01rem;
  animation:
    typing 1.5s steps(13, end) forwards,
    blink-caret 0.75s step-end infinite;
  width: 0;
}

.subtitle {
  font-size: 2vw;
  animation:
    typing 1.5s steps(13, end) forwards 2s,
    blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 13ch;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-right-color: transparent;
  }
  50% {
    border-color: var(--mocha-pink);
  }
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
  width: 80vw;
  max-width: 1600px;
  min-height: 80vh;
  height: auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 60px;
}

.subcontainer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  height: 100%;
  width: 90%;
}

.about-me-container {
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 0.1rem;
  height: 80%;
  width: 50%;
  text-align: left;
}

.tech-stack-skills-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 80%;
  width: 40%;
  text-align: left;
}

.tech-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  grid-row-gap: 0.5rem;
  grid-column-gap: 0.5rem;
  width: 100%;
  padding: 5px;
  box-sizing: border-box;
  max-width: 720px;
  margin: 0 auto;
}


.popup .tech-stack {
  justify-items: center;
  grid-row-gap: 1rem;
  grid-column-gap: 1rem;
  max-width: none;
  width: auto;
  grid-auto-flow: column;
  grid-auto-columns: min-content;
  justify-content: center;
  margin: 0 auto;
}


.popup .tech-stack-item {
  min-width: 150px;
  max-width: 260px;
  width: auto;
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--mocha-base);
  border-radius: 8px;
  padding: 14px;
  box-sizing: border-box;
  border: solid 0.5px var(--mocha-surface0);
}

.popup .tech-stack-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.tech-stack-item {
  display: flex;
  background-color: var(--mocha-base);
  border-radius: 8px;
  padding: 10px;
  border: solid 0.5px var(--mocha-surface0);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  aspect-ratio: 1/1;
}

.tech-stack-item img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.tech-name {
  margin-top: 5px;
  font-size: 100%;
  color: var(--mocha-text);
}

.skills {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  height: 50%;
  width: 100%;
}

.projects-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  height: 35%;
  width: 80%;
}

.project-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--mocha-base);
  width: 10%;
  aspect-ratio: 1/1.2;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-align: center;
  font-size: clamp(0.8rem, 1vw, 1.2rem);
  border: 0.5px solid var(--mocha-surface0);
  transition:
    transform 1s ease,
    border 1s ease,
    background-color 1s ease,
    outline 1s ease;
}

.project-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-button:hover {
  transform: scale(1.1);
  background-color: var(--mocha-surface0);
  outline: 2px solid var(--mocha-mauve);
}

#skills-list,
#about-me-text {
  color: var(--mocha-subtext0);
  font-size: clamp(0.8rem, 1vw, 1.2rem);
}

#title-about-me,
#title-skills,
#title-projects,
#title-tech-stack {
  color: var(--mocha-sapphire);
  background-color: var(--mocha-crust);
  border-radius: 10px;
  font-size: clamp(1rem, 1.5vw, 2.5rem);
  font-weight: 400;
  margin: 0;
}

@media (max-width: 786px) {
  .subcontainer {
    flex-direction: column;
    width: 95%;
  }

  .about-me-container,
  .tech-stack-skills-container {
    width: 100%;
    height: auto;
  }

  .project-button {
    width: 40%;
    aspect-ratio: 1/1.2;
  }

  .smallfetch-popup {
    width: 80%;
    left: 10%;
  }

  .p2p-chat-popup {
    width: 80%;
    left: 80%;
  }

  .popup .tech-stack {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    max-width: 100%;
  }
}
