/* ===========================================================================
   BugsBunny - dark red-team editorial system
   Design tokens + components, translated from the approved handoff.
   Mobile hardening retained; responsive 404 page merged.
   =========================================================================== */

:root {
  /* dark surface levels & ink */
  --bg: #0a0a0c;
  --surface-1: #0d0d10;
  --surface-2: #111116;
  --surface-3: #15151a;
  --border: #26262e;
  --border-soft: rgba(255, 255, 255, 0.06);

  --ink-hi: #f6f6f8;
  --ink-strong: #f1f1f4;
  --ink-body: #cdced4;
  --ink-mid: #b4b4bd;
  --ink-muted: #9a9aa2;
  --ink-dim: #7a7a82;
  --ink-faint: #5a5a62;

  /* accents */
  --accent: #c62828;
  --diff-adv: #ef7a64;
  --diff-int: #d9a23a;
  --diff-beg: #5a9e6a;

  /* fonts */
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-serif: "Newsreader", Georgia, serif;

  /* layout */
  --measure: 68ch;
  --maxw: 75rem;
  --radius-chip: 0.375rem;
  --radius-btn: 0.5rem;
  --radius-card: 0.75rem;
  --radius-frame: 1rem;

  /* shadows / glows */
  --shadow-card: 0 12px 30px -24px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 16px 36px -22px rgba(198, 40, 40, 0.45);

  /* category cover tints */
  --cover-ad: linear-gradient(150deg, #14090c 0%, #101015 75%);
  --cover-internals: linear-gradient(150deg, #0e1014 0%, #101015 75%);
  --cover-exploit: linear-gradient(150deg, #100b07 0%, #101015 75%);
  --cover-redteam: linear-gradient(150deg, #14090c 0%, #101015 75%);
}

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

html {
  width: 100%;
  max-width: 100%;
  font-size: clamp(16px, 1.015625vw, 20.8px);
  scroll-behavior: smooth;
  overflow-x: hidden; /* fallback */
  overflow-x: clip;
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink-body);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* fallback */
  overflow-x: clip;
}

img,
svg,
video,
iframe {
  max-width: 100%;
  height: auto;
  display: block;
}
.pix { image-rendering: pixelated; image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; }
.mono { font-family: var(--font-mono); }
.sans { font-family: var(--font-body); }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--font-head); }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.625rem 1rem;
  border-radius: 0 0 0.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.skip-link:focus { left: 0; }

/* ---- Focus visibility ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---- Layout helpers ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 2.5rem; }
.wrap-narrow { max-width: 68.75rem; margin: 0 auto; padding: 0 2.5rem; }

/* =====================================================================
   NAV
   ===================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9375rem 2.5rem;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-brand { display: flex; align-items: center; gap: 0.75rem; }
.nav-brand img { height: 2.125rem; width: auto; filter: drop-shadow(0 0 6px rgba(198, 40, 40, 0.35)); }
.nav-brand .brand-name { font-size: 0.9375rem; font-weight: 600; color: var(--ink-strong); letter-spacing: 0.01em; line-height: 1; }
.nav-brand .brand-sub { font-family: var(--font-mono); font-size: 0.5625rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); margin-top: 3px; }
.nav-brand .brand-lockup { display: flex; flex-direction: column; }

.nav-links { display: flex; align-items: center; gap: 1.875rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; }
.nav-links a { color: var(--ink-dim); transition: color 0.2s ease; }
.nav-links a:hover { color: var(--ink-body); }
.nav-links a[aria-current="page"] { color: var(--ink-strong); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--ink-muted); transition: all 0.25s ease; }

@media (max-width: 720px) {
  .site-nav { padding: 13px 18px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 10, 12, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links[data-open="true"] { max-height: 240px; }
  .nav-links a { padding: 15px 24px; border-top: 1px solid var(--border-soft); font-size: 14px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer { background: var(--bg); border-top: 1px solid var(--border-soft); }
.site-footer .footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.875rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.875rem;
}
.footer-sig { display: flex; align-items: center; gap: 0.6875rem; }
.footer-sig img { height: 1.625rem; width: auto; opacity: 0.85; }
.footer-sig .mono { font-size: 0.6875rem; color: var(--ink-dim); }
.footer-social { display: flex; gap: 1.125rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-muted); }
.footer-social a { transition: color 0.2s ease; }
.footer-social a:hover { color: var(--accent); }

/* =====================================================================
   BUTTONS / CTAs
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5625rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  padding: 0.8125rem 1.375rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary { color: #fff; background: var(--accent); box-shadow: 0 10px 26px -14px var(--accent); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { color: var(--ink-body); border-color: var(--border); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink-strong); }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { position: relative; background: var(--bg); overflow: hidden; }

.hero-grid {
  position: absolute;
  inset: -30px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 76% 50%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 80% at 76% 50%, #000 0%, transparent 72%);
  animation: gridPan 26s linear infinite;
}
.hero-glow {
  position: absolute;
  left: 76%;
  top: 50%;
  width: 26.25rem;
  height: 26.25rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 60%, transparent) 0%, transparent 62%);
  filter: blur(10px);
  transform: translate(-50%, -50%);
  animation: glowPulse 7s ease-in-out infinite;
}

.hero-inner {
  position: relative;
  z-index: 4;
  max-width: min(82.5rem, calc(100% - 4rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 2.5rem;
  align-items: center;
  padding: clamp(2.5rem, 7vh, 5rem) 0;
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; }
.hero-eyebrow { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 1.375rem; }
.hero-eyebrow .prompt { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.hero-eyebrow .rule { width: 2.625rem; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }
.hero-eyebrow .tail { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.1em; color: var(--ink-dim); }

.hero-title {
  margin: 0;
  font-size: clamp(3rem, 3.6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--ink-hi);
  max-width: 14ch;
}
.hero-title .accent { color: var(--accent); }
.caret {
  display: inline-block;
  width: 5px;
  height: 0.82em;
  background: var(--accent);
  margin-left: 0.5rem;
  transform: translateY(6px);
  vertical-align: baseline;
  animation: blink 1.1s step-end infinite;
}
.hero-sub { margin: 1.375rem 0 0; font-size: 1.0625rem; line-height: 1.5; color: var(--ink-mid); max-width: 46ch; }

.hero-topics { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.625rem; }
.hero-topics span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  padding: 0.375rem 0.6875rem;
}
.hero-ctas { display: flex; align-items: center; gap: 1rem; margin-top: 2.125rem; flex-wrap: wrap; }

/* mascot artifact */
.artifact-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.artifact-group { cursor: default; position: relative; display: flex; align-items: center; justify-content: center; }
.artifact-glow-hover {
  position: absolute; left: 50%; top: 50%;
  width: 28.75rem; height: 28.75rem; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 72%, transparent) 0%, transparent 60%);
  filter: blur(12px);
  transform: translate(-50%, -50%);
  opacity: 0; pointer-events: none; z-index: 0;
  transition: opacity 0.55s ease;
}
.artifact-ring {
  position: absolute; left: 50%; top: 50%;
  width: 14.375rem; height: 14.375rem;
  border: 1px solid color-mix(in oklab, var(--accent) 55%, transparent);
  border-radius: 1.5rem; z-index: 1;
  animation: ringExpand 5.5s ease-out infinite;
}
.artifact-float { position: relative; z-index: 2; animation: glowDrift 13s ease-in-out infinite; }
.dossier {
  position: relative;
  width: clamp(17.5rem, 20vw, 23.75rem);
  background: linear-gradient(160deg, #161318 0%, #100d11 100%);
  border: 1px solid #34272b;
  border-radius: 1.125rem;
  padding: 1.625rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.dossier-scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 6px);
  animation: scan 1.4s linear infinite;
  pointer-events: none;
}
.dossier-shimmer {
  position: absolute; left: 0; top: 0; width: 100%; height: 45%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateY(-130%); opacity: 0; pointer-events: none; z-index: 3;
}
.dossier .tick { position: absolute; width: 12px; height: 12px; }
.dossier .tick.tl { top: 10px; left: 10px; border-top: 1px solid #4a3a3e; border-left: 1px solid #4a3a3e; }
.dossier .tick.tr { top: 10px; right: 10px; border-top: 1px solid #4a3a3e; border-right: 1px solid #4a3a3e; }
.dossier .tick.bl { bottom: 10px; left: 10px; border-bottom: 1px solid #4a3a3e; border-left: 1px solid #4a3a3e; }
.dossier .tick.br { bottom: 10px; right: 10px; border-bottom: 1px solid #4a3a3e; border-right: 1px solid #4a3a3e; }
.dossier-head { position: relative; display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.875rem; }
.dossier-head .fig { font-family: var(--font-mono); font-size: 0.5625rem; letter-spacing: 0.14em; text-transform: uppercase; color: #7d6a6e; }
.dossier-head .live { font-family: var(--font-mono); font-size: 0.5625rem; letter-spacing: 0.14em; color: var(--accent); }
.dossier-mark { position: relative; display: flex; align-items: center; justify-content: center; padding: 0.875rem 0 1.125rem; }
.mark-float { position: relative; animation: floatY 5.5s ease-in-out infinite; }
.mark-float img { height: clamp(8.75rem, 14vw, 13.75rem); width: auto; filter: drop-shadow(0 6px 22px rgba(198, 40, 40, 0.45)); transition: filter 0.5s ease; }
.mark-float .pix-hover {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  height: clamp(8.75rem, 14vw, 13.75rem); width: auto;
  filter: drop-shadow(0 6px 22px rgba(198, 40, 40, 0.45));
  opacity: 0; transition: opacity 0.06s; pointer-events: none;
}
.eye-bloom {
  position: absolute; left: 50%; top: 60%; width: 7.5rem; height: 2.125rem;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(232, 42, 42, 0.62) 0%, transparent 70%);
  filter: blur(3px); mix-blend-mode: screen; opacity: 0.55; pointer-events: none;
  animation: blinkRare 9s ease-in-out infinite;
  transition: opacity 0.4s ease;
}
.eye-flare {
  position: absolute; left: 54%; top: 57%; width: 7px; height: 7px; border-radius: 50%;
  background: #ffd4d4; box-shadow: 0 0 12px 3px rgba(232, 62, 62, 0.9);
  transform: translate(-50%, -50%) scale(0); opacity: 0; pointer-events: none;
}
.eye-lid {
  position: absolute; left: 50%; top: 57%;
  width: 88px; height: 20px;
  transform: translate(-50%, -50%) scaleY(0);
  background: #0d090b;
  border-radius: 50%;
  opacity: 0; pointer-events: none;
  transform-origin: center;
}
.dossier-foot { position: relative; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #2a2024; padding-top: 0.75rem; }
.dossier-foot span { font-family: var(--font-mono); font-size: 0.5625rem; color: #6a5a5e; letter-spacing: 0.06em; }
.artifact-spark { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #e87070; z-index: 2; }
.artifact-spark.s1 { left: 34%; bottom: 18%; animation: spark 5s ease-out infinite; }
.artifact-spark.s2 { left: 62%; bottom: 14%; animation: spark 6.2s ease-out infinite 1.8s; }

/* hover interaction (pointer devices) */
@media (hover: hover) {
  .artifact-group:hover .artifact-glow-hover { opacity: 0.85; }
  .artifact-group:hover .mark-float img { filter: drop-shadow(0 8px 32px rgba(232, 62, 62, 0.8)); }
  .artifact-group:hover .mark-float .pix { opacity: 0; transition: opacity 0.06s; }
  .artifact-group:hover .mark-float .pix-hover { opacity: 1; }
  .artifact-group:hover .dossier-shimmer { animation: shimmerRun 0.9s ease-out; }

}

/* hero → next section transition */
.hero-fade { position: relative; z-index: 4; height: 5.625rem; background: linear-gradient(180deg, transparent 0%, var(--surface-1) 100%); }

/* =====================================================================
   SECTION SHELL
   ===================================================================== */
.section { padding: 4rem 0 3.75rem; }
.section-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 2.5rem; }
.section-prompt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 0.875rem; }
.section-title { margin: 0; font-size: 2.125rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-hi); line-height: 1.1; }
.section-lead { margin: 0.75rem 0 0; font-size: 1rem; line-height: 1.5; color: var(--ink-mid); max-width: 52ch; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2.5rem; gap: 1.5rem; flex-wrap: wrap; }
.section-head .count { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-dim); white-space: nowrap; }
.view-all { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }

.surface-1 { background: var(--surface-1); }

/* =====================================================================
   FOCUS CARDS
   ===================================================================== */
.focus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.focus-card {
  position: relative;
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.375rem;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.focus-card:hover { border-color: var(--accent); transform: translateY(-3px); background: #160a0d; box-shadow: var(--shadow-lift); }
.focus-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.focus-card .idx { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-dim); letter-spacing: 0.04em; }
.focus-card .diamond { width: 10px; height: 10px; background: var(--accent); transform: rotate(45deg); border-radius: 1px; }
.focus-card .name { font-size: 1.0625rem; font-weight: 600; color: var(--ink-strong); line-height: 1.25; margin-bottom: 0.625rem; }
.focus-card .blurb { margin: 0 0 1.125rem; font-size: 0.84375rem; line-height: 1.5; color: #a6a6ae; }
.focus-card .foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 0.875rem; }
.focus-card .foot .n { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-mid); }
.focus-card .foot .arrow { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); }

/* =====================================================================
   WRITEUP CARDS + COVERS
   ===================================================================== */
.writeup-card {
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.writeup-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.cover { position: relative; height: 8.25rem; overflow: hidden; display: flex; align-items: flex-end; padding: 0.875rem; border-bottom: 1px solid var(--border); }
.cover.cat-active-directory, .cover.cat-red-teaming { background: var(--cover-ad); }
.cover.cat-windows-internals { background: var(--cover-internals); }
.cover.cat-exploit-development { background: var(--cover-exploit); }
.cover-code {
  position: absolute; inset: 0; padding: 0.875rem;
  font-family: var(--font-mono); font-size: 0.625rem; line-height: 1.7;
  color: #fff; opacity: 0.05; white-space: pre; pointer-events: none; overflow: hidden;
}
.cover-title { position: relative; font-family: var(--font-mono); font-size: 1.375rem; font-weight: 700; color: #e8e6ea; letter-spacing: -0.02em; }
.cover-image { background: repeating-linear-gradient(135deg, #16161b 0, #16161b 8px, #121217 8px, #121217 16px); align-items: center; justify-content: center; }
.cover-image img { height: 100%; width: 100%; object-fit: cover; position: absolute; inset: 0; }
.cover-image .placeholder { font-family: var(--font-mono); font-size: 0.625rem; color: var(--ink-faint); }
.cover-mark { background: var(--surface-1); align-items: center; justify-content: center; gap: 0.625rem; }
.cover-mark .diamond { width: 14px; height: 14px; background: var(--accent); transform: rotate(45deg); border-radius: 1px; }
.cover-mark .slug { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-body); }

.card-body { padding: 1.25rem; }
.card-cat { font-family: var(--font-mono); font-size: 0.625rem; color: #a6a6ae; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.8125rem; }
.card-title { margin: 0 0 0.625rem; font-size: 1.03125rem; font-weight: 600; line-height: 1.3; color: var(--ink-strong); }
.card-excerpt { margin: 0 0 1rem; font-size: 0.8125rem; line-height: 1.55; color: #a6a6ae; }
.card-tags { display: flex; gap: 0.375rem; margin-bottom: 0.875rem; flex-wrap: wrap; }
.card-tag { font-family: var(--font-mono); font-size: 0.625rem; color: var(--ink-dim); background: #16161c; border: 1px solid var(--border); border-radius: 4px; padding: 3px 7px; }
.card-meta { display: flex; align-items: center; gap: 0.875rem; border-top: 1px solid #24242b; padding-top: 0.8125rem; }
.card-meta .m { font-family: var(--font-mono); font-size: 0.65625rem; color: var(--ink-muted); }
.diff { font-family: var(--font-mono); font-size: 0.65625rem; margin-left: auto; display: inline-flex; align-items: center; gap: 5px; }
.diff .dot { width: 5px; height: 5px; border-radius: 50%; }

/* =====================================================================
   FEATURED WRITEUP CARD
   ===================================================================== */
.featured-card {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.featured-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 22px 50px -26px rgba(198, 40, 40, 0.5); }
.featured-cover {
  position: relative; min-height: 20rem;
  border-right: 1px solid var(--border); overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 1.5rem;
}
.featured-cover.cat-active-directory, .featured-cover.cat-red-teaming { background: linear-gradient(155deg, #15090c 0%, #0d0d12 70%); }
.featured-cover.cat-windows-internals { background: linear-gradient(155deg, #0e1014 0%, #0d0d12 70%); }
.featured-cover.cat-exploit-development { background: linear-gradient(155deg, #100b07 0%, #0d0d12 70%); }
.featured-cover .fc-code { position: absolute; inset: 0; padding: 1.375rem; font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1.7; color: #fff; opacity: 0.05; white-space: pre; overflow: hidden; pointer-events: none; }
.featured-cover .fc-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; }
.featured-badge { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.08em; color: #fff; background: var(--accent); border-radius: 5px; padding: 5px 10px; }
.featured-cover .fc-tag { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.1em; color: #9a6a6e; }
.featured-cover .fc-glyph { position: relative; }
.featured-cover .fc-cat { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.375rem; }
.featured-cover .fc-big { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.02em; color: #f0eef0; line-height: 1.05; font-family: var(--font-head); }
.featured-meta { padding: 2.125rem 2.25rem; display: flex; flex-direction: column; justify-content: center; }
.featured-pills { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pill { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-body); border: 1px solid #34343c; border-radius: 5px; padding: 4px 9px; }
.pill-diff { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #4a2a24; }
.pill-diff .dot { width: 6px; height: 6px; border-radius: 50%; }
.featured-title { margin: 0 0 0.875rem; font-size: 1.6875rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; color: var(--ink-hi); }
.featured-excerpt { margin: 0 0 1.375rem; font-size: 0.9375rem; line-height: 1.6; color: #b8b8c0; max-width: 52ch; }
.featured-metarow { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.625rem; flex-wrap: wrap; }
.featured-metarow .m { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-muted); }
.featured-metarow .sep { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-faint); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.125rem; }

/* =====================================================================
   WRITEUPS LISTING - page header, filters, empty state
   ===================================================================== */
.page-header { padding: 3.25rem 0 1.875rem; border-bottom: 1px solid var(--border-soft); }
.page-header .ph-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 2.5rem; display: flex; justify-content: space-between; align-items: flex-end; gap: 1.875rem; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 2.625rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; color: var(--ink-hi); }
.page-lead { margin: 0.875rem 0 0; max-width: 60ch; font-size: 1rem; line-height: 1.55; color: var(--ink-mid); }

.filter-bar {
  border-bottom: 1px solid var(--border-soft);
}
.filter-bar .fb-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 1.375rem 2.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 0.5625rem; flex-wrap: wrap; }
.filter-label { font-family: var(--font-mono); font-size: 0.625rem; color: var(--ink-dim); letter-spacing: 0.1em; text-transform: uppercase; margin-right: 3px; }
.chip {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-body);
  background: var(--surface-3); border: 1px solid #2c2c34; border-radius: 1rem;
  padding: 0.4375rem 0.9375rem; cursor: pointer; transition: all 0.2s ease;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.chip-diff { display: inline-flex; align-items: center; gap: 6px; border-radius: 0.875rem; color: var(--ink-muted); padding: 0.375rem 0.75rem; font-size: 0.6875rem; }
.chip-diff .dot { width: 5px; height: 5px; border-radius: 50%; }
.chip-diff[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }

.search-box { display: flex; align-items: center; gap: 0.5rem; background: var(--surface-3); border: 1px solid #2c2c34; border-radius: 0.5rem; padding: 0.5rem 0.75rem; width: 12.5rem; }
.search-box:focus-within { border-color: var(--accent); }
.search-box .icon { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-dim); }
.search-box input { background: none; border: 0; outline: none; color: var(--ink-body); font-family: var(--font-mono); font-size: 0.75rem; width: 100%; }
.search-box input::placeholder { color: var(--ink-faint); }

.listing-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.375rem; }
.listing-toolbar .mono { font-size: 0.75rem; color: var(--ink-dim); }

.load-more { display: flex; justify-content: center; margin-top: 2.125rem; }
.load-more button { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-body); border: 1px solid #2c2c34; border-radius: 0.5rem; padding: 0.6875rem 1.375rem; background: transparent; cursor: pointer; transition: border-color 0.2s ease; }
.load-more button:hover { border-color: var(--accent); }

.empty-state {
  display: none;
  flex-direction: column; align-items: center; text-align: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 0.875rem;
  padding: 2.875rem 1.875rem;
}
.empty-state.visible { display: flex; }
.empty-state img { height: 3.375rem; width: auto; opacity: 0.35; filter: grayscale(0.4); margin-bottom: 1.125rem; }
.empty-state .grep { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); margin-bottom: 0.625rem; }
.empty-state .et { font-size: 1.125rem; font-weight: 600; color: var(--ink-strong); margin-bottom: 0.5rem; }
.empty-state p { margin: 0 0 1.125rem; font-size: 0.875rem; line-height: 1.55; color: var(--ink-muted); max-width: 42ch; }

.mobile-filters { display: none; }

/* =====================================================================
   ARTICLE READING PAGE
   ===================================================================== */
.reading-progress { position: sticky; top: 0; z-index: 31; height: 3px; background: #1a1a20; }
.reading-progress .bar { height: 3px; width: 0; background: var(--accent); transition: width 0.1s linear; }
/* nav sits just below the progress bar */
.has-progress .site-nav { top: 3px; }

.breadcrumb { max-width: 73.75rem; margin: 0 auto; padding: 1.375rem 2.5rem 0; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-dim); letter-spacing: 0.04em; }
.breadcrumb a { color: #8a8a92; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: #4a4a52; }
.breadcrumb .current { color: var(--ink-mid); }

.article-header { max-width: 47.5rem; margin: 0 auto; padding: 1.375rem 2.5rem; text-align: center; }
.article-header .pills { display: flex; justify-content: center; gap: 0.625rem; margin-bottom: 1rem; flex-wrap: wrap; }
.article-header .pill { font-size: 0.6875rem; padding: 5px 11px; border-radius: 6px; }
.article-header .pill-diff { border: 1px solid #4a2a24; }
.article-title { margin: 0; font-size: 2.5rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; color: #f7f7f9; }
.article-excerpt { margin: 0.875rem auto 0; max-width: 62ch; font-size: 1.0625rem; line-height: 1.5; color: #a8a8b0; }
.article-author { display: flex; justify-content: center; align-items: center; gap: 0.875rem; margin-top: 1.25rem; }
.article-author img { height: 2rem; width: auto; border: 1px solid var(--border); border-radius: 0.5rem; padding: 3px; background: var(--surface-2); }
.article-author .name { font-size: 0.8125rem; font-weight: 600; color: #e8e8ec; text-align: left; }
.article-author .date { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-dim); margin-top: 2px; text-align: left; }

.article-cover { max-width: 62.5rem; margin: 0 auto 0.5rem; padding: 0 2.5rem; }
.article-cover .ac-inner {
  position: relative; height: 13.75rem; border-radius: 0.875rem; overflow: hidden;
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
}
.article-cover.cat-active-directory .ac-inner, .article-cover.cat-red-teaming .ac-inner { background: linear-gradient(150deg, #15090c 0%, #0d0d12 72%); }
.article-cover.cat-windows-internals .ac-inner { background: linear-gradient(150deg, #0e1014 0%, #0d0d12 72%); }
.article-cover.cat-exploit-development .ac-inner { background: linear-gradient(150deg, #100b07 0%, #0d0d12 72%); }
.article-cover .ac-code { position: absolute; inset: 0; padding: 1.5rem; font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.8; color: #fff; opacity: 0.06; white-space: pre; overflow: hidden; }
.article-cover .ac-glyph { position: relative; text-align: center; }
.article-cover .ac-cat { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.article-cover .ac-big { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.02em; color: #f0eef0; font-family: var(--font-head); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

.art-grid {
  width: 100%;
  max-width: 68.75rem;
  min-width: 0;
  margin: 0 auto;
  padding: 1.875rem 2.5rem 2.5rem;
  display: grid;
  grid-template-columns: 13.125rem minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

/* TOC */
.toc-rail { position: sticky; top: 6rem; }
.toc-rail .toc-head { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 1rem; }
.toc-rail nav { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid #24242b; }
.toc-rail nav a {
  font-size: 0.8125rem; color: #8a8a92; padding: 0.4375rem 0 0.4375rem 1rem;
  border-left: 2px solid transparent; margin-left: -1px; transition: color 0.2s ease, border-color 0.2s ease;
}
.toc-rail nav a.lvl-3 { padding-left: 1.75rem; font-size: 0.78125rem; }
.toc-rail nav a:hover { color: var(--ink-body); }
.toc-rail nav a.active { color: var(--ink-body); border-left-color: var(--accent); }
.toc-actions { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid #24242b; display: flex; flex-direction: column; gap: 0.6875rem; }
.toc-actions button { background: none; border: 0; text-align: left; cursor: pointer; font-family: var(--font-mono); font-size: 0.8125rem; color: #8a8a92; padding: 0; transition: color 0.2s ease; }
.toc-actions button:hover { color: var(--accent); }

.toc-inline { display: none; margin: 0 0 1.75rem; background: var(--surface-1); border: 1px solid var(--border); border-radius: 0.5625rem; }
.toc-inline summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 0.8125rem 1rem; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary .label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-body); }
.toc-inline summary .count { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--accent); }
.toc-inline .toc-links { display: flex; flex-direction: column; gap: 2px; padding: 0 1rem 0.875rem; }
.toc-inline .toc-links a { font-size: 0.8125rem; color: #8a8a92; padding: 0.375rem 0; }
.toc-inline .toc-links a.lvl-3 { padding-left: 0.875rem; }

/* =====================================================================
   PROSE
   ===================================================================== */
.prose {
  width: 100%;
  max-width: var(--measure);
  min-width: 0;
}
.prose > * {
  min-width: 0;
  max-width: 100%;
}
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.375rem; font-size: 1.0625rem; line-height: 1.75; color: var(--ink-body); font-family: var(--font-body); }
.prose h2 { margin: 2.625rem 0 0.9375rem; font-size: 1.5625rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-hi); font-family: var(--font-head); scroll-margin-top: 5.5rem; }
.prose h3 { margin: 2rem 0 0.6875rem; font-size: 1.1875rem; font-weight: 600; color: #ececed; font-family: var(--font-head); scroll-margin-top: 5.5rem; }
.prose h4 { margin: 1.5rem 0 0.5625rem; font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.01em; color: #d8d8de; font-family: var(--font-body); scroll-margin-top: 5.5rem; }
.prose strong { color: #f0f0f3; font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.375rem; padding-left: 1.375rem; }
.prose li { font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.7; color: var(--ink-body); margin-bottom: 0.5rem; }
.prose p,
.prose li,
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.callout p,
.article-excerpt,
.refs .ref-text,
.tested-on .to-val {
  overflow-wrap: anywhere;
  word-break: normal;
}
.prose a:not(.header-anchor) { color: #ef8a78; border-bottom: 1px solid #5a2e2a; transition: color 0.2s ease; }
.prose a:not(.header-anchor):hover { color: #ff9d8c; }
.prose .header-anchor { color: inherit; border: 0; }

/* inline technical tokens */
.prose code, code.tok { font-family: var(--font-mono); font-size: 0.86em; background: #16161c; border: 1px solid #2a2a32; border-radius: 5px; padding: 1px 6px; color: #d2d3da; overflow-wrap: anywhere; word-break: break-word; }
.t-cmd { font-family: var(--font-mono); font-size: 0.86em; background: #1a0f10; border: 1px solid #3e2422; border-radius: 5px; padding: 1px 6px; color: #ef9a8e; }
.t-path { font-family: var(--font-mono); font-size: 0.86em; background: #0f1216; border: 1px solid #243038; border-radius: 5px; padding: 1px 6px; color: #9fb6c8; }
.t-reg { font-family: var(--font-mono); font-size: 0.86em; background: #161206; border: 1px solid #36300f; border-radius: 5px; padding: 1px 6px; color: #d9b07a; }
.t-ph { font-family: var(--font-mono); font-size: 0.86em; background: transparent; border: 1px dashed #4a4a54; border-radius: 5px; padding: 1px 6px; color: var(--ink-muted); }
.t-red { font-family: var(--font-mono); font-size: 0.86em; background: #26262c; border-radius: 4px; padding: 1px 8px; color: #75757e; letter-spacing: 0.04em; }
kbd { font-family: var(--font-mono); font-size: 0.8em; background: #1c1c22; border: 1px solid #36363e; border-bottom-width: 2px; border-radius: 5px; padding: 2px 7px; color: #dcdce2; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }

/* blockquote */
.prose blockquote { margin: 0 0 1.625rem; border-left: 3px solid #34343c; padding: 0.375rem 0 0.375rem 1.375rem; }
.prose blockquote p { font-size: 1.25rem; line-height: 1.55; color: var(--ink-body); font-style: italic; font-family: var(--font-serif); margin: 0; }

/* =====================================================================
   CODE BLOCK component (emitted by markdown fence renderer)
   ===================================================================== */
.codeblock { width: 100%; max-width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 0.625rem; overflow: hidden; margin: 0 0 1.625rem; background: #0e0e12; }
.codeblock-bar { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.625rem 0.875rem; background: #141419; border-bottom: 1px solid var(--border); }
.codeblock-lang { min-width: 0; font-size: 0.6875rem; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codeblock-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 0.875rem; }
.codeblock-actions button { background: none; border: 0; cursor: pointer; font-family: var(--font-mono); font-size: 0.6875rem; padding: 0; }
.codeblock-wrap { color: #6a6a72; transition: color 0.2s ease; }
.codeblock-wrap:hover, .codeblock-wrap[aria-pressed="true"] { color: var(--ink-body); }
.codeblock-copy { color: var(--accent); }
.codeblock-copy.copied { color: var(--diff-beg); }
.codeblock-copy.error { color: var(--diff-int); }
.codeblock pre { width: 100%; max-width: 100%; min-width: 0; margin: 0; padding: 1rem 1.125rem; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; color: #d6d6dd; overflow-x: auto; overscroll-behavior-inline: contain; white-space: pre; }
.codeblock pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
pre.wrap { white-space: pre-wrap !important; word-break: break-word; }
.codescroll { scrollbar-width: thin; scrollbar-color: #2e2e36 #0b0b0e; }
.codescroll::-webkit-scrollbar { height: 9px; }
.codescroll::-webkit-scrollbar-track { background: #0b0b0e; }
.codescroll::-webkit-scrollbar-thumb { background: #2e2e36; border-radius: 5px; border: 2px solid #0b0b0e; }
.codescroll::-webkit-scrollbar-thumb:hover { background: #3c3c46; }

/* Prism token colors - restrained, dark-mode tuned */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #7a7a82; }
.token.punctuation { color: #9a9aa2; }
.token.string, .token.char, .token.attr-value, .token.inserted { color: #9ed29e; }
.token.number, .token.boolean, .token.constant { color: #d9b07a; }
.token.keyword, .token.selector, .token.tag, .token.deleted { color: #ef9a8e; }
.token.function, .token.class-name { color: #c4c4cc; }
.token.operator, .token.variable, .token.property { color: #c0c0c8; }
.token.attr-name, .token.namespace { color: #9fb6c8; }

/* =====================================================================
   CALLOUTS
   ===================================================================== */
.callout { width: 100%; max-width: 100%; min-width: 0; border-left: 3px solid var(--accent); border-radius: 0 0.5rem 0.5rem 0; padding: 1rem 1.25rem; margin: 0 0 1.625rem; background: #160a0c; }
.callout .co-label { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem; color: var(--accent); }
.callout p { margin: 0; font-size: 0.9375rem; line-height: 1.6; font-family: var(--font-body); color: #d4c2c2; }
.callout.note { border-color: var(--accent); background: #160a0c; }
.callout.note .co-label { color: var(--accent); }
.callout.warning { border-color: var(--diff-int); background: #15110a; }
.callout.warning .co-label { color: var(--diff-int); }
.callout.warning p { color: #d8cdb8; }
.callout.opsec { border-color: #b5482f; background: #160c0a; }
.callout.opsec .co-label { color: #d97a5e; }
.callout.opsec p { color: #d8c3ba; }
.callout.tip { border-color: var(--diff-beg); background: #0b130d; }
.callout.tip .co-label { color: var(--diff-beg); }
.callout.tip p { color: #bdccc0; }
.callout.reference { border-color: #6a7a8c; background: #0e1115; }
.callout.reference .co-label { color: #9fb6c8; }
.callout.reference p { color: #c0c8d0; }

/* =====================================================================
   FIGURE
   ===================================================================== */
.prose figure { width: 100%; max-width: 100%; min-width: 0; margin: 0 0 0.875rem; }
.prose figure .frame {
  border-radius: 0.625rem; border: 1px solid var(--border); overflow: hidden;
  background: repeating-linear-gradient(135deg, #16161b 0, #16161b 9px, #121217 9px, #121217 18px);
  display: flex; align-items: center; justify-content: center; min-height: 12.5rem;
}
.prose figure img { border-radius: 0.625rem; border: 1px solid var(--border); }
.prose figure .ph { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-faint); }
.prose figcaption { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-dim); text-align: center; margin-top: 0.625rem; }

/* =====================================================================
   TABLE
   ===================================================================== */
.prose .tscroll, .tscroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--border); border-radius: 0.625rem; margin: 0 0 1.625rem; scrollbar-width: thin; scrollbar-color: #2e2e36 #0b0b0e; }
.prose table, table.tbl { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-family: var(--font-body); min-width: 460px; }
.prose table thead th, table.tbl thead th { text-align: left; font-family: var(--font-mono); font-size: 0.65625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mid); background: #141419; padding: 0.6875rem 1rem; border-bottom: 1px solid #2c2c34; }
.prose table td, table.tbl td { padding: 0.6875rem 1rem; border-bottom: 1px solid #1e1e24; color: #c4c4cc; line-height: 1.5; vertical-align: top; overflow-wrap: anywhere; }
.prose table tr:last-child td, table.tbl tr:last-child td { border-bottom: none; }
.prose table tbody tr:hover td, table.tbl tbody tr:hover td { background: #101015; }

/* =====================================================================
   ARTICLE FOOTER BITS - tested-on, refs, tags, prev/next, related
   ===================================================================== */
.tested-on { width: 100%; max-width: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 1.125rem 1.625rem; background: #0e0e12; border: 1px solid var(--border); border-radius: 0.625rem; padding: 1rem 1.25rem; margin: 0 0 1.625rem; }
.tested-on .to-label { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 5px; }
.tested-on .to-val { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-body); }
.tested-on .to-val.ok { color: #9ed29e; }

.refs { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.25rem; }
.refs a { min-width: 0; display: flex; gap: 0.75rem; align-items: baseline; }
.refs .num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }
.refs .ref-text { font-size: 0.9375rem; color: var(--ink-body); font-family: var(--font-serif); }

.tag-footer { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2.125rem; padding-top: 1.5rem; border-top: 1px solid #24242b; }
.tag-footer a { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-muted); border: 1px solid var(--border); border-radius: 0.375rem; padding: 0.375rem 0.6875rem; transition: border-color 0.2s ease, color 0.2s ease; }
.tag-footer a:hover { border-color: var(--accent); color: var(--ink-body); }

.prevnext { max-width: 68.75rem; margin: 0 auto; padding: 0 2.5rem 3rem; }
.prevnext .pn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pn-card { display: flex; flex-direction: column; gap: 0.5rem; background: var(--surface-1); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem 1.375rem; transition: transform 0.25s ease, border-color 0.25s ease; }
.pn-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pn-card.next { align-items: flex-end; text-align: right; }
.pn-card .pn-label { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--accent); }
.pn-card .pn-title { font-size: 1rem; font-weight: 600; color: #ececed; line-height: 1.3; }

.related { background: var(--surface-1); border-top: 1px solid var(--border-soft); }
.related .rel-inner { max-width: 68.75rem; margin: 0 auto; padding: 2.875rem 2.5rem 3.75rem; }
.related .rel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.related .rel-head h2 { margin: 0; font-size: 1.375rem; font-weight: 700; color: var(--ink-hi); letter-spacing: -0.01em; }

/* =====================================================================
   ABOUT PAGE
   ===================================================================== */
.about-intro { display: grid; grid-template-columns: 18.75rem 1fr; gap: 3rem; padding: 3.75rem 0 3.5rem; align-items: start; }
.about-intro-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 2.5rem; }
.about-mark { display: flex; flex-direction: column; gap: 1.125rem; }
.about-mark .frame {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-frame);
  background: linear-gradient(160deg, #15090c 0%, #0d0d12 75%);
  padding: 1.875rem; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.about-mark .frame .glow { position: absolute; left: 50%; top: 50%; width: 13.75rem; height: 13.75rem; border-radius: 50%; background: radial-gradient(circle, color-mix(in oklab, var(--accent) 45%, transparent) 0%, transparent 64%); filter: blur(8px); transform: translate(-50%, -50%); }
.about-mark .frame img { position: relative; height: 9.375rem; width: auto; filter: drop-shadow(0 6px 22px rgba(198, 40, 40, 0.45)); }
.about-identity { border: 1px solid var(--border); border-radius: 0.75rem; padding: 1rem 1.125rem; background: var(--surface-1); }
.about-identity .ai-head { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.625rem; }
.about-identity .row { display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--ink-body); margin-bottom: 0.4375rem; }
.about-identity .row:last-child { margin-bottom: 0; }
.about-identity .row .k { color: var(--ink-dim); }
.about-identity .row .v { font-family: var(--font-mono); font-size: 0.75rem; }

.about-bio .prompt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 1rem; }
.about-bio h1 { margin: 0 0 0.375rem; font-size: 2.375rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; color: #f7f7f9; }
.about-bio .role { font-family: var(--font-mono); font-size: 0.9375rem; font-weight: 500; color: var(--ink-muted); margin: 0 0 1.5rem; }
.about-bio .body { display: flex; flex-direction: column; gap: 1rem; max-width: 62ch; }
.about-bio .body p { margin: 0; font-size: 1.03125rem; line-height: 1.7; color: var(--ink-body); font-family: var(--font-body); }

.about-section { padding: 3.125rem 0; border-bottom: 1px solid var(--border-soft); }
.about-section-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 2.5rem; }
.about-section .prompt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 0.5rem; }
.about-section h2 { margin: 0 0 1.625rem; font-size: 1.625rem; font-weight: 700; letter-spacing: -0.015em; color: var(--ink-hi); }

.about-focus-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.875rem; }
.about-focus-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 0.6875rem; padding: 1.125rem; transition: border-color 0.25s ease, transform 0.25s ease; }
.about-focus-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.about-focus-card .diamond { width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg); display: block; margin-bottom: 1rem; }
.about-focus-card .name { font-size: 0.9375rem; font-weight: 600; color: var(--ink-strong); line-height: 1.25; margin-bottom: 0.4375rem; }
.about-focus-card .blurb { margin: 0; font-size: 0.78125rem; line-height: 1.5; color: var(--ink-muted); }

.selected-list { display: flex; flex-direction: column; gap: 0.625rem; }
.selected-row { display: flex; align-items: center; gap: 1.25rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.125rem 1.375rem; transition: transform 0.25s ease, border-color 0.25s ease; }
.selected-row:hover { border-color: var(--accent); transform: translateX(3px); }
.selected-row .idx { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-faint); white-space: nowrap; }
.selected-row .sr-body { flex: 1; }
.selected-row .sr-title { font-size: 1.0625rem; font-weight: 600; color: var(--ink-strong); line-height: 1.25; }
.selected-row .sr-meta { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-dim); margin-top: 5px; }
.selected-row .arrow { font-family: var(--font-mono); font-size: 0.875rem; color: var(--accent); }

.topic-chips { display: flex; flex-wrap: wrap; gap: 0.5625rem; }
.topic-chips a, .topic-chips span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-body); background: var(--surface-3); border: 1px solid #2c2c34; border-radius: 0.4375rem; padding: 0.5rem 0.8125rem; transition: border-color 0.2s ease; }
.topic-chips a:hover { border-color: var(--accent); }

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.875rem; }
.contact-card { display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem 1.375rem; transition: transform 0.25s ease, border-color 0.25s ease; }
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-card .cc-label { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.375rem; }
.contact-card .cc-handle { font-size: 0.9375rem; font-weight: 600; color: var(--ink-strong); }
.contact-card .arrow { font-family: var(--font-mono); font-size: 0.875rem; color: var(--accent); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1100px) {
  .art-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .toc-rail { display: none; }
  .toc-inline { display: block; }
}

@media (max-width: 980px) {
  .focus-grid { grid-template-columns: repeat(2, 1fr); }
  .about-focus-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; padding: 40px 22px 30px; text-align: center; }
  .hero-copy { align-items: center; }
  .hero-title { font-size: 32px; max-width: none; }
  .caret { height: 26px; }
  .artifact-wrap { order: -1; margin-bottom: 12px; }
  .dossier { width: 220px; }
  .mark-float img { height: 120px; }
  .mark-float .pix-hover { height: 120px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-cover { min-height: 160px; }
  .grid-3 { grid-template-columns: 1fr; }
  .focus-grid { grid-template-columns: 1fr; }
  .about-intro { grid-template-columns: 1fr; gap: 26px; }
  .about-mark { max-width: 280px; margin: 0 auto; }
  .about-focus-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .prevnext .pn-grid { grid-template-columns: 1fr; }
  .wrap, .wrap-narrow, .section-inner, .ph-inner, .fb-inner,
  .about-intro-inner, .about-section-inner, .footer-inner { padding-left: 18px; padding-right: 18px; }
  .article-header, .article-cover, .art-grid, .breadcrumb, .prevnext, .related .rel-inner { padding-left: 18px; padding-right: 18px; }
  .section { padding: 40px 0; }
  .page-title { font-size: 30px; }
  .article-title { font-size: 27px; }
  .section-title { font-size: 26px; }
  /* hide desktop filter bar, show mobile version */
  .filter-bar .fb-inner { display: none; }
  .mobile-filters { display: block; }

  /* Article/mobile overflow hardening */
  main,
  .article-header,
  .article-cover,
  .breadcrumb,
  .art-grid,
  .prose,
  .prose > *,
  .toc-inline,
  .codeblock,
  .callout,
  .tested-on,
  .refs,
  .tag-footer,
  .prevnext,
  .related .rel-inner {
    min-width: 0;
    max-width: 100%;
  }

  .article-header,
  .article-cover,
  .breadcrumb,
  .art-grid,
  .prevnext,
  .related .rel-inner {
    width: 100%;
  }

  .prose {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }

  .prose p,
  .prose li,
  .callout p,
  .article-excerpt,
  .refs .ref-text,
  .tested-on .to-val {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .codeblock,
  .codeblock pre,
  .codescroll,
  .prose .tscroll,
  .tscroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .codeblock pre,
  .codescroll,
  .prose .tscroll,
  .tscroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Raw markdown tables must not force a 460px page width. */
  .prose table,
  table.tbl {
    min-width: 0;
    max-width: 100%;
    table-layout: auto;
  }

  .prose table th,
  .prose table td,
  table.tbl th,
  table.tbl td {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    overflow-wrap: anywhere;
  }

  .article-cover .ac-code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

/* wide + short viewport: 2048×697 and similar */
@media (min-width: 761px) and (max-height: 760px) {
  .hero-inner { padding-block: clamp(1.5rem, 4vh, 2.5rem); }
}

/* =====================================================================
   404 PAGE
   ===================================================================== */
.notfound-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: calc(100vh - 4rem);
  min-height: calc(100svh - 4rem);
  display: flex;
  align-items: center;
  padding: 5rem 2.5rem;
}

.notfound-inner {
  width: 100%;
  max-width: var(--maxw);
  min-width: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
}

.notfound-inner > *,
.nf-terminal,
.nf-copy {
  min-width: 0;
  max-width: 100%;
}

/* terminal block */
.nf-terminal {
  width: 100%;
  background: #0d0d0f;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.nf-bar {
  min-width: 0;
  background: #161618;
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nf-bar span {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
}

.nf-bar-title {
  min-width: 0;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  background: none !important;
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nf-body {
  min-width: 0;
  max-width: 100%;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #2e2e36 #0b0b0e;
}

.nf-body::-webkit-scrollbar { height: 9px; }
.nf-body::-webkit-scrollbar-track { background: #0b0b0e; }
.nf-body::-webkit-scrollbar-thumb {
  background: #2e2e36;
  border-radius: 5px;
  border: 2px solid #0b0b0e;
}

.nf-line {
  min-width: 0;
  color: var(--ink-body);
  margin-bottom: 0.125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.nf-spacer { height: 0.75rem; }
.nf-prompt { color: var(--accent); margin-right: 0.5rem; }
.nf-err,
.nf-red { color: #e57373; }
.nf-dim { color: var(--ink-dim); }

/* copy block */
.nf-eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.nf-title {
  max-width: 14ch;
  font-size: clamp(2.25rem, 3.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-hi);
  line-height: 1.1;
  margin: 0 0 1.25rem;
  overflow-wrap: anywhere;
}

.nf-title .accent { color: var(--accent); }

.nf-sub {
  max-width: 46ch;
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-mid);
  overflow-wrap: anywhere;
}

.nf-actions {
  display: flex;
  gap: 0.875rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .notfound-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .nf-title {
    max-width: none;
    font-size: 2rem;
  }
}

@media (max-width: 760px) {
  .notfound-wrap {
    min-height: auto;
    padding: 2.5rem 1.125rem;
  }

  .notfound-inner { gap: 2rem; }

  .nf-terminal { font-size: 0.75rem; }
  .nf-body { padding: 1rem; }

  .nf-title {
    max-width: none;
    font-size: 1.875rem;
  }

  .nf-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nf-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* =====================================================================
   REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reading-progress .bar { transition: none; }
}

/* =====================================================================
   PRINT - Save PDF
   ===================================================================== */
@media print {
  .no-print, .site-nav, .reading-progress, .toc-rail, .toc-inline,
  .prevnext, .related, .site-footer, .codeblock-actions { display: none !important; }
  body { background: #fff; color: #111; }
  .prose p, .prose li { color: #222; }
  .art-grid { grid-template-columns: 1fr; padding: 0; }
  .prose { max-width: none; }
  .codeblock { border-color: #ccc; }
}

/* =====================================================================
   KEYFRAMES
   ===================================================================== */
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes glowPulse { 0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 0.78; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes glowDrift { 0% { transform: translate(0, 0); } 50% { transform: translate(2.5%, -2%); } 100% { transform: translate(0, 0); } }
@keyframes gridPan { 0% { background-position: 0 0; } 100% { background-position: 46px 46px; } }
@keyframes scan { 0% { background-position: 0 0; } 100% { background-position: 0 6px; } }
@keyframes spark { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 0.85; } 100% { transform: translateY(-54px); opacity: 0; } }
@keyframes ringExpand { 0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.4; } 100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } }
@keyframes blinkRare { 0%, 90%, 100% { opacity: 0.55; } 92% { opacity: 0.06; } 94% { opacity: 0.55; } 96% { opacity: 0.06; } 98% { opacity: 0.55; } }
@keyframes blinkOnHover {
  0%   { transform: translate(-50%, -50%) scaleY(0); opacity: 0; }
  20%  { transform: translate(-50%, -50%) scaleY(1); opacity: 1; }
  55%  { transform: translate(-50%, -50%) scaleY(1); opacity: 1; }
  80%  { transform: translate(-50%, -50%) scaleY(0); opacity: 0; }
  100% { transform: translate(-50%, -50%) scaleY(0); opacity: 0; }
}
@keyframes shimmerRun { 0% { transform: translateY(-130%); opacity: 0; } 25% { opacity: 0.55; } 100% { transform: translateY(130%); opacity: 0; } }
@keyframes flarePop { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } }
