/* ============================================
   SecureByDezign - Main Stylesheet
   Dark mode cybersecurity aesthetic
   Emerald → Blue gradient for headings/titles
   ============================================ */

/* --- Variables --- */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1624;
  --bg-card: #131d2e;
  --bg-card-hover: #192437;
  --bg-sidebar: #0d1520;
  --bg-code: #0b1120;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --emerald: #10b981;
  --emerald-light: #34d399;
  --emerald-dark: #059669;
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --cyan: #06b6d4;

  --gradient-start: #10b981;
  --gradient-end: #3b82f6;

  --border: rgba(16, 185, 129, 0.12);
  --border-hover: rgba(16, 185, 129, 0.3);

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);

  --radius: 12px;
  --radius-sm: 6px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  scroll-padding-top: 56px; /* height of sticky filter bar */
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* --- Gradient Text --- */
.gradient-text,
h1, h2, h3,
.article-title,
.section-heading,
.card-title a,
.hero-title,
.logo-text {
  background: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Override gradient for specific elements that need plain color */
.nav-donate,
.btn-primary,
.btn-donate,
.btn-donate-primary,
.tag,
.meta-date,
.meta-read,
.meta-author,
.site-footer p,
.footer-copy,
.card-meta,
.card-read-more {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

p { margin-bottom: 1.25rem; color: var(--text-secondary); }

a {
  color: var(--emerald-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--blue-light); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.4em;
  color: var(--emerald-light);
}

pre {
  background: var(--bg-code) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}

pre.diagram {
  background: rgba(16, 185, 129, 0.04) !important;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 3px solid #10b981;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #a8ecd4;
  white-space: pre;
  overflow-x: auto;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-primary);
}

blockquote {
  border-left: 3px solid var(--emerald);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(16, 185, 129, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

li { margin-bottom: 0.5rem; }

strong { color: var(--text-primary); font-weight: 600; }

/* --- Layout --- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 64px;
  width: auto;
  display: block;
  object-fit: contain;
}

.footer-logo-img {
  height: 48px;
  margin-bottom: 0.25rem;
}

/* Logo text next to header logo image */
.logo .logo-text {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 800;
  margin-left: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.logo-accent {
  /* inherits gradient from .logo-text */
}

.footer-brand-text {
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.main-nav a:hover { color: var(--emerald-light); }
.main-nav a.nav-active { color: #10b981; }

/* ── Author link in article meta ─────────────────────────── */
.author-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(16, 185, 129, 0.3);
  transition: color 0.15s, border-color 0.15s;
}
.author-link:hover {
  color: #10b981;
  border-bottom-color: #10b981;
}

.nav-donate {
  background: linear-gradient(135deg, var(--emerald-dark), var(--blue));
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.nav-donate:hover { opacity: 0.85; color: #fff !important; }

/* ── Hamburger button (mobile only) ────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  cursor: pointer;
  padding: 9px 8px;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.nav-hamburger:hover { border-color: rgba(16, 185, 129, 0.45); }

.nav-hamburger .ham-line {
  display: block;
  width: 18px;
  height: 2px;
  background: #94a3b8;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, background 0.2s;
  transform-origin: center;
}
.nav-hamburger.is-open .ham-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: #10b981;
}
.nav-hamburger.is-open .ham-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-hamburger.is-open .ham-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: #10b981;
}

/* --- Hero (Homepage) --- */
.home-hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-secondary);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 14, 26, 0.45) 0%,
    rgba(10, 14, 26, 0.8)  50%,
    rgba(10, 14, 26, 1)   100%
  );
}

/* Article hero gets a heavier scrim so text pops over busy images */
.article-hero .hero-overlay {
  background: linear-gradient(
    to bottom,
    rgba(10, 14, 26, 0.55)  0%,
    rgba(10, 14, 26, 0.82) 45%,
    rgba(10, 14, 26, 0.97) 70%,
    rgba(10, 14, 26, 1)   100%
  );
}

.hero-home-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--emerald-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--emerald-dark), var(--blue));
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: 100px;
  transition: opacity 0.2s, transform 0.2s;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); color: #fff; }

.btn-primary.btn-large {
  font-size: 1.05rem;
  padding: 1rem 2.5rem;
}

