/*=============== GOOGLE FONTS ===============*/
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/*=============== VARIABLES CSS ===============*/
:root {
  --header-height: 4rem;

  /*========== Colors ==========*/
  --bg-color: #f3f4f6; /* Light grey body background */
  --card-bg: #ffffff;
  --text-color: #4b5563; /* Grey 600 */
  --title-color: #111827; /* Grey 900 */
  --accent-color: #3b82f6; /* Blue accent */
  --black-color: #000000;

  /*========== Font and typography ==========*/
  --body-font: 'Space Grotesk', sans-serif;
  --biggest-font-size: 2.5rem;
  --h1-font-size: 2rem;
  --h2-font-size: 1.5rem;
  --h3-font-size: 1.25rem;
  --normal-font-size: 1rem;
  --small-font-size: .875rem;

  /*========== Font weight ==========*/
  --font-regular: 400;
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}

@media screen and (min-width: 968px) {
  :root {
    --biggest-font-size: 4rem;
    --h1-font-size: 3rem;
    --h2-font-size: 2.25rem;
    --h3-font-size: 1.5rem;
    --normal-font-size: 1.125rem;
  }
}

/*========== Variables Dark theme ==========*/
body.dark-theme {
  --bg-color: #111827;
  --card-bg: #1f2937;
  --text-color: #9ca3af;
  --title-color: #f3f4f6;
  --black-color: #111827;
}

.dark-theme .card,
.dark-theme .project__card,
.dark-theme .contact__form-wrapper,
.dark-theme .home__img,
.dark-theme .about__img,
.dark-theme .button,
.dark-theme .contact__input,
.dark-theme .footer,
.dark-theme .scrollup {
  border-color: #374151; /* Lighter gray border for dark theme so it stands out against bg */
}

.dark-theme .home__img-shadow,
.dark-theme .about__img-shadow {
  border-color: #374151;
}

.dark-theme .project__img-box {
  border-bottom-color: #374151;
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color .4s, color .4s;
}
h1, h2, h3, h4 {
  color: var(--title-color);
  font-weight: var(--font-bold);
  line-height: 1.2;
}
ul {
  list-style: none;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.container {
  max-width: 1024px;
  margin-inline: 1.5rem;
}
.grid {
  display: grid;
  gap: 2rem;
}
.section {
  padding-block: 5rem 2rem;
}
.section__title {
  font-size: var(--h1-font-size);
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}
.section__title::after {
  content: "";
  position: absolute;
  bottom: 0px;
  right: -10px;
  width: 40px;
  height: 20px;
  background-color: var(--accent-color);
  opacity: 0.3;
  z-index: -1;
}

.text-accent {
  color: var(--accent-color);
}

/*=============== BUTTON ===============*/
.button {
  display: inline-block;
  background-color: var(--title-color);
  color: var(--bg-color);
  padding: 1rem 2rem;
  font-weight: var(--font-semi-bold);
  border: 2px solid var(--black-color);
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s, color 0.3s;
  cursor: pointer;
}
.button:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0px var(--accent-color);
}
.button--ghost {
  background-color: transparent;
  color: var(--title-color);
}
.dark-theme .button:hover {
  box-shadow: 4px 4px 0px var(--accent-color);
}

/*=============== HEADER & NAV ===============*/
.header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  background-color: var(--bg-color);
  z-index: var(--z-fixed);
  transition: box-shadow .4s, background-color .4s;
}
.shadow-header {
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  background-color: var(--card-bg);
}
.nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav__logo {
  font-size: 1.5rem;
  font-weight: var(--font-bold);
  color: var(--title-color);
}
.nav__buttons {
  display: flex;
  align-items: center;
  column-gap: 1.5rem;
}
.change-theme {
  font-size: 1.5rem;
  color: var(--title-color);
  cursor: pointer;
  transition: color .3s;
}
.change-theme:hover {
  color: var(--accent-color);
}
.nav__toggle, .nav__close {
  display: flex;
  font-size: 1.5rem;
  color: var(--title-color);
  cursor: pointer;
}

/* Navigation for mobile devices */
@media screen and (max-width: 767px) {
  .nav__menu {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    padding-block: 4rem;
    text-align: center;
    border-bottom: 2px solid var(--black-color);
    transition: top .4s ease-in-out;
    z-index: var(--z-fixed);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }
}

