/* ========================
   Definindo Variáveis de Cores (Modo Dark - Padrão)
   ======================== */
:root {
  --bg: #000;
  --primary: #3009b1;
  --secondary: #6c52e6;
  --text: #f2f1f4;
  --card-bg: #111;

  --subtitle: #cfc7ff; /* subtítulo/typewriter no dark */
  --muted: #b8b2cc; /* parágrafos menos fortes */
  --link: #9e8bff; /* links/realces */
  --link-hover: #c0b3ff; /* hover de links */
  --chip-text: #f2f1f4; /* texto das "chips" de skills */
  --border: rgba(255, 255, 255, 0.08);

  --shadow: 0 4px 12px rgba(192, 179, 255, 0.4);
}

/* ========================
   Light Mode
   ======================== */
body.light-mode {
  --bg: #b8b5ff; /* fundo lilás marcante */
  --card-bg: #dcd9ff; /* um tom acima do bg p/ cartão */
  --text: #1a1833; /* texto escuro */

  --primary: #5c46e5; /* roxo principal */
  --secondary: #3009b1; /* roxo escuro */

  --subtitle: #322b5f; /* subtítulo/typewriter no light */
  --muted: #4a4666; /* parágrafos menos fortes */
  --link: #473bd8; /* links/realces */
  --link-hover: #2f22a8; /* hover de links */
  --chip-text: #ffffff; /* melhor contraste nas chips */
  --border: rgba(0, 0, 0, 0.08);

  --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

/* ========================
   Header
   ======================== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--bg);
  display: flex;
  justify-content: space-between; /* logo à esquerda, menu no meio, botão no final */
  align-items: center;
  padding: 1.7rem 2rem;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(6px);
}

.logo img {
  width: 300px;
  height: 50px;
}

nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%); /* centraliza no meio da tela */
  display: flex;
  gap: 1rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}

nav a:hover {
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 2px; /* dá espaço da linha */
}

/* Acessibilidade: foco visível em teclados */
:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

#toggle-mode {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

#toggle-mode img {
  width: 24px;
  height: 24px;
}

/* ========================
   Gradiente Animado no Nome
   ======================== */
.gradient-text {
  font-family: Cantarell;
  font-size: 3rem;
  background: linear-gradient(
    270deg,
    var(--primary),
    var(--secondary),
    var(--link)
  );
  background-size: 600% 600%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientAnimation 5s ease infinite;
  margin: 0;
}

@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ========================
   Seção Intro/Home - Nome + Subtítulo + Foto (coluna 1) | Sobre Mim (coluna 2)
   ======================== */
#intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding-top: 120px;
  padding-bottom: 50px;
  max-width: 1200px;
  margin: auto;
}

/* Coluna esquerda */
#intro .left-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#intro .left-content h1.gradient-text {
  font-size: 3rem;
  margin-bottom: 10px;
}

#intro .left-content h2 {
  color: var(--subtitle);
  font-weight: 300;
  margin-top: 10px;
}

#intro .sobre-texto strong {
  color: var(--link);
  font-weight: bold;
}

.profile-pic {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--link);
  margin-top: 45px;
}

/* Coluna direita */
#intro .sobre-texto {
  text-align: left;
}

#intro .sobre-texto h2 {
  color: var(--secondary);
  border-left: 5px solid var(--primary);
  padding-left: 10px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

#intro .sobre-texto p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* Responsividade: Mobile */
@media (max-width: 768px) {
  #intro {
    grid-template-columns: 1fr;
    text-align: center;
  }

  #intro .left-content,
  #intro .sobre-texto {
    align-items: center;
    text-align: center;
  }

  #intro .sobre-texto h3 {
    border-left: none;
    padding-left: 0;
  }
}

/* ========================
   Typewriter
   ======================== */
#typewriter {
  font-size: 1rem;
  color: var(--subtitle); /* ← muda com o tema */
  font-weight: normal;
  letter-spacing: 1px;
  opacity: 0.8;
  overflow: hidden;
  white-space: nowrap;
  margin: 0;
  display: inline-block;
  position: relative;
}