.btn-play {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  -webkit-text-fill-color: #fff;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-play:hover { background: rgba(255, 255, 255, 0.2); }

/* --- Site Intro --- */
.site-intro {
  padding: 4rem 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}

.intro-text h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-text p { color: var(--text-secondary); max-width: 600px; margin-bottom: 0; }

.intro-stats {
  display: flex;
  gap: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

/* --- Articles Grid --- */
.articles-section {
  padding: 5rem 0;
}

/* ── Sticky Filter Bar ─────────────────────────────────── */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg-primary);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  padding: 0;
}

.filter-bar.is-stuck {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  background: rgba(10, 14, 26, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.filter-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 0.25rem;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.ftab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.95rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}

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

.ftab.active {
  color: #10b981;
  border-bottom-color: #10b981;
}

.ftab-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: inherit;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.ftab.active .ftab-count {
  opacity: 0.85;
}

/* ── Cluster Sections ──────────────────────────────────── */
.clusters-wrapper {
  padding-bottom: 2rem;
}

.cluster-section {
  padding: 3.5rem 0 1rem;
}

.cluster-section + .cluster-section {
  border-top: 1px solid var(--border);
}

.cluster-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.cluster-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cluster-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: #10b981;
  letter-spacing: 0.08em;
  opacity: 0.7;
  padding-top: 0.1em;
}

.cluster-title {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.cluster-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.cluster-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
  max-width: 480px;
  text-align: right;
  display: none;
}

@media (min-width: 900px) {
  .cluster-desc { display: block; }
}

.cluster-count-badge {
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.04em;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 0.75rem;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
}

/* --- Article Card --- */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.card-image-link {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  background: var(--bg-secondary);
}

.article-card:hover .card-image { transform: scale(1.04); }

.card-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(13, 21, 32, 0.8) 100%);
}

.card-body {
  padding: 1.5rem;
}

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

.card-title {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.card-title a {
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  font-weight: 700;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  background: none;
  -webkit-text-fill-color: var(--text-muted);
}

.card-read-more {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--emerald-light);
  -webkit-text-fill-color: var(--emerald-light);
  text-decoration: none;
  transition: color 0.2s;
}

.card-read-more:hover { color: var(--blue-light); -webkit-text-fill-color: var(--blue-light); }

/* --- Tags --- */
.tag, .tag-sm {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--emerald-light);
  -webkit-text-fill-color: var(--emerald-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background-clip: unset;
}

.tag { font-size: 0.7rem; }
.tag-sm { font-size: 0.7rem; }

/* --- CTA Section --- */
.cta-section {
  padding: 5rem 0;
  background: var(--bg-secondary);
}

.cta-box {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-box h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-box p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ---- Article Page ---- */
.article-hero {
  position: relative;
  min-height: 55vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-secondary);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-bottom: 3rem;
  padding-top: 6rem;
}

.tags-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.article-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 16px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 40px rgba(0, 0, 0, 0.6));
}

.article-subtitle {
  font-size: 1.15rem;
  color: #c8d8e4;
  margin-bottom: 1.25rem;
  max-width: 700px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8), 0 2px 24px rgba(0, 0, 0, 0.6);
}

.article-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #94a3b8;
  -webkit-text-fill-color: #94a3b8;
  background: none;
  background-clip: unset;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.article-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3rem;
  padding-top: 3rem;
  padding-bottom: 5rem;
  align-items: start;
}

/* --- Sidebar --- */
.article-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.podcast-card, .toc-card, .donate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.podcast-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.podcast-icon { font-size: 1.8rem; }

.podcast-header h3 {
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.2rem;
}

.podcast-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.podcast-player {
  width: 100%;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  accent-color: var(--emerald);
}

.download-btn {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.download-btn:hover {
  border-color: var(--emerald);
  color: var(--emerald-light);
  -webkit-text-fill-color: var(--emerald-light);
}

.toc-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  background: none;
  background-clip: unset;
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc-counter;
}

.toc-list li {
  counter-increment: toc-counter;
  margin-bottom: 0;
}

.toc-list a {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  -webkit-text-fill-color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: color 0.2s;
  line-height: 1.4;
}

.toc-list a::before {
  content: counter(toc-counter, decimal-leading-zero);
  font-size: 0.7rem;
  color: var(--emerald);
  -webkit-text-fill-color: var(--emerald);
  font-weight: 600;
  min-width: 1.5rem;
  margin-top: 0.1rem;
}

