/* ─────────────────────────────────────────────────────────────
   zeropwn — Security Research Blog Stylesheet
   Theme: Beralock Cyber-Aesthetic (Red #e8192c / Base #050508)
   Typography: Minecraftia (UI/Headings) + Chakra Petch (Content/Meta) + JetBrains Mono (Code)
───────────────────────────────────────────────────────────── */

/* ─── FONTS ─── */
@font-face {
  font-family: 'Minecraftia';
  src: url('../fonts/uziii2208-pixel.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ─── RESET & CSS VARIABLES ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red: #e8192c;
  --red-dim: #9b1020;
  --red-muted: #3d0810;
  --red-glow: rgba(232, 25, 44, 0.22);
  --red-laser: rgba(232, 25, 44, 0.85);
  --bg: #050508;
  --bg-card: #0c0c10;
  --bg-card-hover: #121218;
  --bg-card-elevated: #161620;
  --border: #1a1a22;
  --border-red: #3d0810;
  --border-red-focus: #e8192c;
  --text: #e8e8f0;
  --text-dim: #8888a0;
  --text-muted: #4e4e66;
  --font-ui: 'Minecraftia', sans-serif;
  --font-heading: 'Minecraftia', sans-serif;
  --font-content: 'Chakra Petch', sans-serif;
  --font-meta: 'Chakra Petch', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  /* Typography System Aliases */
  --heading: var(--font-heading);
  --ui: var(--font-ui);
  --content: var(--font-content);
  --meta: var(--font-meta);
  --code: var(--font-code);
  --mono: var(--font-code);
  --banner-h: 0px;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-content);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

code, pre, kbd, samp {
  font-family: var(--font-code);
}

::selection {
  background: var(--red);
  color: #fff;
}

/* ─── READING PROGRESS LASER BAR ─── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #9b1020, var(--red), #ff4455);
  box-shadow: 0 0 10px var(--red), 0 0 4px #fff;
  z-index: 10000;
  pointer-events: none;
  transition: width 0.08s ease-out;
}

/* ─── MIGRATION NOTICE BANNER ─── */
#migration-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1001;
  background: #090709;
  border-bottom: 1px solid var(--border-red);
  display: none;
  padding: 7px 1.5rem;
  font-family: var(--font-content);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-tag {
  font-size: 0.6rem;
  color: var(--red);
  background: rgba(232, 25, 44, 0.1);
  border: 1px solid var(--red-dim);
  padding: 1px 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.banner-link {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s;
}

.banner-link:hover {
  color: #ff4455;
}

.banner-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
  transition: all 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.banner-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ─── OVERHAULED CYBER-TERMINAL HUD NAVIGATION ─── */
nav {
  position: fixed;
  top: var(--banner-h, 0px);
  left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 58px;
  background: rgba(8, 8, 14, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: top 0.2s ease;
}

/* Subtle under-header laser beam */
nav::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(232, 25, 44, 0.55) 50%, transparent 100%);
  pointer-events: none;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

/* Brand Terminal Logo */
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  user-select: none;
}

.nav-brand:hover {
  background: rgba(232, 25, 44, 0.08);
  border-color: var(--border-red);
  box-shadow: 0 0 12px rgba(232, 25, 44, 0.22);
}

.brand-prompt {
  color: var(--red);
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 0.90rem;
  text-shadow: 0 0 6px var(--red-glow);
}

.brand-name {
  color: #f0f0f5;
}

.brand-num {
  color: var(--red);
  text-shadow: 0 0 8px var(--red-glow);
}

.brand-cursor {
  color: var(--red);
  font-family: var(--font-mono);
  animation: cursor-blink 1s infinite;
  margin-left: -1px;
}

@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.brand-badge {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: #11111b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 4px;
}

/* Nav Route Pills */
.nav-routes {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-route-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.18s ease;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-route-item .route-num {
  font-family: var(--font-ui);
  font-size: 0.64rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.18s ease;
  white-space: nowrap;
}

.nav-route-item .route-label {
  font-weight: 500;
  white-space: nowrap;
}

.nav-route-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.nav-route-item:hover .route-num {
  color: var(--red);
}

.nav-route-item.active {
  color: #ffffff;
  background: rgba(232, 25, 44, 0.09);
  border-color: rgba(232, 25, 44, 0.35);
  box-shadow: inset 0 0 10px rgba(232, 25, 44, 0.08);
}

.nav-route-item.active .route-num {
  color: var(--red);
  text-shadow: 0 0 6px var(--red-glow);
}

.nav-route-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  border-radius: 1px;
}

/* Nav Right Container */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* HUD Sound Equalizer Toggle */
.btn-sfx-hud {
  background: rgba(18, 18, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 0.70rem;
  letter-spacing: 0.07em;
  padding: 4px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 3px;
  transition: all 0.18s ease;
  user-select: none;
}

.btn-sfx-hud:hover {
  border-color: var(--red);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(232, 25, 44, 0.25);
  background: rgba(232, 25, 44, 0.08);
}

.btn-sfx-hud .sfx-eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 12px;
  height: 12px;
}

.btn-sfx-hud .sfx-bar {
  width: 2px;
  background: var(--red);
  border-radius: 1px;
  box-shadow: 0 0 4px var(--red-glow);
}

.btn-sfx-hud:not(.muted) .bar-1 {
  height: 8px;
  animation: eq-bounce 0.7s ease-in-out infinite alternate;
}

.btn-sfx-hud:not(.muted) .bar-2 {
  height: 12px;
  animation: eq-bounce 0.5s ease-in-out 0.15s infinite alternate;
}

.btn-sfx-hud:not(.muted) .bar-3 {
  height: 6px;
  animation: eq-bounce 0.65s ease-in-out 0.3s infinite alternate;
}

.btn-sfx-hud.muted {
  opacity: 0.55;
  border-color: rgba(255, 255, 255, 0.06);
}

.btn-sfx-hud.muted .sfx-bar {
  animation: none !important;
  height: 2px !important;
  background: var(--text-muted) !important;
  box-shadow: none !important;
}

.btn-sfx-hud.muted .sfx-val {
  color: var(--text-muted);
}

.btn-sfx-hud .sfx-label {
  color: var(--text-muted);
  font-size: 0.66rem;
}

.btn-sfx-hud .sfx-val {
  color: var(--red);
  font-weight: 600;
  min-width: 22px;
  text-align: left;
}

@keyframes eq-bounce {
  0% { height: 3px; }
  50% { height: 12px; }
  100% { height: 5px; }
}

/* Nav Keyboard Shortcut Buttons */
.nav-shortcuts {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-shortcut-btn,
.shortcut-chip {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: #0e0e17;
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 3px 9px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.nav-shortcut-btn:hover,
.shortcut-chip:hover {
  border-color: var(--red);
  color: #ffffff;
  background: rgba(232, 25, 44, 0.08);
  box-shadow: 0 0 8px rgba(232, 25, 44, 0.2);
}

.nav-shortcut-btn .shortcut-key,
.nav-shortcut-btn kbd,
.shortcut-chip kbd {
  background: #171724;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--red);
  padding: 1px 5px;
  font-size: 0.62rem;
  font-family: var(--font-ui);
  font-weight: 600;
  border-radius: 2px;
  line-height: 1.2;
}

.nav-shortcut-btn:hover .shortcut-key,
.nav-shortcut-btn:hover kbd,
.shortcut-chip:hover kbd {
  background: rgba(232, 25, 44, 0.2);
  border-color: var(--red);
  box-shadow: 0 0 5px var(--red-glow);
}

.nav-shortcut-btn .shortcut-text {
  font-weight: 500;
}

/* Operator Badge */
.nav-operator-badge,
.nav-tag {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s ease;
  user-select: none;
}

.nav-operator-badge .operator-dot {
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--red);
}

.nav-operator-badge:hover,
.nav-tag:hover {
  border-color: var(--red);
  color: #ffffff;
  background: rgba(232, 25, 44, 0.07);
  box-shadow: 0 0 10px rgba(232, 25, 44, 0.2);
}

.nav-operator-badge:hover .operator-dot {
  transform: scale(1.3);
}

/* ─── MOBILE HAMBURGER BUTTON & DRAWER ─── */
.nav-hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  background: rgba(18, 18, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.nav-hamburger-btn:hover {
  border-color: var(--red);
  background: rgba(232, 25, 44, 0.1);
  box-shadow: 0 0 10px rgba(232, 25, 44, 0.25);
}

.hamburger-box {
  width: 18px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: #ffffff;
  border-radius: 1px;
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.18s ease,
              background-color 0.2s ease;
}

.nav-hamburger-btn:hover .hamburger-line {
  background: var(--red);
}

/* Active hamburger icon transforms to ✕ */
.nav-hamburger-btn.is-active .line-1 {
  transform: translateY(6px) rotate(45deg);
  background: var(--red);
}

.nav-hamburger-btn.is-active .line-2 {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger-btn.is-active .line-3 {
  transform: translateY(-6px) rotate(-45deg);
  background: var(--red);
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 8, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.mobile-menu-open .mobile-menu-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Menu Drawer */
.mobile-menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(340px, 86vw);
  height: 100vh;
  height: 100dvh;
  background: #09090e;
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.85), -1px 0 0 rgba(232, 25, 44, 0.35);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

body.mobile-menu-open {
  overflow: hidden;
}

body.mobile-menu-open .mobile-menu-drawer {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.mobile-drawer-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--text);
  user-select: none;
}

.mobile-drawer-close {
  background: #11111a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  width: 32px;
  height: 32px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.mobile-drawer-close:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(232, 25, 44, 0.1);
}

.mobile-drawer-content {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.mobile-section-tag {
  font-family: var(--font-meta);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.mobile-routes-list {
  list-style: none;
  margin: 0 0 24px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-route-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.18s ease;
  font-family: var(--font-ui);
}

.mobile-route-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateX(2px);
}

.mobile-route-item.active {
  background: rgba(232, 25, 44, 0.09);
  border-color: var(--border-red-focus);
  border-left: 3px solid var(--red);
}

.mobile-route-item .m-route-num {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-right: 10px;
}

.mobile-route-item.active .m-route-num {
  color: var(--red);
}

.mobile-route-item .m-route-label {
  font-size: 0.82rem;
  font-weight: normal;
  letter-spacing: 0.06em;
  flex: 1;
}

.mobile-route-item.active .m-route-label {
  color: #ffffff;
}

.mobile-route-item .m-route-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: transform 0.18s ease;
}

.mobile-route-item:hover .m-route-arrow {
  color: var(--red);
  transform: translateX(3px);
}

.mobile-tools-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.mobile-tool-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #0e0e16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.mobile-tool-btn:hover {
  border-color: var(--red);
  color: #ffffff;
  background: rgba(232, 25, 44, 0.08);
}

.mobile-tool-btn .m-tool-kbd {
  background: #181824;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--red);
  padding: 1px 6px;
  font-size: 0.68rem;
  font-family: var(--font-ui);
  border-radius: 2px;
}

.mobile-tool-btn .m-tool-icon {
  color: var(--red);
  font-size: 0.85rem;
}

.mobile-tool-btn .m-tool-name {
  flex: 1;
  text-align: left;
  margin-left: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.mobile-tool-btn .m-tool-hint {
  font-family: var(--font-code);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.mobile-tool-btn .m-tool-val {
  color: var(--red);
  font-weight: 600;
}

.mobile-drawer-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mobile-operator-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #07070b;
  border: 1px solid var(--border);
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.mobile-operator-badge:hover {
  border-color: var(--red);
  background: rgba(232, 25, 44, 0.05);
}

.mobile-operator-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-operator-handle {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.m-operator-desc {
  font-family: var(--font-meta);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

@media (min-width: 769px) {
  .mobile-menu-backdrop,
  .mobile-menu-drawer {
    display: none !important;
  }
}

/* ─── HERO SECTION ─── */
#hero {
  padding: 5rem 2.5rem 4rem;
  padding-top: calc(56px + var(--banner-h, 0px) + 3.2rem);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 65% 55% at 85% 25%, rgba(232, 25, 44, 0.07) 0%, transparent 65%),
    radial-gradient(ellipse 45% 45% at 10% 80%, rgba(232, 25, 44, 0.03) 0%, transparent 60%),
    var(--bg);
}

/* ─── GLOBAL CYBER CONSTELLATION & PIXEL BUGS CANVAS ─── */
#cyber-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  max-width: 920px;
  position: relative;
  z-index: 3;
}

.hero-eyebrow {
  font-family: var(--font-meta);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow-badge {
  font-family: var(--font-meta);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--red);
  background: rgba(232, 25, 44, 0.08);
  border: 1px solid var(--border-red);
  padding: 3px 8px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.eyebrow-sep {
  color: var(--text-muted);
  font-weight: 600;
}

.eyebrow-text {
  color: var(--text-dim);
  font-weight: 500;
}

#hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: normal;
  line-height: 1.32;
  letter-spacing: 0.015em;
  margin-bottom: 1.4rem;
  color: #ffffff;
  -webkit-text-stroke: 0.35px rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

#hero h1 .red {
  color: var(--red);
  -webkit-text-stroke: 0.35px var(--red);
  text-shadow: none;
  display: inline-block;
  white-space: nowrap;
}

.hero-sub {
  font-family: var(--font-content);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.7;
  color: #a0a0be;
  margin-bottom: 2.2rem;
  max-width: 680px;
}

/* ─── EDITORIAL METRIC STRIP ─── */
.hero-metric-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 24px;
  padding: 16px 24px;
  background: rgba(12, 12, 16, 0.85);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  max-width: 760px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-label {
  font-family: var(--font-meta);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.metric-val {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: normal;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.metric-val.highlight {
  color: var(--red);
}

.metric-sep {
  color: var(--border);
  font-family: var(--font-meta);
  font-size: 1rem;
  font-weight: 300;
  user-select: none;
}

@media (max-width: 640px) {
  .hero-metric-strip {
    padding: 14px 18px;
    gap: 14px 18px;
  }
  .metric-sep {
    display: none;
  }
  .metric-item {
    min-width: 120px;
  }
}

/* ─── MAIN CONTENT & POSTS SECTION ─── */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 5rem 2.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title span { color: var(--red); }

.section-count {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ─── TOOLBAR & SEARCH ─── */
.toolbar-container {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.search-box:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 16px var(--red-glow);
}

.search-icon {
  font-family: var(--font-ui);
  color: var(--red);
  padding-left: 14px;
  font-size: 0.85rem;
  user-select: none;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-content);
  font-size: 0.82rem;
  outline: none;
}

.search-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  transition: color 0.15s;
}

.search-clear:hover { color: var(--red); }

.search-shortcut {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: #14141e;
  border: 1px solid #232332;
  padding: 2px 7px;
  margin-right: 12px;
  user-select: none;
}

.filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}

.filter-btn:hover {
  border-color: var(--red-dim);
  color: var(--text);
}

.filter-btn.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-muted);
  box-shadow: 0 0 10px var(--red-glow);
}

.filter-btn[data-tag="easy"]:hover,
.filter-btn[data-tag="easy"].active {
  border-color: #38ef7d;
  color: #38ef7d;
  background: rgba(56, 239, 125, 0.12);
  box-shadow: 0 0 10px rgba(56, 239, 125, 0.35);
}

.filter-btn[data-tag="medium"]:hover,
.filter-btn[data-tag="medium"].active {
  border-color: #f1c40f;
  color: #f1c40f;
  background: rgba(241, 196, 15, 0.12);
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.35);
}

