:root {
  --bg: #1a1a1a;
  --bg-soft: #222222;
  --fg: #f3f4f6;
  --muted: #a1a1aa;
  --border: rgba(255, 255, 255, 0.1);
  --card: rgba(255, 255, 255, 0.05);
  --accent: #9c6eb3;
  --accent-soft: rgba(156, 110, 179, 0.16);
  --radius: 0.75rem;
  --max: 72rem;
  --font: Inter, "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-weight: 400;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  height: 2.25rem;
  width: auto;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  transition: 0.2s ease;
}

.header-links a:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}

/* Hero */
.hero {
  padding: 3rem 0 2.5rem;
  background: linear-gradient(180deg, rgba(156, 110, 179, 0.12), transparent 70%);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 40rem;
}

.search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 40rem);
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.search svg {
  flex-shrink: 0;
  opacity: 0.55;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
}

.search input::placeholder {
  color: var(--muted);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--fg);
}

.breadcrumb span[aria-hidden] {
  opacity: 0.4;
}

/* Layout */
.page {
  padding: 1.5rem 0 4rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

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

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1.25rem 1.35rem;
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 650;
}

.card .subtitle {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.card-list li + li {
  border-top: 1px solid var(--border);
}

.card-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.15rem;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.card-list a::after {
  content: "›";
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.card-list a:hover {
  color: #e9d5ff;
}

.card-list a:hover::after {
  color: #e9d5ff;
}

/* Destaques em 2 colunas — gap evita a flecha da esquerda colar no texto da direita */
.card-list--featured {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 2.5rem;
  row-gap: 0;
}

@media (min-width: 768px) {
  .card-list--featured {
    grid-template-columns: 1fr 1fr;
  }

  .card-list--featured li {
    border-top: 1px solid var(--border);
  }

  .card-list--featured li:nth-child(-n + 2) {
    border-top: 0;
  }
}

.card-list--featured a {
  min-width: 0;
}

.card-list--featured a::after {
  width: 1rem;
  text-align: right;
}

.card-meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.card-meta a {
  color: #d8b4fe;
}

.card-meta a:hover {
  text-decoration: underline;
}

/* Article */
.article-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 16.5rem;
    gap: 3rem;
  }
}

.article {
  max-width: 48rem;
  min-width: 0;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.article-header .eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.article-header .updated {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.article h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.2rem;
  scroll-margin-top: 5.5rem;
}

.article h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
}

.article p,
.article li {
  color: #d4d4d8;
  font-size: 0.975rem;
}

.article p {
  margin: 0 0 1rem;
}

.article ul,
.article ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.article li + li {
  margin-top: 0.4rem;
}

.article strong {
  color: var(--fg);
  font-weight: 600;
}

.article .note {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(156, 110, 179, 0.35);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.article .note p {
  margin: 0;
  color: var(--fg);
}

/* TOC — canto direito */
.toc {
  display: none;
}

@media (min-width: 1024px) {
  .toc {
    display: block;
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7rem);
    overflow: auto;
    padding-left: 0.15rem;
  }
}

.toc__title {
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.toc__list a {
  display: block;
  position: relative;
  padding: 0.45rem 0.75rem 0.45rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted);
  transition: color 0.15s ease;
}

.toc__list a:hover {
  color: var(--fg);
}

.toc__list a.is-active {
  color: var(--fg);
  font-weight: 600;
}

.toc__list a.is-active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 2px;
  background: #fff;
  border-radius: 1px;
}

/* TOC compacto no mobile (acima do artigo) */
.toc--mobile {
  display: block;
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.toc--mobile .toc__list {
  max-height: 12rem;
  overflow: auto;
}

@media (min-width: 1024px) {
  .toc--mobile {
    display: none;
  }
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.steps li {
  position: relative;
  padding: 0.85rem 0.85rem 0.85rem 3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 0.65rem;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.75rem;
  top: 0.85rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.8rem;
}

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