/* =============================================================================
   TechDark Pro — Hugo Blog CSS
   Dark elegant minimal, The Verge style
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Custom Properties
   ----------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-primary: #0ea5e9;
  --color-secondary: #8b5cf6;
  --color-accent: #f97316;
  --color-bg: #0a0a0a;
  --color-bg-card: #1a1a1a;
  --color-bg-elevated: #222222;
  --color-text: #f5f5f5;
  --color-text-muted: #a1a1a1;
  --color-border: #2a2a2a;
  --color-border-hover: #3a3a3a;

  /* Semantic */
  --color-success: #22c55e;
  --color-warning: #eab308;
  --color-error: #ef4444;
  --color-info: var(--color-primary);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  --gradient-accent: linear-gradient(135deg, var(--color-accent), #ef4444);
  --gradient-hero: linear-gradient(180deg, rgba(14,165,233,0.08) 0%, transparent 60%);
  --gradient-card-hover: linear-gradient(135deg, rgba(14,165,233,0.06), rgba(139,92,246,0.06));

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-size-base: 16px;

  /* Fluid type scale — clamp(min, preferred, max) */
  --text-xs:   clamp(0.694rem, 0.6rem + 0.3vw, 0.75rem);
  --text-sm:   clamp(0.833rem, 0.75rem + 0.4vw, 0.875rem);
  --text-base: clamp(0.938rem, 0.9rem + 0.2vw, 1rem);
  --text-md:   clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.6vw, 1.25rem);
  --text-xl:   clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl:  clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-3xl:  clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
  --text-4xl:  clamp(2.25rem, 1.8rem + 2.25vw, 3.5rem);
  --text-5xl:  clamp(2.75rem, 2rem + 3.75vw, 5rem);

  /* Spacing */
  --space-1:  8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-5:  40px;
  --space-6:  48px;
  --space-8:  64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;

  /* Layout */
  --max-width: 1200px;
  --content-width: 760px;
  --sidebar-width: 320px;
  --header-height: 64px;

  /* Shape */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:   0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:   0 16px 48px rgba(0,0,0,0.5);
  --shadow-glow-primary:   0 0 24px rgba(14,165,233,0.25);
  --shadow-glow-secondary: 0 0 24px rgba(139,92,246,0.25);
  --shadow-glow-accent:    0 0 24px rgba(249,115,22,0.25);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;

  /* Z-index */
  --z-base:    0;
  --z-raised:  10;
  --z-overlay: 100;
  --z-sticky:  200;
  --z-modal:   300;
  --z-top:     9999;
}

/* Light mode override */
@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #ffffff;
    --color-bg-card: #f8f8f8;
    --color-bg-elevated: #f0f0f0;
    --color-text: #0a0a0a;
    --color-text-muted: #555555;
    --color-border: #e4e4e7;
    --color-border-hover: #d4d4d8;
    --gradient-hero: linear-gradient(180deg, rgba(14,165,233,0.05) 0%, transparent 60%);
    --gradient-card-hover: linear-gradient(135deg, rgba(14,165,233,0.04), rgba(139,92,246,0.04));
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.15);
  }
}

/* Manual dark/light toggles via [data-theme] */
[data-theme="dark"] {
  --color-bg: #0a0a0a;
  --color-bg-card: #1a1a1a;
  --color-bg-elevated: #222222;
  --color-text: #f5f5f5;
  --color-text-muted: #a1a1a1;
  --color-border: #2a2a2a;
  --color-border-hover: #3a3a3a;
}

[data-theme="light"] {
  --color-bg: #ffffff;
  --color-bg-card: #f8f8f8;
  --color-bg-elevated: #f0f0f0;
  --color-text: #0a0a0a;
  --color-text-muted: #555555;
  --color-border: #e4e4e7;
  --color-border-hover: #d4d4d8;
}

