:root {
  --color-light-50: #f0edee;
  --color-light-100: #f0edee98;
  --color-dark-800: #0a090c;
  --color-green-50: #07393ce6;
  --color-green-100: #07393c;
  --color-gradient: linear-gradient(90deg, #0a090c, #07393c, #0a090c);
}

body.light-theme {
  --color-light-50: #1a1a1a;
  --color-light-100: #00000088;
  --color-dark-800: #f0edee;
  --color-green-50: #38b0c0;
  --color-green-100: #4adef1;
  --color-gradient: linear-gradient(90deg, #f0edee, #4adef1, #f0edee);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

*::-webkit-scrollbar {
  width: 20px;
  background-color: var(--color-dark-800);
}

*::-webkit-scrollbar-thumb {
  border-radius: 20px;
  background-color: var(--color-light-50);
}

*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active {
  background-color: var(--color-light-100);
}

a {
  text-decoration: none;
}

a::selection,
img::selection,
h2::selection,
h1::selection,
button::selection,
p::selection,
h3::selection {
  color: var(--color-light-50);
  background-color: var(--color-dark-800);
}

body {
  background: var(--color-gradient);
  transition: background 0.3s ease;
}

body header {
  position: fixed;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100vw;
  height: 10vh;
  padding: 20px;
  z-index: 10;
  background-color: var(--color-dark-800);
  transition: background-color 0.3s ease;
}

body header nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

body header nav #btn-close {
  display: none;
}

body header nav #btn-theme,
body header nav #btn-translate {
  background: none;
  border: none;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

body header nav #btn-theme:hover,
body header nav #btn-translate:hover {
  transform: scale(1.1);
}

body header nav #btn-theme:active,
body header nav #btn-translate:active {
  transform: scale(0.95);
}

body header nav #btn-theme svg,
body header nav #btn-translate svg,
body header nav #btn-menu,
body header nav #btn-close {
  fill: var(--color-light-50);
  transition: fill 0.3s ease;
}

body header nav #btn-theme svg,
body header nav #btn-translate svg {
  width: 24px;
  height: 24px;
}

body header nav .menu {
  position: fixed;
  justify-content: space-around;
  align-items: center;
  flex-direction: column;
  text-align: center;
  width: 100vw;
  height: 0;
  overflow: hidden;
  top: 15vh;
  right: 0;
  margin-top: -50px;
  transition: height 0.4s ease;
  background-color: var(--color-dark-800);
}

body header nav .menu li {
  list-style: none;
  max-width: 60vw;
  font-size: 1.3em;
}

body header nav .menu li a,
body main #home div h1,
body main #contact section div a,
body main #contact .back a,
body footer p,
.content-title,
body main #about section p,
body main #about section a,
body main #knowledge .knowledge-title,
body main #knowledge .knowledge-item p,
.overlay-text,
body main .modal .modal-content,
.alert-content,
body main .modal .modal-content .modal-links a,
body main .modal .modal-content .close,
body main #contact p {
  color: var(--color-light-50);
  transition: color 0.3s ease;
}

body main #home {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

body main #home .home-img {
  width: 100vw;
  height: 48vh;
  margin-top: 12vh;
  animation: scale-up-center 2s;
}

body main #home div {
  width: 60vw;
}

body main #home div h2 {
  color: var(--color-light-100);
  transition: color 0.3s ease;
}

body main #home div h1,
body main #home div h2 {
  animation: appear 2s;
  font-size: 1.5em;
}

body main #home section {
  padding: 1vh 0 0 0;
}

body main #about,
body main #knowledge,
body main #contact {
  margin-top: 16vh;
}

.content-title {
  margin-bottom: 1vh;
}

body main #about,
body main #about section {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex-direction: column;
  text-align: center;
}

body main #about section p {
  width: 80%;
  font-size: 1em;
  font-weight: lighter;
}

body main #about section div {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

body main #about section a {
  font-weight: normal;
  text-decoration: underline;
  transition: background-color 0.3s ease;
}

body main #about section a:active {
  color: var(--color-dark-800);
  background-color: var(--color-light-100);
}

body main #knowledge {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

body main #knowledge .knowledge-title {
  width: 250px;
  margin: auto auto 10px;
  font-weight: lighter;
  letter-spacing: 5px;
  padding: 5px 0;
  border-radius: 20px;
  background-color: var(--color-dark-800);
  transition: background-color 0.3s ease;
}

