/* ============================================================
   LINEAR THEME — Main Stylesheet
   Dark, minimal, shiny borders, SaaS-grade UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@300;400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Core palette */
  --bg-base:        #080808;
  --bg-subtle:      #0e0e0e;
  --bg-surface:     #141414;
  --bg-elevated:    #1a1a1a;
  --bg-hover:       #1f1f1f;

  /* Borders — the star of the show */
  --border-faint:   rgba(255,255,255,0.05);
  --border-subtle:  rgba(255,255,255,0.09);
  --border-default: rgba(255,255,255,0.13);
  --border-strong:  rgba(255,255,255,0.22);

  /* Shiny gradient borders */
  --border-shine:   linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.12) 100%);
  --border-glow:    linear-gradient(135deg, rgba(139,92,246,0.6) 0%, rgba(59,130,246,0.4) 50%, rgba(139,92,246,0.2) 100%);
  --border-accent:  linear-gradient(135deg, rgba(99,102,241,0.8) 0%, rgba(168,85,247,0.5) 100%);

  /* Typography */
  --text-primary:   rgba(255,255,255,0.93);
  --text-secondary: rgba(255,255,255,0.55);
  --text-tertiary:  rgba(255,255,255,0.30);
  --text-disabled:  rgba(255,255,255,0.18);

  /* Accent colors */
  --accent-violet:  #7c3aed;
  --accent-indigo:  #4f46e5;
  --accent-blue:    #2563eb;
  --accent-glow:    rgba(124, 58, 237, 0.35);

  /* Semantic */
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;

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

  /* Border radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(124,58,237,0.12), 0 4px 20px rgba(0,0,0,0.5);
  --shadow-glow-strong: 0 0 60px rgba(124,58,237,0.2), 0 8px 32px rgba(0,0,0,0.6);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --duration-slow: 350ms;

  /* Layout */
  --container-max: 1120px;
  --container-narrow: 720px;

  /* Typography scale */
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

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

/* ── Background Grid Pattern ───────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.08) 0%, rgba(124,58,237,0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout Wrapper ────────────────────────────────────────── */
.site-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ── Shiny Border Utility ──────────────────────────────────── */
.shiny-border {
  position: relative;
  border-radius: var(--radius-lg);
}

.shiny-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--border-shine);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Navigation ────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-4) 0;
  background: rgba(8,8,8,0.75);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-faint);
  transition: border-color var(--duration-base) var(--ease-out),
              background var(--duration-base) var(--ease-out);
}

.site-nav.scrolled {
  background: rgba(8,8,8,0.92);
  border-bottom-color: var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 16px rgba(124,58,237,0.4);
  flex-shrink: 0;
}

.nav-logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  letter-spacing: -0.01em;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-links a.active {
  color: var(--text-primary);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--duration-base) var(--ease-out);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition:
    background var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
  user-select: none;
}

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

/* Primary button */
.btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(124,58,237,0.5),
    0 2px 8px rgba(124,58,237,0.3),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  pointer-events: none;
}

.btn-primary:hover {
  box-shadow:
    0 0 0 1px rgba(124,58,237,0.7),
    0 4px 20px rgba(124,58,237,0.45),
    inset 0 1px 0 rgba(255,255,255,0.2);
  filter: brightness(1.08);
}

/* Secondary button */
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  box-shadow:
    0 0 0 1px var(--border-default),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow:
    0 0 0 1px var(--border-strong),
    inset 0 1px 0 rgba(255,255,255,0.09),
    0 2px 12px rgba(0,0,0,0.4);
}

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

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

/* Button sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 11px 22px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

/* ── Hero Section ──────────────────────────────────────────── */
.hero {
  padding: var(--space-20) 0 var(--space-16);
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 12px 5px 8px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: rgba(167,139,250,0.9);
  letter-spacing: 0.01em;
  margin-bottom: var(--space-8);
  cursor: default;
  transition: border-color var(--duration-base) var(--ease-out),
              background var(--duration-base) var(--ease-out);
}

