/* ===========================================================
   securityDN — тема "Deep Indigo".
   Тёмный фиолетово-синий фон, золотой акцент + фиолетовый,
   карточки и теги-пилюли. Тёмная, насыщенная, журнальная.
   =========================================================== */

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

:root {
  --bg: #13111f;
  --bg2: #1a1730;
  --surf: #1f1b35;
  --surf2: #262141;
  --text: #d6d2e8;
  --bright: #f4f2fb;
  --muted: #8d87a8;
  --faint: #5a5478;
  --gold: #f0a830;
  --gold-dim: #c4862020;
  --violet: #a78bfa;
  --violet-dim: #8b6ce0;
  --violet-glow: #a78bfa1a;
  --line: #272240;
  --line-bright: #352e54;

  --fdisp: "Space Grotesk", -apple-system, sans-serif;
  --ftext: "Inter", -apple-system, "Segoe UI", sans-serif;
  --fmono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --maxw: 760px;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ftext);
  font-size: 17px;
  line-height: 1.7;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(760px 380px at 82% -5%, #3a2a6033, transparent 70%),
    radial-gradient(620px 320px at 8% 8%, #2a1f5022, transparent 70%);
}
body > * { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--bright); }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, var(--bg2), transparent);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px;
}
.logo {
  font-family: var(--fdisp); font-weight: 700; font-size: 1.2rem;
  color: var(--bright); letter-spacing: -0.01em;
}
.logo::before { content: "\25C6 "; color: var(--gold); font-size: 0.85em; }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: var(--muted); font-family: var(--fmono); font-size: 0.84rem;
  padding: 4px 9px; border-radius: 5px;
}
.main-nav a:hover { color: var(--bright); background: var(--surf); }
.nav-divider { color: var(--faint); font-family: var(--fmono); }