body main #knowledge .knowledge-item {
  margin-bottom: 50px;
}

body main #knowledge .knowledge-item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

body main #knowledge .description {
  font-size: 0.9em;
  color: var(--color-light-100) !important;
  margin: 5px 0;
  transition: color 0.3s ease;
}

body main #projects .content-title {
  text-align: center;
}

body main #projects .galery-pai {
  display: flex;
  justify-content: center;
  padding: 20px;
}

body main #projects .galery-pai .galery-filho {
  width: 80%;
  max-width: 700px;
}

body main #projects .galery-pai .galery-filho .galery-neto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

body main #projects .galery-pai .galery-filho .galery-neto .galery-image {
  position: relative;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
  border-radius: 10px;
}

body main #projects .galery-pai .galery-filho .galery-neto .galery-image:hover {
  transform: scale(1.05);
}

.overlay-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
  background-color: rgba(7, 57, 60, 0.85);
  padding: 8px 12px;
  border-radius: 5px;
  opacity: 1;
  transition: background-color 0.3s ease;
}

body.light-theme .overlay-text {
  color: #1a1a1a;
  background-color: rgba(178, 235, 242, 0.85);
}

body
  main
  #projects
  .galery-pai
  .galery-filho
  .galery-neto
  .galery-image
  .btns-projects {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body
  main
  #projects
  .galery-pai
  .galery-filho
  .galery-neto
  .galery-image:hover
  .btns-projects {
  opacity: 1;
}

body
  main
  #projects
  .galery-pai
  .galery-filho
  .galery-neto
  .galery-image
  .btns-projects
  button {
  background-color: var(--color-dark-800);
  color: var(--color-light-50);
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body
  main
  #projects
  .galery-pai
  .galery-filho
  .galery-neto
  .galery-image
  .btns-projects
  button:hover {
  color: var(--color-dark-800);
  background-color: var(--color-light-100);
}

body main .modal,
.alert-modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 9, 12, 0.9);
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease-in, visibility 0.5s ease-in;
}

body main .modal {
  padding: 20px;
  overflow-y: hidden;
  opacity: 0;
  visibility: hidden;
}

.alert-modal {
  display: none;
  z-index: 2000;
}

body.light-theme .modal,
body.light-theme .alert-modal {
  background-color: rgba(0, 0, 0, 0.7);
}

body main .modal.active {
  opacity: 1;
  visibility: visible;
}

body main .modal .modal-content,
.alert-content {
  background-color: var(--color-green-100);
  padding: 35px;
  border-radius: 10px;
  text-align: center;
  transition: background-color 0.3s ease;
}

body main .modal .modal-content {
  max-width: 90%;
  position: relative;
  transform: scale(0.7);
  opacity: 0;
  transition: transform 0.5s ease-out, opacity 0.5s ease-out,
    background-color 0.3s ease;
}

.alert-content {
  padding: 20px;
  border-radius: 8px;
  max-width: 300px;
}

body main .modal.active .modal-content {
  opacity: 1;
  transform: scale(1);
}

body main .modal .modal-content img {
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 15px;
  border: 2px solid var(--color-dark-800);
  transition: border-color 0.3s ease;
}

body main .modal .modal-content h2 {
  margin: 10px 0;
}

body main .modal .modal-content p,
#modal-technologies {
  font-size: 1rem;
  color: var(--color-light-100);
  transition: color 0.3s ease;
}

#modal-technologies {
  margin-top: 10px;
  font-size: 0.95rem;
}

.alert-content button {
  margin-top: 10px;
  background-color: var(--color-green-50);
  border: none;
  color: var(--color-light-50);
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.alert-content button:hover {
  background-color: var(--color-green-100);
}

body main .modal .modal-content .modal-links {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

body main .modal .modal-content .modal-links a {
  background-color: var(--color-dark-800);
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

body main .modal .modal-content .modal-links a:hover {
  color: var(--color-dark-800);
  background-color: var(--color-light-100);
}

body main .modal .modal-content .close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
}

body main #contact,
body main #contact section,
body main #contact section div {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

body main #contact {
  padding: 20px;
  background-color: var(--color-dark-800);
  transition: background-color 0.3s ease;
}

body main #contact section {
  margin-bottom: 5px;
}