.hero-badge:hover {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.4);
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-violet);
  box-shadow: 0 0 8px rgba(124,58,237,0.8);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(124,58,237,0.6); }
  50% { box-shadow: 0 0 14px rgba(124,58,237,1); }
}

.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--text-primary);
  max-width: 800px;
  margin: 0 auto var(--space-6);
}

.hero-title-gradient {
  background: linear-gradient(135deg, #a78bfa 0%, #818cf8 40%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 350;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-10);
  line-height: 1.65;
  letter-spacing: -0.01em;
}

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

.hero-meta {
  margin-top: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  font-size: 13px;
  color: var(--text-tertiary);
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-meta-item svg {
  opacity: 0.5;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

/* Shiny card border */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--border-shine);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}

/* Top-edge highlight */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  border-radius: 0 0 var(--radius-full) var(--radius-full);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.card:hover::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.16) 100%);
}

.card-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 80px;
  background: radial-gradient(ellipse at center, rgba(124,58,237,0.15), transparent 70%);
  pointer-events: none;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 18px;
}

.card-title {
  font-size: 15px;
  font-weight: 550;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.card-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── Feature Grid ──────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

/* ── Section ───────────────────────────────────────────────── */
.section {
  padding: var(--space-16) 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-violet);
  margin-bottom: var(--space-3);
}

.section-label::before, .section-label::after {
  content: '';
  width: 16px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.65;
  letter-spacing: -0.01em;
}

.section-header {
  margin-bottom: var(--space-10);
}

.section-header--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle) 30%, var(--border-default) 50%, var(--border-subtle) 70%, transparent);
  margin: var(--space-12) 0;
}

/* ── Code blocks ───────────────────────────────────────────── */
pre, code {
  font-family: var(--font-mono);
}

code {
  font-size: 0.875em;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 6px;
  color: rgba(167,139,250,0.9);
}

pre {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
  position: relative;
  font-size: 13.5px;
  line-height: 1.7;
}

pre::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--border-shine);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Blog Post Card ────────────────────────────────────────── */
.post-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.post-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--border-shine);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background var(--duration-base) var(--ease-out);
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.post-card:hover::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.18) 100%);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.post-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  color: rgba(167,139,250,0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-date {
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.post-card-title {
  font-size: 17px;
  font-weight: 550;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: var(--space-3);
  transition: color var(--duration-fast) var(--ease-out);
}

.post-card:hover .post-card-title {
  color: #fff;
}

.post-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  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;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-faint);
}

.post-read-more {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-violet);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: gap var(--duration-fast) var(--ease-out);
}

.post-card:hover .post-read-more {
  gap: var(--space-2);
}