.filter-btn[data-tag="hard"]:hover,
.filter-btn[data-tag="hard"].active {
  border-color: #ff7675;
  color: #ff7675;
  background: rgba(255, 118, 117, 0.12);
  box-shadow: 0 0 10px rgba(255, 118, 117, 0.35);
}

.filter-btn[data-tag="insane"]:hover,
.filter-btn[data-tag="insane"].active {
  border-color: #c084fc;
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.35);
}

.search-status-bar {
  font-family: var(--font-meta);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.search-status-bar strong {
  color: var(--red);
}

/* ─── CYBER POST LIST & CARDS ─── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.post-item {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.6rem 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

.post-item::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(232, 25, 44, 0.05), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}

.post-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-red);
  border-left-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 15px var(--red-glow);
}

.post-item:hover::before {
  left: 100%;
}

.post-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.post-meta-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-meta);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.post-meta-inline .meta-sep {
  color: var(--border-red);
  font-weight: 700;
}

.post-meta-inline .meta-readtime {
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.post-tags-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-item .post-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: normal;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: #ffffff;
  transition: color 0.15s ease, text-shadow 0.15s ease;
  margin-bottom: 0;
}

.post-item:hover .post-title {
  color: var(--red);
  text-shadow: 0 0 16px var(--red-glow);
}

.post-item .post-excerpt {
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.6;
  font-family: var(--font-content);
  max-width: 950px;
}

.post-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 0.3rem;
  font-family: var(--font-meta);
  font-size: 0.7rem;
}

.post-action-cue {
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-weight: 600;
  transition: color 0.15s;
}

.post-action-cue .arrow-icon {
  transition: transform 0.2s ease;
}

.post-item:hover .post-action-cue {
  color: var(--red);
}

.post-item:hover .post-action-cue .arrow-icon {
  transform: translateX(4px);
}

.post-auth-badge {
  color: var(--text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

/* ─── TAG CHIPS ─── */
.tag {
  font-family: var(--font-meta);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border: 1px solid;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  transition: all 0.12s;
}

/* ─── DIFFICULTY TAG CHIPS ─── */
.tag-easy {
  color: #38ef7d;
  border-color: rgba(56, 239, 125, 0.35);
  background: rgba(56, 239, 125, 0.08);
}
.tag-easy:hover {
  background: rgba(56, 239, 125, 0.22);
  border-color: #38ef7d;
  box-shadow: 0 0 10px rgba(56, 239, 125, 0.35);
}

.tag-medium {
  color: #f1c40f;
  border-color: rgba(241, 196, 15, 0.35);
  background: rgba(241, 196, 15, 0.08);
}
.tag-medium:hover {
  background: rgba(241, 196, 15, 0.22);
  border-color: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.35);
}

