/*
Theme Name: JustRuss
Description: Security research blog
Version: 3.0
Author: justruss
*/

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

:root {
  --navy:       #1a2133;
  --navy2:      #212840;
  --bg:         #f8fafc;
  --surface:    #ffffff;
  --border:     #e2e8f0;
  --border2:    #cbd5e1;
  --text:       #0f172a;
  --text2:      #334155;
  --text3:      #64748b;
  --text4:      #94a3b8;
  --amber:      #f59e0b;
  --amber-light:#fffbeb;
  --amber-dark: #b45309;
  --sans:       'Inter', system-ui, sans-serif;
  --mono:       'JetBrains Mono', monospace;
  --display:    'Syne', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ─── LAYOUT ─── */
.site-wrapper {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* logo */
.logo-wrap { margin-bottom: 28px; }
.logo-wrap a { display: block; }
.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid var(--amber);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  color: var(--amber);
  margin-bottom: 10px;
  transition: background 0.15s;
}
.logo-wrap a:hover .logo-badge { background: rgba(245,158,11,0.1); }
.logo-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 3px;
}
.logo-tag {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--amber);
  opacity: 0.7;
  letter-spacing: 0.04em;
}
.sdot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 5px;
  animation: sdot 2.5s infinite;
}
@keyframes sdot { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* nav */
.nav-section { margin-bottom: 6px; }
.nav-heading {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0 8px;
  margin: 14px 0 5px;
}
.nav-list { list-style: none; }
.nav-list li { margin-bottom: 1px; }
.nav-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  color: #94a3b8;
  font-size: 12.5px;
  border: 1px solid transparent;
  transition: all 0.13s;
}
.nav-list a:hover { color: #e2e8f0; background: rgba(255,255,255,0.06); }
.nav-list a.is-active {
  color: var(--amber);
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.18);
}
.nav-icon {
  font-family: var(--mono);
  font-size: 10px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.6;
}
.nav-list a.is-active .nav-icon { opacity: 1; }
.ni-dfir  { color: #38bdf8; }
.ni-hunt  { color: #a78bfa; }
.ni-htb   { color: #34d399; }
.ni-mal   { color: #fbbf24; }
.ni-lab   { color: #86efac; }
.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  color: #374151;
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 3px;
}

/* sidebar bottom */
.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.s-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: #374151;
  padding: 5px 8px;
  border-radius: 5px;
  margin-bottom: 2px;
  transition: all 0.13s;
}
.s-link:hover { color: #94a3b8; background: rgba(255,255,255,0.05); }
.s-link svg { width: 12px; height: 12px; fill: currentColor; flex-shrink: 0; }

/* ─── MOBILE HEADER ─── */
.mob-header {
  display: none;
  background: var(--navy);
  padding: 11px 18px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.mob-logo {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
}
.mob-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mob-btn span { display: block; width: 17px; height: 1.5px; background: #94a3b8; }

.mob-nav {
  background: var(--navy2);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 14px 18px;
}
.mob-nav a {
  display: block;
  padding: 8px 0;
  color: #94a3b8;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mob-nav a:last-child { border-bottom: none; }

/* ─── MAIN ─── */
.site-main { min-height: 100vh; background: var(--bg); }

/* page header */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 30px 36px 24px;
  position: relative;
  overflow: hidden;
}
.page-head::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(245,158,11,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber-dark);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 9px;
  opacity: 0.85;
}
.eyebrow::before { content: '// '; color: var(--text4); }
.page-title {
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 9px;
}
.page-title .accent { color: var(--amber); }
.page-title .cur::after {
  content: '_';
  color: var(--amber);
  animation: cur 1.1s step-end infinite;
}
@keyframes cur { 0%,100%{opacity:1} 50%{opacity:0} }
.page-desc { font-size: 13.5px; color: var(--text3); max-width: 480px; line-height: 1.7; }

/* filter bar */
.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 9px 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-label { font-family: var(--mono); font-size: 9px; color: var(--text4); margin-right: 3px; }
.f-btn {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text3);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
  display: inline-block;
}
.f-btn:hover { border-color: var(--border2); color: var(--text2); }
.f-btn.is-active { border-color: var(--amber); color: var(--amber-dark); background: var(--amber-light); }

/* post list */
.posts-wrap { padding: 22px 36px 52px; }
.posts-list { display: flex; flex-direction: column; gap: 9px; }

.post-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 0;
}
.post-card:hover {
  border-color: var(--border2);
  transform: translateX(3px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.post-card:hover::before { opacity: 1; }
.pc-dfir::before   { background: #0ea5e9; }
.pc-hunt::before   { background: #8b5cf6; }
.pc-htb::before    { background: #10b981; }
.pc-mal::before    { background: #f59e0b; }
.pc-lab::before    { background: #34d399; }

.post-body { flex: 1; min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }

.badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 3px;
}
.b-dfir { background: #e0f2fe; color: #0369a1; }
.b-hunt { background: #ede9fe; color: #6d28d9; }
.b-htb  { background: #d1fae5; color: #065f46; }
.b-mal  { background: #fef3c7; color: #92400e; }
.b-lab  { background: #f0fdf4; color: #166534; }

.post-date { font-family: var(--mono); font-size: 10px; color: var(--text4); }
.post-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 4px;
  transition: color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-card:hover .post-title { color: #1d4ed8; }
.post-excerpt {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-arrow { font-size: 14px; color: var(--border2); flex-shrink: 0; transition: all 0.15s; }
.post-card:hover .post-arrow { color: var(--amber); transform: translateX(3px); }

/* pagination */
.pagination { margin-top: 30px; }
.pagination ul { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination ul li a,
.pagination ul li span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text3);
  background: var(--surface);
  display: block;
  transition: all 0.12s;
}
.pagination ul li a:hover { border-color: var(--border2); color: var(--text2); }
.pagination ul li span.current { border-color: var(--amber); color: var(--amber-dark); background: var(--amber-light); }

/* ─── SINGLE POST ─── */
.post-page { max-width: 800px; padding: 30px 36px 60px; }

.post-page-head {
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.post-page-title {
  font-family: var(--display);
  font-size: clamp(21px, 2.8vw, 31px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 9px 0 11px;
}
.post-page-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text4);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.post-page-meta .sep { color: var(--border2); }

/* post content */
.entry-content {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.88;
}
.entry-content p { margin-bottom: 1.2rem; }
.entry-content h2 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  margin: 2.5rem 0 0.9rem;
  letter-spacing: -0.015em;
}
.entry-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  padding-left: 11px;
  border-left: 3px solid var(--amber);
}
.entry-content strong { color: var(--text); font-weight: 600; }
.entry-content em { font-style: italic; }
.entry-content a { color: #1d4ed8; border-bottom: 1px solid rgba(29,78,216,0.2); }
.entry-content a:hover { border-color: #1d4ed8; }

.entry-content code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: #f1f5f9;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.entry-content pre {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: #94a3b8;
  overflow-x: auto;
  line-height: 1.75;
  margin: 1.2rem 0 1.7rem;
  white-space: pre;
}
.entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.entry-content ul,
.entry-content ol { padding-left: 1.5rem; margin-bottom: 1.2rem; }
.entry-content li { margin-bottom: 0.4rem; }
.entry-content blockquote {
  border-left: 3px solid var(--amber);
  padding: 10px 18px;
  margin: 1.5rem 0;
  background: var(--amber-light);
  border-radius: 0 8px 8px 0;
}
.entry-content blockquote p { margin: 0; color: var(--amber-dark); font-style: italic; }

/* post nav */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.post-nav a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  transition: all 0.13s;
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-nav a:hover { border-color: var(--amber); color: var(--amber-dark); background: var(--amber-light); }
.post-nav .pn-prev::before { content: '\2190 '; }
.post-nav .pn-next::after  { content: ' \2192'; }

/* ─── ABOUT ─── */
.about-page { padding: 30px 36px 60px; max-width: 720px; }
.about-content { font-size: 15px; color: var(--text2); line-height: 1.88; }
.about-content p { margin-bottom: 1.2rem; }
.about-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 2.25rem 0 0.75rem;
  padding-left: 11px;
  border-left: 3px solid var(--amber);
}
.about-content code { font-family: var(--mono); font-size: 12.5px; background: #f1f5f9; color: #0369a1; padding: 2px 6px; border-radius: 4px; border: 1px solid #e2e8f0; }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 10px; margin-top: 14px; }
.skill-block { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 13px 14px; transition: border-color 0.13s; }
.skill-block:hover { border-color: var(--border2); }
.skill-name { font-family: var(--mono); font-size: 9px; color: var(--amber-dark); text-transform: uppercase; letter-spacing: 0.1em; background: var(--amber-light); display: inline-block; padding: 2px 7px; border-radius: 3px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.skill-tag { font-family: var(--mono); font-size: 10px; color: var(--text3); background: var(--bg); border: 1px solid var(--border); padding: 2px 7px; border-radius: 3px; }

/* ─── 404 ─── */
.not-found { padding: 70px 36px; text-align: center; }
.nf-code { font-family: var(--display); font-size: 88px; font-weight: 800; color: var(--border2); line-height: 1; margin-bottom: 10px; }
.nf-msg { font-family: var(--mono); font-size: 13px; color: var(--text3); margin-bottom: 28px; }
.nf-back { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; padding: 9px 20px; border: 1px solid var(--border2); border-radius: 7px; color: var(--text3); background: var(--surface); transition: all 0.13s; }
.nf-back:hover { border-color: var(--amber); color: var(--amber-dark); background: var(--amber-light); }

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  .site-wrapper { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mob-header { display: flex; }
  .page-head { padding: 22px 20px 18px; }
  .filter-bar { padding: 9px 20px; }
  .posts-wrap { padding: 18px 20px 44px; }
  .post-page { padding: 22px 20px 52px; }
  .about-page { padding: 22px 20px 52px; }
  .not-found { padding: 50px 20px; }
}
