/* ============================================
   all-about-ai.tech — Main Stylesheet
   Professional AI Blog | July 2026
   ============================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-elevated: #1e1e2a;
  --border-subtle: #252535;
  --border-default: #333348;
  --text-primary: #e8e8ed;
  --text-secondary: #a0a0b5;
  --text-muted: #6b6b80;
  --text-on-accent: #0a0a0f;

  /* Accent / Brand */
  --accent-primary: #6c5ce7;
  --accent-secondary: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.25);

  /* Difficulty Tier Colors */
  --tier-l1: #00cec9;   /* Teal — Layman */
  --tier-l2: #fdcb6e;   /* Gold — Enthusiast */
  --tier-l3: #e17055;   /* Coral — Practitioner */
  --tier-l4: #ff7675;   /* Rose — Expert */

  --tier-l1-bg: rgba(0, 206, 201, 0.1);
  --tier-l2-bg: rgba(253, 203, 110, 0.1);
  --tier-l3-bg: rgba(225, 112, 85, 0.1);
  --tier-l4-bg: rgba(255, 118, 117, 0.1);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace;
  --font-display: 'Space Grotesk', var(--font-sans);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --content-width: 780px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px var(--accent-glow);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Misc */
  --header-height: 72px;
}

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

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

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

/* Subtle grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(108, 92, 231, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 92, 231, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--space-md); }

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-primary); }

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

/* --- Utility Classes --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

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

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent-primary), #a29bfe);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
}

.logo-dot {
  color: var(--accent-primary);
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
}

.theme-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}
.theme-toggle:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: var(--space-4xl) 0 var(--space-3xl);
  text-align: center;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-xs) var(--space-md);
  border-radius: 50px;
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.15); }
}

.hero h1 {
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.6;
}

/* --- Difficulty Tier Navigation --- */
.tier-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
  z-index: 1;
  position: relative;
}

.tier-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: 50px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: var(--font-sans);
}
.tier-btn:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.tier-btn.active {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.tier-btn.l1.active { border-color: var(--tier-l1); background: var(--tier-l1-bg); color: var(--tier-l1); }
.tier-btn.l2.active { border-color: var(--tier-l2); background: var(--tier-l2-bg); color: var(--tier-l2); }
.tier-btn.l3.active { border-color: var(--tier-l3); background: var(--tier-l3-bg); color: var(--tier-l3); }
.tier-btn.l4.active { border-color: var(--tier-l4); background: var(--tier-l4-bg); color: var(--tier-l4); }

.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.tier-dot.l1 { background: var(--tier-l1); }
.tier-dot.l2 { background: var(--tier-l2); }
.tier-dot.l3 { background: var(--tier-l3); }
.tier-dot.l4 { background: var(--tier-l4); }

/* --- Skill / Topic Navigation --- */
.skill-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  z-index: 1;
  position: relative;
  align-items: center;
}

.skill-nav-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: var(--space-sm);
  white-space: nowrap;
}

.skill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-xs) var(--space-md);
  border-radius: 50px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.skill-btn:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.skill-btn.active {
  border-color: var(--accent-primary);
  background: rgba(108, 92, 231, 0.12);
  color: var(--accent-secondary);
  transform: translateY(-1px);
}

.skill-count {
  font-size: 0.7rem;
  background: var(--bg-elevated);
  padding: 1px 7px;
  border-radius: 50px;
  color: var(--text-muted);
  font-weight: 600;
}

.skill-btn.active .skill-count {
  background: rgba(108, 92, 231, 0.2);
  color: var(--accent-secondary);
}

/* --- Search --- */
.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto var(--space-3xl);
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  padding-left: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: all var(--transition-base);
  outline: none;
}
.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

