/* =========================================================
   RedTeam Blog — cyber/dark theme
   ========================================================= */
:root {
  --bg: #0a0e14;
  --bg-2: #0f141c;
  --bg-3: #141b25;
  --panel: #11161f;
  --border: #1f2a3a;
  --border-2: #2a3a52;
  --fg: #d6e1ee;
  --fg-dim: #8b9bb0;
  --fg-mute: #5a6b80;
  --accent: #00ff9c;
  --accent-2: #00d4ff;
  --red: #ff3860;
  --yellow: #ffd166;
  --orange: #ff8c42;
  --purple: #b07cff;
  --green: #4ade80;
  --link: #00d4ff;
  --link-hover: #00ff9c;
  --code-bg: #0b1119;
  --code-fg: #e2eaf3;
  --shadow: 0 0 0 1px rgba(0, 255, 156, 0.08), 0 8px 30px rgba(0, 0, 0, 0.6);
  --font-sans: ui-sans-serif, -apple-system, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0, 255, 156, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(0, 212, 255, 0.05), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255, 255, 255, 0.012) 2px 3px);
  z-index: 0;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-shadow: 0 0 6px rgba(0, 255, 156, 0.4); }

::selection { background: var(--accent); color: #001a10; }

/* ---------- Sidebar ---------- */
:root {
  --sidebar-w: 268px;
  --sidebar-w-collapsed: 0px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, width 0.25s ease, margin-left 0.25s ease;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-w)));
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-head .avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}
.sidebar-head .brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-head .brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--fg);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-head .brand .slash { color: var(--fg-mute); }
.sidebar-head .brand .accent { color: var(--accent); }
.sidebar-head .brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-mute);
  margin-top: 2px;
}

.sidebar-social {
  display: flex;
  gap: 6px;
  padding: 8px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 5px;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  background: var(--bg-3);
  transition: color 0.12s, border-color 0.12s, background 0.12s, transform 0.12s;
  text-decoration: none;
  flex: 1;
}
.sidebar-social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 255, 156, 0.06);
  transform: translateY(-1px);
  text-shadow: none;
}
.sidebar-social a svg,
.sidebar-social a img {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.9;
  filter: brightness(0) saturate(100%) invert(85%) sepia(38%) saturate(642%) hue-rotate(88deg) brightness(95%) contrast(92%);
}
.sidebar-social a:hover svg,
.sidebar-social a:hover img { opacity: 1; }

.sidebar-search {
  position: relative;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-search .search-input {
  width: 100%;
  padding: 8px 50px 8px 12px;
  background: var(--bg-3);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sidebar-search .search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 156, 0.12);
}
.sidebar-search .search-input::placeholder { color: var(--fg-mute); }
.sidebar-search kbd {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-mute);
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 2px 6px;
  pointer-events: none;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 24px;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.sidebar-section {
  margin-top: 14px;
}
.sidebar-section:first-child { margin-top: 6px; }
.sidebar-section-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  padding: 8px 12px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--fg-dim);
  font-size: 0.88rem;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin: 1px 4px;
}
.sidebar-entry:hover {
  background: var(--bg-3);
  color: var(--fg);
  text-shadow: none;
}
.sidebar-entry.active {
  background: rgba(176, 124, 255, 0.12);
  color: #d4b9ff;
  border-left-color: var(--purple);
}
.sidebar-entry .ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--fg-mute);
}
.sidebar-entry.active .ico { color: var(--purple); }
.sidebar-entry .lbl {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-empty {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-mute);
  padding: 12px;
  text-align: center;
}

/* Sidebar toggle (hamburger) */
.sidebar-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-dim);
  cursor: pointer;
  transition: left 0.25s ease, color 0.12s, border-color 0.12s;
}
.sidebar-toggle:hover { color: var(--accent); border-color: var(--accent); }
body:not(.sidebar-collapsed) .sidebar-toggle {
  left: calc(var(--sidebar-w) - 50px);
  top: 18px;
  background: transparent;
  border-color: transparent;
  width: 32px;
  height: 32px;
}
body:not(.sidebar-collapsed) .sidebar-toggle:hover {
  background: var(--bg-3);
  border-color: var(--border-2);
}

/* ---------- Main + site ---------- */
.main {
  position: relative;
  z-index: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}
body.sidebar-collapsed .main { margin-left: 0; }

.site {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}
.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
.brand .slash { color: var(--fg-mute); }
.brand .accent { color: var(--accent); }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 12px var(--accent); }
  50% { opacity: 0.55; box-shadow: 0 0 4px var(--accent); }
}

