@import url("https://fonts.googleapis.com/css2?family=League+Spartan:wght@100..900&display=swap");

@font-face {
  font-family: 'Cascadia Code';
  src: url('../fonts/Cascadia.woff2') format('woff2'),
    url('../fonts/Cascadia.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

/* * ----- Variables ----- */
:root {
  --bg-color: #F6F6F6;
  --text-color: #31333B;
  --bg-dark-color: #31333B;
  --text-dark-color: #F6F6F6;
  --primary-color: #F0BF6C;
  --secondary-color: #0792c9;
  --box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

body.dark {
  --box-shadow: 0 0 1px 1px rgba(90, 90, 90, 0.342);
}

/* * ----- Reset CSS ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
  transition: background 0.004s ease, color 0.004s ease;
}

body {
  font-family: "Cascadia Code", "League Spartan", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  position: relative;
  overflow-x: hidden;
}

body {
  background-color: #eee7e7;
}

body.dark {
  background-color: var(--bg-dark-color);
  color: var(--text-dark-color);
}

img {
  width: 100%;
  object-fit: cover;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 400;
}

p {
  line-height: 1.5;
  font-size: 1.1rem;
}

input,
button,
select,
option,
textarea,
a {
  border: none;
  outline: none;
  cursor: pointer;
  background-color: transparent;
}

/* * ----- Utility Classes ----- */
.container {
  max-width: 1600px;
  padding: 0 8vw;
  margin: 0 auto;
}

.section-heading {
  font-size: 4rem;
  font-weight: 500;
  color: var(--text-color);
  letter-spacing: 1px;
  max-width: 40rem;
  margin-bottom: 2rem;
}

body.dark .section-heading {
  color: var(--text-dark-color);
}

.section-heading span {
  color: var(--primary-color);
}

section {
  padding-top: 6rem;
}

.service p,
.project p,
.about-container p {
  font-family: "League Spartan", sans-serif;
  font-size: 1.2rem;
}

/* Button */
.primary-btn {
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  border: 2px solid var(--primary-color);
  letter-spacing: 1px;
  position: relative;
  width: max-content;
  color: var(--primary-color);
  border-radius: 0.5rem;
}

.primary-btn span {
  position: relative;
  z-index: 2;
}

.primary-btn:after {
  position: absolute;
  content: "";
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--primary-color);
  transition: all 0.25s ease-in-out;
}

.primary-btn:hover {
  color: var(--bg-color);
}

.primary-btn:hover:after {
  width: 100%;
}

.secondary-btn {
  color: var(--secondary-color);
  font-size: 1.2rem;
}

/* theme-toggler */
.theme-toggler {
  color: white;
  width: 1.6rem;
  position: absolute;
  top: 0;
  right: 1rem;
  height: 100%;
}

.theme-toggler .light-theme-icon {
  display: none;
}

body.dark .theme-toggler .light-theme-icon {
  display: block;
}

.theme-toggler .dark-theme-icon {
  display: block;
}

body.dark .theme-toggler .dark-theme-icon {
  display: none;
}

/* * ----- Main Styles ----- */

/* * ----- Navbar ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  padding: 1rem 0;
}

.nav-contact a {
  background-color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.nav-contact:hover a {
  background-color: transparent;
  color: white;
  box-shadow: 0 0 0 1px var(--primary-color);
}

.navbar.scrolled {
  background-color: var(--text-color);
  box-shadow: var(--box-shadow);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  position: relative;
}

.logo {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--bg-color);
  letter-spacing: 2px;
  cursor: pointer;

  & span {
    color: var(--primary-color);
  }
}

.navlinks {
  display: flex;
  gap: 2rem;
  color: var(--bg-color);
}

.navlinks li {
  font-size: 1.1rem;
  font-weight: 500;
}

.navlinks li:hover {
  color: var(--primary-color);
}

.navbar-button {
  font-size: 1.3rem;
  display: none;
}

/* * ----- Hero Section ----- */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero .profile-image {
  border-radius: 50%;
  position: relative;
  filter: drop-shadow(5px -5px 5px var(--primary-color));
}

.hero .profile-image img {
  max-width: 25rem;
}

.hero .dot-pattern {
  position: absolute;
  bottom: -20%;
  right: 0;
}

.hero .section-heading {
  color: var(--bg-color);
  margin: 0;
  line-height: 5rem;
}

.hero .section-heading span {
  display: block;
}

.hero .primary-btn {
  color: var(--bg-color);
  font-size: 1.5rem;
  padding: 1rem 2rem;
}

/* * ----- Services ----- */
.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 2rem;
}

.service {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  box-shadow: var(--box-shadow);
  text-align: center;
  border-radius: 1rem;
}

.service:hover {
  box-shadow: none;
}

.service i {
  font-size: 2.5rem;
  color: var(--primary-color);
}

.service h3 {
  font-size: 1.5rem;
  font-weight: 500;
}

/* * ----- Projects ----- */
.projects-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.project {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  place-items: center;
  gap: 2rem;
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-img img {
  border-radius: 0.5rem;
}

.projects-container div:nth-child(even) {
  grid-template-columns: 1.2fr 0.8fr;

  .project-img {
    order: 1;
  }

  .project-info {
    order: 2;
  }
}

.project-info h1 {
  font-size: 2.2rem;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* * ----- About ----- */
#about .section-heading.outer {
  display: none;
}

.about-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-height: 30rem;
  column-gap: 2rem;
  position: relative;
}

.about-container .dot-pattern {
  position: absolute;
  bottom: -20%;
  left: 75%;
}

.about-img {
  padding-left: 3vw;
}

.about-img-bg {
  padding: 0 0.5rem 0.5rem 0.5rem;
  position: relative;
  background: url("../images/about.avif") no-repeat center center/cover;
  min-height: 20rem;
  height: 100%;
  border-radius: 0.5rem;
}

.about-img-bg::after {
  content: "";
  width: 90%;
  height: 90%;
  border: 0.5rem solid var(--primary-color);
  position: absolute;
  top: calc(10% + 1.5rem);
  right: calc(10% + 1.5rem);
  z-index: -1;
  border-radius: 1rem;
  overflow: hidden;
}

.about-info p {
  margin-top: 3rem;
}

.about-info .primary-btn {
  margin-top: 1rem;
  display: block;
}

/* * ----- Contact ----- */
#contact .section-heading.outer {
  display: none;
}

