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

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

:root {
  --fg: #0D0D0D;
  --bg: #FAFAF5;
  --surface: #FAFAF5;
  --surface-alt: #EDEBE5;
  --muted: #666;
  --yellow: #FFE500;
  --blockquote-bg: #FFFCE0;
  --border: 3px solid var(--fg);
  --shadow-sm: 3px 3px 0 var(--fg);
  --shadow-md: 5px 5px 0 var(--fg);
  --shadow-lg: 8px 8px 0 var(--fg);
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
  --fg: #F0EDE6;
  --bg: #111111;
  --surface: #111111;
  --surface-alt: #1E1E1E;
  --muted: #888;
  --blockquote-bg: #1A1900;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s, color 0.2s;
}

/* prevent transition on page load (class added by JS after load) */
body.no-transition * {
  transition: none !important;
}

main { flex: 1; }

a { color: inherit; }

img { max-width: 100%; display: block; }

/* ─── HEADER ─── */
.site-header {
  border-bottom: var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  transition: background-color 0.2s;
}

.site-logo {
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
}

.site-logo .logo-dot {
  width: 10px;
  height: 10px;
  background: var(--yellow);
  border: 2px solid var(--fg);
  display: inline-block;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.85rem;
  border: 2px solid transparent;
  color: var(--fg);
  transition: all 0.1s;
}

.site-nav a:hover,
.site-nav a.active {
  border: 2px solid var(--fg);
  background: var(--yellow);
  color: #0D0D0D;
  box-shadow: var(--shadow-sm);
}

/* ─── THEME TOGGLE ─── */
.theme-toggle {
  width: 38px;
  height: 38px;
  border: 2px solid var(--fg);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  transition: all 0.1s;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--yellow);
  color: #0D0D0D;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* ─── HERO ─── */
.hero {
  padding: 5rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  border-bottom: var(--border);
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  color: #0D0D0D;
  display: inline-block;
  padding: 0.25rem 0.85rem;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin-bottom: 2rem;
}

.hero h1 em {
  font-style: normal;
  -webkit-text-stroke: 3px var(--fg);
  color: transparent;
}

.hero-desc {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  max-width: 480px;
  color: var(--muted);
  border-left: 5px solid var(--fg);
  padding-left: 1.25rem;
  margin-bottom: 3rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: var(--border);
  box-shadow: var(--shadow-md);
  transition: all 0.08s;
  cursor: pointer;
  user-select: none;
}

.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.btn-primary { background: var(--yellow); color: #0D0D0D; }
.btn-outline  { background: transparent; color: var(--fg); }
.btn-dark     { background: var(--fg); color: var(--bg); }

/* ─── SECTION LABEL ─── */
.section-block {
  padding: 4rem 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.section-label::before {
  content: '';
  display: block;
  width: 28px;
  height: 3px;
  background: var(--fg);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 2.5rem;
}

/* ─── POST GRID ─── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.post-card {
  border: var(--border);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: all 0.1s, background-color 0.2s;
  text-decoration: none;
  color: var(--fg);
}

.post-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.post-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.post-card-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-card-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--fg);
  color: var(--bg);
  padding: 0.15rem 0.55rem;
}

.post-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.post-card p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.5rem;
}

.post-card-footer {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 2px solid var(--fg);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-card-footer::after {
  content: '→';
  margin-left: auto;
  font-size: 1rem;
  font-weight: 700;
}

/* ─── LIST PAGE ─── */
.list-header {
  padding: 4rem 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  border-bottom: var(--border);
}

.list-header .post-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* ─── SINGLE POST ─── */
.post-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.post-back {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
  color: var(--fg);
  border-bottom: 2px solid transparent;
  transition: border-color 0.1s;
}

.post-back:hover { border-bottom-color: var(--fg); }

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  border: 2px solid var(--fg);
  text-decoration: none;
  color: var(--fg);
  transition: all 0.1s;
}

.tag:hover {
  background: var(--yellow);
  color: #0D0D0D;
  box-shadow: var(--shadow-sm);
}

.post-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 2.5rem;
  border-bottom: var(--border);
  margin-bottom: 3rem;
}

.post-meta-sep { color: var(--muted); }