/* -----------------------------------------------------------------------------
   Modern CSS Reset
   ----------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: color-mix(in srgb, var(--color-primary) 80%, white 20%);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* -----------------------------------------------------------------------------
   Scrollbar
   ----------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background var(--duration-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-primary) 60%, var(--color-border) 40%);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-bg);
}

/* -----------------------------------------------------------------------------
   Reading Progress Bar
   ----------------------------------------------------------------------------- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-primary);
  z-index: var(--z-top);
  transition: width var(--duration-fast) linear;
  box-shadow: 0 0 10px rgba(14,165,233,0.5);
}

/* -----------------------------------------------------------------------------
   Utilities
   ----------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 640px) {
  .container { padding-inline: var(--space-5); }
}

@media (min-width: 1024px) {
  .container { padding-inline: var(--space-6); }
}

.container--narrow {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.grid {
  display: grid;
}

.flex {
  display: flex;
}

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

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  border: none;
  margin: var(--space-8) 0;
}

/* -----------------------------------------------------------------------------
   Header
   ----------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--color-bg) 80%, transparent 20%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-base) var(--ease-in-out),
              border-color var(--duration-base) var(--ease-in-out);
}

.site-header--scrolled {
  background: color-mix(in srgb, var(--color-bg) 92%, transparent 8%);
  border-bottom-color: var(--color-border-hover);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-4);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo__mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.05em;
}

.site-logo__name {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  transition: color var(--duration-fast);
}

.site-logo:hover .site-logo__name {
  color: var(--color-primary);
}

/* Navigation */
.site-nav {
  display: none;
}

@media (min-width: 768px) {
  .site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }
}

.site-nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast), background var(--duration-fast);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav__link:hover,
.site-nav__link--active {
  color: var(--color-text);
  background: var(--color-bg-elevated);
}

.site-nav__link--active {
  color: var(--color-primary);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.header-search-btn,
.header-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--duration-fast);
}

.header-search-btn:hover,
.header-theme-btn:hover {
  color: var(--color-text);
  background: var(--color-bg-elevated);
  border-color: var(--color-border);
}

.header-cta {
  display: none;
}

@media (min-width: 640px) {
  .header-cta {
    display: flex;
  }
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: all var(--duration-fast);
}

.mobile-menu-btn:hover {
  color: var(--color-text);
  background: var(--color-bg-elevated);
}

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

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background: color-mix(in srgb, var(--color-bg) 96%, transparent 4%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: calc(var(--z-sticky) - 1);
  padding: var(--space-4);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  overflow-y: auto;
}

.mobile-nav.is-open {
  transform: translateX(0);
}

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

.mobile-nav__link {
  display: block;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.mobile-nav__link:hover {
  color: var(--color-primary);
}

/* -----------------------------------------------------------------------------
   Hero Section
   ----------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: var(--space-12) 0 var(--space-10);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(14,165,233,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(14,165,233,0.1);
  border: 1px solid rgba(14,165,233,0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.hero__title {
  font-size: var(--text-5xl);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-6);
  font-weight: 400;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Featured Hero Post */
.hero-post {
  padding: var(--space-10) 0;
}

.hero-post__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 768px) {
  .hero-post__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

.hero-post__image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
}

.hero-post__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.hero-post__image:hover img {
  transform: scale(1.04);
}

.hero-post__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
}

.hero-post__content {}

.hero-post__title {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
  line-height: 1.2;
}

.hero-post__title a {
  color: var(--color-text);
  text-decoration: none;
}

.hero-post__title a:hover {
  color: var(--color-primary);
}

.hero-post__excerpt {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.7;
}

/* -----------------------------------------------------------------------------
   Post Cards
   ----------------------------------------------------------------------------- */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.posts-grid--wide {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .posts-grid--wide {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Card Base */
.post-card {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base),
              box-shadow var(--duration-base);
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
  background: color-mix(in srgb, var(--color-bg-card) 85%, var(--color-primary) 5%);
}

.post-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card-hover);
  opacity: 0;
  transition: opacity var(--duration-base);
  pointer-events: none;
  z-index: 0;
}

.post-card:hover::before {
  opacity: 1;
}

.post-card > * {
  position: relative;
  z-index: 1;
}

