:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #0b0f17;
  --muted: #5a6475;
  --line: #e3e6ec;
  --accent: #0a9e6e;
  --accent-2: #5b5bf0;
  --node: rgba(10, 158, 110, .55);
  --edge: rgba(91, 91, 240, .14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17;
    --surface: #121826;
    --text: #e8ecf3;
    --muted: #8b95a8;
    --line: #1f2839;
    --accent: #7cf5c4;
    --accent-2: #9a9aff;
    --node: rgba(124, 245, 196, .6);
    --edge: rgba(154, 154, 255, .12);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17;
  --surface: #121826;
  --text: #e8ecf3;
  --muted: #8b95a8;
  --line: #1f2839;
  --accent: #7cf5c4;
  --accent-2: #9a9aff;
  --node: rgba(124, 245, 196, .6);
  --edge: rgba(154, 154, 255, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Nav */
nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo { font-weight: 700; text-decoration: none; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.links { display: flex; gap: 22px; align-items: center; font-size: .92rem; }
.links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.links a:hover { color: var(--text); }
.links .hide-sm { display: none; }
@media (min-width: 640px) { .links .hide-sm { display: inline; } }
.theme-btn {
  background: none; border: 1px solid var(--line); color: var(--text);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1rem;
}

/* Hero */
header.hero { position: relative; min-height: 88vh; display: flex; align-items: center; overflow: hidden; }
#net { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .wrap { position: relative; width: 100%; padding-top: 48px; padding-bottom: 48px; }
.eyebrow { color: var(--accent); font-size: .85rem; letter-spacing: .04em; margin-bottom: 20px; }
.eyebrow::before { content: "> "; opacity: .6; }
h1 {
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 1; letter-spacing: -.04em; font-weight: 700; max-width: 12ch;
}
h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 46ch; margin-top: 28px; }
.typed { color: var(--text); border-right: 2px solid var(--accent); padding-right: 3px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { border-color: transparent; } }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; text-decoration: none; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface); transition: transform .15s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Sections */
section { padding: 96px 0; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 44px; }
.sec-num { color: var(--accent); font-size: .85rem; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; line-height: 1.1; }

.about { display: grid; gap: 40px; }
@media (min-width: 820px) { .about { grid-template-columns: 1.4fr 1fr; } }
.about p { color: var(--muted); font-size: 1.08rem; margin-bottom: 16px; }
.about p strong { color: var(--text); font-weight: 500; }
.stack { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; font-size: .88rem; }
.stack .k { color: var(--accent-2); }
.stack .s { color: var(--accent); }
.stack .c { color: var(--muted); }
.stack pre { white-space: pre-wrap; word-break: break-word; line-height: 1.75; }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px; transition: border-color .2s, transform .2s; position: relative;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card .ico { font-size: 1.5rem; margin-bottom: 14px; }
.card h3 { font-size: 1.15rem; margin-bottom: 8px; letter-spacing: -.01em; }
.card p { color: var(--muted); font-size: .96rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { font-size: .72rem; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }

.posts { list-style: none; }
.posts li { border-bottom: 1px solid var(--line); }
.posts a {
  display: grid; grid-template-columns: 1fr; gap: 4px; padding: 22px 0; text-decoration: none;
  transition: padding-left .2s;
}
@media (min-width: 640px) { .posts a { grid-template-columns: 110px 1fr auto; align-items: center; gap: 24px; } }
.posts a:hover { padding-left: 8px; }
.posts a:hover .arrow { color: var(--accent); transform: translateX(4px); }
.posts .date { color: var(--muted); font-size: .8rem; }
.posts .title { font-size: 1.1rem; font-weight: 500; }
.posts .arrow { color: var(--muted); transition: transform .2s, color .2s; display: none; }
@media (min-width: 640px) { .posts .arrow { display: block; } }


.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 12px; }
.stat b { display: block; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1; letter-spacing: -.03em; color: var(--accent); }
.stat span { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.manifesto blockquote { font-size: clamp(1.4rem, 3.6vw, 2.2rem); line-height: 1.25; letter-spacing: -.02em; font-weight: 500; max-width: 26ch; }
.manifesto .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.manifesto .note { color: var(--muted); max-width: 60ch; margin-top: 28px; }
.tags.big { margin-top: 20px; gap: 8px; }
.tags.big .tag { font-size: .82rem; padding: 6px 12px; }
.contact { text-align: center; }
.contact h2 { font-size: clamp(2rem, 6vw, 3.6rem); max-width: 16ch; margin: 0 auto 20px; }
.contact p { color: var(--muted); max-width: 48ch; margin: 0 auto 32px; }
.contact .cta { justify-content: center; }

footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .82rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .typed { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Matérias ---------- */
.page-head { padding: 72px 0 40px; }
.page-head h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); max-width: none; }
.page-head .lead { margin-top: 18px; }
.posts .excerpt { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.posts .tags { margin-top: 10px; }
.empty { color: var(--muted); padding: 40px 0; }
.home-materias .more { display: inline-block; margin-top: 28px; }

article.materia { padding: 64px 0 96px; }
.materia .wrap { max-width: 760px; }
.back { color: var(--muted); text-decoration: none; font-size: .85rem; }
.back:hover { color: var(--accent); }
.materia h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1.1; max-width: none; margin: 22px 0 16px; }
.materia .meta { color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.materia .tags { margin: 18px 0 40px; }
.prose { font-size: 1.1rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: 1.6rem; margin-top: 2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 85%, var(--muted)); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose a { color: var(--accent); }
.prose strong { color: var(--text); }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; font-size: 1.2rem; color: var(--text); }
.prose code { font-family: "JetBrains Mono", monospace; font-size: .88em; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.prose pre { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; overflow-x: auto; font-size: .88rem; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose img { max-width: 100%; border-radius: 12px; }
