/* ============================================
   FONTS — Self-hosted variable fonts
   ============================================ */

/* Unbounded — display font, weights 200-900 */
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('../fonts/unbounded-cyrillic-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('../fonts/unbounded-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('../fonts/unbounded-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('../fonts/unbounded-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Onest — body font, weights 100-900 */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/onest-cyrillic-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/onest-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/onest-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/onest-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* JetBrains Mono — monospace font, weights 100-800 */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('../fonts/jetbrains-mono-cyrillic-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('../fonts/jetbrains-mono-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('../fonts/jetbrains-mono-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('../fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */

:root {
  /* Cyber-Industrial Noir - Light Theme */
  --background: 220 20% 94%;
  --foreground: 220 25% 10%;
  --card: 220 20% 97%;
  --card-foreground: 220 25% 10%;

  --primary: 75 85% 40%;
  --primary-foreground: 220 20% 5%;
  --primary-dim: 75 70% 32%;

  --secondary: 220 18% 90%;
  --secondary-foreground: 220 25% 10%;
  --muted: 220 18% 90%;
  --muted-foreground: 220 15% 36%;

  --accent: 280 80% 55%;
  --accent-foreground: 0 0% 100%;

  --destructive: 0 72% 51%;
  --border: 220 18% 82%;
  --input: 220 18% 86%;
  --ring: 75 85% 40%;
  --radius: 0.625rem;

  --surface: 220 18% 90%;
  --surface-elevated: 220 20% 97%;

  --success: 160 72% 36%;
  --warning: 38 85% 48%;
  --info: 217 80% 55%;

  --glow-primary: 75 85% 40%;
  --glow-accent: 280 80% 55%;

  --glass-bg: 220 20% 97% / 0.85;
  --glass-border: 220 18% 76% / 0.6;

  --code-bg: 220 18% 92%;
  --code-header-bg: 220 18% 88%;
  --code-text: 220 20% 22%;
}

.dark {
  /* Cyber-Industrial Noir - Dark Theme */
  --background: 220 20% 4%;
  --foreground: 0 0% 95%;
  --card: 220 15% 8%;
  --card-foreground: 0 0% 95%;

  --primary: 75 100% 50%;
  --primary-foreground: 220 20% 4%;
  --primary-dim: 75 80% 35%;

  --secondary: 220 15% 12%;
  --secondary-foreground: 0 0% 95%;
  --muted: 220 15% 12%;
  --muted-foreground: 220 10% 55%;

  --accent: 280 100% 65%;
  --accent-foreground: 0 0% 100%;

  --destructive: 0 63% 31%;
  --border: 220 15% 15%;
  --input: 220 15% 15%;
  --ring: 75 100% 50%;

  --surface: 220 15% 8%;
  --surface-elevated: 220 15% 12%;

  --glow-primary: 75 100% 50%;
  --glow-accent: 280 100% 65%;

  --glass-bg: 220 15% 8% / 0.8;
  --glass-border: 0 0% 95% / 0.1;

  --code-bg: 220 20% 6%;
  --code-header-bg: 220 20% 8%;
  --code-text: 210 20% 85%;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Onest', ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "rlig" 1, "calt" 1, "ss01" 1;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Unbounded', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

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

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

::selection {
  background: hsl(var(--primary) / 0.3);
  color: hsl(var(--foreground));
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.2);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.4);
}

/* ============================================
   LAYOUT — sticky footer
   ============================================ */

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-main {
  flex: 1;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
}

/* Two-column layout: main + sidebar */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr 280px;
    gap: 3rem;
  }
}

@media (min-width: 1200px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr 320px;
  }
}

.layout-main {
  min-width: 0;
}

.blog-content {
  max-width: 900px;
  margin: 0 auto;
}

/* ============================================
   GLASS CARD
   ============================================ */

.glass-card {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid hsl(var(--glass-border));
  border-radius: 1rem;
  background: hsl(var(--glass-bg));
}

