:root {
  /* --- PALETA DARK MODE --- */
  --bg-body: #0f1115;       /* Fundo principal (quase preto) */
  --bg-surface: #1a1d24;    /* Fundo de cards e seções alternadas */
  --bg-surface-hover: #232732; /* Hover em cards */
  
  --text-primary: #f0f4f8;  /* Branco suave para títulos */
  --text-secondary: #9fabb8; /* Cinza azulado para parágrafos */
  
  --primary-color: #3b82f6; /* Azul vibrante (melhor contraste no escuro) */
  --primary-hover: #60a5fa;
  
  --border-color: #2d3340;  /* Bordas sutis */
  --shadow-color: rgba(0, 0, 0, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- LAYOUT & TIPOGRAFIA --- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container { padding: 0 1.5rem; }
}
@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary); /* Títulos claros */
}

h1 { font-size: 2.25rem; line-height: 1.1; }
h2 { font-size: 1.875rem; line-height: 1.2; }
h3 { font-size: 1.5rem; line-height: 1.3; }

@media (min-width: 768px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2.25rem; }
  h3 { font-size: 1.875rem; }
}

@media (min-width: 1024px) {
  h1 { font-size: 3.75rem; }
  h2 { font-size: 3rem; }
}

p {
  font-size: 1rem;
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  p { font-size: 1.125rem; }
}

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

a:hover {
  color: #fff;
  background-color: var(--primary-hover);
    
}

/* --- BOTÕES --- */
button, .btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); /* Glow azul */
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1); /* Fundo sutil azul */
}

/* --- NAVEGAÇÃO --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all 0.3s ease;
  background: transparent;
  backdrop-filter: blur(5px); /* Efeito vidro */
}

nav.scrolled {
  background: rgba(15, 17, 21, 0.95); /* Fundo escuro com opacidade */
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  background: var(--primary-color);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.nav-menu {
  display: none;
  gap: 2rem;
  list-style: none;
}

@media (min-width: 768px) {
  .nav-menu { display: flex; }
}

.nav-menu a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  padding: 1rem;
  transition: all 0.3s ease;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -ms-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  border-radius: 1rem;
  -webkit-border-radius: 1rem;
  -moz-border-radius: 1rem;
  -ms-border-radius: 1rem;
  -o-border-radius: 1rem;
}

.nav-menu a:hover {
  color: var(--primary-color);
  background-color: var(--text-primary);
}

.nav-cta {
  display: none;
}

@media (min-width: 768px) {
  .nav-cta { display: inline-block; }
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

@media (min-width: 768px) {
  .menu-toggle { display: none; }
}

.menu-icon span {
  width: 100%;
  height: 2px;
  background: var(--text-primary); /* Branco no dark mode */
  transition: all 0.3s ease;
}

.menu-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.menu-toggle.active .menu-icon span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}
.menu-toggle.active .menu-icon span:nth-child(2) { opacity: 0; }
.menu-toggle.active .menu-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
}

.mobile-menu.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mobile-menu a { color: var(--text-primary); }

/* --- SEÇÕES --- */
section {
  padding: 5rem 0;
}

@media (min-width: 768px) { section { padding: 8rem 0; } }
@media (min-width: 1024px) { section { padding: 10rem 0; } }

/* Hero */
#hero { padding-top: 8rem; }
@media (min-width: 768px) { #hero { padding-top: 12rem; } }
@media (min-width: 1024px) { #hero { padding-top: 14rem; } }

.hero-content h1 { margin-bottom: 1.5rem; }
.hero-content p { color: var(--text-secondary); margin-bottom: 2rem; }

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 640px) { .hero-cta { flex-direction: row; } }

/* Sobre & Skills (Fundo Alternado) */
#sobre, #skills {
  background: var(--bg-surface); /* Cinza escuro */
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-title { margin-bottom: 3rem; }

/* Cards (Serviços/Sobre) */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--bg-body); /* Contraste com o fundo da seção */
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  transition: all 0.3s ease;
}

.card:hover {
  background: var(--bg-surface-hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-5px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}
.card h3 { margin-bottom: 1rem; }
.card p { font-size: 0.95rem; }

/* Cases/Portfolio */
#cases { background: var(--bg-body); }

.case-item {
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.case-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.case-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .case-content { flex-direction: row; gap: 2rem; }
}

.case-text { flex: 1; }
.case-text p { margin-bottom: 0.75rem; font-size: 0.95rem; }

.case-result {
  color: var(--primary-color);
  font-weight: 600;
}

.case-metric {
  text-align: center;
  min-width: 8rem;
  background: rgba(255,255,255,0.03); /* Leve destaque */
  padding: 1rem;
  border-radius: 8px;
}

.case-metric .value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}
.case-metric .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .skills-grid { grid-template-columns: repeat(4, 1fr); } }

.skill-card {
  background: var(--bg-body);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.skill-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.skill-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
}

/* Contato */
#contato {
  background: #050505; /* Mais escuro que o body */
  color: var(--text-primary);
  text-align: center;
  border-top: 1px solid var(--border-color);
}

#contato h2 { color: white; margin-bottom: 1.5rem; }
#contato p {
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}
@media (min-width: 640px) { .cta-buttons { flex-direction: row; } }

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.cta-btn.primary {
  background: var(--primary-color);
  color: white;
}
.cta-btn.primary:hover { background: var(--primary-hover); }

.cta-btn.secondary {
  background: transparent;
  color: white;
  border: 1px solid var(--border-color);
}
.cta-btn.secondary:hover {
  background: white;
  color: #000;
}

/* Footer */
footer {
  background: #000000;
  color: #4b5563;
  border-top: 1px solid #1f2937;
  padding: 2rem 0;
  text-align: center;
  font-size: 0.875rem;
}

/* Animações */
.scroll-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}