:root {
  --bg: #0b0e13;
  --text: #e8f0ff;
  --muted: #9db0c8;
  --card: rgba(25, 32, 44, 0.55);
  --border: rgba(255, 255, 255, 0.09);
  --accent: #71e6ff;
  --accent-2: #8b6bff;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Background grid */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
      circle at 10% 10%,
      rgba(139, 107, 255, 0.18),
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 20%,
      rgba(113, 230, 255, 0.18),
      transparent 40%
    ),
    radial-gradient(
      circle at 50% 80%,
      rgba(44, 245, 180, 0.12),
      transparent 40%
    ),
    linear-gradient(var(--bg), var(--bg));
}
.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.15) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Header */
.site-header,
.cabecalho-site {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(
    180deg,
    rgba(11, 14, 19, 0.9),
    rgba(11, 14, 19, 0.65) 60%,
    transparent
  );
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.2) blur(8px);
}
.brand,
.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand-logo,
.logo-marca {
  height: 36px;
  width: auto;
  display: block;
  border-radius: 8px;
  object-fit: contain;
}
.brand-text,
.texto-marca {
  font-weight: 700;
  letter-spacing: 0.6px;
}
.nav,
.navegacao {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav a,
.navegacao a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease;
}
.nav a:hover,
.nav a.active,
.navegacao a:hover,
.navegacao a.active {
  color: var(--accent);
  background: rgba(113, 230, 255, 0.08);
  border-color: rgba(113, 230, 255, 0.22);
}
.theme-toggle,
.menu-toggle,
.alternar-tema,
.alternar-menu {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.menu-toggle,
.alternar-menu {
  display: none;
}

/* Layout */
.container,
.conteudo {
  position: relative;
  z-index: 1;
}
.section,
.secao {
  padding: 72px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.section,
.secao {
  scroll-margin-top: 88px;
}
.reveal,
.revelar {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal.visible,
.revelar.visivel {
  opacity: 1;
  transform: translateY(0);
}

/* Hero */
.hero,
.destaque {
  padding-top: 56px;
}
.hero .hero-wrap,
.destaque .destaque-grade {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  align-items: center;
}
.hero .hero-text,
.destaque .destaque-texto {
  padding: 28px;
  border-radius: 16px;
}
.eyebrow,
.chamada {
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 12px;
}
.title,
.titulo {
  font-size: clamp(30px, 6.5vw, 52px);
  line-height: 1.1;
  margin: 0 0 8px;
}
.subtitle,
.subtitulo {
  margin: 0 0 10px;
  font-weight: 700;
  color: #bfeaff;
  letter-spacing: 0.2px;
}
.lede,
.resumo {
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 60ch;
}
.highlight,
.texto-destaque {
  color: var(--accent);
  font-weight: 700;
}
.cta-row,
.cta-linha {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0 8px;
}
.avatar {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin: 8px 0 14px;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar.xl {
  width: 315px;
  height: 315px;
  margin: 0 auto;
}
.hero-media,
.destaque-midia {
  padding: 18px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Buttons */
.btn,
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  box-shadow: var(--shadow);
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn:hover,
.botao:hover {
  transform: translateY(-1px);
}
.btn:focus-visible,
.botao:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn.primary,
.botao.primario {
  background: linear-gradient(
    135deg,
    rgba(139, 107, 255, 0.28),
    rgba(113, 230, 255, 0.28)
  );
  border-color: rgba(255, 255, 255, 0.12);
}
.cta-row {
  flex-wrap: wrap;
}

/* Projects grid and cards */
.projects-grid,
.grade-projetos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.project-card,
.cartao-projeto {
  padding: 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.project-card:hover,
.cartao-projeto:hover {
  border-color: rgba(113, 230, 255, 0.35);
  transform: translateY(-2px);
}
.project-title,
.titulo-projeto {
  margin: 0 0 6px;
}
.project-desc,
.descricao-projeto {
  color: var(--muted);
  margin: 0 0 10px;
}
.project-links a,
.links-projeto a {
  color: var(--text);
  text-decoration: none;
  margin-right: 10px;
}
.project-links a:hover,
.links-projeto a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.chips,
.etiquetas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.chip,
.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
}

/* Preview de imagem de projetos (caso exista) */
.imagem-projeto {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: block;
  margin-bottom: 10px;
}

/* Botões de links (código/demo) mais visíveis e consistentes */
.links-projeto {
  display: flex;
  gap: 8px;
  align-items: center;
}
.links-projeto a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.2s ease,
    background-color 0.2s ease;
  text-decoration: none;
  color: var(--text);
  /* Esconde possíveis caracteres de texto residuais no anchor */
  font-size: 0;
}
.links-projeto a:hover {
  transform: translateY(-1px);
  border-color: rgba(113, 230, 255, 0.35);
  text-decoration: none;
}
.links-projeto a img,
.links-projeto a .icon-img {
  width: 24px;
  height: 24px;
  display: block;
}
.links-projeto a svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
}

/* Tech icons */
.tech-icons,
.icones-tecnologias {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 18px;
  padding: 20px;
  border-radius: 16px;
  align-items: center;
  justify-items: center;
}
.tech-icons img,
.icones-tecnologias img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* Sections */
.section-header p {
  color: var(--muted);
  margin-top: 6px;
}
.about,
.contact,
.sobre-bloco,
.contato-bloco {
  padding: 20px;
  border-radius: 16px;
}

.meta-row,
.meta-linha {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  margin-top: 6px;
}
.dot,
.ponto {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* Toggles */
.theme-toggle,
.menu-toggle,
.alternar-tema,
.alternar-menu {
  min-width: 40px;
  min-height: 40px;
}

/* Hero responsive */
@media (max-width: 900px) {
  .hero .hero-wrap,
  .destaque .destaque-grade {
    grid-template-columns: 1fr;
  }
}

/* Light theme overrides */
.light .btn.primary {
  background: linear-gradient(
    135deg,
    rgba(124, 92, 255, 0.18),
    rgba(108, 240, 255, 0.18)
  );
  border-color: rgba(0, 0, 0, 0.08);
}
.btn.primary {
  background: linear-gradient(
    135deg,
    rgba(139, 107, 255, 0.28),
    rgba(113, 230, 255, 0.28)
  );
  border-color: rgba(255, 255, 255, 0.18);
}
.meta-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
}

/* Sections */
.section-header h3 {
  margin: 0 0 6px;
  font-size: 22px;
}
.section-header p {
  margin: 0 0 22px;
  color: var(--muted);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.project-card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.03)
  );
  box-shadow: var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease;
}
.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(113, 230, 255, 0.35);
}
.project-title {
  margin: 0;
  font-size: 18px;
}
.project-desc {
  margin: 0;
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: #cfe8ff;
}
.project-links {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.project-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.project-links a:hover {
  color: var(--accent);
}

/* Tech icons */
.tech-icons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 18px;
  padding: 20px;
  border-radius: 16px;
  align-items: center;
  justify-items: center;
}
.tech-icons img,
.icones-tecnologias img {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  opacity: 0.95;
}