.glass-card-glow {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid hsl(var(--glass-border));
  border-radius: 1rem;
  background: hsl(var(--glass-bg));
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card-glow:hover {
  border-color: hsl(var(--primary) / 0.4);
  box-shadow:
    0 0 30px hsl(var(--primary) / 0.15),
    inset 0 0 20px hsl(var(--primary) / 0.05);
}

/* ============================================
   GRADIENT TEXT
   ============================================ */

.gradient-text {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(
    135deg,
    hsl(var(--primary)) 0%,
    hsl(var(--primary)) 40%,
    hsl(var(--accent)) 100%
  );
}

/* ============================================
   SECTION DIVIDER
   ============================================ */

.section-divider {
  height: 1px;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    hsl(var(--border)) 20%,
    hsl(var(--primary) / 0.5) 50%,
    hsl(var(--border)) 80%,
    transparent 100%
  );
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-glow {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  font-weight: 600;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary-dim)) 100%);
  color: hsl(var(--primary-foreground));
  box-shadow: 0 4px 20px hsl(var(--primary) / 0.4);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px hsl(var(--primary) / 0.5),
    0 0 0 1px hsl(var(--primary) / 0.3);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  font-weight: 600;
  border-radius: 0.75rem;
  border: 2px solid hsl(var(--border));
  color: hsl(var(--foreground));
  background: transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
}

.btn-ghost:hover {
  border-color: hsl(var(--primary) / 0.5);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

/* ============================================
   TERMINAL / CODE BLOCK
   ============================================ */

.terminal {
  border-radius: 1rem;
  overflow: hidden;
  background: hsl(var(--code-bg));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 25px 50px -12px hsl(0 0% 0% / 0.1);
}

.dark .terminal {
  box-shadow:
    0 25px 50px -12px hsl(0 0% 0% / 0.5),
    inset 0 1px 0 hsl(0 0% 100% / 0.05);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: hsl(var(--code-header-bg));
  border-bottom: 1px solid hsl(var(--border));
}

.terminal-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
}

/* ============================================
   NAV
   ============================================ */

.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all 0.3s ease;
}

.nav-bar.scrolled {
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid hsl(var(--border));
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.05);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

@media (min-width: 1024px) {
  .nav-inner { height: 5rem; }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.nav-logo:hover .nav-logo-icon {
  background: hsl(var(--primary) / 0.2);
  border-color: hsl(var(--primary) / 0.4);
}

.nav-logo-text {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .nav-links { display: flex; }
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: hsl(var(--foreground));
}

.nav-link.active {
  color: hsl(var(--primary));
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn {
  padding: 0.625rem;
  border-radius: 0.75rem;
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  background: hsl(var(--surface));
  color: hsl(var(--foreground));
}

.nav-lang {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.75rem;
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.nav-lang:hover {
  background: hsl(var(--surface));
  color: hsl(var(--foreground));
}

.nav-signin {
  display: none;
  margin-left: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.75rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.1);
}

@media (min-width: 640px) {
  .nav-signin { display: inline-flex; }
}

.nav-signin:hover {
  background: hsl(var(--primary) / 0.9);
  box-shadow: 0 0 10px hsl(var(--primary) / 0.3);
}

.mobile-signin {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  text-align: center;
  font-weight: 500;
}

.mobile-menu-btn {
  display: flex;
  padding: 0.625rem;
  border-radius: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: hsl(var(--foreground));
  transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
  background: hsl(var(--surface));
}

@media (min-width: 1024px) {
  .mobile-menu-btn { display: none; }
}

.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0 1.5rem;
}

@media (min-width: 1024px) {
  .mobile-menu { display: none; }
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: hsl(var(--muted-foreground));
  transition: all 0.2s ease;
}

.mobile-menu a:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--surface));
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  padding: 3rem 0;
  border-top: 1px solid hsl(var(--border));
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsl(var(--surface) / 0.3), transparent);
  pointer-events: none;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-brand-name {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
}

