/* ==========================================================
   siinatra35 — dark, terminal-inspired blog theme
   ========================================================== */
:root {
  --bg: #0a0b0d;
  --bg-2: #111317;
  --surface: #14171c;
  --border: #23272e;
  --border-hi: #343a44;
  --text: #e6e8eb;
  --muted: #9aa1ab;
  --dim: #6b727c;
  --accent: #c6ff3d;      /* acid lime */
  --accent-2: #4de1ff;    /* cyan */
  --danger: #ff5c7a;
  --warn: #ffb547;
  --radius: 10px;
  --wrap: 1120px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; position: relative; z-index: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent); color: #000; }
img { max-width: 100%; height: auto; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.center { text-align: center; }

/* Background grid + glow */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .35;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-grid::after {
  content: ""; position: absolute; left: 50%; top: -240px; width: 900px; height: 500px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(198,255,61,.12), transparent);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10,11,13,.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-family: var(--mono); font-weight: 700; color: var(--text); font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-prompt { color: var(--accent); }
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav { display: flex; gap: 4px; font-family: var(--mono); font-size: 14px; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.nav a:hover, .nav a[aria-current] { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a[aria-current]::before { content: "./"; color: var(--accent); }
@media (max-width: 480px) { .nav a { padding: 6px 6px; } .nav a[aria-current]::before { content: ""; } }

/* Eyebrow labels */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 16px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* Hero */
.hero { padding: 72px 0 48px; }
@media (min-width: 720px) { .hero { padding: 120px 0 72px; } }
.hero-title {
  font-size: clamp(40px, 8vw, 84px); line-height: 1.02; letter-spacing: -.035em;
  font-weight: 800; margin: 0 0 24px; max-width: 14ch;
}
.hero-sub { font-size: 18px; color: var(--muted); max-width: 56ch; margin: 0 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 56px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border-radius: 8px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #0a0b0d; }
.btn-primary:hover { box-shadow: 0 0 24px rgba(198,255,61,.35); }
.btn-ghost { border-color: var(--border-hi); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Terminal */
.terminal {
  max-width: 640px; border: 1px solid var(--border-hi); border-radius: var(--radius);
  background: var(--bg-2); overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(198,255,61,.04);
}
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-hi); }
.terminal-bar em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--dim); }
.terminal pre { margin: 0; padding: 18px; font-size: 14px; line-height: 1.7; color: var(--muted); overflow-x: auto; }
.terminal .p { color: var(--accent); }
.terminal .c { color: var(--accent-2); }

/* Sections */
.section { padding: 48px 16px; }
@media (min-width: 720px) { .section { padding: 72px 32px; } }
.section-head { margin-bottom: 28px; border-top: 1px solid var(--border); padding-top: 28px; }
.section-head h2 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.02em; margin: 0; }

.topics { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 720px) { .topics { grid-template-columns: repeat(3, 1fr); } }
.topic { background: var(--bg); padding: 28px; color: var(--text); transition: background .2s; position: relative; }
.topic:hover { background: var(--surface); text-decoration: none; }
.topic:hover h3 { color: var(--accent); }
.topic-num { font-size: 12px; color: var(--dim); }
.topic h3 { margin: 12px 0 8px; font-size: 20px; transition: color .2s; }
.topic p { margin: 0; color: var(--muted); font-size: 15px; }

/* Cards */
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(20,23,28,.6); transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-link { display: flex; flex-direction: column; height: 100%; padding: 22px; color: var(--text); }
.card-link:hover { text-decoration: none; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; color: var(--dim); }
.card-title { font-size: 19px; line-height: 1.3; margin: 14px 0 8px; letter-spacing: -.01em; }
.card-desc { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; flex: 1; }
.card-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.read { margin-left: auto; color: var(--accent); }
.more { margin-top: 24px; font-size: 14px; }

.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 4px; border: 1px solid currentColor; color: var(--accent); }
.tag-malware { color: var(--danger); }
.tag-htb { color: var(--accent); }
.tag-research { color: var(--accent-2); }
.tag-notes { color: var(--warn); }
.pill { color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }

/* Pages */
.page { padding: 56px 16px 80px; max-width: 820px; }
@media (min-width: 720px) { .page { padding: 80px 32px 96px; } }
.page-title { font-size: clamp(34px, 6vw, 56px); letter-spacing: -.03em; margin: 0 0 32px; line-height: 1.05; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter { font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 1px solid var(--border-hi); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.filter:hover { color: var(--text); }
.filter.is-active { color: #0a0b0d; background: var(--accent); border-color: var(--accent); }

.archive { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.archive-item { display: grid; grid-template-columns: 1fr; gap: 4px 20px; padding: 16px 0; border-bottom: 1px solid var(--border); align-items: center; }
@media (min-width: 640px) { .archive-item { grid-template-columns: 100px 1fr auto; } }
.archive-item time { font-size: 13px; }
.archive-item a { color: var(--text); font-weight: 600; }
.archive-item a:hover { color: var(--accent); }
.archive-item .tag { justify-self: start; }

/* Post */
.post { max-width: 780px; padding: 48px 16px 96px; }
@media (min-width: 720px) { .post { padding: 64px 32px 96px; } }
.back { display: inline-block; font-size: 13px; color: var(--dim); margin-bottom: 28px; }
.back:hover { color: var(--accent); text-decoration: none; }
.post-title { font-size: clamp(32px, 5.5vw, 52px); line-height: 1.08; letter-spacing: -.03em; margin: 16px 0 16px; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 24px; }
.post-header { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }

.box-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; margin: 24px 0 0; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.box-info div { background: var(--bg-2); padding: 12px 16px; }
.box-info dt { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.box-info dd { margin: 4px 0 0; color: var(--text); font-size: 14px; }

/* Prose */
.prose { font-size: 17px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 28px; letter-spacing: -.02em; margin-top: 2.2em; padding-top: .4em; }
.prose h2::before { content: "## "; color: var(--accent); font-family: var(--mono); font-size: .7em; }
.prose h3 { font-size: 21px; margin-top: 1.8em; }
.prose h3::before { content: "### "; color: var(--dim); font-family: var(--mono); font-size: .7em; }
.prose p, .prose li { color: #cfd3d8; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--accent); }
.prose hr { border: 0; border-top: 1px dashed var(--border-hi); margin: 2.5em 0; }
.prose blockquote { margin-left: 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; color: var(--muted); }
.prose blockquote p { margin: 0; color: inherit; }
.prose img { border: 1px solid var(--border); border-radius: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface); font-family: var(--mono); font-size: 13px; color: var(--muted); }

.prose :not(pre) > code {
  font-family: var(--mono); font-size: .86em; color: var(--accent);
  background: var(--surface); border: 1px solid var(--border); padding: .1em .4em; border-radius: 4px;
  overflow-wrap: anywhere;
}

/* Code blocks (Rouge) */
div.highlighter-rouge, figure.highlight { position: relative; margin: 1.4em 0; }
.highlight pre, pre.highlight {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  font: 14px/1.6 var(--mono); color: #d6dae0;
}
div.highlighter-rouge[class*="language-"]::before {
  position: absolute; top: 0; right: 0; padding: 3px 10px; font: 11px var(--mono);
  color: var(--dim); text-transform: lowercase; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0 var(--radius) 0 6px;
}
.language-bash::before, .language-sh::before, .language-shell::before { content: "bash"; }
.language-python::before { content: "python"; }
.language-powershell::before { content: "powershell"; }
.language-c::before { content: "c"; }
.language-yara::before { content: "yara"; }
.language-nasm::before, .language-asm::before { content: "asm"; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2; opacity: 0; transition: opacity .15s;
  font: 12px var(--mono); color: var(--muted); background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
div.highlighter-rouge:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn.done { color: var(--accent); border-color: var(--accent); }
@media (hover: none) { .copy-btn { opacity: 1; } }

.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: #6b727c; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kc { color: #ff7ab6; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sh, .highlight .se, .highlight .sx, .highlight .sr { color: #c6ff3d; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: #ffb547; }
.highlight .nf, .highlight .fm, .highlight .nb, .highlight .bp { color: #4de1ff; }
.highlight .nc, .highlight .nn, .highlight .no { color: #ffd76b; }
.highlight .nv, .highlight .vi, .highlight .vg, .highlight .na { color: #b9a3ff; }
.highlight .o, .highlight .ow, .highlight .p { color: #9aa1ab; }
.highlight .gp { color: #c6ff3d; user-select: none; }
.highlight .gi { color: #c6ff3d; }
.highlight .gd { color: #ff5c7a; }
.highlight .err { color: #ff5c7a; background: none; }

.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 48px; font-size: 12px; }
.post-nav { display: grid; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 14px; }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.post-nav a:hover { border-color: var(--accent); text-decoration: none; }
.post-nav .next { text-align: right; }

/* Footer */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 28px 0; font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

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