/* ─── POST CONTENT ─── */
.post-content {
  font-size: 1.05rem;
  line-height: 1.82;
}

.post-content h2 {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 3rem 0 1.25rem;
  letter-spacing: -0.02em;
  border-bottom: 3px solid var(--fg);
  padding-bottom: 0.6rem;
  line-height: 1.15;
}

.post-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}

.post-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.post-content p { margin-bottom: 1.5rem; }

.post-content strong { font-weight: 800; }

.post-content em { font-style: italic; }

.post-content a {
  color: var(--fg);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: background 0.1s;
}

.post-content a:hover { background: var(--yellow); color: #0D0D0D; }

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-alt);
  border: 1px solid var(--fg);
  padding: 0.15rem 0.45rem;
  color: var(--fg);
}

.post-content pre {
  background: #0D0D0D;
  color: #E8E8E8;
  padding: 1.75rem;
  overflow-x: auto;
  border: 3px solid var(--fg);
  box-shadow: var(--shadow-md);
  margin: 2rem 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #E8E8E8;
  font-size: 1em;
}

.post-content blockquote {
  border: var(--border);
  border-left: 7px solid var(--yellow);
  background: var(--blockquote-bg);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.post-content blockquote p { margin-bottom: 0; color: var(--fg); }

.post-content ul,
.post-content ol {
  margin: 1.5rem 0;
  padding-left: 1.75rem;
}

.post-content li { margin-bottom: 0.6rem; }

.post-content hr {
  border: none;
  border-top: 3px solid var(--fg);
  margin: 3rem 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.post-content th {
  background: var(--fg);
  color: var(--bg);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.post-content td {
  padding: 0.75rem 1rem;
  border: 2px solid var(--fg);
  color: var(--fg);
}

.post-content tr:nth-child(even) td { background: var(--surface-alt); }

/* ─── ABOUT PAGE ─── */
.about-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.about-hero {
  border-bottom: var(--border);
  padding-bottom: 3rem;
  margin-bottom: 3rem;
}

.about-hero h1 {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 2rem;
}

.about-hero h1 em {
  font-style: normal;
  -webkit-text-stroke: 3px var(--fg);
  color: transparent;
}

.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  margin-top: 2rem;
}

.about-sidebar-item {
  margin-bottom: 2rem;
}

.about-sidebar-item .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.about-sidebar-item .value {
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 2px solid var(--fg);
  padding-bottom: 0.75rem;
}

.about-bio p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.about-bio blockquote {
  font-size: 1.25rem;
  font-weight: 700;
  border-left: 5px solid var(--yellow);
  padding-left: 1.5rem;
  margin: 2.5rem 0;
  font-style: italic;
  line-height: 1.5;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.ops-card {
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  background: var(--surface);
}

.ops-card .ops-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.ops-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.ops-card p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.skills-section { margin-top: 3rem; }

.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.skill-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid var(--fg);
  padding: 0.35rem 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg);
  transition: all 0.1s;
  background: transparent;
}

.skill-chip:hover {
  background: var(--yellow);
  color: #0D0D0D;
  box-shadow: var(--shadow-sm);
}

/* ─── CONTACT STRIP ─── */
.contact-strip {
  background: var(--yellow);
  border-top: var(--border);
  border-bottom: var(--border);
  padding: 3.5rem 2rem;
  margin-top: 4rem;
}

.contact-strip-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.contact-strip h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #0D0D0D;
}

.contact-strip-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-strip .btn-dark {
  background: #0D0D0D;
  color: #FAFAF5;
  border-color: #0D0D0D;
  box-shadow: 5px 5px 0 #0D0D0D;
}

.contact-strip .btn-outline {
  color: #0D0D0D;
  border-color: #0D0D0D;
  box-shadow: 5px 5px 0 #0D0D0D;
}

/* ─── STATS ROW ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: var(--border);
}

.stat-item {
  padding: 2rem 1.5rem;
  border-right: var(--border);
  text-align: center;
}

.stat-item:last-child { border-right: none; }

.stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ─── TAGS PAGE ─── */
.tags-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.tag-big {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 1.2rem;
  border: var(--border);
  text-decoration: none;
  color: var(--fg);
  box-shadow: var(--shadow-sm);
  transition: all 0.1s;
}