.footer-brand-tagline {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.footer-copy {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ============================================
   POST CARD
   ============================================ */

.post-card {
  display: block;
  padding: 1.5rem;
  border-radius: 1rem;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid hsl(var(--glass-border));
  background: hsl(var(--glass-bg));
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover {
  border-color: hsl(var(--primary) / 0.4);
  box-shadow:
    0 0 30px hsl(var(--primary) / 0.15),
    inset 0 0 20px hsl(var(--primary) / 0.05);
  transform: translateY(-4px);
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

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

.post-card-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.post-card-desc {
  font-size: 0.9375rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.post-card + .post-card {
  margin-top: 1.5rem;
}

/* ============================================
   TAG BADGE
   ============================================ */

.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  transition: all 0.2s ease;
}

.tag-badge:hover {
  background: hsl(var(--primary) / 0.25);
}

/* ============================================
   ARTICLE BODY (Medium-like typography)
   ============================================ */

.article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  color: hsl(var(--foreground));
}

.article-body > * + * {
  margin-top: 1.5rem;
}

.article-body h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.article-body h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.article-body h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-body p {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.article-body a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.article-body a:hover {
  opacity: 0.8;
}

.article-body strong {
  font-weight: 700;
}

.article-body blockquote {
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--accent))) 1;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: hsl(var(--surface) / 0.5);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: hsl(var(--muted-foreground));
}

.article-body blockquote p {
  margin: 0;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
}

.article-body li {
  margin-top: 0.5rem;
}

.article-body li::marker {
  color: hsl(var(--primary));
}

.article-body code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.875em;
  background: hsl(var(--code-bg));
  padding: 0.2em 0.4em;
  border-radius: 0.375rem;
  color: hsl(var(--code-text));
}

.article-body pre {
  margin: 2rem 0;
  border-radius: 1rem;
  overflow: hidden;
  background: hsl(var(--code-bg));
  border: 1px solid hsl(var(--border));
}

.article-body pre code {
  display: block;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  background: none;
  font-size: 0.875rem;
  line-height: 1.7;
}

.article-body img {
  border-radius: 0.75rem;
  margin: 2rem auto;
}

.article-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    hsl(var(--border)) 20%,
    hsl(var(--primary) / 0.5) 50%,
    hsl(var(--border)) 80%,
    transparent 100%
  );
  margin: 3rem 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
}

.article-body th,
.article-body td {
  padding: 0.75rem 1rem;
  border: 1px solid hsl(var(--border));
  text-align: left;
}

.article-body th {
  background: hsl(var(--surface));
  font-weight: 600;
}

/* ============================================
   HERO / LIST PAGE
   ============================================ */

.blog-hero {
  padding: 8rem 0 3rem;
  text-align: center;
}

.blog-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.blog-hero-desc {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   SINGLE POST PAGE
   ============================================ */

.post-header {
  padding: 7rem 0 2rem;
}

.post-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
}

.post-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: hsl(var(--muted-foreground) / 0.4);
}

.post-cover {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 1rem;
  margin-bottom: 2rem;
}

.post-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.post-footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-bottom: 2rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination a {
  border: 2px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.pagination a:hover {
  border-color: hsl(var(--primary) / 0.5);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.pagination .active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: 2px solid hsl(var(--primary));
}

/* ============================================
   TAXONOMY (TAGS)
   ============================================ */

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.tags-cloud .tag-badge {
  font-size: 0.875rem;
  padding: 0.375rem 1rem;
}

/* ============================================
   SYNTAX HIGHLIGHTING (Hugo Chroma — monokai)
   ============================================ */

/* Background */
.highlight pre { background: hsl(var(--code-bg)); }
.dark .highlight pre { background: hsl(var(--code-bg)); }

.highlight .chroma { background: hsl(var(--code-bg)); color: hsl(var(--code-text)); }

/* Line numbers */
.highlight .ln { color: hsl(var(--muted-foreground) / 0.5); margin-right: 0.75rem; user-select: none; }
.highlight .lnt { color: hsl(var(--muted-foreground) / 0.5); margin-right: 0.75rem; user-select: none; }

/* Keywords */
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: hsl(280 80% 65%); font-weight: 500; }
.dark .highlight .k, .dark .highlight .kc, .dark .highlight .kd, .dark .highlight .kn, .dark .highlight .kp, .dark .highlight .kr, .dark .highlight .kt { color: hsl(280 100% 75%); }