/* Status bar */
.status-bar {
  border-bottom: 1px solid var(--line); background: var(--bg2);
  font-family: var(--fmono); font-size: 0.74rem; color: var(--muted);
}
.status-bar .wrap {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding-top: 8px; padding-bottom: 8px;
}
.status-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  flex-shrink: 0; animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 #f0a83055; }
  70%  { box-shadow: 0 0 0 6px #f0a83000; }
  100% { box-shadow: 0 0 0 0 #f0a83000; }
}
.status-key { color: var(--faint); }
.status-val { color: var(--text); }
.status-sep { color: var(--faint); }

/* Hero / intro */
.intro { padding: 52px 0 34px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.intro .eyebrow {
  font-family: var(--fmono); font-size: 0.74rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 16px;
}
.intro h1.hero-title {
  font-family: var(--fdisp); font-weight: 600;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.12;
  letter-spacing: -0.02em; color: var(--bright); margin: 0 0 18px;
}
.intro p { color: var(--muted); font-size: 1.0rem; max-width: 58ch; margin: 0; }

/* Headings */
h1, h2, h3 {
  font-family: var(--fdisp); color: var(--bright);
  line-height: 1.25; font-weight: 600; letter-spacing: -0.015em;
}
h1 { font-size: 1.7rem; margin-top: 0; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

/* Post list — карточки */
.post-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 56px; }
.post-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 15px 16px; border-radius: var(--radius);
  border: 1px solid transparent; transition: background 0.16s ease, border-color 0.16s ease;
}
.post-row:hover { background: var(--surf); border-color: var(--line-bright); }
.post-row-date { font-family: var(--fmono); font-size: 0.74rem; color: var(--faint); flex-shrink: 0; width: 5.6em; }
.post-row-title { font-family: var(--ftext); font-weight: 500; font-size: 1.02rem; margin: 0; flex: 1; line-height: 1.4; }
.post-row-title a { color: var(--text); }
.post-row-title a:hover { color: var(--violet); }
.post-row-cat { font-family: var(--fmono); font-size: 0.72rem; color: var(--faint); flex-shrink: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.post-row-cat:hover { color: var(--violet-dim); }
.empty-state { font-family: var(--fmono); color: var(--faint); padding: 26px 16px; border: 1px dashed var(--line-bright); border-radius: var(--radius); }
.empty-state::before { content: "// "; color: var(--violet-dim); }

/* Category icons */
.cat-icon { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; color: var(--violet-dim); }
.cat-icon-break { opacity: 0.6; }
.post-meta-cat { display: inline-flex; align-items: center; gap: 6px; }
.post-meta-cat .cat-icon { width: 14px; height: 14px; }
h1 .cat-icon { width: 22px; height: 22px; vertical-align: -3px; margin-right: 8px; color: var(--gold); }

/* Tags — пилюли */
.post-tags { margin-top: 4px; }
.tag-pill {
  display: inline-block; font-family: var(--fmono); font-size: 0.72rem;
  padding: 3px 11px; margin: 2px 6px 2px 0; border-radius: 20px;
  background: var(--surf2); color: var(--muted); border: 1px solid var(--line);
}
.tag-pill::before { content: "#"; color: var(--violet-dim); }
.tag-pill:hover { border-color: var(--violet-dim); color: var(--bright); }

/* Full post */
.post-full .post-meta { font-family: var(--fmono); font-size: 0.78rem; color: var(--faint); margin-bottom: 16px; }
.post-full .post-meta a { color: var(--muted); }
.post-full .post-meta a:hover { color: var(--violet); }
.post-full h1 { font-size: 1.95rem; }
.post-full .post-body { margin-top: 30px; max-width: 700px; }
.post-full .post-body p { margin: 1.15em 0; }
.post-full .post-body h2 { margin-top: 2.1em; padding-top: 1.3em; border-top: 1px solid var(--line); }
.post-full .post-body h3 { margin-top: 1.6em; }
.post-full .post-body ul, .post-full .post-body ol { padding-left: 1.4em; }
.post-full .post-body li { margin: 0.5em 0; }
.post-full .post-body strong { color: var(--bright); }
.post-full .post-body a { border-bottom: 1px solid var(--violet-dim); }

.post-body pre {
  background: var(--bg2); border: 1px solid var(--line);
  border-left: 2px solid var(--violet-dim); border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; font-size: 0.86rem; line-height: 1.6;
}
.post-body code { font-family: var(--fmono); background: var(--surf2); color: #d8b4fe; padding: 2px 6px; border-radius: 4px; font-size: 0.88em; }
.post-body pre code { background: none; padding: 0; color: var(--text); }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 0.9rem; font-family: var(--fmono); }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; }
.post-body th { background: var(--surf); color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.post-body tr:nth-child(even) td { background: var(--bg2); }
.post-body blockquote { border-left: 2px solid var(--gold); margin: 1.4em 0; padding: 6px 18px; color: var(--muted); background: var(--gold-dim); border-radius: 0 var(--radius) var(--radius) 0; }

.back-link { margin-top: 46px; font-family: var(--fmono); font-size: 0.88rem; }
.back-link a { color: var(--muted); }
.back-link a:hover { color: var(--violet); }

/* Static pages */
.static-page { max-width: 660px; }
.static-page .page-body { margin-top: 22px; }
.static-page .page-body p { margin: 1.15em 0; color: var(--text); }
.static-page .page-body ul { padding-left: 1.4em; }
.static-page .page-body li { margin: 0.6em 0; }
.static-page .page-body strong { color: var(--bright); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 26px 0 60px; color: var(--faint); font-size: 0.8rem; font-family: var(--fmono); }
.site-footer a { color: var(--muted); }
.tag-cloud { margin-top: 14px; }

.hero-illustration { display: none; }

/* Responsive */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .intro { padding: 36px 0 26px; }
  .status-bar .wrap { gap: 12px; }
  .status-hide-sm { display: none; }
  .post-row { flex-wrap: wrap; gap: 3px 14px; padding: 13px 12px; }
  .post-row-date { width: auto; order: 1; }
  .post-row-cat { order: 2; }
  .post-row-title { order: 3; width: 100%; flex-basis: 100%; }
  h1 { font-size: 1.4rem; }
}

/* View counter */
.post-views { color: var(--faint); }
.post-views-num { color: var(--muted); }

/* ---------- Inline post diagrams ---------- */
.post-diagram-wrap { margin: 1.8em 0; overflow-x: auto; }
.post-diagram { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; }
.diagram-box {
  fill: var(--surf);
  stroke: var(--line-bright);
  stroke-width: 1.5;
}
.diagram-box-model { fill: var(--surf2); stroke: var(--violet-dim); }
.diagram-box-output { fill: var(--surf); stroke: var(--cyan-dim); }
.diagram-box-injected { fill: var(--gold-dim); stroke: var(--gold); stroke-dasharray: 4 3; }
.diagram-label {
  fill: var(--text);
  font-family: var(--fmono);
  font-size: 13px;
}
.diagram-label-dim { fill: var(--muted); font-size: 11px; }
.diagram-label-injected { fill: var(--gold); font-size: 12px; }
.diagram-arrow { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.diagram-trace { stroke: var(--gold); stroke-width: 1.5; fill: none; stroke-dasharray: 3 3; opacity: 0.7; }
