/* =================== RESPONSIVIDADE CONSOLIDADA ================== */

@media screen and (max-width: 1257px) {
  .lista-projetos {
    justify-content: space-evenly;
  }
  .card-projeto {
    justify-items: center;
  }
  .sobre-mim-texto {
    width: 500px;
  }
}
/* 1. TABLETS (Até 1024px) */
@media screen and (max-width: 1200px) {
  .sobre-mim-texto {
    max-width: 100%;
    width: auto;
    padding: 20px;
  }
  main figure img {
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    flex-shrink: 0;
  }

  main figure {
    margin-left: 0;
  }

  main figure p {
    font-size: 1.5rem;
    max-width: none;
  }

  /* Contato */
  .container-contato {
    padding: 50px;
    text-align: left;
    justify-items: center;
  }

  .container-contato h3 {
    margin-left: 0;
    font-size: 1.1rem;
  }

  #contato {
    align-items: flex-start;
  }

  .contato-info {
    padding: 0;
    font-size: 1.5rem;
    align-items: center;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
  }

  main #sobre-mim {
    grid-template-columns: 1fr 1.2fr;
    justify-items: center;
    text-align: center;
    padding-top: 60px;
    margin-inline: 5%;
    gap: 20px !important;
  }

  .detalhe {
    text-align: center;
    margin: 0 auto;
  }

  .detalhe::before {
    left: 0;
  }

  figure {
    align-items: center;
    text-align: center;
  }

  .perfil-container {
    justify-content: center;
  }

  .sobre-mim-texto {
    padding: 30px 20px;
  }
}
@media screen and (max-width: 1000px) {
  .sobre-mim-texto {
    width: 300px;
  }
  .estilo-paragrafo {
    font-size: 0.8rem;
  }
}

@media screen and (max-width: 780px) {
  .header-container {
    flex-direction: column;
    gap: 15px;
  }
  main #sobre-mim {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    margin-inline: 0;
  }

  .sobre-mim-texto {
    width: auto;
  }

  .container-index {
    padding-bottom: 0px;
  }

  main figure {
    margin-left: 0;
    align-items: center;
    text-align: center;
  }
  .perfil-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 0;
  }

  .estilo-paragrafo {
    font-size: 1rem;
  }

  /* Projetos */
  .layout-projetos {
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    margin: 60px;
  }

  .titulo-lateral {
    writing-mode: horizontal-tb;
    transform: rotate(0);
    font-size: 3rem;
    margin: 20px 0;
  }
  .container-contato {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .lista-projetos {
    gap: 10px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  }

  .icon-seta {
    width: 20px; /* Reduz a imagem proporcionalmente */
    height: 20px;
  }
}
/* Ajuste específico para evitar o "Safe Area" (Iphones novos/Androids sem borda) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .back-to-top {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media screen and (max-width: 633px) {
  .detalhe {
    font-size: 2.5rem;
  }

  .sobre-mim-texto {
    width: 500px;
  }
}

@media screen and (max-width: 689px) {
  .card-projeto {
    max-width: 500px !important;
    justify-items: center;
  }
}

@media screen and (max-width: 520px) {
  /* 1. Centraliza o container pai */
  header h1 {
    font-size: 1.5rem;
  }
  header nav ul {
    gap: 10px;
  }
  header nav a {
    font-size: 0.9rem;
  }

  #sobre-mim {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
  }

  .sobre-mim-texto {
    width: 90%;
    max-width: 380px;
    height: 420px;
    padding: 30px 20px;
    margin: 0 auto;
  }

  .estilo-paragrafo {
    font-size: 0.8rem;
    line-height: 1.6;
    max-width: 100%;
  }

  /* 2. Centraliza a Figure e remove margens residuais */
  main figure {
    margin: 0 auto;
    align-items: center;
    gap: 10px;
  }

  main figure img {
    object-fit: cover;
    margin: 0 auto;
  }

  /* 4. Empilha os itens dentro do perfil */
  .perfil-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  main figure p {
    font-size: 1.1rem;
    max-width: none;
    text-align: center;
  }

  .layout-projetos {
    padding: 0 20px !important;
    width: 100%;
    align-items: center;
    margin: 50px;
  }

  .lista-projetos {
    gap: 20px;
  }

  .info-projeto h3 {
    font-size: 2em;
  }

  .descricao-projeto {
    font-size: 0.9rem;
  }

  .card-projeto {
    width: 100% !important;
    max-width: 100%;
    padding: 20px;
    margin: 0;
    max-height: none;
  }

  /* Botões dentro do card */
  .links-projeto {
    flex-direction: column;
    width: 100%;
    text-align: center;
  }

  .btn-link,
  .btn-github {
    width: 100% !important;
    max-width: none;
    height: auto;
  }

  .btn-link {
    font-size: 20px;
  }

  .capa-projeto img {
    display: none;
  }

  .btn-ver-mais {
    font-size: 1rem;
    border: 2px solid;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0px 1px 3px #000000;
  }
  .container-ver-mais {
    max-width: 100%;
    margin: 0 auto;
  }

  .btn-ver-mais::before {
    display: none;
  }

  .tecnologias-wrapper {
    margin: 0 10px;
    justify-content: flex-start;
    gap: 40px;
  }

  .style-tecnologias {
    font-size: 12px;
  }

  .coluna-tecnologia {
    flex: none;
  }

  .icone-seta {
    display: none;
  }
  .contato-info li {
    font-size: 1.2rem;
  }

  @media screen and (max-width: 450px) {
    .lista-projetos {
      max-width: none;
      width: 80%;
    }
    .btn-ver-mais {
      font-size: 0.8rem;
    }
  }
}