.tag-big:hover {
  background: var(--yellow);
  color: #0D0D0D;
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-md);
}

/* ─── 404 ─── */
.error-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 6rem 2rem;
  text-align: center;
}

.error-wrap h1 {
  font-size: 8rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  -webkit-text-stroke: 4px var(--fg);
  color: transparent;
  margin-bottom: 1rem;
}

.error-wrap p {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ─── FOOTER ─── */
.site-footer {
  border-top: var(--border);
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg);
  transition: background-color 0.2s;
}

.site-footer a {
  text-decoration: none;
  font-weight: 700;
  color: var(--fg);
}

.site-footer a:hover { text-decoration: underline; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stats-row .stat-item:nth-child(2) { border-right: none; }
}

@media (max-width: 640px) {
  .site-header { padding: 0 1.25rem; }
  .hero { padding: 3.5rem 1.25rem 3rem; }
  .posts-grid { grid-template-columns: 1fr; padding: 1.25rem 1.25rem 3rem; }
  .section-block { padding: 3rem 1.25rem 0; }
  .post-wrap { padding: 3rem 1.25rem; }
  .about-wrap { padding: 3rem 1.25rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .contact-strip { padding: 2.5rem 1.25rem; }
  .site-nav { display: none; }
  .site-footer { padding: 1.25rem; flex-direction: column; align-items: flex-start; }
}

@media print {
  .site-header, .site-footer, .post-back, .hero-actions { display: none; }
  body { font-size: 12pt; }
  .post-content pre { border: 1px solid #999; box-shadow: none; }
}

/* ─── PROGRESS BAR ─── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--yellow);
  border-right: 2px solid var(--fg);
  z-index: 200;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ─── COPY BUTTON ─── */
.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: #222;
  color: #aaa;
  border: 1px solid #444;
  padding: 0.2rem 0.65rem;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
}

.copy-btn:hover { background: var(--yellow); color: #0D0D0D; border-color: var(--yellow); }
.copy-btn.copied { background: #2a5; color: #fff; border-color: #2a5; }

/* ─── TICKER TAPE ─── */
.ticker-wrap {
  overflow: hidden;
  background: var(--yellow);
  border-top: var(--border);
  border-bottom: var(--border);
  height: 42px;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker 60s linear infinite;
}

.ticker-track span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0D0D0D;
  padding-right: 5rem;
}

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── TABLE OF CONTENTS ─── */
.post-wrap--toc { max-width: 1120px; }

.post-body { display: block; }

.post-wrap--toc .post-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 4rem;
  align-items: start;
}

.post-toc { position: sticky; top: 80px; }

.toc-inner {
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--fg);
}

.post-toc nav ul { list-style: none; padding: 0; margin: 0; }
.post-toc nav li { margin-bottom: 0.35rem; }

.post-toc nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--muted);
  display: block;
  padding: 0.15rem 0.5rem;
  border-left: 2px solid transparent;
  transition: all 0.1s;
  line-height: 1.4;
}

.post-toc nav a:hover {
  color: var(--fg);
  border-left-color: var(--yellow);
  background: var(--surface-alt);
}

.post-toc nav ul ul { padding-left: 0.75rem; margin-top: 0.2rem; }

/* ─── RELATED POSTS ─── */
.related-posts {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: var(--border);
}

.related-posts h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  margin-top: 0.4rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.related-card {
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.1s;
}

.related-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-md);
  background: var(--surface-alt);
}

.related-card h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.related-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: auto;
}

/* ─── SEARCH PAGE ─── */
.search-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.pagefind-ui {
  --pagefind-ui-scale: 0.9;
  --pagefind-ui-primary: #0D0D0D;
  --pagefind-ui-text: var(--fg);
  --pagefind-ui-background: var(--bg);
  --pagefind-ui-border: var(--fg);
  --pagefind-ui-border-width: 2px;
  --pagefind-ui-border-radius: 0px;
  --pagefind-ui-font: var(--font-mono);
}