/* --- Article Grid --- */
.articles-section {
  position: relative;
  z-index: 1;
  padding-bottom: var(--space-4xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.section-header h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.article-count {
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

/* --- Article Card --- */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.article-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 0;
  pointer-events: none;
}

.article-card:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

/* Card tier accent borders */
.article-card[data-tier="1"] { border-left: 3px solid var(--tier-l1); }
.article-card[data-tier="2"] { border-left: 3px solid var(--tier-l2); }
.article-card[data-tier="3"] { border-left: 3px solid var(--tier-l3); }
.article-card[data-tier="4"] { border-left: 3px solid var(--tier-l4); }

.article-card[data-tier="1"]:hover { box-shadow: 0 8px 32px rgba(0, 206, 201, 0.1); }
.article-card[data-tier="2"]:hover { box-shadow: 0 8px 32px rgba(253, 203, 110, 0.1); }
.article-card[data-tier="3"]:hover { box-shadow: 0 8px 32px rgba(225, 112, 85, 0.1); }
.article-card[data-tier="4"]:hover { box-shadow: 0 8px 32px rgba(255, 118, 117, 0.1); }

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-badge.l1 { background: var(--tier-l1-bg); color: var(--tier-l1); }
.tier-badge.l2 { background: var(--tier-l2-bg); color: var(--tier-l2); }
.tier-badge.l3 { background: var(--tier-l3-bg); color: var(--tier-l3); }
.tier-badge.l4 { background: var(--tier-l4-bg); color: var(--tier-l4); }

.card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-reading-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  position: relative;
  z-index: 1;
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  z-index: 1;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.tag:hover {
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--text-muted);
}

/* --- Ad Widget --- */
.ad-section {
  padding: var(--space-2xl) 0;
  background: var(--bg-secondary);
  position: relative;
  z-index: 1;
}

.ad-widget-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  min-height: 100px;
}

/* Header ad widget — taller placement below the site header */
div[data-widget-id="2051819"] {
  min-height: 300px;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3xl) 0;
  background: var(--bg-secondary);
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
}

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

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 100%;
  text-align: center;
  margin-top: var(--space-lg);
}

/* --- Article Page Styles --- */
.article-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl) var(--space-4xl);
  position: relative;
  z-index: 1;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-2xl);
  transition: color var(--transition-fast);
}
.article-back:hover {
  color: var(--text-primary);
}

.article-top-ad {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.article-header {
  margin-bottom: var(--space-2xl);
}

.article-difficulty-bar {
  height: 4px;
  border-radius: 2px;
  margin-bottom: var(--space-lg);
  background: var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.article-difficulty-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 2px;
}
.article-difficulty-bar.l1::after { width: 25%; background: var(--tier-l1); }
.article-difficulty-bar.l2::after { width: 50%; background: var(--tier-l2); }
.article-difficulty-bar.l3::after { width: 75%; background: var(--tier-l3); }
.article-difficulty-bar.l4::after { width: 100%; background: var(--tier-l4); }

.article-meta-main {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.article-meta-main .tier-badge {
  font-size: 0.75rem;
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: var(--space-md);
  line-height: 1.15;
}

.article-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.article-author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}

.author-name {
  font-weight: 600;
  color: var(--text-primary);
}

.author-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Article content */
.article-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 1.65rem;
  margin: var(--space-2xl) 0 var(--space-md);
  padding-top: var(--space-lg);
}

.article-content h3 {
  font-size: 1.3rem;
  margin: var(--space-xl) 0 var(--space-sm);
}

.article-content p {
  margin-bottom: var(--space-lg);
}

.article-content ul,
.article-content ol {
  margin: var(--space-md) 0 var(--space-lg) var(--space-xl);
}