/* Strings */
.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .s1, .highlight .ss { color: hsl(45 90% 40%); }
.dark .highlight .s, .dark .highlight .sa, .dark .highlight .sb, .dark .highlight .sc, .dark .highlight .dl, .dark .highlight .sd, .dark .highlight .s2, .dark .highlight .se, .dark .highlight .sh, .dark .highlight .si, .dark .highlight .sx, .dark .highlight .sr, .dark .highlight .s1, .dark .highlight .ss { color: hsl(45 90% 60%); }

/* Numbers */
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo { color: hsl(280 60% 55%); }
.dark .highlight .m, .dark .highlight .mb, .dark .highlight .mf, .dark .highlight .mh, .dark .highlight .mi, .dark .highlight .il, .dark .highlight .mo { color: hsl(280 80% 72%); }

/* Comments */
.highlight .c, .highlight .ch, .highlight .cm, .highlight .c1, .highlight .cs, .highlight .cp, .highlight .cpf { color: hsl(var(--muted-foreground) / 0.6); font-style: italic; }

/* Functions */
.highlight .nf, .highlight .fm { color: hsl(75 85% 40%); }
.dark .highlight .nf, .dark .highlight .fm { color: hsl(75 100% 55%); }

/* Names / variables */
.highlight .n, .highlight .na, .highlight .nb, .highlight .nc, .highlight .no, .highlight .nd, .highlight .ni, .highlight .ne, .highlight .nl, .highlight .nn, .highlight .nt, .highlight .nv, .highlight .bp, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm { color: hsl(var(--code-text)); }

/* Operators */
.highlight .o, .highlight .ow { color: hsl(var(--primary)); }

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  position: sticky;
  top: 6rem;
  align-self: start;
}

.sidebar-section {
  padding: 1.25rem;
  border-radius: 1rem;
  background: hsl(var(--glass-bg));
  border: 1px solid hsl(var(--glass-border));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.sidebar-section + .sidebar-section {
  margin-top: 1.5rem;
}

.sidebar-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

/* Search */
.search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  background: hsl(var(--surface));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: hsl(var(--muted-foreground) / 0.6);
}

.search-input:focus {
  border-color: hsl(var(--primary) / 0.5);
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

.search-results {
  display: none;
  margin-top: 0.5rem;
}

.search-result-item {
  display: block;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: hsl(var(--surface));
}

.search-result-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.3;
}

.search-result-desc {
  display: block;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
  line-height: 1.4;
}

.search-empty {
  padding: 0.75rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
}

/* Sidebar Tags */
.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-count {
  font-size: 0.625rem;
  opacity: 0.7;
}

/* Sidebar Posts */
.sidebar-posts {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-post {
  display: block;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  transition: background 0.15s ease;
}

.sidebar-post:hover {
  background: hsl(var(--surface));
}

.sidebar-post-active {
  background: hsl(var(--primary) / 0.1);
  border-left: 3px solid hsl(var(--primary));
  padding-left: calc(0.625rem - 3px);
}

.sidebar-post-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  line-height: 1.4;
}

.sidebar-post-date {
  display: block;
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
}

/* Table of Contents */
.sidebar-toc {
  position: relative;
}

.toc nav,
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  border-radius: 0.375rem;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.toc a:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--surface));
}

.toc ul ul a {
  padding-left: 1.25rem;
  font-size: 0.75rem;
}

.toc ul ul ul a {
  padding-left: 2rem;
}

/* Mobile: sidebar goes below content */
@media (max-width: 899px) {
  .sidebar {
    position: static;
  }
}

/* ============================================
   UTILITIES
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.text-muted {
  color: hsl(var(--muted-foreground));
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