/* ─── RESPONSIVE: TOC + RELATED ─── */
@media (max-width: 960px) {
  .post-wrap--toc .post-body { grid-template-columns: 1fr; }
  .post-toc { position: static; }
  .toc-inner { margin-bottom: 2rem; }
}

@media (max-width: 640px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* ─── TLP LABELS ─── */
.tlp-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.65rem;
  border: 2px solid;
  display: inline-block;
  vertical-align: middle;
}

.tlp-white, .tlp-clear { color: #555; border-color: #555; background: transparent; }
.tlp-green  { color: #1a6b1a; border-color: #1a6b1a; background: #e8f5e8; }
.tlp-amber  { color: #7a4000; border-color: #e07800; background: #fff3cd; }
.tlp-amber-strict { color: #7a4000; border-color: #e07800; background: #fff3cd; }
.tlp-red    { color: #b00000; border-color: #b00000; background: #fce8e8; }

[data-theme="dark"] .tlp-white,
[data-theme="dark"] .tlp-clear  { color: #aaa; border-color: #aaa; }
[data-theme="dark"] .tlp-green  { color: #4CAF50; border-color: #4CAF50; background: #0d1f0d; }
[data-theme="dark"] .tlp-amber  { color: #FFB300; border-color: #FFB300; background: #1f1500; }
[data-theme="dark"] .tlp-red    { color: #f44336; border-color: #f44336; background: #1f0505; }

/* ─── IOC TABLE ─── */
.ioc-table {
  margin: 2rem 0;
  border: var(--border);
  box-shadow: var(--shadow-md);
}

.ioc-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin: 0;
}

.ioc-table th {
  background: var(--red, #b00000);
  background: #b00000;
  color: #fff;
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: var(--border);
}

.ioc-table td {
  padding: 0.6rem 1rem;
  border-bottom: 2px solid var(--fg);
  color: var(--fg);
  word-break: break-all;
}

.ioc-table tr:last-child td { border-bottom: none; }
.ioc-table tr:nth-child(even) td { background: var(--surface-alt); }

/* ─── ATT&CK BADGES ─── */
.attack-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: #12122a;
  color: #c8c8ff;
  border: 2px solid #4444aa;
  padding: 0.2rem 0.7rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.1s;
  vertical-align: middle;
}

.attack-badge:hover {
  background: #1e1e4a;
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: var(--shadow-sm);
}

.attack-id { font-weight: 800; }
.attack-sep { opacity: 0.4; }
.attack-name { opacity: 0.85; }

/* ─── REDACTED TEXT ─── */
.redacted {
  background: var(--fg);
  color: transparent;
  cursor: pointer;
  user-select: none;
  padding: 0 0.25rem;
  transition: background 0.25s, color 0.25s;
  display: inline;
}

.redacted:hover,
.redacted.revealed {
  background: var(--yellow);
  color: var(--fg);
}

/* ─── MOBILE NAV ─── */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--fg);
  color: var(--fg);
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 1.1rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0.5rem;
  transition: all 0.1s;
}

.nav-toggle:hover {
  background: var(--yellow);
  color: #0D0D0D;
  border-color: var(--fg);
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: var(--border);
    border-top: var(--border);
    padding: 0.75rem 1.25rem;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 99;
  }

  .site-nav.open { display: flex; }

  .site-nav a {
    padding: 0.65rem 0.75rem;
    width: 100%;
    border: 2px solid transparent;
  }
}

/* ─── SERIES NAV ─── */
.series-nav {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: var(--border);
}

.series-nav h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  margin-top: 0.4rem;
}

.series-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.series-item {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 2px solid transparent;
  transition: all 0.1s;
}

.series-item:hover {
  border-color: var(--fg);
  color: var(--fg);
  background: var(--surface-alt);
  box-shadow: var(--shadow-sm);
}

.series-item.active {
  border-color: var(--fg);
  background: var(--yellow);
  color: #0D0D0D;
  font-weight: 700;
}

.series-num {
  font-weight: 800;
  font-size: 0.75rem;
  min-width: 1.5rem;
  text-align: center;
  background: var(--fg);
  color: var(--bg);
  padding: 0.1rem 0.3rem;
}

.series-item.active .series-num {
  background: #0D0D0D;
  color: var(--yellow);
}