.article-content li {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.article-content blockquote {
  border-left: 3px solid var(--accent-primary);
  padding: var(--space-md) var(--space-xl);
  margin: var(--space-xl) 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

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

/* Inline contextual links to related articles */
.inline-article-link {
  color: var(--accent-secondary);
  text-decoration: underline;
  text-decoration-color: rgba(162, 155, 254, 0.4);
  text-underline-offset: 0.15em;
  font-weight: 500;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.inline-article-link:hover {
  color: var(--accent-primary);
  text-decoration-color: var(--accent-secondary);
}

/* Callout boxes */
.callout {
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius-md);
  margin: var(--space-xl) 0;
  border: 1px solid;
}

.callout.insight {
  background: rgba(108, 92, 231, 0.08);
  border-color: rgba(108, 92, 231, 0.3);
}

.callout.warning {
  background: rgba(255, 118, 117, 0.08);
  border-color: rgba(255, 118, 117, 0.3);
}

.callout.tip {
  background: rgba(0, 206, 201, 0.08);
  border-color: rgba(0, 206, 201, 0.3);
}

/* Cross-reference callout (in-content related reading) */
.callout.crossref {
  background: rgba(162, 155, 254, 0.06);
  border-color: rgba(162, 155, 254, 0.25);
}

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

.crossref-list li {
  margin-bottom: var(--space-sm);
}

.crossref-list li:last-child {
  margin-bottom: 0;
}

.crossref-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
  line-height: 1.4;
}

.crossref-link:hover {
  color: var(--accent-secondary);
}

.crossref-link .tier-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
}

/* Related Articles section (bottom of article page) */
.related-articles {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.related-articles h3 {
  margin-bottom: var(--space-lg);
  font-size: 1.3rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
}

.related-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.related-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.related-reading-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.related-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0;
}

.related-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.callout-title {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

/* Key takeaways at bottom */
.article-takeaways {
  margin-top: var(--space-3xl);
  padding: var(--space-xl);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.article-takeaways h3 {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

.article-takeaways ul {
  margin-left: var(--space-lg);
}

.article-takeaways li {
  margin-bottom: var(--space-sm);
}

/* Share / difficulty nav at bottom */
.article-footer-nav {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.difficulty-legend {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.difficulty-steps {
  display: flex;
  gap: 3px;
}

.difficulty-step {
  width: 28px;
  height: 6px;
  border-radius: 3px;
  background: var(--border-subtle);
  transition: background var(--transition-base);
}

.difficulty-step.filled { background: var(--tier-l1); }
.difficulty-step.filled.l2 { background: var(--tier-l2); }
.difficulty-step.filled.l3 { background: var(--tier-l3); }
.difficulty-step.filled.l4 { background: var(--tier-l4); }

/* --- Prev/Next Article Navigation --- */
.prev-next-nav {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.prev-next-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.prev-next-group {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-secondary);
}

.prev-next-position {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.prev-next-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.prev-next-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
}

.prev-next-link:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.prev-next-link.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.prev-next-link.disabled:hover {
  transform: none;
  border-color: var(--border-subtle);
  box-shadow: none;
}

.prev-next-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.prev-link .prev-next-label {
  color: var(--text-muted);
}

.next-link .prev-next-label {
  color: var(--accent-secondary);
  text-align: right;
}

.prev-link {
  align-items: flex-start;
  text-align: left;
}

.next-link {
  align-items: flex-end;
  text-align: right;
}

.prev-next-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.prev-next-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .hero {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-lg);
    gap: var(--space-md);
  }

  .nav-links.open {
    display: flex;
  }

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

  .tier-nav {
    gap: var(--space-xs);
  }

  .tier-btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .article-content {
    font-size: 1rem;
  }

  .skill-nav {
    gap: var(--space-xs);
  }

  .skill-nav-label {
    width: 100%;
    text-align: center;
    margin-right: 0;
    margin-bottom: var(--space-xs);
  }

  .skill-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
  }

  .prev-next-links {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .header-inner {
    padding: 0 var(--space-md);
  }

  .ad-widget-container {
    padding: 0 var(--space-md);
  }

  .hero h1 {
    font-size: 1.75rem;
  }

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

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

.article-card {
  animation: fadeInUp 0.5s ease forwards;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }
.article-card:nth-child(7) { animation-delay: 0.35s; }
.article-card:nth-child(8) { animation-delay: 0.4s; }

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