/* Card Thumbnail */
.post-card__thumbnail {
  aspect-ratio: 16/9;
  overflow: hidden;
  flex-shrink: 0;
}

.post-card__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.post-card:hover .post-card__thumbnail img {
  transform: scale(1.06);
}

.post-card__thumbnail--placeholder {
  background: linear-gradient(135deg, var(--color-bg-elevated), var(--color-border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-border);
}

/* Card Body */
.post-card__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-2);
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.post-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.post-card__title a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.post-card__title a:hover {
  color: var(--color-primary);
}

.post-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

/* Card Horizontal */
.post-card--horizontal {
  flex-direction: row;
}

.post-card--horizontal .post-card__thumbnail {
  width: 200px;
  aspect-ratio: auto;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .post-card--horizontal {
    flex-direction: column;
  }
  .post-card--horizontal .post-card__thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
  }
}

/* Card Featured */
.post-card--featured {
  grid-column: 1 / -1;
}

@media (min-width: 1024px) {
  .post-card--featured {
    flex-direction: row;
  }
  .post-card--featured .post-card__thumbnail {
    width: 55%;
    aspect-ratio: auto;
    min-height: 300px;
    flex-shrink: 0;
  }
  .post-card--featured .post-card__title {
    font-size: var(--text-2xl);
  }
}

/* -----------------------------------------------------------------------------
   Tags & Categories Pills
   ----------------------------------------------------------------------------- */
.tag,
.category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--duration-fast);
  line-height: 1;
}

.tag {
  color: var(--color-text-muted);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
}

.tag:hover {
  color: var(--color-primary);
  border-color: rgba(14,165,233,0.4);
  background: rgba(14,165,233,0.08);
}

.category {
  color: var(--color-primary);
  background: rgba(14,165,233,0.1);
  border: 1px solid rgba(14,165,233,0.2);
}

.category:hover {
  background: rgba(14,165,233,0.18);
  border-color: rgba(14,165,233,0.4);
  color: var(--color-primary);
  box-shadow: 0 0 12px rgba(14,165,233,0.2);
}

.category--secondary {
  color: var(--color-secondary);
  background: rgba(139,92,246,0.1);
  border-color: rgba(139,92,246,0.2);
}

.category--secondary:hover {
  background: rgba(139,92,246,0.18);
  border-color: rgba(139,92,246,0.4);
  box-shadow: 0 0 12px rgba(139,92,246,0.2);
}

.category--accent {
  color: var(--color-accent);
  background: rgba(249,115,22,0.1);
  border-color: rgba(249,115,22,0.2);
}

.category--accent:hover {
  background: rgba(249,115,22,0.18);
  border-color: rgba(249,115,22,0.4);
  box-shadow: 0 0 12px rgba(249,115,22,0.2);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: scale(0.97);
}

/* Primary CTA */
.btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(14,165,233,0.3);
}

.btn--primary:hover {
  box-shadow: 0 8px 24px rgba(14,165,233,0.4),
              var(--shadow-glow-primary);
  transform: translateY(-1px);
  color: #fff;
}

/* Secondary */
.btn--secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-bg-card);
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

.btn--ghost:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border-color: var(--color-border-hover);
}

/* Accent CTA */
.btn--accent {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(249,115,22,0.3);
}

.btn--accent:hover {
  box-shadow: 0 8px 24px rgba(249,115,22,0.4);
  transform: translateY(-1px);
  color: #fff;
}

/* Outline */
.btn--outline-primary {
  background: transparent;
  color: var(--color-primary);
  border-color: rgba(14,165,233,0.4);
}