/* Show menu */
.nav__menu.show-menu {
  top: 0 !important;
}

.nav__list {
  display: flex;
  flex-direction: column;
  row-gap: 2rem;
}
.nav__link {
  color: var(--title-color);
  font-size: var(--h3-font-size);
  font-weight: var(--font-medium);
  transition: color .3s;
}
.nav__link:hover, .active-link {
  color: var(--accent-color);
}
.nav__close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
}

/*=============== HOME ===============*/
.home__container {
  padding-top: 3rem;
  row-gap: 3rem;
}
.home__content {
  text-align: center;
}
.home__subtitle {
  font-size: var(--h3-font-size);
  font-weight: var(--font-medium);
  display: block;
  margin-bottom: .5rem;
}
.home__title {
  font-size: var(--biggest-font-size);
  margin-bottom: .5rem;
}
.home__profession {
  font-size: var(--h2-font-size);
  color: var(--text-color);
  margin-bottom: 1.5rem;
}
.home__description {
  margin-bottom: 2rem;
}
.home__buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 1.5rem;
}
.home__social {
  display: flex;
  column-gap: 1.5rem;
}
.home__social-link {
  font-size: 1.5rem;
  color: var(--title-color);
  transition: color .3s, transform .3s;
}
.home__social-link:hover {
  color: var(--accent-color);
  transform: translateY(-3px);
}
.home__perfil {
  justify-self: center;
}
.home__image-box {
  position: relative;
  width: 250px;
}
.home__img {
  border: 2px solid var(--black-color);
  position: relative;
  z-index: 10;
  background-color: var(--card-bg);
}
.home__img-shadow {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--accent-color);
  top: 15px;
  left: 15px;
  z-index: 5;
  border: 2px solid var(--black-color);
}
.dark-theme .home__img-shadow {
  background-color: var(--title-color);
}

/*=============== ABOUT ===============*/
.about__container {
  row-gap: 3rem;
}
.about__description {
  margin-bottom: 2rem;
}
.about__stats {
  display: flex;
  column-gap: 2rem;
  margin-bottom: 2rem;
}
.about__stat-number {
  display: block;
  font-size: var(--h2-font-size);
  font-weight: var(--font-bold);
  color: var(--title-color);
}
.about__image-box {
  position: relative;
  width: 250px;
  justify-self: center;
}
.about__img {
  border: 2px solid var(--black-color);
  position: relative;
  z-index: 10;
}
.about__img-shadow {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--title-color);
  top: -15px;
  right: -15px;
  z-index: 5;
  border: 2px solid var(--black-color);
}
.dark-theme .about__img-shadow {
  background-color: var(--card-bg);
}

/*=============== TECH STACK (SERVICES STYLE) ===============*/
.skills__container {
  grid-template-columns: 280px;
  justify-content: center;
}
.card {
  background-color: var(--card-bg);
  border: 2px solid var(--black-color);
  padding: 2.5rem 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
  cursor: pointer;
}
.card:hover {
  transform: translate(-5px, -5px);
  box-shadow: 6px 6px 0px var(--accent-color);
}
.card__icon-box {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}
.card__icon-bg {
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: var(--accent-color);
  top: -4px;
  left: -4px;
}
.card__icon {
  font-size: 2.5rem;
  color: var(--title-color);
  position: relative;
  z-index: 5;
}
.card__title {
  font-size: var(--h3-font-size);
  margin-bottom: 1rem;
}
.card__description {
  font-size: var(--small-font-size);
}

