/* Fonts */
@font-face {
  font-family: "Inter";
  src: url(assets/fonts/Inter/Inter-VariableFont_opsz\wght.ttf)
    format("truetype");
  font-weight: 100 900;
  font-style: normal;
}

/* Global */
:root {
  --background: #121010;
  --cinza: #1a1a1a;
  --vermelho: #660000;
  --texto-primario: #eaeaea;
  --texto-secundario: #9ca3af;
  --cards: #1f1818;
  --box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3),
    4px 4px 10px 10px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 70px;
  width: 100%;
  height: calc(100% + 90px);
  font-family: "Inter", sans-serif;
  background-color: var(--background);
  color: var(--texto-primario);
  scroll-behavior: smooth;
}

main {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin: 40px 0;
  scroll-margin-top: 120px;
}

center {
  width: 60%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* Animation */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Header */
header {
  width: 100%;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--box-shadow);
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--cinza);
  z-index: 1000;
}

header .Me {
  width: 70%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: auto 20px;
}

header .Me h1 {
  font-size: 24px;
  font-weight: 400;
  color: var(--vermelho);
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
}

header .Me h2 {
  font-size: 16px;
  font-weight: 400;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
}

header nav {
  width: 30%;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}

header nav a {
  position: relative;
  text-decoration: none;
  color: var(--texto-secundario);
  font-size: 16px;
  font-weight: 400;
  padding-bottom: 6px;
  transition: color 0.3s;
}

header nav a:hover {
  color: var(--vermelho);
}

header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background-color: var(--vermelho);
  transition: width 0.3s ease;
}

header nav a.active::after {
  width: 100%;
}

/* Sobre Mim */
#about h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
}

#about center {
  flex-direction: row;
  margin-top: 20px;
  gap: 20px;
}

#about center p {
  width: 40%;
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  text-align: justify;
  color: var(--texto-secundario);
  margin-right: 40px;
}

#about .profile-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#about center img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #330000;
  box-shadow: var(--box-shadow);
  position: relative;
  z-index: 2;
}

/* ========================================= */
/* CARROSSEL 3D PURO CSS - SEM JAVASCRIPT */
/* ========================================= */

.carousel-3d-orbit {
  position: absolute; /* Mudado para absolute para sobrepor a imagem */
  bottom: -10px; /* Posiciona na parte inferior da foto */
  width: 100%;
  height: 100px; /* Altura reduzida */
  perspective: 1000px;
  z-index: 10; /* Garante que fique acima da imagem */
}

.orbit-ring {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  /* Ajustamos o ângulo inicial para parecer um carrossel frontal */
  transform: rotateX(-10deg);
  animation: orbitRotate 10s linear infinite;
}

/* Pausa a animação ao passar o mouse */
.profile-container:hover .orbit-ring {
  animation-play-state: paused;
}

@keyframes orbitRotate {
  from {
    transform: rotateX(-5deg) rotateY(0deg);
  }
  to {
    transform: rotateX(-5deg) rotateY(360deg);
  }
}

/* Adicione este seletor para manter os ícones virados para o usuário */
.orbit-ring .orbit-icon i {
  animation: counterRotate 10s linear infinite;
}

/* Cores dos ícones */
.fa-html5,
.fa-css3-alt,
.fa-js,
.fa-node-js,
.fa-database {
  color: var(--vermelho);
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
}

.orbit-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin-left: -25px;
  margin-top: -25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  transform-style: preserve-3d;
  /* Removemos as configurações individuais estáticas e usamos uma lógica baseada em 360/5 */
  backface-visibility: hidden; /* Oculta ícones quando estiverem "de costas" */
}

/* Configuração de rotação para cada um dos 5 ícones */
.orbit-icon:nth-child(1) {
  transform: rotateY(0deg) translateZ(130px);
}
.orbit-icon:nth-child(2) {
  transform: rotateY(72deg) translateZ(130px);
}
.orbit-icon:nth-child(3) {
  transform: rotateY(144deg) translateZ(130px);
}
.orbit-icon:nth-child(4) {
  transform: rotateY(216deg) translateZ(130px);
}
.orbit-icon:nth-child(5) {
  transform: rotateY(288deg) translateZ(130px);
}

/* Projetos */

#projects {
  margin-top: 160px;
}

#projects h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

#projects .project-cards {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

#projects .project-cards > .card {
  width: 320px;
  height: 450px;
  background-color: var(--cards);
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s;
}

#projects .project-cards > .card:hover {
  transform: translateY(-10px);
  border: 1px solid #330000;
}

#projects .project-cards > .card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: var(--box-shadow);
}

#projects .project-cards > .card h4 {
  font-size: 30px;
  font-weight: 500;
  color: var(--vermelho);
  margin-bottom: 10px;
}

#projects .project-cards > .card p {
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  text-align: justify;
  color: var(--texto-secundario);
}

#projects .project-cards > .card a {
  padding: 15px 25px;
  margin-top: auto;
  text-decoration: none;
  color: var(--texto-primario);
  background-color: var(--cinza);
  font-weight: 600;
  box-shadow: var(--box-shadow);
  border-radius: 8px;
  transition: background-color 0.3s;
}

#projects .project-cards > .card a:hover {
  background-color: var(--vermelho);
}

