/* ============================================
   WE INVESTIGATE ANYTHING — Underground DFIR Theme
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f18;
  --bg-card: #12121e;
  --bg-card-hover: #1a1a2e;
  --bg-terminal: #080810;
  --text-primary: #c8c8d4;
  --text-secondary: #6a6a80;
  --text-dim: #3a3a50;
  --accent-green: #00ff41;
  --accent-green-dim: #00cc33;
  --accent-cyan: #00d4ff;
  --accent-red: #ff0040;
  --accent-yellow: #ffcc00;
  --accent-purple: #b44aff;
  --border-color: #1e1e30;
  --border-glow: rgba(0, 255, 65, 0.15);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --container-width: 1200px;
  --container-narrow: 800px;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-green-dim) var(--bg-secondary);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* === SCANLINE & NOISE EFFECTS === */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 65, 0.008) 2px,
    rgba(0, 255, 65, 0.008) 4px
  );
}

.noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-green-dim); border-radius: 3px; }

/* === LINKS === */
a {
  color: var(--accent-green);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

/* === CONTAINERS === */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 2rem;
}

/* === HEADER === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 2px;
}
.logo-q {
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
  transition: all 0.3s ease;
}
.logo-q:nth-child(2) {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}
.logo-q:nth-child(3) {
  color: var(--accent-red);
  text-shadow: 0 0 10px rgba(255, 0, 64, 0.5);
}
.logo-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
  letter-spacing: 1px;
  font-weight: 400;
  transition: color 0.2s;
}
.site-logo:hover .logo-name {
  color: var(--accent-green);
}
.site-logo:hover .logo-q {
  animation: logo-flicker 0.4s ease;
}
@keyframes logo-flicker {
  0%, 100% { opacity: 1; }
  33% { opacity: 0.3; }
  66% { opacity: 0.8; }
}

@keyframes blink {
  50% { opacity: 0; }
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  align-items: center;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.nav-links a:hover {
  color: var(--accent-green);
  background: rgba(0, 255, 65, 0.05);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

/* === DROPDOWN === */
.nav-dropdown {
  position: relative;
}
.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dropdown-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
}
.nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: rgba(15, 15, 24, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 1001;
}
.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu li {
  list-style: none;
}
.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: all 0.2s;
}
.dropdown-menu a:hover {
  color: var(--accent-green);
  background: rgba(0, 255, 65, 0.05);
  border-left-color: var(--accent-green);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.dropdown-viewall a {
  color: var(--accent-green) !important;
  font-weight: 600;
  font-size: 0.78rem;
  border-bottom: 1px dashed rgba(0, 255, 65, 0.2);
  margin-bottom: 0.2rem;
}

.lang-switch a {
  border: 1px solid var(--accent-green-dim);
  color: var(--accent-green) !important;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
}
.lang-switch a:hover {
  background: var(--accent-green);
  color: var(--bg-primary) !important;
  text-shadow: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent-green);
  transition: all 0.3s;
}

/* === HERO === */
.hero {
  padding: 5rem 0 0.5rem;
  position: relative;
}

/* Hero badge - large ??? above terminal */
.hero-badge {
  text-align: center;
  margin-bottom: 1.2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.badge-q {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  display: inline-block;
  animation: badge-float 3s ease-in-out infinite;
}
.badge-q:nth-child(1) {
  color: var(--accent-green);
  text-shadow: 0 0 30px rgba(0, 255, 65, 0.4), 0 0 60px rgba(0, 255, 65, 0.1);
  animation-delay: 0s;
}
.badge-q:nth-child(2) {
  color: var(--accent-cyan);
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.4), 0 0 60px rgba(0, 212, 255, 0.1);
  animation-delay: 0.3s;
}
.badge-q:nth-child(3) {
  color: var(--accent-red);
  text-shadow: 0 0 30px rgba(255, 0, 64, 0.4), 0 0 60px rgba(255, 0, 64, 0.1);
  animation-delay: 0.6s;
}
@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Hex dump styling */
.hex-dump {
  font-size: 0.75rem !important;
  opacity: 0.6;
  margin-bottom: 0.2rem !important;
}
.hex-offset {
  color: var(--text-dim);
  margin-right: 0.5rem;
}
.hex-data {
  color: var(--accent-green-dim);
  letter-spacing: 1px;
}
.hex-ascii {
  color: var(--text-dim);
  margin-left: 1rem;
}

