/* ===== Variáveis de tema ===== */
:root,
:root[data-theme='dark'] {
  --bg: #0b1120;
  --bg-2: #111a2e;
  --surface: #1a2438;
  --border: #2a3550;
  --text: #e8edf7;
  --text-muted: #94a3b8;
  --accent: #818cf8;
  --accent-2: #22d3ee;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

:root[data-theme='light'] {
  --bg: #f8fafc;
  --bg-2: #eef2f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-2: #0891b2;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

/* Impede que o cabeçalho fixo cubra o título da seção ao clicar num link. */
section[id] {
  scroll-margin-top: 5.5rem;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.3s, color 0.3s;
}

.accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Navegação ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.nav__links {
  display: flex;
  gap: 1.25rem;
}

.nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}

.nav__links a:hover {
  color: var(--text);
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  min-height: 88vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  background: radial-gradient(ellipse at top, var(--bg-2), var(--bg));
}

.hero__content {
  max-width: 720px;
}

.hero__hello {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.hero__name {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero__role {
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 600;
  margin: 0.5rem 0 1rem;
}

.hero__desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 1.75rem;
}

.hero__actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  display: inline-block;
}

.btn--primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
}

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

.btn--ghost:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.hero__social {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}

.hero__social a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.hero__social a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== Seções ===== */
.section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.section__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.section__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.section__sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.sobre {
  display: grid;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 1.5rem;
  max-width: 760px;
}

.sobre strong {
  color: var(--text);
}

/* ===== Habilidades ===== */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.skill-group h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.skill-group ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-group li {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

/* ===== Projetos ===== */
.projetos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.projeto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.projeto-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.projeto-card__emoji {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.projeto-card__title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.projeto-card__desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 1rem;
}

.projeto-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.projeto-card__tags span {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.projeto-card__links {
  display: flex;
  gap: 0.75rem;
}

.projeto-card__links a {
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}

.projeto-card__links a:hover {
  text-decoration: underline;
}

/* ===== Contato ===== */
.section--contato {
  text-align: center;
}

.section--contato .section__title::after {
  left: 50%;
  transform: translateX(-50%);
}

.section--contato p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 1rem auto 1.75rem;
}

.contato__email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.95rem;
}

.btn-copiar {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-copiar:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ===== Animação de revelação ao rolar ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ===== Responsivo ===== */
@media (max-width: 600px) {
  .nav {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  .nav__links {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .nav__links a {
    font-size: 0.85rem;
  }
}