.tag-hard {
  color: #ff7675;
  border-color: rgba(255, 118, 117, 0.4);
  background: rgba(255, 118, 117, 0.09);
}
.tag-hard:hover {
  background: rgba(255, 118, 117, 0.22);
  border-color: #ff7675;
  box-shadow: 0 0 10px rgba(255, 118, 117, 0.35);
}

.tag-insane {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.4);
  background: rgba(192, 132, 252, 0.09);
}
.tag-insane:hover {
  background: rgba(192, 132, 252, 0.22);
  border-color: #c084fc;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.4);
}

.tag-cve {
  color: var(--red);
  border-color: var(--border-red);
  background: rgba(232,25,44,0.07);
}
.tag-cve:hover { background: rgba(232,25,44,0.18); border-color: var(--red); }

.tag-htb {
  color: #9d8cff;
  border-color: #201a40;
  background: rgba(157,140,255,0.07);
}
.tag-htb:hover { background: rgba(157,140,255,0.18); border-color: #9d8cff; }

.tag-ctf {
  color: #38ef7d;
  border-color: #0c3318;
  background: rgba(56,239,125,0.07);
}
.tag-ctf:hover { background: rgba(56,239,125,0.18); border-color: #38ef7d; }

.tag-research {
  color: #ffaa44;
  border-color: #3d2408;
  background: rgba(255,170,68,0.07);
}
.tag-research:hover { background: rgba(255,170,68,0.18); border-color: #ffaa44; }

.tag-windows {
  color: #00d2ff;
  border-color: #004d73;
  background: rgba(0, 210, 255, 0.08);
}
.tag-windows:hover {
  background: rgba(0, 210, 255, 0.2);
  border-color: #00d2ff;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.35);
}

.tag-linux {
  color: #f59e0b;
  border-color: #5c3b00;
  background: rgba(245, 158, 11, 0.08);
}
.tag-linux:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.tag-challenge,
.tag-challenges {
  color: #ec4899;
  border-color: #501334;
  background: rgba(236, 72, 153, 0.08);
}
.tag-challenge:hover,
.tag-challenges:hover {
  background: rgba(236, 72, 153, 0.2);
  border-color: #ec4899;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.35);
}

.tag-generic {
  color: var(--text-dim);
  border-color: var(--border);
  background: rgba(255,255,255,0.03);
}

/* ─── UI SVG ICONS ─── */
.ui-icon {
  stroke: currentColor;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ─── ENHANCED CYBER BACKGROUND FOR POST & ARCHIVE PAGES ─── */
body.page-post,
body.page-post-index {
  background-color: #050508;
  background-image:
    radial-gradient(ellipse 85% 40% at 50% -2%, rgba(232, 25, 44, 0.16) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 90% 20%, rgba(232, 25, 44, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 45% 40% at 10% 60%, rgba(155, 16, 32, 0.035) 0%, transparent 45%),
    linear-gradient(rgba(232, 25, 44, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 25, 44, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  background-attachment: fixed;
  position: relative;
}

body.page-post #cyber-canvas,
body.page-post-index #cyber-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ─── POST DETAIL VIEW LAYOUT ─── */
#post-view,
#post-index-view {
  min-height: calc(100vh - 120px);
  padding-top: calc(56px + var(--banner-h, 0px));
  position: relative;
  z-index: 1;
}

#post-view main {
  padding: 2.2rem 2.5rem 5rem 2.5rem;
}

.breadcrumb {
  font-family: var(--font-meta);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover { color: var(--red); }
.breadcrumb span.sep { color: var(--border-red); font-weight: 700; }
.breadcrumb span.crumb-current { color: var(--red); font-weight: 600; }

.post-view-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-btn {
  background: #0c0c12;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  gap: 8px;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.back-btn:hover {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.post-ctrl-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: #0c0c12;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  gap: 7px;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.btn-ctrl:hover {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

.post-view-header {
  margin-bottom: 2.8rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.8rem;
}

.post-view-title {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: normal;
  line-height: 1.45;
  color: #fff;
  margin-bottom: 1.2rem;
  letter-spacing: 0.02em;
}

.post-meta-bar {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-family: var(--font-meta);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.post-meta-bar .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
}

.post-meta-bar .meta-sep {
  color: var(--border-red);
  font-weight: 700;
}

.meta-author { color: var(--red) !important; font-weight: 600; }

/* Two column post layout with sticky TOC */
.post-body-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 3rem;
  align-items: start;
  position: relative;
}

.post-main-content {
  min-width: 0;
}

/* ─── POST HERO BANNER ─── */
.post-hero-banner {
  width: 100%;
  margin-bottom: 2.2rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232, 25, 44, 0.3);
  border-top: 2px solid var(--red);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 20px rgba(232, 25, 44, 0.14);
  background: #06060a;
  border-radius: 4px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.post-hero-banner::before,
.post-hero-banner::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(232, 25, 44, 0.85);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}

.post-hero-banner::before {
  top: 6px;
  left: 6px;
  border-width: 2px 0 0 2px;
}

.post-hero-banner::after {
  bottom: 6px;
  right: 6px;
  border-width: 0 2px 2px 0;
}

.post-hero-img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.post-hero-banner:hover {
  border-color: rgba(232, 25, 44, 0.5);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.75), 0 0 28px rgba(232, 25, 44, 0.22);
}

.post-hero-banner:hover .post-hero-img {
  transform: scale(1.008);
  filter: brightness(1.04);
}

/* Raw markdown container (hidden by default) */
#raw-markdown-view {
  background: #09090f;
  border: 1px solid var(--border);
  padding: 1.5rem;
  font-family: var(--font-code);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #c0c0d8;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

/* ─── STICKY TOC SIDEBAR ─── */
.post-toc-sidebar {
  position: sticky;
  top: calc(56px + var(--banner-h, 0px) + 2rem);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 18px 16px 20px 18px;
  background: rgba(10, 10, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 2px solid rgba(232, 25, 44, 0.4);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: var(--font-meta);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-toc-sidebar:hover {
  border-left-color: var(--red);
  box-shadow: 0 8px 30px rgba(232, 25, 44, 0.14);
}

/* Sleek Cyber Scrollbar for TOC */
.post-toc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.post-toc-sidebar::-webkit-scrollbar-track {
  background: rgba(10, 10, 16, 0.5);
}

.post-toc-sidebar::-webkit-scrollbar-thumb {
  background: rgba(232, 25, 44, 0.3);
  border-radius: 2px;
}

.post-toc-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}

.toc-title {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.95rem;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-title-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toc-title-left span {
  color: var(--red);
  font-weight: 700;
}

.toc-status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: pulse-beacon 2s infinite ease-in-out;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  list-style: none;
  position: relative;
}

.toc-nav li {
  line-height: 1.4;
}

.toc-nav a {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.45;
  position: relative;
  padding: 5px 8px 5px 14px;
  border-radius: 3px;
  border-left: 2px solid transparent;
}

.toc-nav a::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 11px;
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.18s ease;
}

.toc-nav a:hover {
  color: #ffffff;
  background: rgba(232, 25, 44, 0.06);
  border-left-color: rgba(232, 25, 44, 0.5);
  padding-left: 17px;
}

.toc-nav a:hover::before {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.toc-nav a.active {
  color: #ffffff;
  font-weight: 600;
  background: rgba(232, 25, 44, 0.1);
  border-left-color: var(--red);
  box-shadow: inset 0 0 12px rgba(232, 25, 44, 0.12);
  padding-left: 17px;
}

.toc-nav a.active::before {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  width: 5px;
  height: 5px;
  border-radius: 1px;
}

/* Sub-headings H3 */
.toc-h3 {
  margin-left: 10px;
  position: relative;
}

.toc-h3::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.toc-h3 a {
  font-size: 0.67rem;
  color: var(--text-muted);
  padding: 4px 6px 4px 12px;
}

.toc-h3 a::before {
  left: 2px;
  top: 9px;
  width: 3px;
  height: 3px;
}

.toc-h3 a:hover {
  color: #ffffff;
  background: rgba(232, 25, 44, 0.05);
  padding-left: 15px;
}

.toc-h3 a.active {
  color: var(--red);
  background: rgba(232, 25, 44, 0.08);
  padding-left: 15px;
}

/* ─── MARKDOWN CONTENT STYLING & OPSEC CURSOR LOCKDOWN ─── */
/* Global container lockdown: Disables text selection across writeup prose */
.md-content {
  font-family: var(--font-content);
  font-size: 1rem;
  line-height: 1.78;
  color: #d8d8e8;
  word-wrap: break-word;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* Restricted prose cursor: All non-code/non-image elements show Unavailable cursor */
.md-content p,
.md-content h1,
.md-content h2,
.md-content h3,
.md-content h4,
.md-content h5,
.md-content h6,
.md-content ul,
.md-content ol,
.md-content li,
.md-content blockquote,
.md-content aside,
.md-content table,
.md-content th,
.md-content td,
.md-content strong,
.md-content em,
.md-content hr,
.md-content .katex,
.md-content .katex-display {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  cursor: url('../cursors/Unavailable.png') 16 16, url('../cursors/Unavailable.cur'), not-allowed !important;
}

/* ─── EXCEPTION 1: CODE BLOCKS & SYNTAX (ALLOWED SELECTION & INTERACTION) ─── */
.md-content pre,
.md-content code,
.md-content .code-block-wrap,
.md-content .code-line,
.md-content .line-content,
.md-content .hljs,
.md-content pre code {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  cursor: url('../cursors/Beam%20select.png') 16 16, url('../cursors/Beam%20select.cur'), text !important;
  pointer-events: auto !important;
}

.md-content .line-number {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: default !important;
}

.md-content .code-copy-btn,
pre .code-copy-btn {
  user-select: none !important;
  cursor: url('../cursors/Link%20select.png') 16 16, url('../cursors/Link%20select.cur'), pointer !important;
  pointer-events: auto !important;
}

/* ─── EXCEPTION 2: WRITEUP IMAGES & LIGHTBOX (ALLOWED HOVER & ZOOM) ─── */
.md-content img,
.md-content figure img,
.md-content .lightbox-trigger {
  cursor: zoom-in !important;
  pointer-events: auto !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
  user-drag: none !important;
  -webkit-touch-callout: none !important;
}

.md-content h1,
.md-content h2,
.md-content h3,
.md-content h4,
.md-content h5,
.md-content h6 {
  font-family: var(--font-heading);
  color: #ffffff;
  font-weight: normal;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.45;
  letter-spacing: 0.02em;
  scroll-margin-top: calc(56px + var(--banner-h, 0px) + 20px);
}

.md-content h2 {
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.md-content h2::before {
  content: '//';
  color: var(--red);
  font-size: 1.05rem;
  font-weight: normal;
}

.md-content h3 { font-size: 1.05rem; }
.md-content h4 { font-size: 0.92rem; }

.md-content p {
  margin-bottom: 1.3rem;
}

.md-content strong {
  color: #fff;
  font-weight: 600;
}

.md-content em {
  color: var(--red);
  font-style: italic;
}

.md-content a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
  cursor: url('../cursors/Link%20select.png') 16 16, url('../cursors/Link%20select.cur'), pointer !important;
  user-select: none !important;
  pointer-events: auto !important;
}

.md-content a:hover {
  color: #ff4455;
}

.md-content ul,
.md-content ol {
  margin-bottom: 1.3rem;
  padding-left: 1.8rem;
}

.md-content li {
  margin-bottom: 0.4rem;
}

.md-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Blockquotes / Callout Asides */
.md-content blockquote,
.md-content aside {
  border-left: 3px solid var(--red);
  background: rgba(232, 25, 44, 0.04);
  padding: 1rem 1.4rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  color: #c4c4dc;
}

.md-content blockquote p:last-child,
.md-content aside p:last-child {
  margin-bottom: 0;
}

/* Tables */
.md-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: 0.88rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow-x: auto;
  display: block;
}

.md-content th {
  background: #0f0f18;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-red);
  padding: 10px 14px;
  text-align: left;
}

.md-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: #b8b8d0;
  vertical-align: top;
}

.md-content tr:hover td {
  background: rgba(232, 25, 44, 0.025);
}

/* Images & Screenshots */
.md-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.8rem auto;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.md-content img:hover {
  transform: scale(1.008);
  box-shadow: 0 8px 30px rgba(0,0,0,0.8), 0 0 16px var(--red-glow);
}

/* ─── CODE BLOCKS & COPY BUTTON ─── */
.md-content code {
  font-family: var(--font-code);
  font-size: 0.85em;
  background: #111119;
  border: 1px solid #20202c;
  color: #ff6b7a;
  padding: 2px 6px;
  border-radius: 2px;
  margin: 0 2px;
  vertical-align: baseline;
}

/* Headings with inline code (e.g. Minecraftia headings with code spans) */
.md-content h1 code,
.md-content h2 code,
.md-content h3 code,
.md-content h4 code,
.md-content h5 code,
.md-content h6 code {
  font-family: var(--font-code);
  font-size: 0.80em;
  padding: 1px 6px;
  margin: 0 4px;
  vertical-align: 1px;
  border-radius: 2px;
  display: inline-block;
  line-height: 1.3;
}

.md-content pre {
  position: relative;
  background: #08080d;
  border: 1px solid var(--border);
  padding: 1.4rem;
  padding-top: 2.6rem; /* space for cyber bar */
  margin: 1.8rem 0;
  overflow-x: auto;
}

.md-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.82rem;
  line-height: 1.65;
}

/* Cyber Code Block Header Bar */
.code-header-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: #0d0d16;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  user-select: none;
}

.code-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.code-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2a2a38;
}

.code-lang-badge {
  text-transform: uppercase;
  color: var(--red);
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-left: 4px;
}

/* Code Copy Button */
.code-copy-btn {
  position: absolute;
  top: 3px;
  right: 6px;
  z-index: 10;
  background: rgba(20, 20, 30, 0.9);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  cursor: url('../cursors/Link%20select.png') 16 16, url('../cursors/Link%20select.cur'), pointer !important;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.code-copy-btn:hover {
  cursor: url('../cursors/Link%20select.png') 16 16, url('../cursors/Link%20select.cur'), pointer !important;
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

.code-copy-btn.copied {
  border-color: #38ef7d;
  color: #38ef7d;
  background: rgba(56, 239, 125, 0.1);
}

/* ─── COMMAND PALETTE HUD (Ctrl+K or /) ─── */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 5000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.cmd-overlay.active {
  display: flex;
}

.cmd-dialog {
  width: 90%;
  max-width: 620px;
  background: #0b0b12;
  border: 1px solid var(--red-dim);
  box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 24px var(--red-glow);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  animation: cmd-pop 0.15s ease-out;
}

@keyframes cmd-pop {
  from { transform: scale(0.96) translateY(-10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.cmd-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #0f0f18;
}

.cmd-prompt {
  font-family: var(--font-ui);
  color: var(--red);
  font-weight: 700;
  font-size: 1rem;
}

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-content);
  font-size: 0.9rem;
  outline: none;
}

.cmd-badge {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
}

.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 0;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.12s;
  text-decoration: none;
  color: inherit;
  gap: 16px;
}

.cmd-item:hover,
.cmd-item.selected {
  background: #141420;
  border-left-color: var(--red);
}

.cmd-item-title {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #fff;
  font-weight: normal;
  flex: 1;
}

.cmd-item:hover .cmd-item-title,
.cmd-item.selected .cmd-item-title {
  color: var(--red);
}

.cmd-item-meta {
  font-family: var(--font-meta);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── IMAGE LIGHTBOX MODAL ─── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  z-index: 6000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-container {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
}

.lightbox-container img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid var(--border-red);
  box-shadow: 0 0 30px rgba(0,0,0,0.9), 0 0 20px var(--red-glow);
}

.lightbox-close {
  position: absolute;
  top: -38px; right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.lightbox-close:hover { color: var(--red); }

.lightbox-caption {
  font-family: var(--font-content);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 12px;
  text-align: center;
}

/* ─── FLOATING BACK TO TOP BUTTON ─── */
.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px; height: 42px;
  background: #0c0c14;
  border: 1px solid var(--border-red);
  color: var(--red);
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.back-to-top-btn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top-btn:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 16px var(--red);
}

/* ─── TOAST NOTIFICATION ─── */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 7000;
  background: #0f0f18;
  border: 1px solid var(--red);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  padding: 10px 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.8), 0 0 16px var(--red-glow);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#toast .toast-svg {
  color: var(--red);
  stroke-width: 2.5;
}

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  background: rgba(5, 5, 8, 0.98);
  width: 100%;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.2rem 2.5rem;
  font-family: var(--font-meta);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer a { color: var(--red); text-decoration: none; transition: color 0.15s; }