#typewriter::after {
  content: "";
  position: absolute;
  top: 0;
  right: -3px;
  width: 2px;
  height: 100%;
  background-color: var(--secondary);
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

/* ========================
   Seções gerais
   ======================== */
section p {
  color: var(--muted);
}

section li {
  color: var(--muted);
}

section {
  padding: 100px 20px;
  max-width: 1000px;
  margin: auto;
  margin-top: 100px;
}

section h2 {
  color: var(--secondary);
  font-size: 2rem;
  margin-bottom: 1rem;
  border-left: 5px solid var(--primary);
  padding-left: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
}

section h2::after {
  content: "";
  display: block;
  width: 50px;
  height: 2px;
  background-color: var(--secondary);
  margin-top: 8px;
}

/* ========================
   Skills (categorias + grid + barra)
   ======================== */
.skills-category {
  margin-bottom: 2.5rem;
}

.skills-category h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.4rem;
  border-left: 4px solid var(--secondary);
  padding-left: 10px;
  letter-spacing: 0.5px;
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  background: var(--card-bg);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 600;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    border-color 0.25s ease;
  border: 1px solid var(--border);
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border);
}

/* Ícones nas skills */
.skill-card i {
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: var(--primary);
  display: block;
}

/* Barra de proficiência (base) */
.progress-bar {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
}

.progress {
  position: relative; /* p/ porcentagem */
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease-in-out, background 0.3s ease;
  background: linear-gradient(90deg, var(--secondary), var(--link));
}

/* Porcentagem minimalista dentro da barra */
.progress::after {
  content: attr(data-pct) "%";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  line-height: 1;
  color: var(--chip-text);
  opacity: 0.9;
  pointer-events: none;
}

/* ========================
   SKILLS — melhorias só no DARK MODE
   ======================== */

/* Título das categorias mais vivo no dark */
body:not(.light-mode) .skills-category h3 {
  color: var(--link); /* usa o lilás claro do dark */
  border-left-color: var(--secondary);
  letter-spacing: 0.6px;
}

/* Ícones das skills mais visíveis no dark */
body:not(.light-mode) .skill-card i {
  color: var(--link); /* em vez de var(--primary) que é escuro no preto */
  filter: drop-shadow(0 0 6px rgba(158, 139, 255, 0.35));
}

/* Barra de proficiência com mais contraste no dark */
body:not(.light-mode) .progress-bar {
  background: rgba(255, 255, 255, 0.14); /* trilho um pouco mais claro */
}

/* Cards levemente mais destacados no hover no dark */
body:not(.light-mode) .skill-card:hover {
  box-shadow: 0 8px 22px rgba(192, 179, 255, 0.4);
}

/* ========================
   Cards de Projetos
   ======================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 20px;
  margin: 10px 0;
  border-radius: 10px;
  transition: transform 0.3s, background-color 0.3s, border-color 0.3s;
}

.card:hover {
  transform: translateY(-4px); /* leve elevação */
  box-shadow: var(--shadow); /* sombra variável pelo tema */
  border: 1px solid var(--border);
}

/* ========================
   Footer
   ======================== */
footer {
  text-align: center;
  padding: 1rem;
  background: var(--bg);
}

/* ========================
   Estrelas no fundo
   ======================== */
#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* ========================
   Estilo da seção Contato com ícones SVG
   ======================== */
#contato ul.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#contato ul.contact-list li {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1rem;
}

#contato .contact-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
}

#contato ul.contact-list li strong {
  margin-right: 5px;
  color: var(--secondary);
}

#contato ul.contact-list li a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.3s, text-decoration 0.3s;
}

#contato ul.contact-list li a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Respeita a preferência do usuário por menos movimento */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  canvas#stars {
    display: none; /* esconde o fundo animado */
  }
}
