@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none;
  outline: none;
  font-family: "Poppins", sans-serif;
}

:root {
  --bg-color: #0b1020;
  --second-bg-color: #323946;
  --main-color: #7cf03d;
  --white-color: #fff;
  --disabled-color: #fff3;
  --accent: #6c5ce7;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  color: var(--white-color);
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem 9%;
  background: var(--second-bg-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}


.logo {
  font-size: 3rem;
  color: var(--white-color);
  font-weight: 700;
}

/* Menu icon for mobile */
#menu-icon {
  font-size: 4rem;
  cursor: pointer;
  display: none;
  z-index: 9999;
}

/* Navigation */
header nav {
  display: none;
}

nav a {
  font-size: 2rem;
  color: var(--white-color);
  font-weight: 500;
  margin: 3.5rem;
  transition: .5s;
}

nav a:hover,
nav a:active {
  color: var(--accent);
}

/* Bars animation */
.bars-box {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
}

.bars-box .bar {
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  animation: hide-bars .5s ease-in-out both;
  animation-delay: calc(.1s * var(--i));
}

@keyframes hide-bars {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%);
  }
}

.bars-box.active .bar {
  animation: show-bars .5s ease-in-out both;
  animation-delay: calc(.1s * var(--i));
}

@keyframes show-bars {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(0);
  }
}

/* Sections */
section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: var(--bg-color);
    padding: 10rem 9% 2rem;
    overflow: auto; /* allow normal scrolling */
}


/* Home */
.home {
  display: flex;
  align-items: center;
  gap: 5rem;
}

.home-detail h1 {
  font-size: clamp(3.5rem, 10vw, 5.5rem);
}

.home-detail h2 {
  display: inline-block;
  font-size: 3.2rem;
  margin-top: -1rem;
}

.home-detail h2 span {
  position: relative;
  display: inline-block;
  color: transparent;
  -webkit-text-stroke: .07rem var(--accent);
  animation: display-text 16s linear infinite;
  animation-delay: calc(-4s * var(--i));
  
}

@keyframes display-text {
  25%, 100% {
    display: none;
  }
}

.home-detail h2 span::before {
  content: attr(data-text);
  position: absolute;
  width: 0;
  border-right: 2px solid var(--accent);
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  animation: fill-text 4s linear infinite;
}



@keyframes fill-text {
  10%, 100% {
    width: 0;
  }
  70%, 90% {
    width: 100%;
  }
}

.home-detail p {
  font-size: 1.6rem;
  margin: 1rem 0 2.5rem;
}

.home-detail .btn-sci {
  display: flex;
  align-items: center;
  gap: 2rem;
  
}

/* Button */
.btn {
  display: inline-block;
  padding: 1rem 3rem;
  background: var(--accent);
  border: .2rem solid var(--accent);
  border-radius: 4rem;
  font-size: 1.6rem;
  color: var(--bg-color);
  font-weight: 500;
  transition: .5s;
}

.btn:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}