footer a:hover { color: #ff4455; text-decoration: underline; }

/* ─── RESPONSIVE BREAKPOINTS ─── */
@media (max-width: 960px) {
  .post-body-layout {
    grid-template-columns: 1fr;
  }
  .post-toc-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-routes, .nav-links { display: none; }
  .nav-operator-badge { display: none; }
  .brand-badge { display: none; }
  .nav-shortcuts { display: none; }
  .btn-sfx-hud { display: none; }
  .nav-hamburger-btn { display: flex; }
  #hero { padding: 3rem 1.2rem 2.5rem; padding-top: calc(56px + var(--banner-h, 0px) + 2rem); }
  main { padding: 2.5rem 1.2rem; }
  #post-view main { padding: 1.5rem 1.2rem 3.5rem; }
  .post-item { padding: 1.2rem 1.3rem; }
  .post-item .post-title { font-size: 1.08rem; }
  .hero-ops-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { padding: 2rem 1.2rem; }
}

@media (max-width: 480px) {
  .hero-ops-grid { grid-template-columns: 1fr; }
  .post-header-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .post-footer-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ─── ARCHIVE CATALOG HERO & TELEMETRY ─── */
.archive-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(232, 25, 44, 0.15);
}

.archive-header-left {
  flex: 1;
  min-width: 280px;
}

.archive-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-meta);
  font-size: 0.72rem;
  color: var(--red);
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}

.archive-eyebrow .eyebrow-tag {
  background: rgba(232, 25, 44, 0.08);
  border: 1px solid rgba(232, 25, 44, 0.3);
  padding: 2px 8px;
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.archive-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: normal;
  color: #ffffff;
  letter-spacing: 0.03em;
  margin: 0 0 0.6rem 0;
  line-height: 1.35;
}