.read-time {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ── Posts Grid ────────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

/* ── Single Post ───────────────────────────────────────────── */
.post-header {
  padding: var(--space-16) 0 var(--space-10);
  border-bottom: 1px solid var(--border-faint);
  margin-bottom: var(--space-10);
}

.post-title {
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

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

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

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.author-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Post Content (prose) ──────────────────────────────────── */
.prose {
  font-size: 16px;
  line-height: 1.75;
  color: rgba(255,255,255,0.78);
  max-width: 680px;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-top: 2.2em;
  margin-bottom: 0.75em;
}

.prose h2 { font-size: 1.6em; }
.prose h3 { font-size: 1.25em; }
.prose h4 { font-size: 1.05em; }

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

.prose a {
  color: rgba(167,139,250,0.9);
  text-decoration: underline;
  text-decoration-color: rgba(124,58,237,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.prose a:hover {
  color: #fff;
  text-decoration-color: var(--accent-violet);
}

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

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

.prose blockquote {
  border-left: 2px solid var(--accent-violet);
  padding: var(--space-4) var(--space-6);
  margin: 2em 0;
  background: rgba(124,58,237,0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.prose img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin: 2em 0;
}

.prose hr {
  border: none;
  height: 1px;
  background: var(--border-subtle);
  margin: 3em 0;
}

/* ── Tag Pills ─────────────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 450;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.tag:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ── Stats / Metrics Strip ─────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border-faint);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.stat-item {
  background: var(--bg-surface);
  padding: var(--space-6) var(--space-5);
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-12);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.pagination a {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.pagination a:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.pagination .current {
  background: var(--accent-violet);
  color: #fff;
  border: 1px solid rgba(124,58,237,0.5);
  box-shadow: 0 0 16px rgba(124,58,237,0.3);
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-faint);
  padding: var(--space-12) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.footer-brand p {
  font-size: 13.5px;
  color: var(--text-tertiary);
  line-height: 1.65;
  margin-top: var(--space-3);
  max-width: 240px;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  font-size: 13.5px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-faint);
}

.footer-copy {
  font-size: 12.5px;
  color: var(--text-disabled);
}

.footer-socials {
  display: flex;
  gap: var(--space-3);
}

.social-link {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.social-link:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

/* ── Alerts / Callouts ─────────────────────────────────────── */
.callout {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid;
  margin: var(--space-6) 0;
}

.callout-info {
  background: rgba(59,130,246,0.05);
  border-color: rgba(59,130,246,0.2);
  color: rgba(147,197,253,0.9);
}

.callout-warning {
  background: rgba(245,158,11,0.05);
  border-color: rgba(245,158,11,0.2);
  color: rgba(253,230,138,0.9);
}

.callout-success {
  background: rgba(16,185,129,0.05);
  border-color: rgba(16,185,129,0.2);
  color: rgba(110,231,183,0.9);
}

.callout-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.callout-content {
  font-size: 14px;
  line-height: 1.6;
}

/* ── Input fields ──────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.input::placeholder { color: var(--text-tertiary); }

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

/* ── Announcement bar ──────────────────────────────────────── */
.announcement {
  background: linear-gradient(90deg, rgba(124,58,237,0.15), rgba(79,70,229,0.1), rgba(124,58,237,0.15));
  border-bottom: 1px solid rgba(124,58,237,0.2);
  padding: var(--space-2) var(--space-4);
  text-align: center;
  font-size: 13px;
  color: rgba(196,181,253,0.9);
}

.announcement a {
  color: rgba(167,139,250,1);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(167,139,250,0.4);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; }
  .nav-toggle { display: flex; }

  .hero { padding: var(--space-12) 0 var(--space-10); }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ── Syntax highlighting (Rouge) ───────────────────────────── */
.highlight { background: transparent; }
.highlight .c  { color: #6b7280; }   /* Comment */
.highlight .k  { color: #a78bfa; }   /* Keyword */
.highlight .s  { color: #6ee7b7; }   /* String */
.highlight .n  { color: #e2e8f0; }   /* Name */
.highlight .o  { color: #94a3b8; }   /* Operator */
.highlight .m  { color: #fcd34d; }   /* Number */
.highlight .na { color: #93c5fd; }   /* Attribute */
.highlight .nb { color: #c4b5fd; }   /* Builtin */
.highlight .nc { color: #86efac; }   /* Class */
.highlight .nf { color: #93c5fd; }   /* Function */
.highlight .p  { color: #94a3b8; }   /* Punctuation */
.highlight .mi { color: #fcd34d; }   /* Integer */
.highlight .kd { color: #a78bfa; }   /* Keyword declaration */
.highlight .kn { color: #a78bfa; }   /* Keyword namespace */

/* ── Scroll-triggered fade-in ──────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  opacity: 0;
  animation: fade-up 0.6s var(--ease-out) forwards;
}

.fade-up:nth-child(1) { animation-delay: 0ms; }
.fade-up:nth-child(2) { animation-delay: 80ms; }
.fade-up:nth-child(3) { animation-delay: 160ms; }
.fade-up:nth-child(4) { animation-delay: 240ms; }
.fade-up:nth-child(5) { animation-delay: 320ms; }
.fade-up:nth-child(6) { animation-delay: 400ms; }