/* Home Image */
.home-img .img-box {
  position: relative;
  width: 32vw;
  height: 32vw;
  border-radius: 50%;
  padding: .5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.home-img .img-box::before,
.home-img .img-box::after {
  content: '';
  position: absolute;
  width: 50rem;
  height: 50rem;
  background: conic-gradient(transparent, transparent, transparent, var(--accent));
  transform: rotate(0deg);
  animation: rotate-border 10s linear infinite;
}

.home-img .img-box::after {
  animation-delay: -5s;
}

@keyframes rotate-border {
  100% {
    transform: rotate(360deg);
  }
}

.home-img .img-box .img-item {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  border-radius: 50%;
  border: .01rem solid var(--bg-color);
  display: flex;
  justify-content: center;
  z-index: 1;
  overflow: hidden;
}

.home-img .img-box .img-item img {
  position: absolute;
  top: 3rem;
  display: block;
  width: 85%;
  object-fit: cover;
  mix-blend-mode: lighten;
}

/* Headings */
.heading {
  font-size: 4.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.heading span {
  color: var(--accent);
}

/* Services */
.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
  gap: 2rem;
}

.services-container .services-box {
  padding: 3rem 2.5rem;
  background: var(--second-bg-color);
  border: .2rem solid var(--second-bg-color);
  border-radius: 1rem;
  transition: .5s;
}

.services-container .services-box:hover {
  border-color: var(--accent);
  transform: scale(1.02);
}

.services-box .icon {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.services-box .icon i {
  font-size: 4.5rem;
  transition: .5s;
}

.services-box:hover .icon i {
  color: var(--accent);
}

.services-box .icon a {
  display: inline-flex;
  background: var(--white-color);
  border-radius: 50%;
  padding: 1rem;
  transition: .5s;
}

.services-box:hover .icon a {
  background: var(--accent);
}

.services-box .icon a i {
  font-size: 3rem;
  color: var(--bg-color);
  transform: rotate(225deg);
}

.services-box .icon a:hover i {
  transform: rotate(100deg);
}

.services-box h3 {
  font-size: 3rem;
  margin: .5rem 0 2rem;
  transition: .5s;
}

.services-box:hover h3 {
  color: var(--accent);
}

.services-box p {
  font-size: 1.6rem;
}


/* About Me */
.aboutme-box {
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.aboutme-box .desc {
  font-size: 1.8rem;
  margin: 2rem 0;
  line-height: 1.6;
  color: var(--white-color);
}

.aboutme-skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.skill-card {
  background: var(--second-bg-color);
  padding: 2rem;
  border-radius: 1rem;
  border: .2rem solid var(--second-bg-color);
  width: 18rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transform: translateY(50px);
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.skill-card:hover {
  border-color: var(--accent);
  transform: scale(1.02);
  padding: 2.5rem;
  
}


.skill-card i {
  font-size: 3rem;
  color: var(--accent);
}

.skill-card h3 {
  font-size: 2rem;
  color: var(--white-color);
}

.skill-card p {
  font-size: 1.4rem;
  color: var(--white-color);
  text-align: center;
}

/* Slide in animation when in viewport */
.skill-card.active {
  opacity: 1;
  transform: translateY(0);
}

.aboutme-box .btn {
  margin-top: 2rem;
}



/* Portfolio */
.portfolio-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}

.portfolio-detail {
  display: none;
}

.portfolio-detail.active {
  display: block;
}

.portfolio-box .numb {
  font-size: 8rem;
  -webkit-text-stroke: .07rem var(--white-color);
  color: transparent;
  line-height: 1;
}

.portfolio-box h3 {
  font-size: 3.5rem;
  margin: .8rem 0 2rem;
}

.portfolio-box p {
  font-size: 1.6rem;
}

.portfolio-box .tech {
  margin: 2rem 0;
  color: var(--accent);
  border-bottom: .1rem solid var(--white-color);
  padding-bottom: 2rem;
}

.portfolio-box .live-github a {
  position: relative;
  display: inline-flex;
  padding: 1.3rem;
  font-size: 3rem;
  color: var(--white-color);
  border-radius: 50%;
  background: var(--second-bg-color);
  transition: .5s;
}

.portfolio-box .live-github a:hover {
  color: var(--accent);
}

.portfolio-box .live-github a:first-child {
  margin-right: 1.5rem;
}

.portfolio-box .live-github a:first-child i {
  transform: rotate(135deg);
}

.portfolio-box .live-github a span {
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%) scale(.9);
  font-size: 1.6rem;
  white-space: nowrap;
  padding: .5rem 1rem;
  border-radius: .6rem;
  pointer-events: none;
  background: var(--white-color);
  color: var(--bg-color);
  opacity: 0;
  transition: .2s;
}

.portfolio-container .live-github a:hover span {
  top: -70%;
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.portfolio-box .portfolio-carousel {
  width: 100%;
  height: 45rem;
  border-radius: 1rem;
  overflow: hidden;
}

.portfolio-carousel .img-slide {
  display: flex;
  transition: transform 0.6s ease-in-out;
}

.portfolio-carousel .img-item {
  min-width: 100%;
  box-sizing: border-box;
}

.portfolio-carousel .img-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1rem;
}

.portfolio-box .navigation button {
  text-align: right;
  margin-top: 2rem;
}

.portfolio-box .navigation button {
  display: inline-block;
  padding: .4rem;
  background: var(--second-bg-color);
  border: .2rem solid var(--accent);
  border-radius: .6rem;
  font-size: 4rem;
  color: var(--accent);
  cursor: pointer;
}

.portfolio-box .navigation button.disabled {
  border-color: var(--second-bg-color);
  color: var(--disabled-color);
  opacity: 0.3;
  pointer-events: none;
}

.portfolio-box .navigation .arrow-right {
  margin: 1.5rem;
}

/* Contact */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 3rem;
}

.contact-container .contact-box:first-child {
  align-self: center;
}

.contact-box h2 {
  font-size: 4.5rem;
}

.contact-box p {
  font-size: 1.6rem;
}

.contact-box .desc {
  margin: 1.5rem 0 2.5rem;
}

.contact-box .contact-detail {
  display: flex;
  align-items: center;
  margin: 2rem 0;
}

.contact-detail i {
  display: inline-flex;
  background: var(--second-bg-color);
  color: var(--accent);
  font-size: 3rem;
  padding: 1.2rem;
  border-radius: .6rem;
  margin-right: 1.5rem;
}

.contact-detail .detail p:first-child {
  color: var(--accent);
}

.contact-box form {
  background: var(--second-bg-color);
  padding: 2.5rem 3.5rem 3.5rem;
  border-radius: 1rem;
  text-align: center;
}

.contact-box .heading {
  font-size: 3.5rem;
}

.contact-box .field-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.contact-box .field-box input,
.contact-box .field-box textarea {
  padding: 1.5rem;
  background: var(--bg-color);
  border: .15rem solid var(--bg-color);
  border-radius: .6rem;
  font-size: 1.6rem;
  color: var(--white-color);
}

.contact-box .field-box textarea {
  grid-column: 1 / -1;
  height: 26rem;
  resize: none;
}

.contact-box .field-box input:focus,
.contact-box .field-box textarea:focus {
  border-color: var(--accent);
}

.contact-box .btn {
  margin-top: 2rem;
  cursor: pointer;
}

/* Footer */
footer {
  background: var(--second-bg-color);
  padding: 20px;
  text-align: center;
}

.footer-social {
  margin-bottom: 10px;
}

.footer-social a {
  font-size: 2.5rem;
  margin: 0 10px;
  color: #7dd3fc;
  transition: 0.3s;
}

.footer-social a:hover {
  color: #38bdf8;
}

footer p {
  font-size: 1.2rem;
}

/* Media Queries */
@media screen and (max-width: 1200px) {
  html { font-size: 55%; }
}

@media screen and (max-width: 992px){
  header { padding: 2rem 4%; }
  section { padding: 10rem 4% 2rem; }
}

@media screen and (max-width: 810px) {
  .contact-box .field-box { grid-template-columns: 1fr; }
}

@media screen and (max-width: 768px) {
  #menu-icon { 
    display: block; 
    cursor: pointer;
  }
  nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem 0;
    background: var(--bg-color);
    border-top: .1rem solid rgba(0, 0, 0, .2); 
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
    text-align: center;
    display: none;
    flex-direction: column;
  }
  nav.active { 
    display: flex; 
  }
  nav a { 
    display: block; 
    margin: 1rem 0;
   }
  .home { 
    flex-direction: column-reverse; 
    justify-content: center; 
    gap: 2rem; 
  }
  .home-img .img-box { 
    width: 35rem; 
    height: 35rem; 
  
  }
  .aboutme-container,
  .portfolio-container,
  .contact-container { 
    grid-template-columns: 1fr;
   }
  .aboutme-container { 
    gap: 3rem; 
  }
  .portfolio-container .portfolio-box:first-child { 
    order: 1; 
  }
  .contact-box .field-box { 
    grid-template-columns: repeat(2, 1fr); 
  }
}

@media screen and (max-width: 600px) {
  .home-img .home-box {
     width: 30rem; height: 30rem; 
    }
  .contact-box .field-box { 
    grid-template-columns: 1fr; 
  }
}

@media screen and (max-width: 450px) {
  html { 
    font-size: 50%; 
  }
}

@media screen and (max-width: 400px) {
  .home-detail,
  .aboutme-box h2,
  .aboutme-box .heading,
  .aboutme-box .desc,
  .aboutme-detail.about .aboutme-item { 
    text-align: center; 
  }
  .home-detail .btn-sci { 
    flex-direction: column-reverse; 
  }
  .home-detail .btn-sci .sci { 
    margin-left: 0; margin-bottom: 2rem; 
  }
  .contact-box form { 
    padding: 2.5rem 3rem 3.5rem; 
  }
  .contact-box h2 { 
    font-size: 3.5rem; 
  }
}