.archive-title .text-glow {
  color: var(--red);
  text-shadow: 0 0 25px rgba(232, 25, 44, 0.55);
}

.archive-title .archive-title-amp {
  color: var(--text-muted);
  font-weight: 400;
}

.archive-desc {
  font-family: var(--font-content);
  font-size: 0.82rem;
  color: var(--text-dim);
  max-width: 680px;
  margin: 0;
  line-height: 1.6;
}

.archive-header-right {
  display: flex;
  align-items: center;
}

.archive-status-badge {
  background: rgba(12, 10, 16, 0.9);
  border: 1px solid rgba(232, 25, 44, 0.25);
  padding: 12px 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive-status-badge .status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: #4ade80;
  letter-spacing: 0.08em;
}

.archive-status-badge .status-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse-beacon 2s infinite ease-in-out;
}

@keyframes pulse-beacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.archive-status-badge .status-count {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.archive-status-badge .count-num {
  color: var(--red);
  font-weight: 700;
}

/* ─── CYBER ARCHIVE TELEMETRY CARDS ─── */
.archive-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 2.5rem;
}

.telemetry-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(16, 14, 22, 0.85) 0%, rgba(10, 9, 14, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid rgba(232, 25, 44, 0.4);
  padding: 16px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(12px);
}

.telemetry-card:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 25, 44, 0.45);
  border-top-color: var(--red);
  box-shadow: 0 8px 24px rgba(232, 25, 44, 0.15), 0 0 12px rgba(232, 25, 44, 0.1);
}

.telemetry-card.highlight-card {
  border-top: 2px solid var(--red);
  background: linear-gradient(180deg, rgba(28, 12, 18, 0.9) 0%, rgba(14, 8, 12, 0.95) 100%);
}

.telemetry-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.telemetry-label {
  font-family: var(--font-meta);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.telemetry-icon {
  color: var(--red);
  opacity: 0.7;
  transition: opacity 0.2s, filter 0.2s;
}

.telemetry-card:hover .telemetry-icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px var(--red));
}

.telemetry-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.telemetry-value {
  font-family: var(--font-ui);
  font-size: 1.65rem;
  font-weight: normal;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.telemetry-value.highlight-val {
  color: var(--red);
  text-shadow: 0 0 15px rgba(232, 25, 44, 0.6);
}

.telemetry-unit {
  font-family: var(--font-meta);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.telemetry-unit.highlight-unit {
  color: rgba(232, 25, 44, 0.9);
}

.telemetry-footer {
  font-family: var(--font-meta);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.telemetry-corner-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 35px;
  height: 35px;
  background: radial-gradient(circle at top right, rgba(232, 25, 44, 0.22), transparent 70%);
  pointer-events: none;
}

@media (max-width: 900px) {
  .archive-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .archive-title {
    font-size: 1.8rem;
    line-height: 1.35;
    font-weight: normal;
  }
}

@media (max-width: 680px) {
  .archive-hero-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
  }
  .archive-header-right {
    width: 100%;
  }
  .archive-status-badge {
    width: 100%;
    padding: 10px 14px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .archive-title {
    font-size: 1.55rem;
    line-height: 1.35;
    font-weight: normal;
  }
  .archive-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 2rem;
  }
  .telemetry-card {
    padding: 14px 12px;
  }
  .telemetry-value {
    font-size: 1.45rem;
    font-weight: normal;
  }
  .telemetry-label {
    font-size: 0.62rem;
  }
  .telemetry-footer {
    font-size: 0.66rem;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 0 0.85rem;
    height: 50px;
  }
  .nav-logo {
    font-size: 1.05rem;
  }
  .nav-right {
    gap: 0.5rem;
  }
  .btn-sfx {
    padding: 4px 7px;
    font-size: 0.64rem;
  }
  .nav-tag {
    font-size: 0.68rem;
    padding: 3px 8px;
  }
  #hero {
    padding: 2rem 0.85rem 1.8rem;
    padding-top: calc(50px + var(--banner-h, 0px) + 1.2rem);
  }
  #hero h1 {
    font-size: clamp(1.4rem, 6vw, 1.85rem);
    font-weight: normal;
    line-height: 1.35;
  }
  .hero-terminal-header {
    font-size: 0.65rem;
    padding: 6px 10px;
  }
  .hero-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1.4rem;
  }
  .hero-ops-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 1.6rem;
  }
  .hero-op-card {
    padding: 12px 14px;
  }
  .hero-badge {
    font-size: 0.62rem;
    padding: 3px 9px;
  }
  main {
    padding: 1.4rem 0.85rem 3rem;
  }
  #post-view main {
    padding: 1rem 0.85rem 3rem;
  }
  .breadcrumb {
    font-size: 0.68rem;
    margin-bottom: 1.2rem;
    gap: 6px;
  }
  .post-item {
    padding: 0.95rem 1rem;
    gap: 0.75rem;
  }
  .post-item .post-title {
    font-size: 0.98rem;
    font-weight: normal;
    line-height: 1.5;
    letter-spacing: 0.02em;
  }
  .post-item .post-excerpt {
    font-size: 0.78rem;
    line-height: 1.5;
  }
  .post-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .post-meta-inline {
    font-size: 0.68rem;
  }
  .post-tags-inline {
    flex-wrap: wrap;
    gap: 5px;
  }
  .tag {
    font-size: 0.62rem;
    padding: 2px 7px;
  }
  .post-footer-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .post-action-cue {
    font-size: 0.68rem;
  }
  .post-auth-badge {
    font-size: 0.58rem;
  }
  .archive-eyebrow {
    font-size: 0.64rem;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.45rem;
  }
  .archive-eyebrow .eyebrow-tag {
    font-size: 0.58rem;
    padding: 1px 6px;
  }
  .archive-title {
    font-size: 1.35rem;
    font-weight: normal;
    line-height: 1.35;
    margin-bottom: 0.45rem;
  }
  .archive-desc {
    font-size: 0.76rem;
    line-height: 1.5;
  }
  .archive-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 1.5rem;
  }
  .telemetry-card {
    padding: 10px 10px;
  }
  .telemetry-card-top {
    margin-bottom: 4px;
  }
  .telemetry-label {
    font-size: 0.56rem;
    letter-spacing: 0.06em;
  }
  .telemetry-icon svg {
    width: 12px;
    height: 12px;
  }
  .telemetry-main {
    margin-bottom: 2px;
    gap: 5px;
  }
  .telemetry-value {
    font-size: 1.45rem;
  }
  .telemetry-unit {
    font-size: 0.58rem;
  }
  .telemetry-footer {
    font-size: 0.58rem;
    line-height: 1.25;
  }
  .archive-status-badge {
    padding: 8px 12px;
  }
  .archive-status-badge .status-count {
    font-size: 0.88rem;
  }
  .archive-status-badge .status-indicator {
    font-size: 0.58rem;
  }
  .toolbar-container {
    margin-bottom: 1.6rem;
  }
  .search-box {
    margin-bottom: 0.75rem;
  }
  .search-box input {
    font-size: 0.76rem;
    padding: 8px 10px;
  }
  .search-shortcut {
    display: none;
  }
  .filters {
    gap: 5px;
  }
  .filter-btn {
    padding: 4px 9px;
    font-size: 0.62rem;
  }
  .filter-count, #search-status-text {
    font-size: 0.66rem;
    width: 100%;
  }
  .post-view-title {
    font-size: 1.25rem;
    font-weight: normal;
    line-height: 1.45;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
  }
  .post-view-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
  }
  .post-meta-bar {
    gap: 0.5rem 0.8rem;
    font-size: 0.68rem;
  }
  .post-view-top-bar {
    gap: 0.6rem;
    margin-bottom: 1.4rem;
  }
  .back-btn {
    padding: 6px 12px;
    font-size: 0.68rem;
  }
  .btn-ctrl {
    padding: 6px 10px;
    font-size: 0.68rem;
  }
  .md-content {
    font-size: 0.92rem;
    line-height: 1.68;
  }
  .md-content h2 {
    font-size: 1.2rem;
    margin-top: 1.8rem;
  }
  .md-content h3 {
    font-size: 1.05rem;
  }
  .md-content pre {
    padding: 1rem 0.75rem;
    padding-top: 2.3rem;
    margin: 1.2rem 0;
    font-size: 0.75rem;
  }
  .code-header-bar {
    height: 26px;
    padding: 0 8px;
    font-size: 0.6rem;
  }
  .code-copy-btn {
    top: 2px;
    right: 4px;
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  .md-content table {
    font-size: 0.76rem;
  }
  .md-content th, .md-content td {
    padding: 7px 9px;
  }
  .md-content blockquote, .md-content aside {
    padding: 0.75rem 0.95rem;
    margin: 1.2rem 0;
    font-size: 0.84rem;
  }
  .footer-inner {
    padding: 1.8rem 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
}

@media (max-width: 360px) {
  nav {
    padding: 0 0.65rem;
  }
  .nav-logo {
    font-size: 0.95rem;
    gap: 6px;
  }
  .nav-right {
    gap: 0.35rem;
  }
  .nav-tag {
    font-size: 0.62rem;
    padding: 2px 6px;
  }
  .btn-sfx span:first-of-type {
    display: none;
  }
  .archive-title {
    font-size: 1.35rem;
  }
  .archive-telemetry-grid {
    gap: 6px;
  }
  .telemetry-card {
    padding: 8px 7px;
  }
  .telemetry-value {
    font-size: 1.3rem;
  }
  .telemetry-unit {
    font-size: 0.52rem;
  }
  .telemetry-footer {
    display: none;
  }
  .archive-status-badge {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ─── PASSWORD LOCKED GATE TERMINAL ─── */
.locked-gate-wrap {
  margin: 1.5rem 0 3rem 0;
  display: flex;
  justify-content: center;
}

.locked-gate-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-card);
  border: 1px solid var(--border-red);
  border-top: 3px solid var(--red);
  padding: 2.2rem 2.4rem;
  position: relative;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7), 0 0 25px var(--red-glow);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

.locked-gate-header {
  text-align: center;
  margin-bottom: 2rem;
}

.locked-gate-icon-pulse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(232, 25, 44, 0.1);
  border: 1px solid var(--red-dim);
  color: var(--red);
  margin-bottom: 1.2rem;
  box-shadow: 0 0 20px var(--red-glow);
  animation: pulseLock 2.5s infinite ease-in-out;
}