.nav { display: flex; gap: 22px; font-family: var(--font-mono); font-size: 0.9rem; }
.nav a { color: var(--fg-dim); }
.nav a:hover, .nav a.active { color: var(--accent); }

footer.site-foot {
  margin: 80px 0 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--fg-mute);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
}

/* ---------- Hero ---------- */
.hero {
  padding: 40px 0 20px;
}
.hero h1 {
  font-size: 2.2rem;
  margin: 0 0 8px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.hero .lead {
  color: var(--fg-dim);
  font-size: 1.05rem;
  max-width: 720px;
}
.terminal {
  margin: 28px 0 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .b { width: 11px; height: 11px; border-radius: 50%; }
.terminal-bar .r { background: #ff5f56; }
.terminal-bar .y { background: #ffbd2e; }
.terminal-bar .g { background: #27c93f; }
.terminal-bar .t {
  margin-left: auto;
  color: var(--fg-mute);
  font-size: 0.8rem;
}
.terminal-body { padding: 14px 16px; white-space: pre-wrap; }
.terminal-body .prompt { color: var(--accent); }
.terminal-body .cmt { color: var(--fg-mute); }
.terminal-body .out { color: var(--fg-dim); }

/* ---------- Search ---------- */
.search-wrap { margin: 20px 0 10px; }
.search-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 156, 0.12);
}
.search-input::placeholder { color: var(--fg-mute); }

/* ---------- Tag filter ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  color: var(--fg-dim);
  cursor: pointer;
  background: transparent;
  transition: all 0.12s;
}
.tag:hover { color: var(--fg); border-color: var(--accent); }
.tag.active { color: #001a10; background: var(--accent); border-color: var(--accent); }

/* ---------- Post list ---------- */
.section-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-mute);
  margin: 36px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 16px; height: 1px;
  background: var(--accent);
}

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { margin: 0; padding: 0; }
.post-card {
  display: block;
  padding: 18px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  margin-bottom: 12px;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 255, 156, 0.15);
}
.post-card .meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-mute);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.post-card .title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
  margin: 2px 0 6px;
}
.post-card .excerpt {
  color: var(--fg-dim);
  font-size: 0.95rem;
}
.post-card .tags-row { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.post-card .pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 8px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  color: var(--fg-dim);
}
.post-card .pill.t-red { color: #ff8b9d; border-color: #5a2030; }
.post-card .pill.t-yellow { color: var(--yellow); border-color: #5a4a1a; }
.post-card .pill.t-purple { color: var(--purple); border-color: #44325a; }
.post-card .pill.t-green { color: var(--green); border-color: #1f5a3a; }

.empty {
  padding: 30px;
  text-align: center;
  color: var(--fg-mute);
  border: 1px dashed var(--border-2);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ---------- Post page ---------- */
.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: -10px 0 16px;
}
.back-link a { color: var(--fg-dim); }
.back-link a:hover { color: var(--accent); }

.post-header {
  margin: 24px 0 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.post-header h1 {
  font-size: 2rem;
  margin: 6px 0 10px;
  line-height: 1.2;
}
.post-header .meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-mute);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.post-header .meta .tags-inline { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.post-header .meta a.pill {
  color: var(--fg-dim);
  border: 1px solid var(--border-2);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.78rem;
  transition: color 0.12s, border-color 0.12s;
}
.post-header .meta a.pill:hover {
  color: #001a10;
  background: var(--accent);
  border-color: var(--accent);
  text-shadow: none;
}

.post-body { font-size: 1.02rem; }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  color: var(--fg);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}
.post-body h1 { font-size: 1.8rem; }
.post-body h2 {
  font-size: 1.4rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.post-body h3 { font-size: 1.15rem; color: var(--accent-2); }
.post-body h4 { font-size: 1rem; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.post-body p { margin: 0.8em 0; }
.post-body ul, .post-body ol { padding-left: 1.6em; }
.post-body li { margin: 0.25em 0; }
.post-body hr { border: 0; border-top: 1px dashed var(--border-2); margin: 2em 0; }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  background: rgba(0, 255, 156, 0.04);
  margin: 1em 0;
  padding: 0.6em 1em;
  color: var(--fg-dim);
  font-style: italic;
}
.post-body strong { color: var(--fg); }
.post-body em { color: var(--fg-dim); }

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.4em auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #000;
}
.post-body p > img:only-child { margin-left: 0; }
.post-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.93rem;
  overflow-x: auto;
  display: block;
}
.post-body table th, .post-body table td {
  border: 1px solid var(--border-2);
  padding: 8px 10px;
  text-align: left;
}
.post-body table th {
  background: var(--bg-3);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.post-body table tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }

/* Inline code */
.post-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(0, 255, 156, 0.07);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 156, 0.15);
}

/* Code blocks */
.post-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  position: relative;
}
.post-body pre code {
  font-family: var(--font-mono);
  background: none;
  color: var(--code-fg);
  padding: 0;
  border: 0;
  font-size: inherit;
}

