:root {
  /* Light mode */
  --color-primary: #3498db;
  --color-secondary: #2ecc71;
  --color-accent: #e74c3c;
  --color-background: #ffffff;
  --color-surface: #f0f0f0;
  --color-text: #2c3e50;
  --color-muted: #7f8c8d;
  --color-border: #dcdde1;

  /* Dark mode */
  --color-bg-dark: #1e1e1e;
  --color-surface-dark: #2c2c2c;
  --color-text-dark: #ecf0f1;
  --color-muted-dark: #95a5a6;
  --color-border-dark: #3a3a3a;

  --transition-speed: 0.8s;
}

/* Loading Animation */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-background);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 2s ease;
}

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid var(--color-bg-dark);
  border-top: 5px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* Dark mode */
body.dark {
  --color-background: var(--color-bg-dark);
  --color-surface: var(--color-surface-dark);
  --color-text: var(--color-text-dark);
  --color-muted: var(--color-muted-dark);
  --color-border: var(--color-border-dark);
  --color-border-dark: var(var(--color-background))
}

html {
  scroll-behavior: smooth;
}

/* Main styles */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  background-color: var(--color-background);
  color: var(--color-text);
  scroll-behavior: smooth;
  transition: background-color var(--transition-speed), color var(--transition-speed);

}

main {
  max-width: 75rem;
  margin: auto;
  padding: 1rem;
}

/* Nav Bar */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-background);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav ul li a {
  transition: 0.5s all ease;
  font-size: 1.15rem;
}
nav ul li a:hover {
  color: var(--color-primary);
}

nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
}

.logo h2 {
  margin: 0;
}

.hire-me-btn {
  background-color: var(--color-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 14px;
  text-decoration: none;
  transition: 0.6s ease;
}

.hire-me-btn:hover {
  background: rgb(126, 126, 224);
}

.themeToggle {
  background: none;
  border: none;
  margin-right: 3rem;
  font-size: 1.3rem;
  cursor: pointer;
}

/* All Sections */
section {
  padding: 2rem 0;
}

article {
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

article img {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
}

.description {
  font-size: 1.45rem;
}



/* Hire Section */

.services-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.service-card {
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 10px;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
  padding: 1.5rem;
  max-width: 16rem;
  text-align: center;
  transition: transform 0.6s ease;
}

.service-card:hover {
  transform: translateY(-8px) scale(1.03);
}



/* ABOUT SECTION LAYOUT */
#about {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  padding: 3rem 0;
}

#about article {
  flex: 1 1 45%;
}


.picture-in-about {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: 6/9;
  border: none;
  border-radius: 10px;
}

.about-text {
  max-width: 100%;
  font-size: 1.3rem;
}

.about-text h2 {
  margin-bottom: 0.5rem;
}

.about-text hr {
  width: 50px;
  border: 2px solid var(--color-primary);
  margin-bottom: 1rem;
}

/* SKILL BAR */
.skill-container {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.skill {
  text-align: center;
}

.skill img {
  width: 5rem;
  height: 5rem;
}


/* Projects */
#projects {
  text-align: center;
}

.card-container {
  display: inline-block;
  width: 45%;
  max-width: 300px;
  margin: 1rem;
  background-color: var(--color-surface);
  box-shadow: 1rem 2rem 2rem var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  padding: 1rem;
  transition: 0.6s;
}

.card-container:hover {
  transform: scale(1.05);
}

.card-container img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  aspect-ratio: 5/4;
}

.card-container a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 1.2rem;
}
.card-container a:hover {
  color: #5151f1;
}

/* Footer */
#footer {
  background-color: var(--color-surface);
  padding: 2rem 1rem;
  justify-content: center;
  text-align: center;
  display: grid;
  grid-template-columns: 3;
}

.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 5rem;
}

.socials img {
  width: 3rem;
  height: 3rem;
  transition: 0.4s;
}

.socials img:hover {
  transform: translateY(-8px) scale(1.1);
}

/* Scroll icons */
.scroll-down button,
.scroll-up button {
  width: 32px;
  height: 32px;
  background: transparent;
  font-size: 2rem;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  animation: bounce 2s infinite;
}


form {
  width: 100%;
  max-width: 40rem;
  background-color: var(--color-background);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

form h2 {
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--color-text);
}

.contact-inputs {
  width: 100%;
  margin: 0.75rem 0;
  background: transparent;
  padding: 0.75rem;
  color: var(--color-text);
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid var(--color-border-dark);
  border-radius: 0.5rem;
  font-size: 1rem;
}

form button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
  align-items: center;
  transition: background 0.4s ease;
}

form button:hover {
  background-color: #0056b3;
}

form button img {
  width: 1.3rem;
  height: 1em;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}



/* Responsive layout */
@media (max-width: 760px) {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  body {
    width: 100%;
    overflow-x: hidden;
  }

  nav {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  nav ul {
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    padding-left: 0;
  }

  .logo {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .hire-me,
  .themeToggle,
  .navToggle {
    margin-top: 0.5rem;
  }

  article img {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  }
  
  #about {
    margin-top: -140px;
  }
  .about-text {
    width: 300px;
    margin-top: -80px;
  }

  article {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
  }

  .profile-pic img {
    width: 140px;
    height: auto;
    border-radius: 50%;
  }

  .description p,
  .description h2 {
    font-size: 1.2rem;
    margin: 0.5rem 0;
  }

  .socials {
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
  }

  .socials img {
    width: 32px;
    height: 32px;
  }

  .card-container {
    width: 100%;
    max-width: 100%;
  }

  form {
    width: 100%;
    padding: 1rem;
  }

  #footer {
    grid-template-columns: 1fr;
  }

  .scroll-down,
  .scroll-up {
    justify-content: center;
  }
}