.btn--outline-primary:hover {
  background: rgba(14,165,233,0.08);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Sizes */
.btn--sm {
  font-size: var(--text-xs);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.btn--lg {
  font-size: var(--text-md);
  padding: 16px 32px;
  border-radius: var(--radius-lg);
}

.btn--xl {
  font-size: var(--text-lg);
  padding: 20px 40px;
  border-radius: var(--radius-xl);
}

/* Icon Button */
.btn--icon {
  padding: 10px;
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
}

/* -----------------------------------------------------------------------------
   Post Meta / Author
   ----------------------------------------------------------------------------- */
.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.post-meta__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-meta__item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

.author-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.author-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
}

.author-card__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.author-card__name:hover {
  color: var(--color-primary);
}

.author-card__role {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* -----------------------------------------------------------------------------
   Breadcrumb
   ----------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: var(--space-3) 0;
}

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

.breadcrumb__item:not(:last-child)::after {
  content: '/';
  color: var(--color-border-hover);
  font-weight: 300;
}

.breadcrumb__link {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.breadcrumb__link:hover {
  color: var(--color-primary);
}

.breadcrumb__current {
  color: var(--color-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

/* -----------------------------------------------------------------------------
   Single Post Layout
   ----------------------------------------------------------------------------- */
.post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding: var(--space-6) 0 var(--space-10);
}

@media (min-width: 1100px) {
  .post-layout {
    grid-template-columns: 1fr var(--sidebar-width);
    align-items: start;
  }
}

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

/* Post Header */
.post-header {
  margin-bottom: var(--space-8);
}

.post-header__title {
  font-size: var(--text-4xl);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
}

.post-header__cover {
  margin-top: var(--space-5);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 21/9;
}

.post-header__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Post Body Prose */
.prose {
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--color-text);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: 2em;
  margin-bottom: 0.75em;
  letter-spacing: -0.02em;
}

.prose h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--color-border);
}

.prose h3 {
  font-size: var(--text-xl);
  font-weight: 700;
}

.prose h4 {
  font-size: var(--text-lg);
  font-weight: 700;
}

.prose p {
  margin-bottom: 1.5em;
}

.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(14,165,233,0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-fast);
}

.prose a:hover {
  text-decoration-color: var(--color-primary);
}

.prose strong {
  font-weight: 700;
  color: var(--color-text);
}

.prose em {
  font-style: italic;
}

.prose ul,
.prose ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li {
  margin-bottom: 0.4em;
  padding-left: 0.25em;
}

.prose blockquote {
  border-left: 3px solid var(--color-primary);
  padding: var(--space-3) var(--space-4);
  background: rgba(14,165,233,0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-5) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--color-accent);
}

.prose pre {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  margin: var(--space-5) 0;
  position: relative;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.prose img {
  border-radius: var(--radius-md);
  margin: var(--space-5) 0;
  border: 1px solid var(--color-border);
}

.prose figure {
  margin: var(--space-6) 0;
}

.prose figcaption {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  font-style: italic;
}

.prose hr {
  margin: var(--space-8) 0;
}

/* -----------------------------------------------------------------------------
   TOC — Table of Contents
   ----------------------------------------------------------------------------- */
.toc {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.toc__title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc__list--nested {
  padding-left: var(--space-3);
  margin-top: 4px;
  border-left: 1px solid var(--color-border);
}

.toc__item {
  margin-bottom: 2px;
}

.toc__link {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--duration-fast);
  line-height: 1.4;
}

.toc__link:hover,
.toc__link--active {
  color: var(--color-primary);
  background: rgba(14,165,233,0.06);
  border-left-color: var(--color-primary);
}

/* Sidebar Sticky */
.sidebar {
  display: none;
}

@media (min-width: 1100px) {
  .sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + var(--space-4));
    max-height: calc(100dvh - var(--header-height) - var(--space-8));
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

.sidebar__section {
  margin-bottom: var(--space-5);
}

.sidebar__heading {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/* -----------------------------------------------------------------------------
   Comparison Table
   ----------------------------------------------------------------------------- */
.comparison-table {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table thead {
  background: var(--color-bg-elevated);
}

.comparison-table thead th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: left;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  letter-spacing: -0.01em;
}

.comparison-table thead th:first-child {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-fast);
}

.comparison-table tbody tr:last-child {
  border-bottom: none;
}

.comparison-table tbody tr:hover {
  background: var(--color-bg-elevated);
}

.comparison-table tbody td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  vertical-align: middle;
}