body main #contact section p a {
  color: #00acff;
  transition: color 0.3s ease;
}

body.light-theme #contact section p a {
  color: #0288d1;
}

body main #contact section div {
  gap: 30px;
  padding: 20px;
  flex-direction: row;
}

body main #contact section div svg {
  fill: var(--color-light-50);
  transition: fill 0.3s ease;
}

body main #contact p {
  font-size: 1.2em;
}

body main #contact .back a {
  font-size: 0.9em;
  font-style: italic;
  box-shadow: 0 2px var(--color-light-100);
}

body footer {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-bottom: 1vh;
  font-size: 0.7em;
  background-color: var(--color-dark-800);
  transition: background-color 0.3s ease;
}

@media only screen and (min-width: 768px) {
  #btn-menu,
  #btn-close {
    display: none;
  }

  body header {
    height: 10vh !important;
    padding: 0 20px;
    transition: 0.4s;
    overflow: hidden;
  }

  body header nav {
    width: 100%;
    height: 100%;
    justify-content: center;
    gap: 20px;
    position: relative;
  }

  body header nav #btn-menu,
  body header nav #btn-close,
  body header nav #btn-theme,
  body header nav #btn-translate {
    cursor: pointer;
  }

  body header nav #btn-theme,
  body header nav #btn-translate {
    position: absolute;
    right: 60px;
    margin: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
  }

  body header nav #btn-translate {
    right: 20px;
  }

  body header nav #btn-theme:hover,
  body header nav #btn-translate:hover {
    transform: translateY(-50%) scale(1.1);
  }

  body header nav #btn-theme:active,
  body header nav #btn-translate:active {
    transform: translateY(-50%) scale(0.95);
  }

  body header.ativo,
  body header nav .menu.ativo {
    height: 5vh !important;
  }

  body header nav .menu {
    flex-direction: row;
    width: auto;
    height: 100%;
    top: auto;
    margin-top: 0;
    transition: 0.4s;
    position: relative;
    gap: 30px;
  }

  body header nav .menu li {
    height: auto;
  }

  body header nav .menu li a {
    display: inline-block;
    padding: 0 5px;
    height: auto;
    line-height: 1.2;
  }

  body header nav .menu li a,
  body main #home section a svg,
  body main #contact .back a,
  body main #about section a {
    transition: 0.3s;
  }

  body header nav .menu li a:hover,
  body main #contact .back a:hover {
    color: var(--color-light-100);
    box-shadow: 0 2px var(--color-light-100);
  }

  body main #home .home-img {
    width: 98vw;
    margin-top: 16vh;
  }

  body main #home section {
    margin-top: 4vh;
  }

  body main #home section a {
    padding: 0 2vw;
  }

  body main #home section a svg {
    width: 60px;
    height: 60px;
  }

  body main #home section a svg:hover {
    fill: var(--color-light-100);
    transform: scale(1.2);
  }

  body main #about section p {
    width: 60%;
    font-size: 1.4em;
  }

  body main #about section a:hover {
    cursor: pointer;
    color: var(--color-dark-800);
    background-color: var(--color-light-100);
  }

  body main #knowledge section {
    max-width: 85vw;
    flex-direction: row;
    flex-wrap: wrap;
  }

  body main #knowledge .knowledge-title {
    margin-bottom: 20px;
  }

  body main #knowledge .knowledge-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 60vw;
    gap: 60px;
    margin-bottom: 80px;
  }

  body main #knowledge .knowledge-item {
    margin-bottom: 0;
  }

  body main .modal .modal-content {
    max-width: 1000px;
    width: 100%;
    padding: 40px;
  }
}

@media only screen and (min-width: 1300px) {
  body main #projects .galery-pai .galery-filho {
    width: 100%;
    max-width: 900px;
  }
}

@media only screen and (min-width: 1600px) {
  body main #knowledge .knowledge-grid {
    max-width: 50vw;
  }

  body main #projects .galery-pai .galery-filho {
    width: 100%;
    max-width: 1200px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  :target {
    scroll-margin-top: 0.8em;
  }
}

@keyframes scale-up-center {
  0% {
    transform: scale(0.5);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes appear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 100;
  }
}