.toc-list a:hover {
  color: var(--emerald-light);
  -webkit-text-fill-color: var(--emerald-light);
}

.donate-card {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(59,130,246,0.08));
  border-color: rgba(16,185,129,0.2);
}

.donate-card h3 {
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.donate-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn-donate {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, var(--emerald-dark), var(--blue));
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  border-radius: 100px;
  transition: opacity 0.2s;
}

.btn-donate:hover { opacity: 0.85; color: #fff; }

/* --- Article Body --- */
.article-body { min-width: 0; }

.exec-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--emerald);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 3rem;
}

.exec-summary h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.summary-content p { color: var(--text-secondary); margin-bottom: 0.75rem; }
.summary-content p:last-child { margin-bottom: 0; }

.article-section {
  margin-bottom: 3.5rem;
  padding-bottom: 3.5rem;
  padding-left: 1.25rem;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
  border-radius: 0 0 0 4px;
  transition: border-left-color 0.3s ease;
}

.article-section:last-child { border-bottom: none; }

.section-heading {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-content { color: var(--text-secondary); }
.section-content p { margin-bottom: 1.25rem; }
.section-content h3, .section-content h4 {
  color: var(--text-primary);
  -webkit-text-fill-color: var(--text-primary);
  background: none;
  background-clip: unset;
  margin: 1.5rem 0 0.75rem;
  font-size: 1.1rem;
}

.pax-insight {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(59,130,246,0.05));
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.insight-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--emerald);
  -webkit-text-fill-color: var(--emerald);
  margin-bottom: 0.5rem;
}

.pax-insight p {
  color: var(--text-primary);
  margin-bottom: 0;
  font-style: italic;
}

.correction-note {
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #fbbf24;
  -webkit-text-fill-color: #fbbf24;
}

/* Practice Lab section badge */
.badge-lab {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Lab prerequisite banner — appears at the top of the Practice section */
.lab-prereq-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 4px solid #10b981;
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.75rem;
}

.lab-prereq-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.lab-prereq-body {
  flex: 1;
}

.lab-prereq-body strong {
  display: block;
  color: #e2f5ec;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.lab-prereq-body p {
  color: #6b8f7a;
  font-size: 0.82rem;
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.lab-prereq-link {
  display: inline-block;
  color: #10b981;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(16, 185, 129, 0.3);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.lab-prereq-link:hover {
  color: #34d399;
  border-color: #34d399;
}

.takeaways-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}

.takeaways-box h2 {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.takeaways-list li {
  padding: 0.6rem 0;
  padding-left: 1.5rem;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.takeaways-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--emerald);
}

.takeaways-list li:last-child { border-bottom: none; }

/* --- Share Section --- */
.share-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.share-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  -webkit-text-fill-color: var(--text-secondary);
  background: none;
  background-clip: unset;
}

.share-buttons { display: flex; gap: 1rem; }