.terminal-window {
  background: var(--bg-terminal);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 0 30px rgba(0, 255, 65, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.5);
}
.terminal-header {
  background: var(--bg-secondary);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
.three-questions {
  display: flex;
  align-items: center;
  gap: 3px;
}
.three-questions .q {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}
.three-questions .q:nth-child(1) {
  color: var(--accent-green);
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}
.three-questions .q:nth-child(2) {
  color: var(--accent-cyan);
  text-shadow: 0 0 6px rgba(0, 212, 255, 0.5);
}
.three-questions .q:nth-child(3) {
  color: var(--accent-red);
  text-shadow: 0 0 6px rgba(255, 0, 64, 0.5);
}
.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
}
.terminal-body {
  padding: 2.5rem 3rem;
  font-family: var(--font-mono);
}

.typing-line {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.prompt {
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-weight: 700;
}
.cmd { color: var(--accent-cyan); }
.cmd.blink { animation: blink 1s step-end infinite; }

.terminal-body h1 {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent-green);
  margin: 0.8rem 0 1.2rem;
  line-height: 1.2;
}

.hero-subtitle {
  color: var(--text-primary);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}
.hero-intro {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.2rem;
  font-style: italic;
}

/* Glitch effect */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.glitch:hover::before {
  opacity: 0.8;
  color: var(--accent-red);
  animation: glitch-1 0.3s linear;
  clip-path: inset(20% 0 30% 0);
}
.glitch:hover::after {
  opacity: 0.8;
  color: var(--accent-cyan);
  animation: glitch-2 0.3s linear;
  clip-path: inset(50% 0 10% 0);
}

@keyframes glitch-1 {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(3px, -3px); }
  60% { transform: translate(-2px, 1px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}
@keyframes glitch-2 {
  0% { transform: translate(0); }
  20% { transform: translate(3px, -2px); }
  40% { transform: translate(-3px, 2px); }
  60% { transform: translate(1px, -3px); }
  80% { transform: translate(-2px, 3px); }
  100% { transform: translate(0); }
}

/* === CATEGORY CARDS === */
.categories-grid {
  padding: 0.5rem 0;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-green);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-green-dim);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 255, 65, 0.1);
}
.category-card:hover::before {
  transform: scaleX(1);
}

.card-icon {
  margin-bottom: 1rem;
  color: var(--accent-green);
  opacity: 0.7;
  transition: all 0.3s;
}
.card-icon svg {
  width: 36px;
  height: 36px;
}
.category-card:hover .card-icon {
  opacity: 1;
  transform: scale(1.1);
  color: var(--accent-cyan);
}
.card-leon .card-icon {
  color: var(--accent-purple);
}
.card-leon:hover .card-icon {
  color: var(--accent-purple);
  filter: brightness(1.3);
}
.category-card h3 {
  font-family: var(--font-mono);
  color: var(--accent-green);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.card-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}

.card-leon::before { background: var(--accent-purple); }
.card-leon:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 8px 30px rgba(180, 74, 255, 0.1);
}
.card-leon h3 { color: var(--accent-purple); }

/* === POSTS LIST === */
.latest-posts {
  padding: 3rem 0 5rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.post-preview {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s;
}
.post-preview:hover {
  padding-left: 1rem;
  border-left: 2px solid var(--accent-green);
}
.post-preview h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.post-preview h3 a {
  color: var(--text-primary);
}
.post-preview h3 a:hover {
  color: var(--accent-green);
}
.post-preview p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.post-category {
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
}
.read-time { color: var(--text-dim); }

.read-more {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-green-dim);
  display: inline-block;
  margin-top: 0.5rem;
}

/* === POST FULL === */
.post-full {
  padding-top: 6rem;
  padding-bottom: 4rem;
}
.post-header {
  margin-bottom: 3rem;
}
.post-title {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--accent-green);
  line-height: 1.3;
  margin-bottom: 1rem;
}
.post-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-purple);
  background: rgba(180, 74, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  border: 1px solid rgba(180, 74, 255, 0.2);
}

/* === POST CONTENT === */
.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
}
.post-content h2 {
  font-family: var(--font-mono);
  color: var(--accent-green);
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-color);
}
.post-content h3 {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 1.2rem;
  margin: 2rem 0 0.8rem;
}
.post-content p { margin-bottom: 1.2rem; }
.post-content ul, .post-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}
.post-content li {
  margin-bottom: 0.4rem;
}
.post-content code {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  color: var(--accent-cyan);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}
.post-content pre {
  background: var(--bg-terminal);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}
.post-content blockquote {
  border-left: 3px solid var(--accent-green);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: rgba(0, 255, 65, 0.03);
  color: var(--text-secondary);
  font-style: italic;
}
.post-content img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  margin: 1.5rem 0;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.post-content th {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  color: var(--accent-green);
  padding: 0.7rem 1rem;
  text-align: left;
  border: 1px solid var(--border-color);
}
.post-content td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-color);
}
.post-content tr:hover {
  background: rgba(0, 255, 65, 0.02);
}