.contact-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 2rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  box-shadow: var(--box-shadow);
  text-align: center;
  border-radius: 1rem;
}

body.dark .contact-card {
  background: var(--bg-dark-color);
}

.contact-card:hover {
  box-shadow: none;
}

.contact-card i {
  font-size: 2.5rem;
  color: var(--primary-color);
}

.contact-card p {
  font-size: 1.2rem;
}

/* * ----- Footer ----- */
footer {
  margin-top: 6rem;
  text-align: center;
  padding: 2rem 0 0.5rem;
  background-color: var(--text-color);
  color: var(--text-dark-color);
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 2rem;
  margin: 2rem 0;
}

.social-links a:hover {
  color: var(--primary-color);
}

body.dark footer {
  box-shadow: 0 1px 1px 1px var(--bg-color);
}

.hidden {
  display: none;
}

.scroll-to-top {
  position: fixed;
  bottom: 0.7rem;
  right: 0.8rem;
  z-index: 999;
  background-color: var(--primary-color);
  color: #fff;
  border-radius: 0.5rem;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.05s ease-in-out;
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 1px solid var(--primary-color);
  width: 14ch;
  animation: typing 4s steps(50) infinite, blink-caret 0.6s step-end infinite;
}

/* * ----- Media Queries ----- */
@media screen and (max-width: 1200px) {
  .hero .section-heading {
    font-size: 3.4rem;
    white-space: nowrap;
  }

  .hero .profile-image img {
    min-width: 20rem;
  }
}

@media screen and (max-width: 1024px) {
  .container {
    padding: 0 6vw;
  }

  .section-heading {
    font-size: 3.2rem;
  }

  .navlinks {
    gap: 1rem;
  }

  .hero .section-heading {
    line-height: 4rem;
    font-size: 3rem;
  }

  .hero .profile-image img {
    min-width: 18rem;
  }

  /* Projects */
  .project {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem;
  }
}

@media screen and (max-width: 900px) {
  .hero {
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
  }

  .hero .profile-image img {
    max-width: 15rem;
    min-width: 15rem;
  }

  /* Mobile Navbar start */
  .navlinks {
    position: absolute;
    top: 130%;
    right: -100%;
    flex-direction: column;
    background-color: var(--text-color);
    text-align: center;
    justify-content: center;
    gap: 2rem;
    height: 90vh;
    overflow: hidden;
    color: var(--bg-color);
    width: 50%;
  }

  .navlinks.mobile {
    right: 0;
  }

  .navbar-button {
    display: block;
    color: var(--bg-color);
  }
}

@media screen and (max-width: 768px) {
  .container {
    padding: 0 4vw;
  }

  .section-heading {
    font-size: 3.4rem;
  }

  .theme-toggler {
    right: 9vw;
  }

  /* Projects */
  .project {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .projects-container div {
    .project-img {
      order: 1;
    }

    .project-info {
      order: 2;
    }
  }

  .project>div {
    width: 100%;
  }

  .project-info p {
    max-width: 40rem;
  }

  .project-img {
    width: 100%;
  }
}

@media screen and (max-width: 700px) {
  .services-container {
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
  }

  .service {
    padding: 1rem;
  }

  .about-container {
    display: flex;
    flex-direction: column;
  }

  #about .section-heading.outer {
    display: block;
  }

  #about .section-heading.inner {
    display: none;
  }
}

@media screen and (max-width: 550px) {
  .dot-pattern {
    display: none !important;
  }

  .hero .profile-image {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

@media screen and (max-width: 480px) {
  html {
    font-size: 90%;
  }

  .section-heading {
    font-size: 3rem;
  }

  .container {
    padding: 0 2vw;
  }

  .navlinks.mobile {
    width: 100%;
  }

  .hero {
    gap: 2rem;
  }

  .hero .section-heading {
    white-space: wrap;
  }

  .hero .profile-image {
    min-width: 10rem;
    max-width: 10rem;
  }
}

@media screen and (max-width: 400px) {
  .theme-toggler {
    right: 10vw;
  }

  .typewriter {
    animation: normal;
    white-space: wrap;
    width: auto;
    display: inline-block !important;
  }
}

/* * ----- Keyframes ----- */
@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 14ch;
  }
}

@keyframes blink-caret {

  from,
  to {
    border-color: transparent;
  }

  50% {
    border-color: var(--primary-color);
  }
}

/* * ----- Scroll bar ----- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--text-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}