/* Serviços */
#services {
  margin-bottom: 140px;
}

#services h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

#services .service-cards {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

#services .service-cards > .card {
  width: 320px;
  height: 340px;
  background-color: var(--cards);
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s;
}

#services .service-cards > .card:hover {
  transform: translateY(-10px);
  border: 1px solid #330000;
}

#services .service-cards > .card h4 {
  font-size: 26px;
  font-weight: 500;
  color: var(--vermelho);
  margin-bottom: 20px;
}

#services .service-cards > .card p {
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  text-align: justify;
  margin-bottom: 10px;
  color: var(--texto-secundario);
}

#services .service-cards > .card > ul {
  margin-top: 15px;
  text-align: left;
  color: var(--texto-primario);
}

#services .service-cards > .card > ul > li {
  margin-bottom: 8px;
  list-style-type: disc;
  margin-left: 20px;
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  flex-wrap: wrap;
  width: 100%;
  height: 40px;
  background-color: var(--cinza);
  box-shadow: -4px -4px 8px rgba(0, 0, 0, 0.3),
    -4px -4px 10px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: center;
  color: var(--texto-primario);
  z-index: 1000;
}

footer p {
  font-size: 14px;
  font-weight: 400;
}

/* ============================= */
/* Tablets e telas médias */
/* ============================= */
@media (max-width: 1024px) {
  center {
    width: 80%;
  }

  header .Me {
    width: 60%;
  }

  header nav {
    width: 40%;
  }

  #about center p {
    width: 55%;
    margin-right: 20px;
  }
}

/* ============================= */
/* Tablets pequenos e celulares */
/* ============================= */
@media (max-width: 768px) {
  html,
  body {
    margin-top: 90px;
  }

  header {
    flex-direction: column;
    height: auto;
    padding: 10px 0;
  }

  header .Me {
    width: 100%;
    align-items: center;
    text-align: center;
    margin-bottom: 10px;
  }

  header nav {
    width: 100%;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
  }

  center {
    width: 90%;
  }

  /* Sobre mim */
  #about center {
    flex-direction: column;
    text-align: center;
  }

  #about center p {
    width: 100%;
    margin-right: 0;
    text-align: justify;
  }

  #about center img {
    margin-top: 20px;
  }

  .carousel-3d-orbit {
    bottom: 0px; /* Ajusta a posição sobre a foto no mobile */
    height: 80px;
    perspective: 800px;
  }

  /* Aplica a animação de rotação corrigida para mobile */
  .orbit-ring {
    animation: orbitRotate 10s linear infinite;
  }

  .orbit-icon {
    width: 35px;
    height: 35px;
    margin-left: -17.5px;
    margin-top: -17.5px;
    font-size: 30px;
  }

  /* Reinicializa os transforms para a nova lógica de órbita frontal */
  .orbit-icon:nth-child(1) {
    transform: rotateY(0deg) translateZ(100px);
  }
  .orbit-icon:nth-child(2) {
    transform: rotateY(72deg) translateZ(100px);
  }
  .orbit-icon:nth-child(3) {
    transform: rotateY(144deg) translateZ(100px);
  }
  .orbit-icon:nth-child(4) {
    transform: rotateY(216deg) translateZ(100px);
  }
  .orbit-icon:nth-child(5) {
    transform: rotateY(288deg) translateZ(100px);
  }

  /* Garante que o contra-giro continue funcionando no mobile */
  .orbit-ring .orbit-icon i {
    animation: counterRotate 10s linear infinite;
  }

  /* Cards */
  #projects .project-cards,
  #services .service-cards {
    flex-direction: column;
  }

  #projects .project-cards > .card,
  #services .service-cards > .card {
    width: 90%;
    max-width: 360px;
  }

  footer {
    height: auto;
    padding: 15px;
  }
}

/* ============================= */
/* Celulares pequenos */
/* ============================= */
@media (max-width: 480px) {
  header .Me h1 {
    font-size: 20px;
  }

  header .Me h2 {
    font-size: 14px;
  }

  header nav a {
    font-size: 14px;
  }

  section {
    margin: 30px 0;
  }

  #about h3,
  #projects h3,
  #services h3 {
    font-size: 24px;
  }

  .carousel-3d-orbit {
    bottom: 10px;
    height: 60px;
  }

  .orbit-icon {
    width: 30px;
    height: 30px;
    margin-left: -15px;
    margin-top: -15px;
    font-size: 26px;
  }

  /* Reduz o raio da órbita para telas muito estreitas */
  .orbit-icon:nth-child(1) {
    transform: rotateY(0deg) translateZ(80px);
  }
  .orbit-icon:nth-child(2) {
    transform: rotateY(72deg) translateZ(80px);
  }
  .orbit-icon:nth-child(3) {
    transform: rotateY(144deg) translateZ(80px);
  }
  .orbit-icon:nth-child(4) {
    transform: rotateY(216deg) translateZ(80px);
  }
  .orbit-icon:nth-child(5) {
    transform: rotateY(288deg) translateZ(80px);
  }

  #projects .project-cards > .card h4,
  #services .service-cards > .card h4 {
    font-size: 22px;
  }

  #projects .project-cards > .card p,
  #services .service-cards > .card p {
    font-size: 13px;
  }

  footer p {
    font-size: 12px;
  }
}