/* highlight.js token colors (atom-one-dark-ish) */
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-tag { color: #c678dd; }
.hljs-string, .hljs-attr, .hljs-symbol, .hljs-bullet, .hljs-addition { color: #98c379; }
.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable { color: #d19a66; }
.hljs-comment, .hljs-quote { color: #5c6370; font-style: italic; }
.hljs-function .hljs-title, .hljs-title.function_ { color: #61afef; }
.hljs-class .hljs-title, .hljs-title.class_ { color: #e5c07b; }
.hljs-meta, .hljs-deletion { color: #e06c75; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* Copy button on code blocks */
.code-block-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  background: var(--bg-3);
  color: var(--fg-dim);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.12s, border-color 0.12s;
}
.code-block-wrap:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

/* Mermaid */
/* Mientras el SVG no está pintado, oculta el <pre> para que no se vea como code block. */
pre.mermaid {
  visibility: hidden;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
pre.mermaid.is-rendering { visibility: visible; }
.mermaid {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin: 1.2em 0;
  text-align: center;
  overflow-x: auto;
}
.mermaid svg { max-width: 100%; height: auto; }
.mermaid-error {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(255, 56, 96, 0.05);
  border: 1px dashed #5a2030;
  border-radius: 6px;
  padding: 12px;
  white-space: pre-wrap;
}

/* ---------- Obsidian-style callouts ---------- */
.callout {
  border-left: 3px solid var(--accent);
  background: rgba(0, 255, 156, 0.04);
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin: 1.2em 0;
  font-size: 0.95rem;
}
.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  color: var(--accent);
}
.callout-icon { font-size: 1rem; }
.callout-body > *:first-child { margin-top: 0; }
.callout-body > *:last-child { margin-bottom: 0; }

.callout.note       { border-left-color: var(--accent-2);   background: rgba(0, 212, 255, 0.05); }
.callout.note       .callout-title { color: var(--accent-2); }
.callout.tip        { border-left-color: var(--green);       background: rgba(74, 222, 128, 0.05); }
.callout.tip        .callout-title { color: var(--green); }
.callout.info       { border-left-color: var(--accent-2);   background: rgba(0, 212, 255, 0.05); }
.callout.info       .callout-title { color: var(--accent-2); }
.callout.warning    { border-left-color: var(--yellow);      background: rgba(255, 209, 102, 0.05); }
.callout.warning    .callout-title { color: var(--yellow); }
.callout.caution    { border-left-color: var(--yellow);      background: rgba(255, 209, 102, 0.05); }
.callout.caution    .callout-title { color: var(--yellow); }
.callout.important  { border-left-color: var(--purple);      background: rgba(176, 124, 255, 0.05); }
.callout.important  .callout-title { color: var(--purple); }
.callout.danger     { border-left-color: var(--red);         background: rgba(255, 56, 96, 0.06); }
.callout.danger     .callout-title { color: var(--red); }
.callout.error      { border-left-color: var(--red);         background: rgba(255, 56, 96, 0.06); }
.callout.error      .callout-title { color: var(--red); }
.callout.example    { border-left-color: var(--fg-dim);      background: rgba(139, 155, 176, 0.05); }
.callout.example    .callout-title { color: var(--fg-dim); }
.callout.quote      { border-left-color: var(--fg-dim);      background: rgba(139, 155, 176, 0.05); }
.callout.quote      .callout-title { color: var(--fg-dim); }
.callout.question   { border-left-color: var(--orange);      background: rgba(255, 140, 66, 0.05); }
.callout.question   .callout-title { color: var(--orange); }
.callout.success    { border-left-color: var(--green);       background: rgba(74, 222, 128, 0.05); }
.callout.success    .callout-title { color: var(--green); }
.callout.bug        { border-left-color: var(--red);         background: rgba(255, 56, 96, 0.06); }
.callout.bug        .callout-title { color: var(--red); }
.callout.fail       { border-left-color: var(--red);         background: rgba(255, 56, 96, 0.06); }
.callout.fail       .callout-title { color: var(--red); }
.callout.failure    { border-left-color: var(--red);         background: rgba(255, 56, 96, 0.06); }
.callout.failure    .callout-title { color: var(--red); }

/* Task list */
.post-body input[type="checkbox"] {
  appearance: none;
  width: 14px; height: 14px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  background: var(--bg-3);
  vertical-align: middle;
  margin-right: 6px;
  position: relative;
  cursor: pointer;
}
.post-body input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.post-body input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: -2px; left: 1px;
  font-size: 11px;
  color: #001a10;
  font-weight: 700;
}

/* Loading state */
.loading {
  padding: 60px 20px;
  text-align: center;
  color: var(--fg-mute);
  font-family: var(--font-mono);
}
.loading::after {
  content: "▋";
  animation: blink 1s steps(1) infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

/* Responsive */
@media (max-width: 900px) {
  :root { --sidebar-w: 240px; }
  .main { margin-left: var(--sidebar-w); }
  body.sidebar-collapsed .main { margin-left: 0; }
  body:not(.sidebar-collapsed) .sidebar-toggle { left: calc(var(--sidebar-w) + 14px); }
}
@media (max-width: 720px) {
  .main { margin-left: 0; }
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  body:not(.sidebar-collapsed) .sidebar { transform: translateX(0); }
  body:not(.sidebar-collapsed) .sidebar-toggle { left: calc(var(--sidebar-w) + 14px); }
  body.sidebar-collapsed .sidebar-toggle { left: 14px; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .post-header h1 { font-size: 1.5rem; }
  .nav { gap: 14px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .post-body { font-size: 0.98rem; }
  .site { padding: 0 16px; }
}

/* =========================================================
   HERO — terminal animada, matrix rain, stats, pills
   ========================================================= */
.hero {
  position: relative;
  margin: 24px 0 36px;
  padding: 36px 32px 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    radial-gradient(800px 300px at 100% 0%, rgba(0, 255, 156, 0.08), transparent 60%),
    radial-gradient(600px 250px at 0% 100%, rgba(0, 212, 255, 0.05), transparent 60%),
    var(--bg-2);
  overflow: hidden;
  isolation: isolate;
}
.hero-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.hero-title {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  margin: 0 0 14px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(0, 255, 156, 0.18);
  min-height: 2.6em;
}
.hero-title .caret {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  background: var(--accent);
  vertical-align: -0.15em;
  margin-left: 2px;
  animation: caret-blink 1s steps(2) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.hero-sub {
  color: var(--fg-dim);
  font-size: 1.02rem;
  margin: 0 0 22px;
  max-width: 640px;
}
.hero-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.hero-stats .stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(15, 20, 28, 0.6);
  backdrop-filter: blur(4px);
}
.hero-stats .num {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}
.hero-stats .lbl {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.hpill {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 5px 11px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  color: var(--fg-dim);
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}
.hpill:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 255, 156, 0.06);
}
.hpill .prompt { color: var(--accent); margin-right: 4px; }
.hpill:hover .prompt { color: var(--accent); }
.hero-output {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--fg-dim);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 0 0 18px;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  min-height: 60px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cta {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #001a10;
  font-weight: 600;
  transition: all 0.12s;
}
.cta:hover {
  background: transparent;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(0, 255, 156, 0.4);
}
.cta-ghost {
  background: transparent;
  color: var(--fg-dim);
  border-color: var(--border-2);
}
.cta-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
  text-shadow: none;
}
.hero-social {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: 4px;
  flex-wrap: wrap;
}
.hero-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  height: 34px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  color: var(--fg-dim);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transition: color 0.12s, border-color 0.12s, background 0.12s, transform 0.12s;
  text-decoration: none;
}
.hero-social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 255, 156, 0.06);
  transform: translateY(-1px);
  text-shadow: none;
}
.hero-social a svg,
.hero-social a img {
  width: 16px;
  height: 16px;
  opacity: 0.9;
  flex-shrink: 0;
  filter: brightness(0) saturate(100%) invert(85%) sepia(38%) saturate(642%) hue-rotate(88deg) brightness(95%) contrast(92%);
}
.hero-social a:hover svg,
.hero-social a:hover img { opacity: 1; }

/* Scan line animation */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 16px var(--accent);
  top: 0;
  animation: scan 6s linear infinite;
  z-index: 2;
  pointer-events: none;
  opacity: 0.6;
}
@keyframes scan {
  0%   { top: 0%; opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}

@media (max-width: 640px) {
  .hero { padding: 24px 18px 22px; }
  .hero-title { font-size: 1.7rem; }
  .hero-stats { gap: 8px; }
  .hero-stats .stat { padding: 6px 10px; }
  .hero-stats .num { font-size: 1.1rem; }
}
