/* ============================================================
   velkris - grimdark offensive-security blog
   Deep black, crimson signal, filmic grain. No external assets.
   ============================================================ */

:root {
  --bg:        #08080a;
  --bg-elev:   #0e0e12;
  --bg-sink:   #050506;
  --line:      #1b1b21;
  --line-lit:  #2a2a33;

  --ink:       #c4c4cb;   /* body */
  --ink-dim:   #71717b;   /* muted */
  --ink-bright:#f2f2f6;   /* headings */

  --red:       #b0141f;   /* crimson accent */
  --red-hot:   #e51d2a;   /* highlight / hover pop */
  --red-deep:  #5c0b11;
  --red-glow:  rgba(203,22,33,0.55);

  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular,
          Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 520px at 50% -8%, rgba(203,22,33,0.14), transparent 68%),
    radial-gradient(700px 400px at 100% 0%, rgba(203,22,33,0.05), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

/* thin crimson severity line across the very top */
.fx-topline {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 101;
  background: linear-gradient(90deg, transparent, var(--red) 18%, var(--red-hot) 50%, var(--red) 82%, transparent);
  box-shadow: 0 0 12px var(--red-glow);
  pointer-events: none;
}

/* filmic grain for depth */
.fx-grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* digitized revenant skull watermark - sits behind content */
.fx-skull {
  position: fixed; z-index: 0; pointer-events: none;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(115vh, 860px); aspect-ratio: 1 / 1;
  background: center / contain no-repeat;
  background-image: url("../img/skull-watermark.png");
  opacity: 0.16;
  mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
}

/* static vignette */
.fx-vignette {
  position: fixed; inset: 0; z-index: 99; pointer-events: none;
  background: radial-gradient(135% 115% at 50% 26%, transparent 58%, rgba(0,0,0,0.66) 100%);
}

/* keep readable content above the watermark */
.site-header, .content, .site-footer { position: relative; z-index: 1; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.4rem; }

/* ---- masthead ------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 2.4rem 0 1.6rem;
}
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-mark {
  width: 0.72em; height: 0.72em; background: var(--red);
  box-shadow: 0 0 14px var(--red-glow); flex-shrink: 0;
  transform: rotate(45deg); transition: background 0.15s, box-shadow 0.15s;
}
.brand-name {
  font-family: var(--mono);
  font-size: 1.5rem; font-weight: 700; letter-spacing: 0.2em;
  color: var(--ink-bright);
}
.brand:hover .brand-mark { background: var(--red-hot); box-shadow: 0 0 20px var(--red-glow); }

.nav { display: flex; gap: 1.5rem; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; }
.nav a {
  color: var(--ink-dim); text-decoration: none; padding-bottom: 3px;
  border-bottom: 1px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.nav a:hover { color: var(--ink-bright); border-bottom-color: var(--red-hot); }

.tagline {
  margin: 1.3rem 0 0; padding-left: 0.85rem;
  border-left: 2px solid var(--red);
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.03em;
  color: var(--ink-dim); max-width: 52ch;
}

/* ---- content -------------------------------------------- */
.content { padding: 3rem 0 3.5rem; min-height: 56vh; }

.lead {
  font-size: 1.16rem; line-height: 1.6; color: var(--ink-bright);
  margin: 0 0 2.2rem;
}
.lead strong { color: #fff; }

.content h1, .content h2, .content h3 { font-family: var(--mono); color: var(--ink-bright); line-height: 1.3; }
.content h1 { font-size: 1.7rem; letter-spacing: 0.01em; margin: 2.4rem 0 1rem; }
.content h2 {
  font-size: 0.98rem; text-transform: uppercase; letter-spacing: 0.16em;
  margin: 2.8rem 0 1.1rem; padding-left: 0.8rem;
  border-left: 3px solid var(--red);
  color: var(--ink-bright);
}
.content h3 { font-size: 0.98rem; color: var(--ink); margin: 1.8rem 0 0.8rem; }
.content > :first-child { margin-top: 0; }

.content p, .content li { color: var(--ink); }
.content a { color: var(--red-hot); text-decoration: none; border-bottom: 1px solid rgba(203,22,33,0.45); }
.content a:hover { border-bottom-color: var(--red-hot); text-shadow: 0 0 12px rgba(229,29,42,0.35); }

strong { color: var(--ink-bright); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line-lit); margin: 2.6rem 0; }

/* ---- writing list --------------------------------------- */
.post-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.post-list li {
  display: flex; gap: 1rem; align-items: baseline;
  padding: 0.95rem 0.6rem 0.95rem 0;
  border-bottom: 1px solid var(--line);
  position: relative; transition: padding-left 0.15s;
}
.post-list li::before {
  content: "\203A"; /* › */
  color: var(--red); font-family: var(--mono); font-weight: 700;
  opacity: 0; transition: opacity 0.15s; position: absolute; left: -0.9rem;
}
.post-list li:hover { padding-left: 0.9rem; }
.post-list li:hover::before { opacity: 1; }
.post-list li:last-child { border-bottom: none; }
.post-list .stamp {
  font-family: var(--mono); font-size: 0.78rem; color: #9a5b60;
  white-space: nowrap; flex-shrink: 0; min-width: 6em; letter-spacing: 0.02em;
}
.post-list a { color: var(--ink-bright); border-bottom: none; font-size: 1.02rem; }
.post-list a:hover { color: var(--red-hot); }

/* ---- documents (about / posts) -------------------------- */
.doc.post .post-date {
  font-family: var(--mono); font-size: 0.82rem; color: #9a5b60;
  margin: -0.3rem 0 1.9rem; letter-spacing: 0.03em;
}
.post-tags { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.post-tags a {
  font-family: var(--mono); font-size: 0.74rem; color: var(--ink-dim);
  border: 1px solid var(--line-lit); border-radius: 3px;
  padding: 0.15rem 0.5rem; text-decoration: none; transition: color 0.15s, border-color 0.15s;
}
.post-tags a:hover { color: var(--red-hot); border-color: var(--red); }

.backlink { font-family: var(--mono); font-size: 0.85rem; margin-top: 3rem; }
.backlink a { color: var(--ink-dim); text-decoration: none; }
.backlink a:hover { color: var(--red-hot); }

/* ---- code ----------------------------------------------- */
code {
  font-family: var(--mono); font-size: 0.86em;
  background: #121218; border: 1px solid var(--line-lit);
  border-radius: 3px; padding: 0.1em 0.4em; color: #e2999f;
}
pre {
  background: #0b0b0f; border: 1px solid var(--line-lit);
  border-left: 3px solid var(--red);
  border-radius: 4px; padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.86rem;
}
pre code { background: none; border: none; padding: 0; color: var(--ink); }

blockquote {
  margin: 1.6rem 0; padding: 0.4rem 1.1rem;
  border-left: 3px solid var(--red-deep);
  color: var(--ink-dim); background: rgba(203,22,33,0.03);
}

/* ---- footer --------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-sink);
  padding: 1.9rem 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
}
.site-footer a { color: var(--ink-dim); text-decoration: none; }
.site-footer a:hover { color: var(--red-hot); }
.foot-sep { margin: 0 0.55rem; color: var(--red-deep); }
.foot-dim { color: #4a4a52; }

/* ---- Rouge syntax highlighting - red-tinted mono theme --- */
.highlight, .highlight pre { background: #0b0b0f; }
.highlight { border-radius: 4px; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cd {
  color: #5a5a63; font-style: italic; }                 /* comments */
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv {
  color: #e5555d; font-weight: 600; }                   /* keywords */
.highlight .kt, .highlight .kc { color: #d98a55; }      /* types / constants kw */
.highlight .o, .highlight .ow { color: #a8a8b0; }       /* operators */
.highlight .p, .highlight .pi { color: #8a8a93; }       /* punctuation */
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc,
.highlight .sd, .highlight .sh, .highlight .sx, .highlight .sr, .highlight .ss,
.highlight .dl { color: #cf8a86; }                      /* strings */
.highlight .se { color: #e5555d; }                      /* string escapes */
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il {
  color: #c98f9a; }                                     /* numbers */
.highlight .nb, .highlight .bp { color: #d9666d; }      /* builtins */
.highlight .nf, .highlight .fm { color: #e8e8ee; font-weight: 600; } /* functions */
.highlight .nc, .highlight .nn, .highlight .no { color: #d9a05b; }   /* classes / namespaces / constants */
.highlight .na { color: #c98f9a; }                      /* attributes */
.highlight .nv, .highlight .vg, .highlight .vi, .highlight .vc { color: #d98a86; } /* variables */
.highlight .nt { color: #e5555d; }                      /* HTML/XML tags */
.highlight .nx, .highlight .n { color: #c4c4cb; }       /* plain names */
.highlight .gp { color: #8a3038; user-select: none; }   /* shell prompt ($) */
.highlight .gi { color: #3fae6b; }                      /* diff insert */
.highlight .gd { color: #e5555d; }                      /* diff delete */
.highlight .err { color: #ff5a5a; background: rgba(229,29,42,0.12); }

/* ---- responsive ----------------------------------------- */
@media (max-width: 600px) {
  .fx-skull { opacity: 0.1; }
  .masthead { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .nav { flex-wrap: wrap; gap: 1.1rem; }
  .brand-name { font-size: 1.3rem; }
  .content { padding-top: 2.2rem; }
  .post-list li { flex-direction: column; gap: 0.15rem; }
}