@keyframes pulseLock {
  0%, 100% { transform: scale(1); box-shadow: 0 0 15px var(--red-glow); }
  50% { transform: scale(1.05); box-shadow: 0 0 28px rgba(232, 25, 44, 0.4); }
}

.locked-gate-eyebrow {
  font-family: var(--font-meta);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--red);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.locked-gate-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.locked-gate-desc {
  font-family: var(--font-content);
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 540px;
  margin: 0 auto;
}

.locked-gate-desc strong {
  color: #fff;
}

.locked-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 1.8rem;
}

.locked-spec-item {
  background: rgba(8, 8, 12, 0.85);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border-red);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.locked-spec-label {
  font-family: var(--font-meta);
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.locked-spec-val {
  font-family: var(--font-meta);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.locked-spec-val.highlight-green {
  color: #38ef7d;
  text-shadow: 0 0 8px rgba(56, 239, 125, 0.3);
}

.locked-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.locked-input-group {
  display: flex;
  align-items: center;
  background: #08080c;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.locked-input-group:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 14px var(--red-glow);
}

.locked-prompt-symbol {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red);
  padding: 0 0.9rem;
  user-select: none;
  letter-spacing: 0.05em;
}

.locked-pass-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-content);
  font-size: 0.95rem;
  padding: 12px 6px;
  letter-spacing: 0.08em;
}

.locked-pass-input::placeholder {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.locked-toggle-vis {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  padding: 0 14px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.locked-toggle-vis:hover {
  color: #fff;
}

.locked-actions-row {
  display: flex;
  gap: 12px;
}

.locked-submit-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--red);
  color: #fff;
  border: none;
  font-family: var(--font-ui);
  font-weight: normal;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 13px 24px;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: 0 0 18px var(--red-glow);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.locked-submit-btn:hover:not(:disabled) {
  background: #ff253a;
  box-shadow: 0 0 26px rgba(232, 25, 44, 0.45);
  transform: translateY(-1px);
}

.locked-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.locked-submit-btn.loading {
  background: var(--red-dim);
  box-shadow: none;
}

.locked-feedback {
  font-family: var(--font-content);
  font-size: 0.78rem;
  padding: 10px 14px;
  border-radius: 0;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.feedback-error {
  background: rgba(232, 25, 44, 0.12);
  border: 1px solid var(--red-dim);
  border-left: 3px solid var(--red);
  color: #ff8892;
}

.feedback-success {
  background: rgba(56, 239, 125, 0.1);
  border: 1px solid #165b32;
  border-left: 3px solid #38ef7d;
  color: #72f7a4;
}

.locked-footer-notice {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-meta);
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.btn-relock {
  color: var(--red) !important;
  border-color: var(--border-red) !important;
}

.btn-relock:hover {
  background: rgba(232, 25, 44, 0.15) !important;
  border-color: var(--red) !important;
}

.tag-locked {
  background: rgba(232, 25, 44, 0.15) !important;
  border-color: var(--red) !important;
  color: #ff4d5a !important;
  font-weight: 700 !important;
  box-shadow: 0 0 8px rgba(232, 25, 44, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-locked svg {
  vertical-align: -1px;
}

.lock-icon-inline {
  vertical-align: -1px;
  margin-right: 6px;
  color: var(--red);
  stroke: var(--red);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.post-item:hover .lock-icon-inline {
  filter: drop-shadow(0 0 6px var(--red-glow));
  transform: scale(1.1);
}

.post-item.is-locked-card {
  border-left: 2px solid var(--border-red);
}

.post-item.is-locked-card:hover {
  border-left-color: var(--red);
}

@media (max-width: 600px) {
  .locked-gate-card {
    padding: 1.6rem 1.2rem;
  }
  .locked-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .locked-gate-title {
    font-size: 1.45rem;
  }
}

/* ─── END-OF-POST ENCRYPT / RE-LOCK CONTAINER ─── */
.post-end-encrypt-bar {
  margin: 3.5rem 0 2rem 0;
  padding: 1.6rem 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.post-end-encrypt-bar::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 140px;
  height: 100%;
  background: radial-gradient(circle at 100% 0%, rgba(232, 25, 44, 0.1), transparent 70%);
  pointer-events: none;
}

.post-end-encrypt-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.post-end-encrypt-meta {
  flex: 1;
  min-width: 260px;
}

.post-end-encrypt-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-meta);
  font-size: 0.72rem;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.post-end-encrypt-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: normal;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.post-end-encrypt-desc {
  font-family: var(--font-content);
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

.btn-end-encrypt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--bg-hover);
  border: 1px solid var(--border-red);
  color: #ff4d5a;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: normal;
  letter-spacing: 0.05em;
  padding: 12px 24px;
  cursor: pointer;
  line-height: 1.2;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-end-encrypt:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 0 20px var(--red-glow);
  transform: translateY(-1px);
}

.btn-end-encrypt:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .post-end-encrypt-bar {
    padding: 1.4rem 1.2rem;
  }
  .post-end-encrypt-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-end-encrypt {
    width: 100%;
  }
}

/* ─── 404 ERROR PAGE STYLING ─── */
.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.page-404 #cyber-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.container-404 {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 6rem;
  position: relative;
  z-index: 2;
}

.card-404 {
  max-width: 780px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: 3.2rem 3rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(232, 25, 44, 0.12);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  position: relative;
  overflow: hidden;
}

.card-404::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle at 100% 0%, rgba(232, 25, 44, 0.15), transparent 70%);
  pointer-events: none;
}

/* 404 Glitch Number */
.glitch-404-wrap {
  position: relative;
  display: inline-block;
  font-family: var(--font-heading);
  font-size: clamp(4.5rem, 12vw, 7.5rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0.05em;
  color: #fff;
  margin-bottom: 0.8rem;
  text-shadow: 0 0 25px rgba(232, 25, 44, 0.6);
  user-select: none;
}

.glitch-404-wrap::before,
.glitch-404-wrap::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-404-wrap::before {
  left: 2px;
  text-shadow: -2px 0 #00ffff;
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.glitch-404-wrap::after {
  left: -2px;
  text-shadow: -2px 0 var(--red);
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% { clip: rect(15px, 9999px, 30px, 0); transform: skew(0.3deg); }
  20% { clip: rect(60px, 9999px, 85px, 0); transform: skew(-0.2deg); }
  40% { clip: rect(20px, 9999px, 50px, 0); transform: skew(0.5deg); }
  60% { clip: rect(75px, 9999px, 100px, 0); transform: skew(-0.4deg); }
  80% { clip: rect(10px, 9999px, 40px, 0); transform: skew(0.2deg); }
  100% { clip: rect(50px, 9999px, 75px, 0); transform: skew(-0.1deg); }
}

@keyframes glitch-anim-2 {
  0% { clip: rect(65px, 9999px, 90px, 0); transform: skew(-0.3deg); }
  25% { clip: rect(10px, 9999px, 35px, 0); transform: skew(0.4deg); }
  50% { clip: rect(80px, 9999px, 110px, 0); transform: skew(-0.2deg); }
  75% { clip: rect(40px, 9999px, 70px, 0); transform: skew(0.3deg); }
  100% { clip: rect(15px, 9999px, 45px, 0); transform: skew(-0.5deg); }
}

/* 404 Eyebrow & Titles */
.eyebrow-404 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-meta);
  font-size: 0.74rem;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 0.8rem;
  background: rgba(232, 25, 44, 0.08);
  border: 1px solid var(--border-red);
  padding: 4px 12px;
}

.title-404 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 0.8rem;
}

.desc-404 {
  font-family: var(--font-content);
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 620px;
}