/* === SHARE BUTTONS === */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
}
.share-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.share-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.share-btn:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
  text-shadow: none;
}

/* === POST NAV === */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
}
.post-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* === COMMENTS === */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

/* === PAGE === */
.page-header {
  padding-top: 6rem;
  margin-bottom: 2rem;
}
.page-title {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--accent-green);
}
.page-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 0.5rem;
}
.page-content {
  font-size: 1.05rem;
  line-height: 1.8;
}
.page-content h2 {
  font-family: var(--font-mono);
  color: var(--accent-green);
  font-size: 1.4rem;
  margin: 3rem 0 1.2rem;
  padding: 0.8rem 0 0.5rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}
.page-content h2::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}
.page-content h3 {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 1.15rem;
  margin: 2rem 0 0.8rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--accent-cyan);
}
.page-content h4 {
  font-family: var(--font-mono);
  color: var(--accent-purple);
  font-size: 1rem;
  margin: 1.5rem 0 0.6rem;
}
.page-content p {
  margin-bottom: 1.2rem;
}
.page-content ul, .page-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}
.page-content li {
  margin-bottom: 0.5rem;
}
.page-content strong {
  color: var(--text-primary);
}
.page-content code {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  color: var(--accent-cyan);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}
.page-content blockquote {
  border-left: 3px solid var(--accent-green);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: rgba(0, 255, 65, 0.03);
  color: var(--text-secondary);
  font-style: italic;
}
.page-content hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 2.5rem 0;
  position: relative;
}
.page-content hr::after {
  content: '///';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary);
  padding: 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 3px;
}
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.page-content th {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  color: var(--accent-green);
  padding: 0.7rem 1rem;
  text-align: left;
  border: 1px solid var(--border-color);
}
.page-content td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-color);
}
.page-content tr:hover {
  background: rgba(0, 255, 65, 0.02);
}
.page-content a {
  border-bottom: 1px dashed rgba(0, 255, 65, 0.3);
}
.page-content a:hover {
  border-bottom-color: var(--accent-cyan);
}

/* === EMPTY STATE === */
.empty-state {
  padding: 3rem 0;
  text-align: center;
}
.terminal-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.dimmed { color: var(--text-dim); }

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  background: var(--bg-secondary);
}
.footer-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}
.footer-logo {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  gap: 2px;
}
.footer-logo .logo-q {
  font-size: 1.4rem;
}
.footer-sitename {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  letter-spacing: 1px;
}
.footer-tagline {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer-col h4 {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}
.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

/* === 404 === */
.page-404 {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 4rem;
}
.error-code {
  font-family: var(--font-mono);
  font-size: 8rem;
  font-weight: 700;
  color: var(--accent-red);
  line-height: 1;
  text-shadow: 0 0 40px rgba(255, 0, 64, 0.3);
}
.error-message {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin: 1rem 0 2rem;
}
.error-link {
  font-family: var(--font-mono);
  border: 1px solid var(--accent-green);
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  display: inline-block;
}
.error-link:hover {
  background: var(--accent-green);
  color: var(--bg-primary);
  text-shadow: none;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1001;
    gap: 0;
  }
  .nav-links.active {
    display: flex;
  }
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .nav-links > li {
    width: 100%;
    list-style: none;
  }
  .nav-links > li > a,
  .nav-links > li > .dropdown-trigger {
    display: block;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
  }
  .nav-dropdown {
    width: 100%;
  }
  .dropdown-menu {
    position: static;
    display: none;
    background: rgba(15, 15, 24, 0.95);
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-dropdown.open .dropdown-menu {
    display: block;
    padding: 0.2rem 0 0.2rem 1.2rem;
  }
  .dropdown-menu li {
    list-style: none;
  }
  .dropdown-menu a {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    display: block;
    color: var(--text-dim);
    border: none;
  }
  .dropdown-menu a:hover {
    color: var(--accent-green);
  }
  .dropdown-arrow {
    float: right;
    transition: transform 0.2s;
  }
  .nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
  }
  .lang-switch {
    padding: 0.5rem 1rem 1rem;
    margin-bottom: 1rem;
  }
  .nav-links > li.lang-switch > a {
    border-top: 2px solid var(--accent-green-dim) !important;
    border-right: 2px solid var(--accent-green-dim) !important;
    border-bottom: 2px solid var(--accent-green-dim) !important;
    border-left: 2px solid var(--accent-green-dim) !important;
    display: block;
    text-align: center;
    padding: 0.5rem;
    max-width: 60px;
  }
  .terminal-body h1 {
    font-size: 1.5rem;
  }
  .hero { padding: 6rem 1rem 2rem; }
  .post-title { font-size: 1.5rem; }
  .logo-name { display: none; }
  .post-content img,
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
  }
}
