/* ===== 0x5t — Dark Terminal Aesthetic ===== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg: #050505;
  --bg-raised: #0a0a0a;
  --bg-card: #0e0e0e;
  --bg-card-hover: #141414;
  --bg-header: #080808;
  --bg-alt: #111111;
  --bg-input: #0c0c0c;

  --text: #f0e6d3;
  --text-secondary: rgba(240, 230, 211, 0.55);
  --text-muted: rgba(240, 230, 211, 0.35);

  --accent: #f0e6d3;
  --accent-dim: rgba(240, 230, 211, 0.7);
  --accent-glow: rgba(240, 230, 211, 0.08);

  --border: rgba(240, 230, 211, 0.1);
  --border-strong: rgba(240, 230, 211, 0.18);
  --border-subtle: rgba(240, 230, 211, 0.06);

  --red: #ff4444;
  --orange: #ff8c00;
  --yellow: #ffd700;
  --green: #00ff88;

  /* Aliases for legacy inline styles */
  --terminal-green: #00ff88;
  --accent-color: var(--accent);
  --content-bg: var(--bg-card);
  --border-color: var(--border);
  --alt-row-bg: var(--bg-alt);
  --code-bg: var(--bg-alt);

  --font-mono: 'JetBrains Mono', 'Geist Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius: 2px;
  --transition: 0.2s ease;
}

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

html { background: var(--bg); }

