/* Blog: same black, minimal language as moisesmelo.com, tuned for long reading. */
:root {
  --bg: #000;
  --ink: #fff;
  --text: #d4d4d4;
  --muted: #a1a1a1;
  --faint: #6b6b6b;
  --line: #ffffff1a;
  --card: #0c0c0c;
  --card-hover: #151515;
  --code-bg: #0e0e0e;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  overflow-x: clip;
}
html { scroll-padding-top: 88px; }

a { color: inherit; -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  transform: translateY(-160%);
  background: #fff; color: #000; padding: 10px 16px; border-radius: 12px;
  font-size: 14px; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

/* ===== TOP BAR ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(#000 60%, #0000);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.wordmark { color: #fff; text-decoration: none; font-size: 24px; font-weight: 600; letter-spacing: -.08em; }
.wordmark span { color: var(--faint); }
.brand-section { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.brand-section:hover { color: #fff; }

.language-switcher { position: relative; }
.language-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #ffffff0a; color: var(--muted);
  cursor: pointer; transition: color .2s, background .2s, border-color .2s;
}
.language-btn svg { width: 20px; height: 20px; }
.language-btn:hover, .language-btn[aria-expanded="true"] { color: #fff; background: #ffffff14; border-color: #ffffff33; }
.language-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 168px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  background: #111; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px #000c;
  animation: menuIn .18s var(--ease);
}
.language-menu[hidden] { display: none; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } }
.language-option {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 8px 10px; border-radius: 9px;
  color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background .15s, color .15s;
}
.language-option:hover { background: #ffffff0f; color: #fff; }
.language-option[aria-current="true"] { color: #fff; }
.language-option[aria-current="true"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.language-flag { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }

/* ===== BLOG INDEX ===== */
.index { width: 100%; max-width: 680px; margin: 0 auto; padding: 128px 20px 80px; }
.index-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 64px; }
.avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-bottom: 20px; box-shadow: 0 0 0 1px var(--line); }
.handle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; font-weight: 500; letter-spacing: -.01em; margin-bottom: 18px; }
.verified { width: 17px; height: 17px; flex-shrink: 0; }
.index-head h1 { font-size: clamp(34px, 6vw, 48px); font-weight: 500; letter-spacing: -.045em; line-height: 1.05; text-wrap: balance; }
.index-sub { margin-top: 16px; max-width: 520px; color: var(--muted); font-size: 16px; line-height: 1.55; text-wrap: balance; }
.index section + section { margin-top: 48px; }
.section-label { color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; margin-bottom: 16px; }
.post-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.post-card {
  display: block; overflow: hidden;
  border: 1px solid var(--line); border-radius: 20px; background: var(--card);
  text-decoration: none; transition: background .2s, border-color .2s;
}
.post-card:hover { background: var(--card-hover); border-color: #ffffff33; }
.post-body { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; }
.post-meta { color: var(--faint); font-size: 12.5px; }
.post-title { color: #fff; font-size: 20px; font-weight: 600; letter-spacing: -.025em; line-height: 1.25; }
.post-excerpt { color: var(--muted); font-size: 15px; line-height: 1.55; }
.post-card--latest { border-color: #ffffff2e; }
.post-card--latest .post-title { font-size: 24px; }
.post-card--latest .post-body { padding: 26px 28px; }
@media (max-width: 600px) {
  .post-body, .post-card--latest .post-body { padding: 20px; }
  .post-title, .post-card--latest .post-title { font-size: 19px; }
}
.post-cta { color: #fff; font-size: 14px; font-weight: 600; margin-top: 4px; }

/* ===== ARTICLE ===== */
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; margin-bottom: 16px; }
.article-wrap {
  width: 100%; max-width: 1180px; margin: 0 auto; padding: 120px 20px 96px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px;
}
.article { width: 100%; max-width: 700px; margin: 0 auto; }
.article-head { margin-bottom: 36px; }
.article-head h1 { font-size: clamp(32px, 5.4vw, 48px); font-weight: 600; letter-spacing: -.045em; line-height: 1.06; }
.lead { margin-top: 18px; color: var(--text); font-size: 18px; line-height: 1.6; }
.byline { margin-top: 20px; display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; }
.byline img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.download {
  margin: 32px 0 8px; padding: 22px; border-radius: 20px;
  border: 1px solid #ffffff2e; background: radial-gradient(120% 140% at 0% 0%, #1b1b1b, #0a0a0a 60%);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.download-copy { flex: 1 1 260px; }
.download-copy strong { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.download-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.download { flex-direction: column; align-items: stretch; justify-content: flex-start; }
.download-copy { flex: none; }
.download-row { display: flex; gap: 8px; }
.download-gate { display: flex; flex-direction: column; gap: 10px; animation: gateIn .25s var(--ease); }
.download-gate[hidden] { display: none; }
.download-open { align-self: flex-start; }
.download-open[hidden] { display: none; }
@keyframes gateIn { from { opacity: 0; transform: translateY(-4px); } }
.download-input {
  flex: 1; min-width: 0; min-height: 46px; padding: 0 16px; border-radius: 14px;
  border: 1px solid #ffffff2e; background: #000; color: #fff;
  font: 500 15px 'Inter', sans-serif; outline: none; transition: border-color .2s;
}
.download-input::placeholder { color: var(--faint); }
.download-input:focus { border-color: #fff; }
.download-input[aria-invalid="true"] { border-color: #f5a524; }
.download-note { color: var(--faint); font-size: 12.5px; line-height: 1.5; }
.download-note.error { color: #f5a524; }
.download-ok { color: #3ecf8e; font-size: 14px; font-weight: 500; }
.download-ok a { color: #fff; }
.download-btn[disabled] { opacity: .6; cursor: progress; }
.download-btn { border: 0; cursor: pointer; font-family: 'Inter', sans-serif; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.download-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 14px; background: #fff; color: #000; text-decoration: none;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.download-btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 5px #ffffff26; }
.download-btn svg { width: 16px; height: 16px; }

.toc { margin: 32px 0 8px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.toc p { color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 12px; }
.toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 8px; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.4; transition: color .15s; }
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--faint); font-family: var(--mono); font-size: 12px; padding-top: 1px; }
.toc a:hover, .toc a.active { color: #fff; }

.prose { color: var(--text); font-size: 17px; line-height: 1.75; }
.prose > * + * { margin-top: 18px; }
.prose h2 {
  margin-top: 64px; color: #fff; font-size: 28px; font-weight: 600; letter-spacing: -.035em; line-height: 1.2;
  display: flex; align-items: baseline; gap: 12px;
}
.prose h2 .step { color: var(--faint); font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: 0; }
.prose h3 { margin-top: 36px; color: #fff; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.prose strong { color: #fff; font-weight: 600; }
.prose a { color: #fff; text-decoration: underline; text-decoration-color: #ffffff55; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: #fff; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--faint); }
.prose code { font-family: var(--mono); font-size: .86em; background: #ffffff12; border: 1px solid #ffffff14; padding: 1px 6px; border-radius: 6px; color: #fff; }
.prose kbd { font-family: var(--mono); font-size: .82em; padding: 1px 6px; border: 1px solid #ffffff33; border-bottom-width: 2px; border-radius: 6px; color: #fff; }

.prose pre {
  position: relative; overflow-x: auto;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; padding-right: 76px;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.65; color: #e8e8e8; white-space: pre; }
.prose pre[data-label]::before {
  content: attr(data-label); display: block; margin-bottom: 8px;
  color: var(--faint); font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  min-height: 30px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: #ffffff0d; color: var(--muted);
  font: 500 12px 'Inter', sans-serif; transition: color .15s, background .15s;
}
.copy-btn:hover { color: #fff; background: #ffffff1a; }

.callout {
  border: 1px solid var(--line); border-left: 3px solid #fff; border-radius: 12px;
  background: #0b0b0b; padding: 14px 18px; font-size: 15.5px; line-height: 1.65;
}
.callout.warn { border-left-color: #f5a524; }
.callout.new { border-left-color: #3ecf8e; }
.callout strong:first-child { display: block; margin-bottom: 4px; }

.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: #fff; font-weight: 600; white-space: nowrap; }

.steps { list-style: none; padding: 0 !important; counter-reset: s; }
.steps > li { counter-increment: s; position: relative; padding-left: 40px; }
.steps > li + li { margin-top: 14px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #ffffff14; border: 1px solid #ffffff22; color: #fff; font-size: 13px; font-weight: 600; line-height: 1;
}

.article-end { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; line-height: 1.6; }
.article-end a { color: #fff; }

@media (min-width: 1180px) {
  .article-wrap { grid-template-columns: 240px minmax(0, 700px); justify-content: center; }
  .article { margin: 0; }
  .toc-aside { position: sticky; top: 104px; align-self: start; }
  .toc-aside .toc { margin: 0; background: none; border: 0; padding: 0; }
  .toc-inline { display: none; }
}
@media (max-width: 1179px) { .toc-aside { display: none; } }

@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  .article-wrap { padding-top: 96px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 24px; margin-top: 52px; }
  .lead { font-size: 17px; }
  .download { padding: 18px; }
  .download-row { flex-direction: column; }
  .download-btn { width: 100%; justify-content: center; }
  .download-open { align-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