/*=============== PROJECTS ===============*/
.projects__container {
  row-gap: 3rem;
}
.project__card {
  background-color: var(--card-bg);
  border: 2px solid var(--black-color);
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.project__card:hover {
  transform: translate(-5px, -5px);
  box-shadow: 6px 6px 0px var(--accent-color);
}
.dark-theme .project__card:hover {
  box-shadow: 6px 6px 0px var(--accent-color);
}
.project__img-box {
  border-bottom: 2px solid var(--black-color);
}
.project__content {
  padding: 1.5rem;
}
.project__subtitle {
  font-size: var(--small-font-size);
  color: var(--accent-color);
  font-weight: var(--font-semi-bold);
  display: block;
  margin-bottom: .25rem;
}
.project__title {
  font-size: var(--h3-font-size);
  margin-bottom: .75rem;
}
.project__description {
  margin-bottom: 1.25rem;
}
.project__link {
  display: inline-flex;
  align-items: center;
  column-gap: .25rem;
  font-weight: var(--font-bold);
  color: var(--title-color);
  transition: color .3s;
}
.project__link:hover {
  color: var(--accent-color);
}

/*=============== CONTACT ===============*/
.contact__container {
  row-gap: 3rem;
}
.contact__description {
  margin-bottom: 2rem;
}
.contact__info-item {
  display: flex;
  align-items: center;
  column-gap: .75rem;
  font-weight: var(--font-medium);
  color: var(--title-color);
  margin-bottom: 1rem;
}
.contact__info-item i {
  font-size: 1.5rem;
  color: var(--accent-color);
}
.contact__form-wrapper {
  background-color: var(--card-bg);
  border: 2px solid var(--black-color);
  padding: 2rem;
}
.contact__form {
  display: grid;
  row-gap: 1.5rem;
}
.contact__inputs {
  display: grid;
  row-gap: 1.5rem;
}
.contact__input {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--black-color);
  background-color: var(--bg-color);
  color: var(--title-color);
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  outline: none;
  transition: border-color .3s, background-color .3s;
}
.contact__input:focus {
  border-color: var(--accent-color);
}
.contact__area {
  height: 120px;
  resize: none;
}

/*=============== FOOTER ===============*/
.footer {
  padding-block: 4rem 2rem;
  border-top: 2px solid var(--black-color);
  background-color: var(--card-bg);
  margin-top: 4rem;
  transition: background-color .4s;
}
.footer__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 2rem;
}
.footer__logo {
  font-size: 1.5rem;
  font-weight: var(--font-bold);
  color: var(--title-color);
}
.footer__links {
  display: flex;
  column-gap: 2rem;
}
.footer__link {
  font-weight: var(--font-medium);
  color: var(--title-color);
  transition: color .3s;
}
.footer__link:hover {
  color: var(--accent-color);
}
.footer__copy {
  font-size: var(--small-font-size);
}

/*=============== SCROLL UP ===============*/
.scrollup {
  position: fixed;
  right: 1.5rem;
  bottom: -50%;
  background-color: var(--title-color);
  color: var(--bg-color);
  padding: .5rem;
  font-size: 1.5rem;
  z-index: var(--z-tooltip);
  transition: bottom .4s, transform .4s, background-color .3s;
  border: 2px solid var(--black-color);
}
.scrollup:hover {
  transform: translate(-3px, -3px);
  box-shadow: 3px 3px 0px var(--accent-color);
}
.show-scroll {
  bottom: 3rem;
}

/*=============== BREAKPOINTS ===============*/
/* Small devices */
@media screen and (max-width: 340px) {
  .container { margin-inline: 1rem; }
  .home__image-box, .about__image-box { width: 200px; }
  .contact__form-wrapper { padding: 1.5rem; }
}

/* Medium devices */
@media screen and (min-width: 576px) {
  .skills__container {
    grid-template-columns: repeat(2, 280px);
  }
  .projects__container {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact__inputs {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 1.5rem;
  }
}

@media screen and (min-width: 768px) {
  .home__container, .about__container, .contact__container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
  }
  .home__content {
    text-align: left;
  }
  .home__buttons {
    flex-direction: row;
    column-gap: 2rem;
  }
  .about__image-box {
    order: -1;
  }
  .nav__menu {
    position: static;
    background-color: transparent;
    padding: 0;
    width: auto;
    border: none;
    box-shadow: none;
  }
  .nav__list {
    flex-direction: row;
    column-gap: 2.5rem;
  }
  .nav__close, .nav__toggle {
    display: none;
  }
  .footer__container {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Large devices */
@media screen and (min-width: 1024px) {
  .container {
    margin-inline: auto;
  }
  .skills__container {
    grid-template-columns: repeat(3, 300px);
  }
  .projects__container {
    grid-template-columns: repeat(3, 1fr);
  }
  .home__image-box, .about__image-box {
    width: 350px;
  }
  .contact__form-wrapper {
    padding: 3rem;
  }
}