.comparison-table tbody td:first-child {
  font-weight: 600;
  color: var(--color-text-muted);
}

.comparison-table .table-check {
  color: var(--color-success);
  font-size: 1.1em;
}

.comparison-table .table-cross {
  color: var(--color-error);
  opacity: 0.7;
}

.comparison-table .table-winner th {
  background: rgba(14,165,233,0.08);
  border-top: 2px solid var(--color-primary);
}

/* Overflow wrapper for mobile */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  -webkit-overflow-scrolling: touch;
}

/* Rating Stars */
.rating {
  display: inline-flex;
  gap: 2px;
  color: var(--color-warning);
  font-size: var(--text-sm);
}

/* Score Badge */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.score-badge--high {
  background: rgba(34,197,94,0.15);
  color: var(--color-success);
  border: 1px solid rgba(34,197,94,0.3);
}

.score-badge--mid {
  background: rgba(234,179,8,0.15);
  color: var(--color-warning);
  border: 1px solid rgba(234,179,8,0.3);
}

.score-badge--low {
  background: rgba(239,68,68,0.15);
  color: var(--color-error);
  border: 1px solid rgba(239,68,68,0.3);
}

/* -----------------------------------------------------------------------------
   Verdict Box
   ----------------------------------------------------------------------------- */
.verdict {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: var(--space-8) 0;
  position: relative;
  overflow: hidden;
}

.verdict::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.verdict__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.verdict__title {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.verdict__score {
  font-size: var(--text-3xl);
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.04em;
}

.verdict__pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

@media (max-width: 480px) {
  .verdict__pros-cons { grid-template-columns: 1fr; }
}

.verdict__pros-heading {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-success);
  margin-bottom: var(--space-2);
}

.verdict__cons-heading {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-error);
  margin-bottom: var(--space-2);
}

.verdict__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.verdict__list li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}

.verdict__list--pros li::before {
  content: '+';
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 700;
}

.verdict__list--cons li::before {
  content: '−';
  position: absolute;
  left: 0;
  color: var(--color-error);
  font-weight: 700;
}

/* -----------------------------------------------------------------------------
   Alert / Callout Blocks
   ----------------------------------------------------------------------------- */
.callout {
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-5) 0;
  border: 1px solid;
  display: flex;
  gap: var(--space-3);
}

.callout__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.callout__body {}

.callout__title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 4px;
}

.callout__text {
  font-size: var(--text-sm);
  line-height: 1.6;
}

.callout--info {
  background: rgba(14,165,233,0.06);
  border-color: rgba(14,165,233,0.25);
}
.callout--info .callout__icon,
.callout--info .callout__title { color: var(--color-primary); }
.callout--info .callout__text  { color: var(--color-text-muted); }

.callout--warning {
  background: rgba(234,179,8,0.06);
  border-color: rgba(234,179,8,0.25);
}
.callout--warning .callout__icon,
.callout--warning .callout__title { color: var(--color-warning); }
.callout--warning .callout__text  { color: var(--color-text-muted); }

.callout--success {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.25);
}
.callout--success .callout__icon,
.callout--success .callout__title { color: var(--color-success); }
.callout--success .callout__text  { color: var(--color-text-muted); }

.callout--error {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.25);
}
.callout--error .callout__icon,
.callout--error .callout__title { color: var(--color-error); }
.callout--error .callout__text  { color: var(--color-text-muted); }

/* -----------------------------------------------------------------------------
   Pagination
   ----------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-8) 0;
  flex-wrap: wrap;
}

.pagination__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: all var(--duration-fast);
  line-height: 1;
}

.pagination__item:hover {
  color: var(--color-primary);
  border-color: rgba(14,165,233,0.4);
  background: rgba(14,165,233,0.06);
}

.pagination__item--active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(14,165,233,0.3);
}

.pagination__item--active:hover {
  color: #fff;
}

.pagination__item--disabled {
  opacity: 0.3;
  pointer-events: none;
}

.pagination__ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.pagination__prev,
.pagination__next {
  gap: 6px;
  padding: 0 var(--space-3);
}

/* -----------------------------------------------------------------------------
   Newsletter / CTA Section
   ----------------------------------------------------------------------------- */