/* About & Contact */
.about,
.contact,
.sobre-bloco,
.contato-bloco {
  padding: 18px;
  border-radius: 16px;
}
.links {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.links a {
  color: var(--muted);
  text-decoration: none;
}
.links a:hover {
  color: var(--text);
}

/* Contact icons */

.contact .links a.icon-btn,
.contato-bloco .links a.icon-btn,
.contato-bloco .links a.botao-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.contact .links a.icon-btn:hover,
.contato-bloco .links a.icon-btn:hover,
.contato-bloco .links a.botao-icone:hover {
  transform: translateY(-1px);
  color: var(--accent);
}
.links a.icon-btn svg,
.links a.botao-icone svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}
.contact .links a:not(.icon-btn) {
  display: none;
}
.contact-email,
.email-contato {
  margin-top: 6px;
  color: var(--muted);
}

.contact-email a,
.email-contato a {
  color: var(--text);
  text-decoration: none;
}
.contact-email a:hover,
.email-contato a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.glass,
.vidro {
  backdrop-filter: blur(8px) saturate(1.1);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.stats {
  padding: 16px;
  border-radius: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.stats img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Footer */
.site-footer,
.rodape-site {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 24px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: linear-gradient(
    0deg,
    rgba(11, 14, 19, 0.9),
    rgba(11, 14, 19, 0.6)
  );
}

/* Acessibilidade */
.skip-link,
.pular-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent-2);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 50;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  outline: none;
}
:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .nav,
  .navegacao {
    display: none;
  }
  .menu-toggle,
  .alternar-menu {
    display: inline-flex;
  }
  .site-header.nav-open .nav a,
  .cabecalho-site.navegacao-aberta .navegacao a {
    display: inline-flex;
    background: var(--card);
    padding: 8px 10px;
    border-radius: 8px;
  }
  .site-header.nav-open .nav,
  .cabecalho-site.navegacao-aberta .navegacao {
    position: absolute;
    right: 16px;
    top: 62px;
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(11, 14, 19, 0.95);
    border: 1px solid var(--border);
  }
  .hero .hero-wrap {
    grid-template-columns: 1fr;
  }
  .avatar.xl {
    width: 200px;
    height: 200px;
  }
}

