/* ================================
   VARIÁVEIS DE CORES E TEMAS
   ================================ */
:root {
  --primary: #1e88e5;   /* Cor principal (botões, destaques) */
  --bg: #ffffff;        /* Fundo padrão claro */
  --text: #222222;      /* Cor do texto principal */
  --muted: #6b7280;     /* Texto secundário */
  --surface: #f5f7fb;   /* Fundo de áreas destacadas */
}

/* ================================
   RESET E BASE
   ================================ */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;                 /* Garante que o rodapé fique no final */
  display: flex;
  flex-direction: column;
  font-family: system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ================================
   CABEÇALHO E NAVEGAÇÃO
   ================================ */
header {
  display: flex;
  flex-direction: column;       /* Empilha título e menu */
  align-items: center;          /* Centraliza horizontalmente */
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid #e5e7eb;
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  text-align: center;
  line-height: 1.2;
}


/* Menu centralizado e nivelado */
nav {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Botão de menu mobile */
#btn-menu {
  display: none;
  background: none;
  border: 1px solid #ccc;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}

/* Lista de navegação nivelada */
#nav-list {
  display: flex;
  justify-content: center;
  align-items: center;          /* Alinha verticalmente todos os itens */
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Links e botão de tema com altura uniforme */
#nav-list a,
#btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  line-height: 1;
  box-sizing: border-box;
}

#nav-list a:hover,
#btn-theme:hover {
  background: #e9eef7;
}

/* ================================
   CONTEÚDO PRINCIPAL
   ================================ */
main {
  flex: 1;                      /* Ocupa espaço entre header e footer */
  padding: 16px;
}

h2 {
  text-align: center;
  margin-top: 24px;
}

/* ================================
   INTRODUÇÃO COM FOTO
   ================================ */
.intro {
  text-align: center;
  margin-bottom: 24px;
}

.intro .perfil {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  margin-bottom: 12px;
}

/* ================================
   PROJETOS (CARDS)
   ================================ */
.projetos {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.card-projeto {
  flex: 1 1 220px;
  max-width: 260px;
  background: var(--surface);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.card-projeto:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.card-projeto img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.card-projeto .info {
  padding: 10px;
}

.card-projeto .titulo {
  font-weight: 600;
  margin: 0 0 6px;
}

.card-projeto .descricao {
  font-size: .85rem;
  color: var(--muted);
}

/* ================================
   CURRÍCULO (LISTAS E TABELAS)
   ================================ */
ul {
  padding-left: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

thead {
  background: #eef2ff;
}

td, th {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
}

/* ================================
   FORMULÁRIO DE CONTATO
   ================================ */
form {
  max-width: 500px;
  margin: 0 auto;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* Foco e validação */
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,136,229,.15);
}

input:invalid {
  border-color: #ef4444;
}

input:valid {
  border-color: #22c55e;
}

/* Feedback visual JS */
.is-invalid {
  border-color: #ef4444 !important;
  background: #fff5f5;
}

.is-valid {
  border-color: #22c55e !important;
}

.erro-campo {
  color: #ef4444;
  font-size: 0.85rem;
  min-height: 1em;
}

/* Botões */
button, .btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 12px;
}

button:hover, .btn:hover {
  filter: brightness(1.05);
}

/* ================================
   RODAPÉ
   ================================ */
footer {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid #e5e7eb;
  margin-top: auto;             /* Empurra o rodapé para o final */
}

/* ================================
   BOTÃO VOLTAR AO TOPO
   ================================ */
#btn-topo {
  position: fixed;       /* Fixa no canto da tela */
  right: 16px;           /* Distância da borda direita */
  bottom: 16px;          /* Distância da borda inferior */
  padding: 10px 12px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;         /* Começa escondido */
  z-index: 999;          /* Garante que fique acima do conteúdo */
}

/* ================================
   TEMA ESCURO
   ================================ */
.dark {
  --bg: #0b1220;
  --text: #e5e7eb;
  --surface: #111827;
}

/* ================================
   RESPONSIVIDADE (MOBILE)
   ================================ */
@media (max-width: 768px) {
  #btn-menu {
    display: inline-flex;
    margin: 0 auto 8px;
  }

  #nav-list {
    display: none;
    position: relative;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    background: transparent;
    border: none;
  }

  #nav-list.open {
    display: flex;
  }
}
#btn-topo {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 10px 12px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none; /* Só aparece quando o usuário rola a página */
}
/* Layout flexível para a página */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  scroll-behavior: smooth; /* ROLAGEM SUAVE */
}

/* Conteúdo principal ocupa espaço entre header e footer */
main.apresentacao {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px;
}

/* Blocos de conteúdo */
.bloco {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  padding: 20px;
  border-radius: 8px;
  border-left: 6px solid var(--primary);
}

/* Estilos específicos por tecnologia */
.bloco.html { border-color: #e44d26; }
.bloco.css  { border-color: #2965f1; }
.bloco.js   { border-color: #f0db4f; }

/* Títulos centralizados */
h2 {
  text-align: center;
  margin-bottom: 12px;
}

/* Botão voltar ao topo */
#btn-topo {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 10px 12px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
}
/* Container dos quadrados */
.quadrados {
  display: flex;
  flex-direction: column;   /* Empilha verticalmente */
  align-items: center;      /* Centraliza horizontalmente */
  gap: 24px;                /* Espaço entre os quadrados */
  margin-top: 40px;
}

/* Estilo base dos blocos */
.bloco {
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Estilos individuais */
.bloco.html { background-color: #e44d26; }   /* Laranja HTML */
.bloco.css  { background-color: #2965f1; }   /* Azul CSS */
.bloco.js   { background-color: #f0db4f; color: #222; } /* Amarelo JS */