.newsletter-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: var(--space-10) 0;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(14,165,233,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.newsletter-section__eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.newsletter-section__title {
  font-size: clamp(1.25rem, 4vw, var(--text-3xl));
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
}

.newsletter-section__subtitle {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 500px;
  margin-inline: auto;
  margin-bottom: var(--space-6);
}

.newsletter-form {
  display: flex;
  gap: var(--space-2);
  max-width: 440px;
  margin-inline: auto;
  flex-wrap: wrap;
}

.newsletter-form__input {
  flex: 1;
  min-width: 200px;
  height: 48px;
  padding: 0 var(--space-3);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  transition: all var(--duration-fast);
  outline: none;
}

.newsletter-form__input::placeholder {
  color: var(--color-text-muted);
}

.newsletter-form__input:focus {
  border-color: rgba(14,165,233,0.5);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
  background: var(--color-bg-card);
}

.newsletter-form__privacy {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

/* -----------------------------------------------------------------------------
   Section Headers
   ----------------------------------------------------------------------------- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-title--sm {
  font-size: var(--text-xl);
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  font-weight: 400;
  margin-top: var(--space-2);
}

.section-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--duration-fast);
}

.section-link:hover {
  gap: 8px;
  color: var(--color-primary);
}

/* -----------------------------------------------------------------------------
   Category / Archive Header
   ----------------------------------------------------------------------------- */
.archive-header {
  padding: var(--space-8) 0 var(--space-6);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}

.archive-header__label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.archive-header__title {
  font-size: var(--text-4xl);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.archive-header__count {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  font-weight: 400;
  margin-top: var(--space-2);
}

/* -----------------------------------------------------------------------------
   Search Box
   ----------------------------------------------------------------------------- */
.search-box {
  position: relative;
  max-width: 480px;
}

.search-box__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-box__input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4) 0 42px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font-size: var(--text-sm);
  transition: all var(--duration-fast);
  outline: none;
}

.search-box__input::placeholder {
  color: var(--color-text-muted);
}

.search-box__input:focus {
  border-color: rgba(14,165,233,0.5);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
  background: var(--color-bg-elevated);
}

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.footer-main {
  padding: var(--space-12) 0 var(--space-8);
}

.footer-main .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 640px) {
  .footer-main .container { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .footer-main .container { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer-brand {}

.footer-brand__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-top: var(--space-3);
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.footer-social__link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: all var(--duration-fast);
}

.footer-social__link:hover {
  color: var(--color-primary);
  border-color: rgba(14,165,233,0.4);
  background: rgba(14,165,233,0.08);
  transform: translateY(-2px);
}

.footer-col__heading {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.footer-col__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col__link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast);
  line-height: 1;
}

.footer-col__link:hover {
  color: var(--color-primary);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  row-gap: var(--space-2);
}

@media (max-width: 480px) {
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

.footer-bottom__copy {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.footer-bottom__links {
  display: flex;
  gap: var(--space-4);
}

.footer-bottom__link {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.footer-bottom__link:hover {
  color: var(--color-primary);
}

/* -----------------------------------------------------------------------------
   Post Footer / Share & Related
   ----------------------------------------------------------------------------- */
.post-footer {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.share-section {}

.share-section__title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--duration-fast);
  border: 1px solid;
}

.share-btn--twitter {
  color: #1da1f2;
  border-color: rgba(29,161,242,0.3);
  background: rgba(29,161,242,0.08);
}
.share-btn--twitter:hover {
  background: rgba(29,161,242,0.15);
  color: #1da1f2;
}

.share-btn--copy {
  color: var(--color-text-muted);
  border-color: var(--color-border);
  background: var(--color-bg-elevated);
}
.share-btn--copy:hover {
  color: var(--color-text);
  border-color: var(--color-border-hover);
}

/* Author Bio Box */
.author-bio {
  display: flex;
  gap: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-6);
  align-items: flex-start;
}

.author-bio__avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
}

.author-bio__name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
  text-decoration: none;
}