.share-btn {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  transition: opacity 0.2s;
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.share-btn.twitter { background: #000; border: 1px solid #333; }
.share-btn.linkedin { background: #0077b5; }
.share-btn:hover { opacity: 0.8; }

/* ── Connect on X ───────────────────────────────────────── */
.article-connect {
  margin: 3rem 0 0;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.connect-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.connect-header svg { flex-shrink: 0; opacity: 0.85; }

.connect-body {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.connect-profiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .connect-profiles { grid-template-columns: 1fr; }
}

.connect-profile {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.connect-profile:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
}

.connect-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.connect-avatar-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1rem;
}

.connect-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.connect-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.connect-handle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #10b981;
  white-space: nowrap;
}

.connect-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.15rem;
}

/* ── Giscus Comments ────────────────────────────────────── */
.article-comments {
  margin: 2.5rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comments-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1.5rem;
}

/* ── Comment Form ────────────────────────────────────────── */
.comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

/* platform picker removed — name-row is always visible now */

.cf-name-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.cf-input {
  flex: 1;
  min-width: 140px;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.cf-input:focus { border-color: rgba(16,185,129,0.5); }

.cf-textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.6;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.cf-textarea:focus { border-color: rgba(16,185,129,0.5); }
.cf-textarea::placeholder { color: var(--text-muted); }

.cf-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 1rem;
}

.cf-chars {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cf-submit {
  padding: 0.55rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.cf-submit:hover { background: #0d9c6c; }
.cf-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.cf-msg {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
}

.cf-msg-ok    { background: rgba(16,185,129,0.12); color: #10b981; }
.cf-msg-error { background: rgba(239,68,68,0.12);  color: #f87171; }

/* ── Comment Cards ───────────────────────────────────────── */
.comments-list { display: flex; flex-direction: column; gap: 1rem; }

.comment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.cc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.cc-author {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.cc-handle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #10b981;
}

.cc-link {
  font-size: 0.72rem;
  color: #10b981;
  text-decoration: none;
  border-bottom: 1px solid rgba(16,185,129,0.3);
  transition: border-color 0.15s, color 0.15s;
  word-break: break-all;
}
.cc-link:hover { color: #34d399; border-color: rgba(52,211,153,0.6); }

.cc-date {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.cc-body {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary, var(--text-primary));
  white-space: pre-wrap;
  word-break: break-word;
}

.comments-empty, .comments-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 2rem 0;
}

/* --- Donate Page --- */
.donate-main { padding: 5rem 0; }

.donate-container { max-width: 1000px; }

.donate-hero {
  text-align: center;
  margin-bottom: 3rem;
}

.donate-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.donate-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.donate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.donate-why h2 {
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.why-list {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.why-list li {
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.pax-quote {
  font-style: italic;
  color: var(--text-secondary);
  padding: 1.25rem;
  border-left: 3px solid var(--emerald);
  background: rgba(16,185,129,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 1.5rem;
}

.pax-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--emerald);
  -webkit-text-fill-color: var(--emerald);
}

.donate-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.donate-form-card h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.amount-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.amount-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  -webkit-text-fill-color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.amount-btn.active, .amount-btn:hover {
  background: rgba(16,185,129,0.12);
  border-color: var(--emerald);
  color: var(--emerald-light);
  -webkit-text-fill-color: var(--emerald-light);
}

.custom-amount { margin-bottom: 1.25rem; }

.custom-amount label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.custom-amount input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  transition: border-color 0.2s;
}

.custom-amount input:focus {
  outline: none;
  border-color: var(--emerald);
}

.stripe-element {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.stripe-errors {
  color: #f87171;
  -webkit-text-fill-color: #f87171;
  font-size: 0.85rem;
  min-height: 1.2rem;
  margin-bottom: 1rem;
}

.btn-donate-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--emerald-dark), var(--blue));
  color: #fff;
  -webkit-text-fill-color: #fff;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-donate-primary:hover { opacity: 0.85; }
.btn-donate-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.secure-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.success-message {
  text-align: center;
  padding: 2rem 0;
}

.success-message h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}

.footer-brand .logo-text {
  font-size: 1.2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--emerald-light);
  -webkit-text-fill-color: var(--emerald-light);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted) !important;
  text-align: right;
  margin: 0;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-copy { text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 600px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions { flex-direction: column; }
  .amount-buttons { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════
   Mobile Navigation — hamburger drawer
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Tighten header padding on mobile */
  .site-header .container {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  /* Shrink logo on mobile */
  .logo-img { height: 44px; }
  .logo .logo-text { font-size: 1.15rem; margin-left: 0.75rem; }

  /* Nav becomes a right-side action row: Pro | Search | ☰ */
  .main-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;         /* allows links to spill to second row when open */
    justify-content: flex-end;
  }

  /* Hamburger visible on mobile */
  .nav-hamburger { display: flex; }

  /* Regular nav links: hidden by default, ordered to a new row below the actions */
  .main-nav > a:not(.nav-donate) {
    order: 50;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    padding: 0 0.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-top: 1px solid transparent;
    transition: max-height 0.28s ease, opacity 0.22s ease, padding 0.22s ease, border-color 0.22s;
  }

  /* Action items (Pro + search) stay on the first row */
  .nav-donate      { order: 10; }
  .nav-search-wrap { order: 11; }
  .nav-hamburger   { order: 12; }

  /* ── Open state ── */
  /* Full-width tinted drawer below the action row */
  .nav-open .main-nav {
    background: rgba(10, 14, 26, 0.98);
    border-top: 1px solid rgba(16, 185, 129, 0.12);
    border-bottom: 1px solid rgba(16, 185, 129, 0.12);
    padding-bottom: 0.5rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .nav-open .main-nav > a:not(.nav-donate) {
    max-height: 52px;
    opacity: 1;
    pointer-events: auto;
    padding: 0.85rem 0.25rem;
    border-top-color: rgba(255, 255, 255, 0.05);
  }

  .nav-open .main-nav > a:not(.nav-donate):first-child {
    border-top-color: transparent;
  }

  .nav-open .main-nav > a:not(.nav-donate):hover {
    color: var(--emerald-light);
  }

  /* Smooth header transition when drawer opens */
  .site-header {
    transition: box-shadow 0.2s;
  }
  .nav-open.site-header {
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
  }
}

/* --- Inline glossary definition links --- */
.def-link {
  color: var(--emerald-light, #34d399);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.def-link:hover {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  text-decoration-style: solid;
}

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

/* --- Prism.js theme adjustments --- */
.token.comment, .token.prolog, .token.doctype, .token.cdata {
  color: #64748b;
}

.token.keyword { color: var(--emerald-light); }
.token.string { color: #86efac; }
.token.number { color: #93c5fd; }
.token.function { color: var(--blue-light); }

/* --- Citations & References --- */
.cite-ref {
  color: var(--emerald-light);
  text-decoration: none;
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
  transition: color 0.15s;
}
.cite-ref:hover {
  color: #6ee7b7;
  text-decoration: underline;
}

.references-section {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 12px;
}
.references-section h2 {
  font-size: 1.3rem;
  color: var(--emerald-light);
  margin-bottom: 1.25rem;
}
.references-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.references-list li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: flex;
  gap: 0.6rem;
}
.ref-num {
  color: var(--emerald-light);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.references-list a {
  color: var(--blue-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
.references-list a:hover {
  color: #93c5fd;
}

/* ============================================
   Section Type Badges — AI Security Training Ground
   ============================================ */
.section-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
  border: 1px solid transparent;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
}

/* History / Origins */
.badge-history {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

/* In the Wild */
.badge-wild {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Attacker's Playbook */
.badge-attack {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

/* Defense Playbook */
.badge-defense {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* Vendor Arsenal */
.badge-vendor {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

/* Article section: subtle left border color based on type */
.article-section.section-type-history    { border-left-color: rgba(139, 92, 246, 0.4); }
.article-section.section-type-in-the-wild { border-left-color: rgba(239, 68, 68, 0.4); }
.article-section.section-type-attack-playbook { border-left-color: rgba(245, 158, 11, 0.4); }
.article-section.section-type-defense-playbook { border-left-color: rgba(16, 185, 129, 0.4); }
.article-section.section-type-vendor-solutions { border-left-color: rgba(59, 130, 246, 0.4); }



/* ============================================================
   RESEARCH HUB REDESIGN — New homepage components
   ============================================================ */

/* ── Hub Hero ─────────────────────────────────────────────── */
.hub-hero {
  position: relative;
  padding: 5rem 0 4rem;
  background: var(--bg-primary);
  overflow: hidden;
}

.hub-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 55% at 50% 0%, rgba(16,185,129,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hub-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 40% at 80% 100%, rgba(59,130,246,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hub-hero-content {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 100px;
  padding: 0.3rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}

.hub-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 55%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hub-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* Large search trigger button */
.hub-search-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 620px;
  margin: 0 auto 2.25rem;
  background: rgba(13,31,22,0.8);
  border: 1.5px solid rgba(16,185,129,0.28);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  cursor: text;
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: left;
  transition: all 0.2s ease;
  box-shadow: 0 4px 32px rgba(0,0,0,0.45);
}

.hub-search-bar:hover,
.hub-search-bar:focus {
  border-color: rgba(16,185,129,0.55);
  box-shadow: 0 4px 40px rgba(0,0,0,0.55), 0 0 0 3px rgba(16,185,129,0.08);
  background: rgba(13,31,22,0.95);
  outline: none;
}

.hub-search-bar svg {
  color: #10b981;
  flex-shrink: 0;
  opacity: 0.85;
}

.hub-search-placeholder {
  flex: 1;
  color: #4a6b5a;
  font-size: 0.95rem;
  pointer-events: none;
}

.hub-search-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  padding: 0.15rem 0.45rem;
  color: #3a5e48;
  flex-shrink: 0;
}

/* Topic pills */
.hub-topics {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hub-topic-label {
  font-size: 0.72rem;
  color: #4a6b5a;
  font-family: var(--font-mono);
  margin-right: 0.1rem;
}

.hub-topic-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border-radius: 100px;
  border: 1px solid rgba(16,185,129,0.14);
  background: rgba(16,185,129,0.04);
  color: #5a7a6a;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hub-topic-pill:hover {
  border-color: rgba(16,185,129,0.38);
  background: rgba(16,185,129,0.1);
  color: #a8ecd4;
}

.hub-topic-pill--vendor {
  border-color: rgba(139,92,246,0.18);
  background: rgba(139,92,246,0.05);
  color: #8b72e0;
}

.hub-topic-pill--vendor:hover {
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.12);
  color: #c4b5fd;
}

/* ── Hub Stats Bar ────────────────────────────────────────── */
.hub-stats-bar {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.hub-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.hub-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem;
}

.hub-stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: linear-gradient(90deg, #10b981, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.hub-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Hub Latest Article ───────────────────────────────────── */
.hub-latest {
  padding: 1.25rem 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.hub-latest-card {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s ease;
}

.hub-latest-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.hub-latest-image {
  width: 190px;
  flex-shrink: 0;
  height: 108px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.hub-latest-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.hub-latest-card:hover .hub-latest-image img {
  transform: scale(1.04);
}

.hub-latest-body {
  flex: 1;
  min-width: 0;
}

.hub-latest-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.hub-latest-badge {
  font-size: 0.68rem;
  color: #10b981;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  padding: 0.12rem 0.55rem;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.hub-latest-read {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hub-latest-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  background: linear-gradient(90deg, #d4f0e0, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-latest-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 0 0 0.4rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hub-latest-cta {
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 600;
}

/* ── Vendor Intelligence Section ─────────────────────────── */
.vendor-hub {
  padding: 3rem 0 4rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.vendor-hub-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.vendor-hub-meta {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.vendor-hub-icon {
  font-size: 2rem;
  line-height: 1;
  margin-top: 0.25rem;
}

.vendor-hub-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.vendor-hub-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Vendor controls (search + filters) */
.vendor-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.vendor-text-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  max-width: 380px;
}

.vendor-text-search-wrap svg {
  color: #4a6b5a;
  flex-shrink: 0;
  opacity: 0.8;
}

.vendor-text-search {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.88rem;
  color: var(--text-primary);
  font-family: var(--font-body);
}

.vendor-text-search::placeholder {
  color: #4a6b5a;
}

.vendor-filter-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.vendor-filter-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4a6b5a;
  font-family: var(--font-mono);
  white-space: nowrap;
  padding-top: 0.32rem;
  min-width: 96px;
}

.vendor-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.vfilter-btn {
  padding: 0.24rem 0.7rem;
  border-radius: 100px;
  border: 1px solid rgba(16,185,129,0.14);
  background: rgba(16,185,129,0.03);
  color: #5a7a6a;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
  white-space: nowrap;
}

.vfilter-btn:hover {
  border-color: rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.07);
  color: #a8ecd4;
}

.vfilter-btn.active {
  border-color: #10b981;
  background: rgba(16,185,129,0.14);
  color: #34d399;
  font-weight: 600;
}

/* Vendor grid */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 1.1rem;
}

/* Vendor card */
.vendor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.vendor-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.vendor-card-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.vendor-initial {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  flex-shrink: 0;
  color: #fff;
  opacity: 0.9;
}

.vendor-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  background-clip: unset !important;
}

.vendor-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.58;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vendor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.vendor-tag {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.12rem 0.48rem;
  border-radius: 100px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.vendor-tag--vector {
  background: rgba(16,185,129,0.09);
  border: 1px solid rgba(16,185,129,0.2);
  color: #34d399;
}

.vendor-tag--topic {
  background: rgba(59,130,246,0.09);
  border: 1px solid rgba(59,130,246,0.2);
  color: #60a5fa;
}

.vendor-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.vendor-articles-link {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.vendor-articles-link:hover {
  color: #10b981;
}

.vendor-site-link {
  font-size: 0.7rem;
  color: #4a6b5a;
  text-decoration: none;
  font-family: var(--font-mono);
  transition: color 0.15s;
}

.vendor-site-link:hover {
  color: #10b981;
}

/* No results state */
.vendor-no-results {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.vendor-no-results .vnr-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.vnr-reset {
  background: none;
  border: none;
  color: #10b981;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
  font-family: var(--font-body);
}

/* ── Responsive overrides ────────────────────────────────── */
@media (max-width: 900px) {
  .hub-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .hub-hero { padding: 3.5rem 0 2.5rem; }
  .hub-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-latest-image { width: 130px; height: 80px; }
  .vendor-filter-group { flex-direction: column; gap: 0.4rem; }
  .vendor-filter-label { min-width: unset; }
  .vendor-controls { padding: 1rem; }
}

@media (max-width: 540px) {
  .hub-hero { padding: 2.5rem 0 2rem; }
  .hub-search-bar { max-width: 100%; padding: 0.85rem 1rem; }
  .hub-search-kbd { display: none; }
  .hub-latest-card { flex-direction: column; gap: 1rem; }
  .hub-latest-image { width: 100%; height: 160px; }
  .hub-latest-title { white-space: normal; }
  .hub-stats-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================
   COMPACT ARTICLE LIST — hub-articles overrides
   Transforms card grid → lean, scannable list rows
   ============================================================ */

/* ── Grid → column list ─────────────────────────────────────── */
.hub-articles .articles-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Each article: compact horizontal row ───────────────────── */
.hub-articles .article-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  border-radius: 0;
  box-shadow: none;
  transition: background 0.12s, border-radius 0.12s;
}

.hub-articles .article-card:last-child {
  border-bottom: none;
}

.hub-articles .article-card:hover {
  background: rgba(16,185,129,0.04);
  border-bottom-color: transparent;
  border-radius: 8px;
  transform: none;
  box-shadow: none;
}

/* ── Thumbnail: small left image ──────────────────────────── */
.hub-articles .card-image-link {
  width: 76px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  display: block;
  position: static;
}

.hub-articles .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.hub-articles .article-card:hover .card-image {
  transform: scale(1.06);
}

.hub-articles .card-image-overlay {
  display: none;
}

/* ── Body: title + meta in a row ──────────────────────────── */
.hub-articles .card-body {
  flex: 1;
  min-width: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── Title ────────────────────────────────────────────────── */
.hub-articles .card-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-articles .card-title a {
  color: var(--text-primary);
  text-decoration: none;
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  background-clip: unset !important;
  font-weight: 500;
}

.hub-articles .card-title a:hover {
  color: var(--emerald-light);
}

/* ── Meta: date · read time ───────────────────────────────── */
.hub-articles .card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.hub-articles .card-meta span:first-child::after {
  content: '·';
  margin-left: 0.4rem;
  opacity: 0.4;
}

/* ── Hide noisy elements ─────────────────────────────────── */
.hub-articles .card-tags,
.hub-articles .card-subtitle,
.hub-articles .card-read-more {
  display: none !important;
}

/* ── Over-limit collapse ────────────────────────────────── */
.hub-articles .article-card.over-limit {
  display: none;
}

.hub-articles .cluster-section.is-expanded .article-card.over-limit {
  display: flex;
}

/* ── Expand/collapse button ─────────────────────────────── */
.cluster-expand-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.6rem 0.5rem 0.25rem auto;
  padding: 0.3rem 0.75rem;
  background: transparent;
  border: 1px solid rgba(16,185,129,0.18);
  border-radius: 100px;
  color: #5a7a6a;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cluster-expand-btn:hover {
  border-color: rgba(16,185,129,0.4);
  background: rgba(16,185,129,0.06);
  color: #a8ecd4;
}

.cluster-expand-btn svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.cluster-expand-btn.is-expanded svg {
  transform: rotate(180deg);
}

/* ── Tighter cluster section spacing ────────────────────── */
.hub-articles .cluster-section {
  padding-bottom: 1rem;
}

.hub-articles .cluster-header {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

/* ── Cluster header: suppress description on compact view ── */
.hub-articles .cluster-desc {
  display: none;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 540px) {
  .hub-articles .card-image-link {
    width: 56px;
    height: 40px;
  }
  .hub-articles .card-title {
    font-size: 0.82rem;
  }
  .hub-articles .card-meta {
    display: none;
  }
}


/* ── Vendor logo images ──────────────────────────────────── */
.vendor-logo-container {
  background: #fff !important;
  border: 1px solid rgba(0,0,0,0.08);
  opacity: 1;
}

.vendor-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  display: block;
  border-radius: 7px;
}
