* {
  font-family: "Outfit", sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}
header {
  background: #000814;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.75rem;

  .logo {
    width: auto;
    height: 5.5rem;
    border-radius: 0.5rem;
    object-fit: contain;
    transition: transform 0.3s ease;
  }
  .logo:hover {
    transform: scale(1.05); /* Leve expansão ao passar o mouse */
  }
  .lista {
    display: flex;
    gap: 2rem;
    list-style: none;
    font-size: 1.5rem;
    font-weight: 600;
  }
  .a {
    text-decoration: none;
    color: aliceblue;
    display: inline-block;
    transition: transform 0.3s ease;
  }
  .a:hover {
    transform: scale(1.05);
  }
}

body {
  background: #343a40;
}
footer {
  background: #000814;
}
.rodape {
  align-items: center;
  padding: 1rem;
  display: flex;
  justify-content: flex-end;
  flex-direction: column-reverse;
}

h1 {
  color: aliceblue;
}
h2 {
  color: aliceblue;
}
p {
  color: #adb5bd;
  line-height: 1.6;
  font-size: 1.25rem;
  font-weight: 600;
}
.h1_roxo {
  color: transparent;
  -webkit-text-stroke: 1px #7b68ee;
  font-weight: 300;
  display: inline-block;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
section#inicio {
  background-color: #000814;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3rem 1rem;
  gap: 2rem;
  contain: paint;
  .div_textos {
    max-width: 60%;
    display: flex;
    /* Mudei a direção para vertical (empilhando os textos) */
    flex-direction: column;
    align-items: flex-start;
    /*o respiro uniforme de 1.5rem entre o h1, h2, p, botão e ícones */
    gap: 1.5rem;
  }
  .div_textos > div {
    display: flex;
    gap: 0.75rem;
    align-items: center;
  }
  .div_textos > div a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.4rem;
    background-color: #7b68ee;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.3s ease;
  }
  .div_textos > div a:hover {
    transform: scale(1.05);
  }
  .icones {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
    border-radius: 0;
    margin-top: 0;
  }

  .div_imagem {
    .perfil {
      max-width: 450px;
      width: 100%;
      border-radius: 50%;
      outline: 4px solid #7b68ee;
      outline-offset: 4px;
    }
  }
}

section#sobre {
  display: flex;
  justify-content: center;
  padding: 1rem 1rem;
  contain: paint;
  .conteudo_sobre {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
    /* Limitei a largura máxima do texto. 
       Isso força a quebra de linha do parágrafo, deixando-o com aspecto 
       de "bloco". */
    max-width: 800px;
  }
  .perfil2 {
    height: 20rem;
    width: 20rem;
    border-radius: 50%;
    outline: 4px solid #7b68ee;
    outline-offset: 4px;
    /*Adicionei 'object-fit' para 
       garantir que a imagem não achate se não for um quadrado perfeito. */
    object-fit: cover;
    /*puxei a foto com margin, sobrepondo o valor do gap de classe */
    margin-top: -2.5rem;
  }
  .conteudo_sobre p {
    align-self: stretch;
    width: 100%;
    text-align: left;
    line-height: 1.75;
    text-wrap: pretty;
  }
}
section#habilidades {
  background: #000814;
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem;
  align-items: center;
  /*espaço entre o Título (H1) e as barras */
  gap: 2rem;
  .item_p {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
  }
}
.ancora {
  text-decoration: none;
  list-style: none;
  color: aliceblue;
  font-size: 1.5rem;
  font-weight: 600;
  display: inline-block;
  padding: 0.3rem 2rem;
  border-radius: 0.5rem;
  background-color: #7b68ee;
  transition: transform 0.3s ease, background-color 0.3s ease;
  &:hover {
    background-color: #5a4db8;
    transform: scale(1.05);
  }
}
.estilo_rodape {
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  display: inline-block;
  padding: 3rem;
}
.barra_habilidades {
  background-color: aliceblue;
  width: 100%;
  height: 10px;
  border-radius: 8px;
  /* Garante que o preenchimento não saia das bordas arredondadas */
  overflow: hidden;
}
.progresso {
  background-color: #7b68ee;
  height: 100%;
  border-radius: 8px;
  /*para a barra carregar com animação */
  transition: width 1s ease-in-out;
}
/* =========================================
  SEÇÃO CONTATO
========================================= */
section#contato {
  background-color: #343a40; /* Intercalando a cor de fundo para dar contraste */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 1rem;
  gap: 2rem;
  text-align: center;
}

.box_contatos {
  display: flex;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  max-width: 1000px;
  flex-wrap: wrap; /* Permite que os cards quebrem de linha se não houver espaço */
  margin-top: 1.5rem;
}

.item_contato {
  background-color: #000814;
  border: 2px solid #7b68ee;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  /* Largura base do card, mas pode crescer para preencher o espaço */
  flex: 1; 
  min-width: 280px; 
}

.item_contato h2 {
  font-size: 1.5rem;
}

.item_contato p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.redes_links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Animação de entrada ao rolar a página (ativada via script.js) */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visivel {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
  RESPONSIVIDADE (MOBILE & TABLET)
========================================= */
@media (max-width: 768px) {
  /* Ajuste do Cabeçalho: Empilha a logo e o menu */
  header {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1rem;

    .lista {
      flex-wrap: wrap; /* Permite que os links desçam de linha se faltar espaço */
      justify-content: center;
      gap: 1rem;
      font-size: 1.2rem; /* Reduz um pouco o tamanho da fonte */
    }
  }

  /* Ajuste da Secção Início: Empilha a foto e o texto */
  section#inicio {
    /* column-reverse coloca a foto em cima e o texto em baixo */
    flex-direction: column-reverse;
    text-align: center;
    padding: 3rem 1rem;
    gap: 3rem;

    .div_textos {
      max-width: 100%; /* O texto passa a ocupar 100% da largura do smartphone */
      align-items: center; /* Centraliza os textos e botões */
    }

    .div_imagem .perfil {
      max-width: 300px; /* Reduz a foto no smartphone */
    }
  }

  /* Ajuste da Secção Sobre: Centralização e espaçamento */
  section#sobre {
    padding: 3rem 1rem;

    .perfil2 {
      margin-top: 0; /* Removemos aquela margem negativa agressiva para o smartphone */
      height: 15rem; /* Diminuímos a foto um pouco */
      width: 15rem;
    }
  }
  /* Ajuste da Secção Contato no Mobile */
  section#contato {
    padding: 3rem 1rem;
  }

  .box_contatos {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    padding: 0 0.5rem;
  }

  .item_contato {
    width: 100%;
    min-width: unset;
    padding: 1.5rem 1rem;
  }

  .ancora {
    font-size: 1.1rem;
    padding: 0.5rem 1.25rem;
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

  .redes_links {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
  }

  .redes_links .ancora {
    max-width: 100%;
  }
  /* Ajustes Gerais de Tipografia para não quebrar no ecrã pequeno */
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  p {
    font-size: 1rem;
  }
}
