:root {
  --bg: #000000;
  --bg-soft: #0c0c0c;
  --fg: #f5f1e8;
  --muted: #8a8780;
  --accent: #f5f1e8;
  --border: rgba(245, 241, 232, 0.15);
  --max: 720px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
}

/* ---------- Top navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.site-nav {
  display: flex;
  gap: 1.4rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  opacity: 1;
}

/* ---------- Page layout ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

/* Títulos: distribui as linhas em blocos de largura parecida,
   evitando a última linha com uma ou duas palavras soltas. */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* Parágrafos: evita viúva (última linha com uma palavra só).
   `pretty` é o valor certo aqui — `balance` é ignorado pelos navegadores
   em blocos com mais de ~4 linhas, que é o caso do corpo dos artigos. */
p,
li,
figcaption {
  text-wrap: pretty;
}

.page h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.page h2 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.9rem;
}

.page h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 1.8rem 0 0.6rem;
}

.page p,
.page ul,
.page ol {
  margin-bottom: 1.1rem;
  color: var(--fg);
  opacity: 0.9;
}

.page ul,
.page ol {
  padding-left: 1.3rem;
}

.page li {
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.15rem;
  opacity: 0.85;
  margin-bottom: 2rem;
  text-wrap: pretty;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.page a:not(.btn) {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.page a:not(.btn):hover {
  text-decoration-color: var(--fg);
}

/* ---------- Home hero ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem 3rem;
}

.hero .avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 1.8rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.hero .bio {
  font-size: 1.05rem;
  max-width: 34rem;
  margin-bottom: 2.2rem;
  opacity: 0.85;
  text-wrap: balance;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  color: var(--bg);
  background: var(--fg);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  border: 1px solid var(--fg);
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: transparent;
  color: var(--fg);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
}

.btn-ghost:hover {
  background: var(--fg);
  color: var(--bg);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

/* ---------- Social row ---------- */
.social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  justify-content: center;
}

.social a {
  color: var(--fg);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.social a:hover {
  opacity: 1;
}

.social .sep {
  color: var(--muted);
  opacity: 0.6;
}

/* ---------- Article / blog cards ---------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.post-card {
  display: block;
  text-decoration: none !important;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.post-card:last-child {
  border-bottom: 1px solid var(--border);
}

.post-card .date {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.post-card h2 {
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
}

/* Descrições dos cards têm 2 a 3 linhas, então `balance` distribui melhor
   que `pretty` e é justamente o caso em que a órfã aparece. */
.post-card p {
  margin: 0;
  opacity: 0.8;
  text-wrap: balance;
}

.post-card:hover h2 {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Article meta ---------- */
.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.back-link:hover {
  color: var(--fg);
}

.article blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Table of contents (superposts) ---------- */
.toc {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.7rem 1.2rem;
  margin: 2rem 0 2.8rem;
  background: var(--bg-soft);
}

.toc .eyebrow {
  margin-bottom: 0.9rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.97rem;
}

.toc li {
  margin-bottom: 0.45rem;
}

.toc ol ol {
  margin-top: 0.45rem;
  padding-left: 1.1rem;
  font-size: 0.92rem;
  opacity: 0.75;
}

/* ---------- Key takeaways / callout ---------- */
.callout {
  border: 1px solid var(--border);
  border-left: 2px solid var(--fg);
  border-radius: 6px;
  padding: 1.3rem 1.5rem 0.5rem;
  margin: 2rem 0;
  background: var(--bg-soft);
}

.callout .eyebrow {
  margin-bottom: 0.7rem;
}

/* ---------- FAQ ---------- */
.faq {
  margin-top: 1rem;
}

.faq h3 {
  margin-top: 1.6rem;
}

/* ---------- Anchor offset under sticky header ---------- */
.article h2[id],
.article h3[id] {
  scroll-margin-top: 5rem;
}

/* ---------- Contact ---------- */
.contact-links {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.contact-links li {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-links li:last-child {
  border-bottom: 1px solid var(--border);
}

.contact-links .label {
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.8rem 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.site-footer nav {
  margin-bottom: 0.6rem;
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.site-footer nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer nav a:hover {
  color: var(--fg);
}

@media (max-width: 480px) {
  .hero .avatar {
    width: 130px;
    height: 130px;
  }
  .site-nav {
    gap: 1rem;
    font-size: 0.85rem;
  }
  .brand span {
    display: none;
  }
}
