/* ===================== VARIÁVEIS E TEMA ===================== */
:root {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --link-color: #0a66c2;
  --card-bg: #f5f5f5;
  --accent: #0a66c2;
}
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #ffffff;
  --link-color: #4dabf7;
  --card-bg: #2c2c2c;
  --accent: #4dabf7;
}

/* ===================== BASE ===================== */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  margin: 0;
  transition: background 0.3s, color 0.3s;
}
section {
  padding: 2rem;
}
h2 {
  color: var(--link-color);
}

/* ===================== HEADER & NAV ===================== */
header, footer {
  padding: 1rem;
  text-align: center;
  background-color: var(--card-bg);
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}
.logo {
  font-size: 1.5rem;
  color: var(--link-color);
}
.theme-toggle {
  background: none;
  border: 2px solid var(--link-color);
  border-radius: 5px;
  padding: 0.5rem 1rem;
  color: var(--link-color);
  cursor: pointer;
}

/* ===================== HERO ===================== */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.hero-text {
  max-width: 500px;
  margin: 1rem;
}
.hero-img {
  width: 200px;
  border-radius: 40%;
  margin: 1rem;
}

/* ===================== SOCIAL LINKS ===================== */
.social-links a {
  margin: 0 0.5rem;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--link-color);
}

/* ===================== SOBRE ===================== */
.sobre-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}
.caixa-texto {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 1rem;
}
.sobre-grid .caixa-texto {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.sobre-icone {
  display: block;
  margin-bottom: 0.5rem;
  width: 72px;
  height: 72px;
}

/* ===================== HABILIDADES ===================== */
.habilidades-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.habilidades-list li {
  flex: 1 1 auto;
  min-width: 120px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.habilidades-list img {
  width: 72px;
  height: 72px;
  margin-bottom: 0.5rem;
}

/* ===================== CARD ===================== */
.card {
  background-color: var(--card-bg);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card:hover,
.card:focus-within {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.card img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  background: #fff;
}
.card h3 {
  font-size: 1.1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
}
.card p {
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}
.card a {
  font-size: 0.92rem;
  margin-top: 0.3rem;
  color: var(--accent);
  text-decoration: underline;
  outline: none;
}
.card a:focus {
  outline: 2px solid var(--accent);
  background: var(--card-bg);
  border-radius: 4px;
}

/* ===================== FOOTER ===================== */
.copy {
  font-size: 0.875rem;
  color: var(--text-color);
}

/* ===================== PROJETOS/CARROSSEL ===================== */
.projetos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1rem;
}
.projetos-header h2 {
  margin: 0;
}
.carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
  width: 100%;
}
.carousel-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  width: 100%;
  justify-content: center;
  align-items: stretch;
}
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.carousel-btn {
  background: var(--card-bg);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 2rem;
  color: var(--link-color);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-btn:focus {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(249,200,70,0.4);
}
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.carousel-indicators span {
  display: block;
  width: 14px;
  height: 14px;
  background: var(--card-bg);
  border-radius: 50%;
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s;
  border: 2px solid var(--accent);
}
.carousel-indicators .active {
  background: var(--accent);
  opacity: 1;
  border-color: var(--link-color);
}

/* ===================== RESPONSIVO ===================== */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
  }
  .habilidades-list {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .habilidades-list li {
    min-width: unset;
    text-align: center;
  }
  .sobre-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .carousel-track {
    grid-template-columns: 1fr;
  }
  .carousel {
    flex-direction: column;
    gap: 1.5rem;
  }
  .projetos-header {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .carousel-controls {
    margin-top: 0.5rem;
  }
  .carousel-btn {
    margin: 0.5rem 0;
  }
}