/* Terminal Diagnostic Block */
.terminal-404 {
  background: #08080c;
  border: 1px solid var(--border);
  margin-bottom: 2.2rem;
  font-family: var(--font-code);
  font-size: 0.78rem;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.terminal-404-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.terminal-body {
  padding: 14px 16px;
  line-height: 1.8;
  color: var(--text-dim);
}

.t-red { color: var(--red); font-weight: 700; }
.t-green { color: #38ef7d; font-weight: 600; }
.t-cyan { color: #00e5ff; }
.t-yellow { color: #f5a623; }
.t-white { color: #fff; }

/* 404 Action Buttons */
.actions-404-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-404-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: normal;
  letter-spacing: 0.05em;
  padding: 12px 26px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  box-shadow: 0 0 18px var(--red-glow);
  transition: all 0.2s ease;
}

.btn-404-primary:hover {
  background: #ff253a;
  box-shadow: 0 0 28px rgba(232, 25, 44, 0.5);
  transform: translateY(-1px);
}

.btn-404-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: normal;
  letter-spacing: 0.05em;
  padding: 11px 22px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: all 0.2s ease;
}

.btn-404-secondary:hover {
  border-color: var(--border-red);
  color: #fff;
  background: rgba(232, 25, 44, 0.08);
  transform: translateY(-1px);
}

.btn-404-secondary kbd {
  background: #000;
  border: 1px solid var(--border);
  padding: 1px 6px;
  font-size: 0.72rem;
  color: var(--red);
  border-radius: 2px;
}

@media (max-width: 600px) {
  .card-404 {
    padding: 2rem 1.4rem;
  }
  .actions-404-grid {
    flex-direction: column;
  }
  .btn-404-primary,
  .btn-404-secondary {
    width: 100%;
  }
}

/* ─── 18. KATEX & LATEX MATHEMATICAL FORMULA STYLING ─── */
.katex {
  font-size: 1.05em;
  text-rendering: geometricPrecision;
  color: #f0f0f8;
}

/* Inline math formula containers */
.math.inline,
span.katex:not(.katex-display .katex) {
  display: inline-block;
  vertical-align: -0.1em;
  padding: 0.1em 0.35em;
  margin: 0 0.12em;
  background: rgba(232, 25, 44, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  line-height: normal;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.math.inline:hover,
span.katex:not(.katex-display .katex):hover {
  border-color: rgba(232, 25, 44, 0.3);
  background: rgba(232, 25, 44, 0.09);
}

/* Display / Block math formula containers */
.math.block,
.katex-display {
  display: block;
  margin: 1.8rem 0;
  padding: 1.4rem 1.8rem;
  background: rgba(11, 11, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--red, #e8192c);
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), inset 0 0 20px rgba(232, 25, 44, 0.02);
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.katex-display > .katex {
  display: inline-block;
  text-align: initial;
  max-width: 100%;
}

/* KaTeX custom horizontal scrollbar for large matrices and equations */
.math.block::-webkit-scrollbar,
.katex-display::-webkit-scrollbar {
  height: 4px;
}

.math.block::-webkit-scrollbar-track,
.katex-display::-webkit-scrollbar-track {
  background: rgba(10, 10, 15, 0.8);
}

.math.block::-webkit-scrollbar-thumb,
.katex-display::-webkit-scrollbar-thumb {
  background: var(--red, #e8192c);
  border-radius: 2px;
}

/* KaTeX error fallback */
.katex-error {
  color: #ff4455 !important;
  font-family: var(--font-code, 'JetBrains Mono', monospace);
  font-size: 0.88em;
  background: rgba(232, 25, 44, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px dashed rgba(232, 25, 44, 0.4);
}

@media (max-width: 768px) {
  .math.block,
  .katex-display {
    padding: 1rem 1.1rem;
    margin: 1.4rem 0;
  }
}

/* ─── 19. CUSTOM CYBER CURSORS (STANDARDIZED 32PX) ─── */
html, body {
  cursor: url('../cursors/Normal%20select.png') 10 5, url('../cursors/Normal%20select.cur'), auto;
}

/* Interactive links, buttons, cards & clickable elements */
a, button, [role="button"], .tag, .filter-btn, .post-item, select, .summary-btn, 
.nav-brand, .shortcut-key, summary, .interactive, .btn-ctrl, .back-btn, 
.btn-sfx-hud, .nav-shortcut-btn, .mobile-tool-btn, .btn-404-primary, .btn-404-secondary,
.companion-model-wrap, .companion-toggle-btn, .dialogue-close, .nav-hamburger-btn,
.code-copy-btn, button.code-copy-btn, pre .code-copy-btn, .pedestal-toggle, .companion-pedestal {
  cursor: url('../cursors/Link%20select.png') 16 16, url('../cursors/Link%20select.cur'), pointer !important;
}

/* Text inputs, code blocks, terminal outputs & editable fields */
input[type="text"], input[type="search"], input[type="password"], textarea, 
pre, code, .code-line, .terminal-body, .locked-pass-input {
  cursor: url('../cursors/Text%20select.png') 14 15, url('../cursors/Text%20select.cur'), text;
}

/* Tooltips, help prompts, badges & info markers */
[title], [aria-label], .help-icon, abbr, .route-num, .brand-badge {
  cursor: url('../cursors/Help%20select.png') 4 3, url('../cursors/Help%20select.cur'), help;
}

/* Busy / loading waiting states */
.is-loading, .loading, .busy, [data-loading="true"] {
  cursor: url('../cursors/Busy.png') 11 15, url('../cursors/Busy.cur'), wait;
}

/* Background task processing / working progress */
.in-background, .working, progress, [data-progress] {
  cursor: url('../cursors/Working%20in%20background.png') 4 3, url('../cursors/Working%20in%20background.cur'), progress;
}

/* Disabled & blocked elements */
:disabled, [disabled], .disabled, [aria-disabled="true"], .is-locked-card {
  cursor: url('../cursors/Unavailable.png') 15 16, url('../cursors/Unavailable.cur'), not-allowed;
}

/* Precision crosshair for interactive canvas & lightbox inspect */
canvas#cyber-canvas, .diagram-canvas, .lightbox-overlay, .pixel-canvas, .post-hero-img {
  cursor: url('../cursors/Precision%20select.png') 16 15, url('../cursors/Precision%20select.cur'), crosshair;
}

/* Move / dragging interactions */
[draggable="true"], .draggable, .moveable, .drag-handle {
  cursor: url('../cursors/move.png') 14 15, url('../cursors/move.cur'), move;
}

/* Resizing handles */
.resize-ns, [data-resize="ns"], .row-resize {
  cursor: url('../cursors/Vertical%20resize.png') 15 16, url('../cursors/Vertical%20resize.cur'), ns-resize;
}
.resize-ew, [data-resize="ew"], .col-resize {
  cursor: url('../cursors/Horizontal%20resize.png') 15 16, url('../cursors/Horizontal%20resize.cur'), ew-resize;
}
.resize-nwse, [data-resize="nwse"] {
  cursor: url('../cursors/Diagonal%20resize%201.png') 15 16, url('../cursors/Diagonal%20resize%201.cur'), nwse-resize;
}
.resize-nesw, [data-resize="nesw"] {
  cursor: url('../cursors/Diagonal%20resize%202.png') 15 16, url('../cursors/Diagonal%20resize%202.cur'), nesw-resize;
}

/* Person / Author / Operative avatar selection */
.meta-author, .post-meta-author, .author-badge, .mobile-operator-badge, 
.nav-operator-badge, .author-dot, .companion-img, .author-avatar {
  cursor: url('../cursors/Person%20select.png') 16 16, url('../cursors/Person%20select.cur'), pointer;
}

/* Alternate selection / quotes / Easter eggs */
.dialogue-cue, .easter-egg, .quote-trigger, .terminal-dots, .post-auth-badge {
  cursor: url('../cursors/Alternate%20select.png') 15 15, url('../cursors/Alternate%20select.cur'), pointer;
}

/* Location selection / navigation breadcrumbs */
.breadcrumb, .breadcrumb a, .route-item, .crumb-current, .toc-link {
  cursor: url('../cursors/Location%20select.png') 7 7, url('../cursors/Location%20select.cur'), pointer;
}

/* Handwriting / Signature */
.handwriting, .signature, .annotation {
  cursor: url('../cursors/Handwritting.png') 1 32, url('../cursors/Handwritting.cur'), default;
}

/* ─── 20. CYBER OPERATIVE COMPANION (KIRA // 0x0D) — DOCKED LEFT ─── */
:root {
  --companion-w: 240px;
  --companion-h: 360px;
}

.cyber-companion {
  position: fixed;
  bottom: 0;
  left: 24px;
  right: auto;
  z-index: 998;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  user-select: none;
}

/* Stage containing Model + Pedestal Dock */
.companion-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

/* Model Container & Forensic Protective Shield */
.companion-model-wrap {
  position: relative;
  width: var(--companion-w);
  height: var(--companion-h);
  pointer-events: auto;
  cursor: url('../cursors/Person%20select.png') 16 16, url('../cursors/Person%20select.cur'), pointer !important;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 1px rgba(232, 25, 44, 0.7));
  transition: transform 0.22s ease, filter 0.22s ease;
  user-select: none;
  -webkit-user-select: none;
}

.companion-model-wrap:hover {
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(232, 25, 44, 0.6)) brightness(1.04);
  transform: translateY(-2px);
}

.companion-model-wrap:active {
  transform: translateY(0) scale(0.99);
}

.companion-model-wrap.is-shifting {
  filter: drop-shadow(0 0 14px rgba(0, 255, 238, 0.75)) drop-shadow(0 0 2px rgba(232, 25, 44, 0.9)) brightness(1.1);
  transform: translateY(-3px) scale(1.015);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.18s ease;
}

/* Invisible Guard Shield covering Kira against Right-Click & Drag */
.companion-shield {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  pointer-events: auto;
  cursor: url('../cursors/Person%20select.png') 16 16, url('../cursors/Person%20select.cur'), pointer !important;
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Character Canvas & Image — Cryptographically Shielded, Anti-Drag, Zero Direct Events */
.companion-canvas,
.companion-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
  user-drag: none !important;
  -webkit-touch-callout: none !important;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transition: transform 0.2s ease, filter 0.2s ease;
  position: relative;
  z-index: 1;
}

/* Ambient Ground Shadow Beneath Boots (Clean, natural, non-slop) */
.holo-emitter-glow {
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 12px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, rgba(232, 25, 44, 0.12) 40%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(2px);
}

/* Modern Tactical Floating Dock (Sleek micro-pill, overlapping lower legs) */
.companion-pedestal {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: auto;
  min-width: 175px;
  margin-top: -52px;
  margin-bottom: 14px;
  padding: 6px 10px 6px 14px;
  background: rgba(11, 11, 17, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 1px rgba(232, 25, 44, 0.4);
  pointer-events: auto;
  z-index: 10;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-sizing: border-box;
}

.companion-pedestal:hover {
  border-color: rgba(232, 25, 44, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.85), 0 0 12px rgba(232, 25, 44, 0.25);
}

.pedestal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-code);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  user-select: none;
}

/* Refined status beacon (soft breathing pulse) */
.pedestal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38ef7d;
  box-shadow: 0 0 6px rgba(56, 239, 125, 0.6);
  flex-shrink: 0;
  animation: ledPulse 2.5s ease-in-out infinite;
}

.pedestal-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.pedestal-sep {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 300;
  font-size: 0.65rem;
}

.pedestal-role {
  color: var(--text-muted);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  font-weight: 500;
  text-transform: uppercase;
}

/* Tactile pill toggle button */
.pedestal-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  font-family: var(--font-code);
  font-size: 0.8rem;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: url('../cursors/Link%20select.png') 16 16, url('../cursors/Link%20select.cur'), pointer !important;
  transition: all 0.18s ease;
  flex-shrink: 0;
  padding: 0;
}

.pedestal-toggle:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 0 10px rgba(232, 25, 44, 0.5);
  transform: scale(1.08);
}

.pedestal-toggle:active {
  transform: scale(0.94);
}

/* Minimized / Collapsed State */
.cyber-companion.collapsed {
  --companion-w: auto;
  --companion-h: 0px;
}

.cyber-companion.collapsed .companion-model-wrap,
.cyber-companion.collapsed .companion-dialogue {
  display: none !important;
}

.cyber-companion.collapsed .companion-stage {
  align-items: flex-start;
}

.cyber-companion.collapsed .companion-pedestal {
  margin-top: 0 !important;
  margin-bottom: 16px;
  padding: 6px 12px 6px 14px;
  border-radius: 999px;
  background: rgba(14, 14, 22, 0.95);
  border-color: rgba(232, 25, 44, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.85), 0 0 12px rgba(232, 25, 44, 0.2);
  cursor: url('../cursors/Link%20select.png') 16 16, url('../cursors/Link%20select.cur'), pointer !important;
}

.cyber-companion.collapsed .companion-pedestal:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.9), 0 0 16px rgba(232, 25, 44, 0.4);
}