body {
  background: var(--bg);
  font: 13px/1.7 var(--font-mono);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main, .container { flex: 1; }

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:visited { color: var(--accent); }
a:hover { opacity: 0.7; text-decoration: none; }
strong, b { font-weight: 600; }
img { border: 0; max-width: 100%; height: auto; }

::selection { background: rgba(240, 230, 211, 0.2); color: var(--text); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Container ===== */
.forum-wrapper, .container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ===== Navbar ===== */
.navbar {
  background: rgba(5, 5, 5, 0.82);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.nav-container {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.nav-brand {
  font: 600 14px var(--font-mono);
  color: var(--text);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.nav-brand:hover { color: var(--text); opacity: 0.8; text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  display: inline-block;
  padding: 6px 14px;
  font: 500 11px var(--font-mono);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition);
}
.nav-links a:hover {
  color: var(--text);
  border-color: var(--border);
  text-decoration: none;
  opacity: 1;
}
.nav-links a[aria-current="page"] {
  color: var(--text);
  border-color: var(--border-strong);
}

/* ===== Breadcrumb ===== */
.breadcrumb { padding: 8px 0; font-size: 11px; color: var(--text-muted); margin-bottom: 20px; letter-spacing: 0.5px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb span { color: var(--text-muted); margin: 0 6px; }

/* ===== Home Layout ===== */
.home-layout { display: flex; gap: 28px; align-items: flex-start; }
.home-main { flex: 1; min-width: 0; }
.home-sidebar { width: 260px; flex-shrink: 0; position: sticky; top: 80px; }

/* ===== Bio Section ===== */
.bio-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}
.bio-header {
  padding: 12px 16px;
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.bio-content { display: flex; gap: 0; }
.bio-logo {
  flex-shrink: 0;
  width: 130px;
  padding: 16px;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.bio-logo img {
  width: 90px;
  height: 90px;
  border: 1px solid var(--border-strong);
  object-fit: cover;
  border-radius: var(--radius);
  filter: grayscale(0.1);
}
.author-rank {
  font: 500 9px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}
.bio-text { flex: 1; padding: 16px; }
.bio-section h1 {
  font: 700 16px var(--font-mono);
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.bio {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.7;
}
.author-stats {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.8;
}
.author-stats strong { color: var(--text-secondary); }
.links { display: flex; gap: 6px; flex-wrap: wrap; }
.links a {
  display: inline-block;
  padding: 5px 12px;
  font: 500 10px var(--font-mono);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition);
}
.links a:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--accent-glow);
  opacity: 1;
}

/* ===== Forum Table (Categories) ===== */
.forum-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cat-header, .forumtitle {
  background: var(--bg-card);
  color: var(--text-muted);
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.cat-header a, .forumtitle a { color: var(--text-muted); text-decoration: none; }
.cat-header a:hover, .forumtitle a:hover { color: var(--text); }

.sub-header {
  background: var(--bg-alt);
  color: var(--text-muted);
  font: 600 9px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.sub-header.left { text-align: left; }

.forum-row { background: var(--bg-card); transition: background var(--transition); }
.forum-row:nth-child(even) { background: var(--bg-alt); }
.forum-row:hover { background: var(--bg-card-hover); }
.forum-row td {
  padding: 12px 14px;
  vertical-align: top;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.forum-row td:last-child { border-right: none; }
.forum-row:last-child td { border-bottom: none; }

.forum-icon { width: 36px; text-align: center; vertical-align: middle; }
.forum-icon img { width: 24px; height: 24px; }
.forum-info { text-align: left; }
.forum-name { font: 600 12px var(--font-mono); margin-bottom: 4px; }
.forum-name a { color: var(--text); }
.forum-name a:hover { opacity: 0.7; }
.forum-desc { font-size: 11px; color: var(--text-muted); letter-spacing: 0.3px; }
.forum-stats { width: 60px; text-align: center; font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.forum-lastpost { width: 180px; font-size: 11px; color: var(--text-muted); }
.forum-lastpost a { color: var(--text-secondary); }

/* ===== Recent Posts / Activity ===== */
.recent-posts {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}
.recent-posts > h2, .posts-header h1 {
  padding: 12px 16px;
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.post-item {
  display: block;
  width: 100%;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 18px;
  transition: background var(--transition);
}
.post-item:nth-child(even) { background: var(--bg-alt); }
.post-item:hover { background: var(--bg-card-hover); }
.post-item:last-child { border-bottom: none; }

.post-title { margin-bottom: 6px; }
.post-title a {
  font: 600 13px var(--font-mono);
  color: var(--text);
  letter-spacing: 0.3px;
}
.post-title a:hover { opacity: 0.7; }
.post-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.5px; }
.post-description { font-size: 12px; color: var(--text-secondary); line-height: 1.7; }
.post-stats {
  display: table-cell;
  width: 80px;
  padding: 8px;
  text-align: center;
  vertical-align: middle;
  font-size: 11px;
  color: var(--text-muted);
  border-left: 1px solid var(--border-subtle);
}

/* ===== Posts Header / Search ===== */
.posts-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}
.posts-header h1 { border-bottom: none; }

.search-container {
  background: var(--bg-alt);
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.search-container input {
  max-width: 220px;
  width: 100%;
  padding: 6px 10px;
  font: 12px var(--font-mono);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  transition: border-color var(--transition);
}
.search-container input:focus { outline: none; border-color: var(--border-strong); }
.search-container input::placeholder { color: var(--text-muted); }

/* ===== Filters / Tags ===== */
.filters {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: none;
  padding: 8px 12px;
  margin-bottom: 12px;
}
#tags-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-filter, .button, .chip, .nf-btn, #ach-more {
  display: inline-block;
  padding: 4px 12px;
  font: 500 10px var(--font-mono);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}
.tag-filter:hover, .button:hover, .chip:hover, .nf-btn:hover, #ach-more:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--accent-glow);
  text-decoration: none;
  opacity: 1;
}
.tag-filter.active, .button.active {
  background: var(--accent-glow);
  color: var(--text);
  border-color: var(--border-strong);
}

.view-all {
  padding: 10px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  letter-spacing: 0.5px;
}
.view-all a { color: var(--text-secondary); }
.no-posts { padding: 24px; text-align: center; color: var(--text-muted); background: var(--bg-alt); font-size: 12px; }

/* ===== Sidebar Panels ===== */
.sidebar-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.sidebar-panel-header {
  padding: 12px 14px;
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.sidebar-panel-body {
  padding: 0;
  font-size: 12px;
  line-height: 1.6;
}
.sidebar-panel-body p { margin-bottom: 8px; }
.sidebar-panel-body p:last-child { margin-bottom: 0; }

.sidebar-stats { list-style: none; }
.sidebar-stats li {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
}
.sidebar-stats li:last-child { border-bottom: none; }
.sidebar-stats .stat-label { color: var(--text-muted); font-size: 11px; }
.sidebar-stats .stat-value { color: var(--text); font-weight: 600; }

.sidebar-links { list-style: none; }
.sidebar-links li {
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-links li:last-child { border-bottom: none; }
.sidebar-links a {
  display: block;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 12px;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}
.sidebar-links a:hover {
  color: var(--text);
  background: var(--accent-glow);
  text-decoration: none;
  opacity: 1;
}

/* ===== CVE Sidebar Panel ===== */
.cve-list { list-style: none; }
.cve-list-item {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
.cve-list-item:last-child { border-bottom: none; }
.cve-list-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font: 500 11px var(--font-mono);
  text-decoration: none;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}
.cve-list-item a:hover {
  color: var(--text);
  background: var(--accent-glow);
  opacity: 1;
}
.cve-id { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cve-severity {
  flex-shrink: 0;
  font: 600 9px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: var(--radius);
  border: 1px solid;
}
.cve-severity.critical { color: var(--red); border-color: rgba(255, 68, 68, 0.3); background: rgba(255, 68, 68, 0.08); }
.cve-severity.high { color: var(--orange); border-color: rgba(255, 140, 0, 0.3); background: rgba(255, 140, 0, 0.08); }
.cve-severity.medium { color: var(--yellow); border-color: rgba(255, 215, 0, 0.3); background: rgba(255, 215, 0, 0.08); }
.cve-severity.low { color: var(--green); border-color: rgba(0, 255, 136, 0.3); background: rgba(0, 255, 136, 0.08); }
.cve-severity.pending { color: var(--text-muted); border-color: var(--border); background: transparent; }

.cve-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font: 500 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
}
.cve-view-all:hover { color: var(--text); background: var(--accent-glow); opacity: 1; }
.cve-view-all .arrow { font-size: 14px; transition: transform var(--transition); }
.cve-view-all:hover .arrow { transform: translateX(3px); }

/* ===== Post Layout (Writeup pages) ===== */
.post-layout { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.post-layout-inner { display: flex; gap: 24px; align-items: flex-start; }
.post-layout-main { flex: 1; min-width: 0; max-width: 100%; }

.thread-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: clip;
  max-width: 100%;
}
.thread-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.thread-header h1 {
  font: 700 16px var(--font-mono);
  color: var(--text);
  margin: 0;
  letter-spacing: 0.3px;
}

.thread-post { display: flex; width: 100%; }
.author-sidebar {
  flex-shrink: 0;
  width: 130px;
  padding: 16px;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  text-align: center;
}
.author-name { font: 600 12px var(--font-mono); color: var(--text); margin-bottom: 6px; }
.author-avatar {
  width: 80px;
  height: 80px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 auto 10px;
  display: block;
}
.author-info { font-size: 10px; color: var(--text-muted); line-height: 1.7; text-align: left; margin-top: 10px; letter-spacing: 0.3px; }
.author-info strong { color: var(--text-secondary); }

.post-content-cell { flex: 1; min-width: 0; padding: 0; }
.post-header-bar {
  background: var(--bg-alt);
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.5px;
}
.post-body { padding: 20px; overflow-x: auto; max-width: 100%; }
.post-footer-bar {
  background: var(--bg-alt);
  padding: 6px 16px;
  border-top: 1px solid var(--border);
  text-align: right;
}

/* ===== TOC Sidebar ===== */
.toc-sidebar {
  width: 180px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.toc-title {
  padding: 12px 12px;
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.toc-list { list-style: none; padding: 8px; }
.toc-list li { margin-bottom: 2px; }
.toc-list a {
  display: block;
  font-size: 11px;
  padding: 4px 8px;
  color: var(--text-secondary);
  word-wrap: break-word;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.toc-list a:hover { background: var(--accent-glow); color: var(--text); text-decoration: none; opacity: 1; }
.toc-list a.active { background: var(--accent-glow); color: var(--text); }
.toc-list a.toc-h3 { padding-left: 18px; font-size: 10px; }

/* ===== Post Content Typography ===== */
.post-content, .post-body { font-size: 13px; line-height: 1.7; }
.post-content h2, .post-body h2 {
  font: 700 15px var(--font-mono);
  color: var(--text);
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.3px;
}
.post-content h3, .post-body h3 {
  font: 600 13px var(--font-mono);
  color: var(--text);
  margin: 20px 0 8px;
}
.post-content h4, .post-body h4 {
  font: 600 12px var(--font-mono);
  color: var(--text-secondary);
  margin: 16px 0 6px;
}
.post-content p, .post-body p { margin-bottom: 14px; color: var(--text-secondary); }
.post-content ul, .post-content ol, .post-body ul, .post-body ol { margin: 0 0 14px 20px; color: var(--text-secondary); }
.post-content li, .post-body li { margin: 4px 0; }

.post-content blockquote, .post-body blockquote {
  background: var(--bg-alt);
  border-left: 2px solid var(--border-strong);
  border-top: none;
  border-right: none;
  border-bottom: none;
  padding: 12px 16px;
  margin: 0 0 14px 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.post-content blockquote::before { content: none; }

.post-content pre, .post-body pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  margin: 0 0 14px 0;
  overflow-x: auto;
  max-height: 500px;
}
.post-content pre code, .post-body pre code {
  display: block;
  padding: 16px 18px;
  font: 12px/1.6 var(--font-mono);
  background: transparent;
  border: none;
  overflow-x: auto;
}
.post-content pre code.hljs, .post-body pre code.hljs {
  background: var(--bg-raised);
  padding: 16px 18px;
}
.post-content :not(pre) > code, .post-body :not(pre) > code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 2px 7px;
  font: 12px var(--font-mono);
  color: var(--accent-dim);
  border-radius: var(--radius);
}
.post-content hr, .post-body hr { border: none; height: 1px; background: var(--border); margin: 16px 0; }

.post-content table, .post-body table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.post-content th, .post-body th {
  background: var(--bg-alt);
  color: var(--text-secondary);
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--border);
}
.post-content td, .post-body td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  font-size: 12px;
  word-break: break-word;
  color: var(--text-secondary);
}
.post-content tr:nth-child(even), .post-body tr:nth-child(even) { background: var(--bg-alt); }
.post-content img, .post-body img { max-width: 100%; border: 1px solid var(--border); margin: 10px 0; border-radius: var(--radius); }

/* ===== CVE Writeup Elements ===== */
.meta-info {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  letter-spacing: 0.5px;
}
.cvss {
  display: inline-block;
  background: rgba(255, 68, 68, 0.15);
  color: var(--red);
  padding: 2px 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 68, 68, 0.3);
  font: 600 10px var(--font-mono);
  letter-spacing: 1px;
}
.tldr {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 2px solid var(--text-muted);
  padding: 16px;
  margin: 18px 0;
  border-radius: var(--radius);
  line-height: 1.7;
}
.tldr strong { color: var(--text); }
.hero-img { width: 100%; border: 1px solid var(--border); margin: 14px 0 18px; border-radius: var(--radius); }
.poc-video { width: 100%; border: 1px solid var(--border); margin: 14px 0; border-radius: var(--radius); }

/* ===== Footer ===== */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  margin-top: 32px;
  text-align: center;
}
.footer-content { max-width: 1060px; margin: 0 auto; }
.footer-text { font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px; }
.footer-text p { margin-bottom: 6px; }
.footer-text p:last-child { margin-bottom: 0; }
.footer .disclaimer {
  font-size: 10px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
  opacity: 0.6;
}

/* ===== Research layout ===== */
.rs-layout { display: table; width: 100%; }
.rs-sidebar { display: table-cell; width: 180px; vertical-align: top; padding-right: 12px; }
.rs-sidebar .toc-sidebar { width: 100%; }
.rs-clear {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}
.rs-main { display: table-cell; vertical-align: top; background: var(--bg-card); border: 1px solid var(--border); }

/* ===== Achievements ===== */
.ach-section { background: var(--bg-card); border: 1px solid var(--border); margin-top: 0; }

/* ===== 404 Page ===== */
.notfound-wrap { display: flex; justify-content: center; padding: 32px; flex: 1; }
.notfound-card { background: var(--bg-card); border: 1px solid var(--border); padding: 28px; max-width: 500px; width: 100%; border-radius: var(--radius); }
.notfound-head { margin-bottom: 12px; }
.notfound-title { font: 700 16px var(--font-mono); color: var(--text); letter-spacing: 1px; }
.nf-ghost { font-size: 24px; }
.notfound-kicker { font-size: 10px; color: var(--text-muted); display: block; margin-top: 6px; letter-spacing: 1px; text-transform: uppercase; }
.notfound-sub { color: var(--text-secondary); margin-bottom: 12px; font-size: 12px; }
.path-chip {
  display: inline-block;
  font: 11px var(--font-mono);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius);
}
.notfound-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.nf-suggest { border-top: 1px solid var(--border); padding-top: 12px; }
.nf-suggest h2 {
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  color: var(--text-muted);
}
.nf-list { list-style: none; }
.nf-item { padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 12px; }
.nf-item:last-child { border-bottom: none; }
.nf-meta { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; }
.nf-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== Command Palette Hint ===== */
.cmd-hint {
  position: fixed;
  bottom: 12px;
  right: 12px;
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: 10px var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
  z-index: 50;
  letter-spacing: 0.5px;
  transition: all var(--transition);
}
.cmd-hint:hover { color: var(--text-secondary); border-color: var(--border-strong); }
.cmd-hint kbd {
  padding: 1px 5px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 2px;
  font: 10px var(--font-mono);
}
.cmd-hint.hidden { display: none; }

/* ===== Forum Stats Bar ===== */
.forum-stats-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.forum-stats-bar strong { color: var(--text); }

.new-badge {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 68, 68, 0.3);
  font: 600 9px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: var(--radius);
}

.rs-link { color: var(--text-secondary); font-size: 11px; }
.rs-link:hover { color: var(--text); }

.hidden { display: none !important; }
.muted { color: var(--text-muted); }

/* ===== Syntax Highlighting ===== */
.hljs { background: var(--bg-raised); color: var(--text-secondary); }
.hljs-comment { color: rgba(240, 230, 211, 0.25); font-style: italic; }
.hljs-keyword { color: #c9a66b; font-weight: 600; }
.hljs-string { color: #98c379; }
.hljs-number { color: #d19a66; }
.hljs-function { color: #61afef; }
.hljs-variable { color: #e5c07b; }
.hljs-built_in { color: #e5c07b; }
.hljs-class { color: #e5c07b; }
.hljs-title { color: #61afef; }
.hljs-params { color: var(--text-secondary); }
.hljs-attr { color: #d19a66; }
.hljs-selector-tag { color: #c9a66b; }
.hljs-selector-class { color: #e5c07b; }
.hljs-selector-id { color: #61afef; }

/* ===== Code Block Copy Button ===== */
.code-block-wrapper { position: relative; }
.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 4px 10px;
  font: 10px var(--font-mono);
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.code-block-wrapper:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--bg-alt); color: var(--text-secondary); }
.copy-btn.copied { background: rgba(0, 255, 136, 0.1); color: var(--green); border-color: rgba(0, 255, 136, 0.3); }

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 60px;
  right: 24px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  z-index: 1000;
  transition: all var(--transition);
}
.back-to-top:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-2px); }

/* ===== Post Navigation ===== */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0;
  padding: 0;
  background: transparent;
  border: none;
}
.post-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-secondary);
  transition: all var(--transition);
  max-width: 45%;
}
.post-nav-link:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  text-decoration: none;
  opacity: 1;
}
.post-nav-prev { text-align: left; }
.post-nav-next { text-align: right; margin-left: auto; }
.post-nav-arrow { font-size: 14px; color: var(--text-muted); }
.post-nav-text { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.post-nav-label {
  font: 500 9px var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.post-nav-title { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-nav-spacer { flex: 1; }
.reading-time { color: var(--text-muted); font-size: 11px; letter-spacing: 0.5px; }

/* ===== Related Posts ===== */
.related-posts {
  margin: 20px 0;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.related-posts-header {
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.related-posts-list { display: flex; flex-direction: column; }
.related-post-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  text-decoration: none;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-subtle);
}
.related-post-item:last-child { border-bottom: none; }
.related-post-item:hover { background: var(--accent-glow); text-decoration: none; opacity: 1; }
.related-post-title { font-size: 12px; color: var(--text-secondary); }
.related-post-meta { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; }

.cmd-search-section { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }

/* ===== Pinned / Featured Post ===== */
.pinned-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}
.pinned-label {
  padding: 10px 16px;
  font: 600 9px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pinned-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-dim);
  border-radius: 50%;
  animation: pinned-pulse 2.5s ease-in-out infinite;
}
@keyframes pinned-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.pinned-content {
  padding: 14px 16px;
}
.pinned-title {
  margin-bottom: 6px;
}
.pinned-title a {
  font: 600 14px var(--font-mono);
  color: var(--text);
  letter-spacing: 0.3px;
}
.pinned-title a:hover { opacity: 0.7; }
.pinned-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pinned-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* ===== CVSS Inline Badge (for activity feed) ===== */
.cvss-inline {
  display: inline-block;
  font: 600 9px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 1px 6px;
  border-radius: var(--radius);
  border: 1px solid;
  vertical-align: middle;
  margin-left: 6px;
}
.cvss-inline.critical { color: var(--red); border-color: rgba(255, 68, 68, 0.3); background: rgba(255, 68, 68, 0.08); }
.cvss-inline.high { color: var(--orange); border-color: rgba(255, 140, 0, 0.3); background: rgba(255, 140, 0, 0.08); }
.cvss-inline.medium { color: var(--yellow); border-color: rgba(255, 215, 0, 0.3); background: rgba(255, 215, 0, 0.08); }
.cvss-inline.low { color: var(--green); border-color: rgba(0, 255, 136, 0.3); background: rgba(0, 255, 136, 0.08); }
.cvss-inline.pending { color: var(--text-muted); border-color: var(--border); background: transparent; }

/* ===== GitHub Activity Widget ===== */
.gh-activity {
  padding: 12px 14px;
}
.gh-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 10px;
}
@keyframes gh-cell-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.gh-cell {
  aspect-ratio: 1;
  border-radius: 1px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
  opacity: 0;
  animation: gh-cell-pop 0.3s ease forwards;
}
.gh-cell.l1 { background: rgba(240, 230, 211, 0.06); border-color: rgba(240, 230, 211, 0.08); }
.gh-cell.l2 { background: rgba(240, 230, 211, 0.14); border-color: rgba(240, 230, 211, 0.16); }
.gh-cell.l3 { background: rgba(240, 230, 211, 0.25); border-color: rgba(240, 230, 211, 0.28); }
.gh-cell.l4 { background: rgba(240, 230, 211, 0.42); border-color: rgba(240, 230, 211, 0.45); }
.gh-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gh-streak {
  font: 500 10px var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
.gh-profile-link {
  font: 500 10px var(--font-mono);
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  transition: all var(--transition);
}
.gh-profile-link:hover { color: var(--text); opacity: 1; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .home-layout { flex-direction: column; }
  .home-sidebar { width: 100%; position: static; }
  .post-layout-inner { flex-direction: column; }
  .toc-sidebar { display: none; }
  .post-layout-main { width: 100%; }
}

@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }

  .forum-wrapper, .container { padding: 16px; max-width: 100%; overflow-x: hidden; }
  .post-layout { padding: 16px; max-width: 100%; overflow-x: hidden; }
  .nav-container { padding: 12px 16px; }

  .bio-logo { display: none; }
  .bio-content { display: block; }
  .bio-text { padding: 16px; }
  .bio-section h1 { font-size: 14px; }

  .forum-stats, .forum-lastpost, .sub-header { display: none; }
  .forum-row td { border-right: none; padding: 12px; }

  .home-sidebar { display: none; }

  .post-item { padding: 14px 16px; }

  .post-layout-inner { gap: 0; }
  .post-layout-main { width: 100%; max-width: 100%; }
  .thread-container { max-width: 100%; overflow: hidden; }
  .thread-post { display: block; width: 100%; }
  .author-sidebar { display: none; }
  .post-content-cell { display: block; width: 100%; max-width: 100%; }
  .post-body {
    padding: 16px;
    overflow-x: hidden;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .post-body pre { font-size: 11px; padding: 12px; margin: 12px 0; overflow-x: auto; max-width: 100%; white-space: pre; word-wrap: normal; }
  .post-body pre code { font-size: 11px; padding: 0; }
  .post-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0; max-width: 100%; font-size: 11px; }
  .post-body h2 { font-size: 14px; margin: 20px 0 10px; }
  .post-body h3 { font-size: 12px; }
  .post-body p { font-size: 12px; }
  .post-body ul, .post-body ol { margin-left: 16px; font-size: 12px; }
  .post-header-bar { padding: 8px 14px; font-size: 10px; }
  .thread-header { padding: 0; }
  .thread-header h1 { font-size: 14px; padding: 12px 16px; }
  .breadcrumb { margin-bottom: 12px; }

  .tldr { padding: 12px; margin: 12px 0; font-size: 11px; }
  .cvss { font-size: 9px; }

  .post-stats { display: none; }
  .search-container input { width: 100%; padding: 10px 12px; font-size: 14px; }
  .view-all { padding: 12px; }
  .footer { padding: 16px; }
  .cmd-hint { display: none; }
  .rs-layout, .rs-sidebar, .rs-main { display: block; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
