:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --accent: #58a6ff;
  --green: #3fb950;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --dot-color: rgba(48, 54, 61, 0.7);
  --navbar-bg: rgba(13, 17, 23, 0.9);
  --btn-primary-text: #0d1117;
  --mono: "JetBrains Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --border: #d0d7de;
  --accent: #0969da;
  --green: #1a7f37;
  --text: #1f2328;
  --text-dim: #636c76;
  --dot-color: rgba(208, 215, 222, 0.7);
  --navbar-bg: rgba(246, 248, 250, 0.9);
  --btn-primary-text: #ffffff;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}

/* ---------- navbar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--navbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--green);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}

/* ---------- layout ---------- */

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-label {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 1.5rem;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 6rem 0 4rem;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -10%;
  width: 70%;
  height: 500px;
  background: radial-gradient(ellipse at top left, rgba(88, 166, 255, 0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: -1;
}

.hero h1 {
  font-size: 2.5rem;
  line-height: 1.2;
}

.hero-title {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1.125rem;
  margin: 0.5rem 0 1.25rem;
}

.hero-bio {
  color: var(--text-dim);
  max-width: 36rem;
}

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

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--btn-primary-text);
  font-weight: 700;
}

.btn-primary:hover {
  background: #79b8ff;
  border-color: #79b8ff;
}

.btn-secondary {
  color: var(--text);
  background: var(--surface);
}

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

/* ---------- stack ---------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
}

.pill {
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
}

.pill-main {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- projetos ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.2s;
}

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

.card-name {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent);
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-dim);
  flex-grow: 1;
}

.card-lang {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.lang-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* ---------- sobre ---------- */

.about {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
}

.about-text {
  color: var(--text-dim);
}

.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: fit-content;
}

.about-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.about-item svg {
  flex-shrink: 0;
  color: var(--green);
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 0.75rem;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ---------- theme toggle ---------- */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- responsivo ---------- */

@media (max-width: 600px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li a {
    display: block;
    padding: 0.875rem 1.5rem;
    border-top: 1px solid var(--border);
  }

  .hero {
    padding: 4rem 0 3rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .about {
    grid-template-columns: 1fr;
  }
}