.cyber-companion.collapsed .companion-pedestal:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.9), 0 0 16px rgba(232, 25, 44, 0.4);
}

/* ─── TACTICAL COMMS HUD (DIALOGUE) ─── */
.companion-dialogue {
  position: relative;
  width: 320px;
  max-width: calc(100vw - 40px);
  margin-bottom: 12px;
  background: rgba(8, 8, 14, 0.97);
  border: 1px solid rgba(232, 25, 44, 0.5);
  border-left: 3px solid var(--red, #e8192c);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), inset 0 0 14px rgba(232, 25, 44, 0.04);
  padding: 10px 14px 8px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(10px);
}

.companion-dialogue.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.comms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(232, 25, 44, 0.2);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.comms-channel {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comms-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.comms-title {
  font-family: var(--font-code);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--red);
  font-weight: 600;
}

.comms-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comms-freq {
  font-family: var(--font-code);
  font-size: 0.58rem;
  color: var(--text-dim);
}

.comms-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: url('../cursors/Link%20select.png') 16 16, url('../cursors/Link%20select.cur'), pointer !important;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}

.comms-close:hover {
  color: #fff;
}

.comms-body {
  font-family: var(--font-ui, 'Chakra Petch', sans-serif);
  font-size: 0.84rem;
  line-height: 1.45;
  color: #f0f0f8;
  min-height: 38px;
}

.comms-prompt {
  font-family: var(--font-code);
  font-size: 0.64rem;
  color: var(--text-dim);
  margin-bottom: 3px;
  letter-spacing: 0.05em;
}

.comms-body p {
  margin: 0;
}

.comms-body .quote-author {
  display: block;
  font-family: var(--font-code);
  font-size: 0.68rem;
  color: var(--red);
  margin-top: 4px;
  text-align: right;
}

.comms-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-code);
  font-size: 0.55rem;
  color: var(--text-dim);
  margin-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  padding-top: 4px;
  letter-spacing: 0.04em;
}

.comms-status {
  color: #38ef7d;
}

.comms-hint {
  color: var(--text-muted);
}

/* Pointer Arrow Anchored Left (Pointing to Kira) */
.dialogue-arrow {
  position: absolute;
  bottom: -6px;
  left: 42px;
  right: auto;
  width: 10px;
  height: 10px;
  background: rgba(8, 8, 14, 0.97);
  border-right: 1px solid rgba(232, 25, 44, 0.5);
  border-bottom: 1px solid rgba(232, 25, 44, 0.5);
  transform: rotate(45deg);
}

/* Hologram Re-sync Animation on Click */
@keyframes holoResync {
  0% { transform: scale(1); filter: brightness(1); }
  25% { transform: scale(1.02) skewX(-1.5deg); filter: brightness(1.5) drop-shadow(0 0 12px #ff4455); }
  50% { transform: scale(0.99) skewX(1.5deg); filter: brightness(0.9) drop-shadow(0 0 8px #00ffee); }
  75% { transform: scale(1.01); filter: brightness(1.25); }
  100% { transform: scale(1); filter: brightness(1); }
}

.companion-model-wrap.is-syncing {
  animation: holoResync 0.32s ease-out;
}

@keyframes emitterPulse {
  0% { opacity: 0.6; transform: translateX(-50%) scaleX(0.9); }
  100% { opacity: 1; transform: translateX(-50%) scaleX(1.1); }
}

@keyframes ledPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Back-to-top Button: Kept in natural right corner */
.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
}

/* Mobile & Tablet Responsive Layout */
@media (max-width: 1280px) {
  :root {
    --companion-w: 200px;
    --companion-h: 300px;
  }
}

@media (max-width: 960px) {
  :root {
    --companion-w: 160px;
    --companion-h: 240px;
  }
  .companion-pedestal {
    margin-top: -38px;
    min-width: 155px;
  }
  .companion-dialogue {
    width: 270px;
  }
}

@media (max-width: 768px) {
  :root {
    --companion-w: 116px;
    --companion-h: 174px;
  }
  .cyber-companion {
    left: 12px;
    bottom: 0px;
  }
  .companion-stage {
    align-items: flex-start;
  }
  .companion-pedestal {
    min-width: unset;
    margin-top: -28px;
    margin-bottom: 10px;
    padding: 4px 6px 4px 10px;
    gap: 8px;
  }
  .pedestal-role, .pedestal-sep {
    display: none; /* Hide subtitle on mobile for ultra-clean layout */
  }
  .pedestal-name {
    font-size: 0.66rem;
  }
  .pedestal-toggle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.9rem;
  }
  .cyber-companion.collapsed .companion-pedestal {
    margin-top: 0 !important;
    margin-bottom: 12px;
    padding: 6px 10px 6px 12px;
  }
  .companion-dialogue {
    width: min(290px, calc(100vw - 24px));
    margin-bottom: 8px;
    padding: 8px 12px;
  }
  .dialogue-arrow {
    left: 28px;
  }
  .comms-freq {
    display: none;
  }
  .comms-body {
    font-size: 0.78rem;
    min-height: auto;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .comms-footer {
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.52rem;
  }
}

@media (max-width: 480px) {
  :root {
    --companion-w: 100px;
    --companion-h: 150px;
  }
  .cyber-companion {
    left: 8px;
    bottom: 0px;
  }
  .companion-pedestal {
    margin-top: -24px;
    margin-bottom: 8px;
    padding: 3px 5px 3px 8px;
    gap: 6px;
  }
  .pedestal-name {
    font-size: 0.62rem;
  }
  .pedestal-toggle {
    width: 26px;
    height: 26px;
    min-width: 26px;
  }
  .cyber-companion.collapsed .companion-pedestal {
    margin-top: 0 !important;
    margin-bottom: 10px;
  }
  .companion-dialogue {
    width: calc(100vw - 16px);
    max-width: 275px;
  }
}