.author-bio__name:hover {
  color: var(--color-primary);
}

.author-bio__role {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.author-bio__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Related Posts */
.related-posts {
  margin-top: var(--space-10);
}

/* -----------------------------------------------------------------------------
   Code Block Enhancements
   ----------------------------------------------------------------------------- */
.code-block {
  position: relative;
  margin: var(--space-5) 0;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 10px var(--space-4);
}

.code-block__lang {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.code-block__copy {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.code-block__copy:hover {
  color: var(--color-primary);
  border-color: rgba(14,165,233,0.4);
}

.code-block pre {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin: 0;
}

/* Syntax highlight tokens */
.token.comment    { color: #6a737d; }
.token.string     { color: #9ecbff; }
.token.number     { color: #79b8ff; }
.token.keyword    { color: #f97583; }
.token.function   { color: #b392f0; }
.token.operator   { color: #e1e4e8; }
.token.class-name { color: #79b8ff; }

/* -----------------------------------------------------------------------------
   Spec Table
   ----------------------------------------------------------------------------- */
.spec-table {
  width: 100%;
  margin: var(--space-5) 0;
}

.spec-table tr {
  display: flex;
  border-bottom: 1px solid var(--color-border);
}

.spec-table tr:last-child {
  border-bottom: none;
}

.spec-table th,
.spec-table td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.spec-table th {
  width: 140px;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-elevated);
}

.spec-table td {
  flex: 1;
  color: var(--color-text);
}

/* -----------------------------------------------------------------------------
   Skeleton Loading
   ----------------------------------------------------------------------------- */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.skeleton {
  animation: skeleton-pulse 1.8s ease-in-out infinite;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-sm);
}

.skeleton--text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton--title {
  height: 1.5em;
  width: 70%;
}

.skeleton--card {
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
}

/* -----------------------------------------------------------------------------
   404 / Error Page
   ----------------------------------------------------------------------------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60dvh;
  padding: var(--space-10) var(--space-4);
}

.error-page__code {
  font-size: clamp(5rem, 20vw, 12rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-page__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.error-page__text {
  color: var(--color-text-muted);
  max-width: 400px;
  margin-bottom: var(--space-6);
}

/* -----------------------------------------------------------------------------
   Animations
   ----------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(14,165,233,0.2); }
  50%       { box-shadow: 0 0 24px rgba(14,165,233,0.4); }
}

.animate-fade-in {
  animation: fadeIn var(--duration-slow) var(--ease-out) both;
}

.animate-slide-in {
  animation: slideInLeft var(--duration-slow) var(--ease-out) both;
}

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* -----------------------------------------------------------------------------
   Reading Progress JS (minimal inline script target)
   ----------------------------------------------------------------------------- */
/*
  Drop this just before </body>:

  <div id="reading-progress"></div>
  <script>
    (function(){
      var el = document.getElementById('reading-progress');
      if (!el) return;
      function update() {
        var s = document.documentElement;
        var pct = (s.scrollTop / (s.scrollHeight - s.clientHeight)) * 100;
        el.style.width = Math.min(pct, 100) + '%';
      }
      window.addEventListener('scroll', update, { passive: true });
    })();
  </script>
*/

/* Header scroll state JS target:
  document.addEventListener('scroll', function() {
    document.querySelector('.site-header').classList
      .toggle('site-header--scrolled', window.scrollY > 10);
  }, { passive: true });
*/

/* -----------------------------------------------------------------------------
   Print
   ----------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .share-section,
  .newsletter-section,
  .pagination,
  #reading-progress {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .container,
  .post-layout {
    max-width: 100%;
    padding: 0;
    grid-template-columns: 1fr;
  }

  .prose a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  .prose pre,
  .prose code {
    white-space: pre-wrap;
    word-break: break-all;
  }
}