/* Melhorias de responsividade adicionais */
@media (max-width: 640px) {
  .grade-projetos {
    grid-template-columns: 1fr;
  }
  .links-projeto a {
    width: 36px;
    height: 36px;
  }
  .imagem-projeto {
    aspect-ratio: 16/10;
  }
}

@media (min-width: 1100px) {
  .hero .hero-text {
    padding: 36px;
  }
}

/* Light theme */
.light {
  --bg: #f7f9fc;
  --text: #0b1220;
  --muted: #475569;
  --card: rgba(255, 255, 255, 0.65);
  --border: rgba(0, 0, 0, 0.1);
  --accent: #2563eb; /* azul para melhor leitura no claro */
  --accent-2: #7c3aed; /* roxo complementar */
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Ajustes de componentes no modo claro */
.light .bg-grid,
.claro .bg-grid {
  background: radial-gradient(
      circle at 10% 10%,
      rgba(37, 99, 235, 0.15),
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 20%,
      rgba(124, 58, 237, 0.14),
      transparent 40%
    ),
    radial-gradient(circle at 50% 80%, rgba(14, 165, 233, 0.1), transparent 40%),
    linear-gradient(var(--bg), var(--bg));
}
.light .bg-grid::after,
.claro .bg-grid::after {
  opacity: 0.12;
  background-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 0.08) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 1px, transparent 1px);
}

.light .site-header,
.claro .cabecalho-site {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 255, 255, 0.7) 60%,
    transparent
  );
  border-bottom: 1px solid var(--border);
}
.light .site-header.nav-open .nav,
.claro .cabecalho-site.navegacao-aberta .navegacao {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
}

.light .btn,
.claro .botao {
  border-color: var(--border);
  background: var(--card);
}
.light .btn.primary,
.claro .botao.primario {
  background: linear-gradient(
    135deg,
    rgba(124, 92, 255, 0.18),
    rgba(108, 240, 255, 0.18)
  );
  border-color: rgba(0, 0, 0, 0.08);
}
/* Navegação em tema claro: hover/ativo com contraste melhor */
.light .nav a:hover,
.light .nav a.active,
.claro .navegacao a:hover,
.claro .navegacao a.active {
  color: #0b0e13;
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.28);
}

.light .project-card,
.claro .cartao-projeto {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.02));
  border-color: var(--border);
}
.light .project-card:hover,
.claro .cartao-projeto:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.light .chip,
.claro .etiqueta {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text);
}
.light .tag {
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.22);
  color: #3b3b3b;
}

.light .links a:hover {
  color: var(--text);
}
.light .tech-icons img,
.claro .icones-tecnologias img {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.light .site-footer,
.claro .rodape-site {
  background: linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.6)
  );
  border-top: 1px solid var(--border);
}

/* Sidebar fixa no desktop */
@media (min-width: 900px) {
  .site-header,
  .cabecalho-site {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 18px;
    padding: 20px;
    background: linear-gradient(
      180deg,
      rgba(11, 14, 19, 0.92),
      rgba(11, 14, 19, 0.75) 60%,
      rgba(11, 14, 19, 0.5)
    );
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
  .nav,
  .navegacao {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .menu-toggle,
  .alternar-menu {
    display: none !important;
  }
  .container,
  .conteudo {
    margin-left: 260px;
  }
}
