/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --blue-light-border: #bfdbfe;
  --violet: #7c3aed;
  --violet-dark: #6d28d9;
  --violet-light: #f5f3ff;
  --violet-light-border: #ddd6fe;
  --teal: #0891b2;
  --teal-dark: #0e7490;
  --teal-light: #ecfeff;
  --teal-light-border: #a5f3fc;
  --amber: #d97706;
  --green: #059669;
  --red: #dc2626;
  --pink: #be185d;

  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  --header-height: 64px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

  --max-width: 1440px;
  --content-max: 920px;
  --padding-x: clamp(1rem, 5vw, 3rem);
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; }
a { color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* Anchor offset for sticky header */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

/* ============================================================
   Header & Navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding-x);
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.logo-link:hover { opacity: 0.8; }

.logo-img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--blue);
  background: var(--blue-light);
}

.nav-link.active {
  color: var(--blue);
  background: var(--blue-light);
  font-weight: 600;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  margin-left: auto;
  transition: all 0.18s;
}
.mobile-menu-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.mobile-menu-btn svg { width: 18px; height: 18px; }
.mobile-menu-btn .icon-close { display: none; }
.mobile-menu-btn[aria-expanded="true"] .icon-menu { display: none; }
.mobile-menu-btn[aria-expanded="true"] .icon-close { display: block; }

.mobile-menu {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 0.75rem var(--padding-x);
}
.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.18s;
}
.mobile-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.mobile-nav-link:hover, .mobile-nav-link.active {
  color: var(--blue);
  background: var(--blue-light);
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #faf5ff 40%, #f0fdf4 100%);
  border-bottom: 1px solid var(--border);
  padding: clamp(3rem, 8vw, 6rem) var(--padding-x);
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-visual { display: none; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid var(--blue-light-border);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #0891b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.375rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}
.hero-btn svg { width: 18px; height: 18px; }
.hero-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.hero-btn--blue { background: var(--blue); color: #fff; }
.hero-btn--blue:hover { background: var(--blue-dark); }
.hero-btn--violet { background: var(--violet); color: #fff; }
.hero-btn--violet:hover { background: var(--violet-dark); }
.hero-btn--teal { background: var(--teal); color: #fff; }
.hero-btn--teal:hover { background: var(--teal-dark); }

/* Hero chart visual */
.hero-visual { position: relative; }
.hero-chart {
  position: relative;
  height: 280px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0 20px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.chart-bar {
  flex: 1;
  height: var(--h);
  background: var(--c);
  border-radius: 6px 6px 0 0;
  opacity: 0.85;
  animation: barRise 0.6s ease-out var(--delay) both;
}
@keyframes barRise {
  from { transform: scaleY(0); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

.chart-line {
  position: absolute;
  inset: 10px;
  pointer-events: none;
}

/* ============================================================
   Section Cards (Home)
   ============================================================ */
.sections-section {
  padding: clamp(3rem, 6vw, 5rem) var(--padding-x);
  background: var(--bg);
}
.sections-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.sections-heading {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 0.75rem;
}
.sections-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.0625rem;
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.7;
}
.sections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 1024px) {
  .sections-grid { grid-template-columns: 1fr; max-width: 640px; margin: 0 auto; }
}

.section-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.22s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.section-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.section-card--blue::before { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.section-card--violet::before { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.section-card--teal::before { background: linear-gradient(90deg, #0891b2, #059669); }
.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.section-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.section-card--blue .section-card-icon { background: var(--blue-light); color: var(--blue); }
.section-card--violet .section-card-icon { background: var(--violet-light); color: var(--violet); }
.section-card--teal .section-card-icon { background: var(--teal-light); color: var(--teal); }
.section-card-icon svg { width: 26px; height: 26px; }

.section-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.section-card-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.section-card-topics {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  list-style: none;
  padding: 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.section-card-topics li a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: color 0.18s;
}
.section-card-topics li a::before {
  content: '→';
  opacity: 0.5;
  font-size: 0.8em;
}
.section-card--blue .section-card-topics li a:hover { color: var(--blue); }
.section-card--violet .section-card-topics li a:hover { color: var(--violet); }
.section-card--teal .section-card-topics li a:hover { color: var(--teal); }

.section-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-sm);
  transition: all 0.18s;
  align-self: flex-start;
}
.section-card-cta svg { width: 16px; height: 16px; transition: transform 0.18s; }
.section-card-cta:hover svg { transform: translateX(3px); }
.section-card--blue .section-card-cta { background: var(--blue-light); color: var(--blue); }
.section-card--blue .section-card-cta:hover { background: var(--blue); color: white; }
.section-card--violet .section-card-cta { background: var(--violet-light); color: var(--violet); }
.section-card--violet .section-card-cta:hover { background: var(--violet); color: white; }
.section-card--teal .section-card-cta { background: var(--teal-light); color: var(--teal); }
.section-card--teal .section-card-cta:hover { background: var(--teal); color: white; }

/* ============================================================
   About Section (Home)
   ============================================================ */
.about-section {
  padding: clamp(3rem, 6vw, 5rem) var(--padding-x);
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.about-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 4rem;
  align-items: start;
}
@media (max-width: 1024px) {
  .about-inner { grid-template-columns: 1fr; gap: 2.5rem; }
}
.about-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}
.about-content p {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 1rem;
  margin-bottom: 1rem;
}
.about-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--violet);
}
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stat-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   Featured Articles (Home)
   ============================================================ */
.featured-section {
  padding: clamp(3rem, 6vw, 5rem) var(--padding-x);
  background: var(--bg);
}
.featured-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.featured-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 2rem;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 1024px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .featured-grid { grid-template-columns: 1fr; }
}

.featured-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: all 0.22s ease;
  box-shadow: var(--shadow-sm);
}
.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.featured-card--blue:hover { border-color: var(--blue-light-border); }
.featured-card--violet:hover { border-color: var(--violet-light-border); }
.featured-card--teal:hover { border-color: var(--teal-light-border); }

.featured-track {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  align-self: flex-start;
}
.featured-card--blue .featured-track { background: var(--blue-light); color: var(--blue); }
.featured-card--violet .featured-track { background: var(--violet-light); color: var(--violet); }
.featured-card--teal .featured-track { background: var(--teal-light); color: var(--teal); }

.featured-card h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
}
.featured-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   Content Page Layout
   ============================================================ */
.content-main {
  flex: 1;
}
.content-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--padding-x) 4rem;
  display: grid;
  grid-template-columns: 1fr;
}

/* ============================================================
   Breadcrumbs
   ============================================================ */
.breadcrumbs {
  padding: 0.75rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
}
.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.breadcrumbs a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.breadcrumbs a:hover { color: var(--blue-dark); text-decoration: underline; }
.breadcrumbs span[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}
.breadcrumb-sep {
  width: 14px;
  height: 14px;
  color: var(--border-strong);
}

/* ============================================================
   Content Article Typography
   ============================================================ */
.content-article {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.content-article h1 {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text) 60%, var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content-article h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.3;
  color: var(--text);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.content-article h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content-article h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content-article p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.content-article a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(37, 99, 235, 0.3);
  transition: all 0.15s;
}
.content-article a:hover {
  color: var(--blue-dark);
  border-bottom-color: var(--blue);
}

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

.content-article em { font-style: italic; }

.content-article ul, .content-article ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.content-article ul { list-style: disc; }
.content-article ol { list-style: decimal; }
.content-article li {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.4rem;
}
.content-article li strong { color: var(--text); }

.content-article blockquote {
  border-left: 4px solid var(--blue);
  padding: 1rem 1.5rem;
  background: var(--blue-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Inline code */
.content-article p code,
.content-article li code,
.content-article td code,
.content-article h3 code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-2);
  color: var(--violet);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ============================================================
   Code Blocks & Syntax Highlighting — Light Theme
   ============================================================ */
.content-article pre,
pre[class*="language-"] {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
  overflow-x: auto;
  margin: 1.75rem 0;
  position: relative;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
}

pre[class*="language-"]::before {
  content: attr(data-lang);
}

.content-article pre code,
pre[class*="language-"] code[class*="language-"] {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: #1e293b;
  background: none;
  border: none;
  padding: 0;
  white-space: pre;
}

/* Language badge */
.code-block-wrapper {
  position: relative;
}
.code-lang-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.25rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 0 var(--radius) 0 var(--radius);
}

/* Copy button — light theme */
.copy-btn {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}
.copy-btn svg { width: 14px; height: 14px; }
.code-block-wrapper:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
.copy-btn:hover {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.copy-btn.copied {
  opacity: 1;
  pointer-events: auto;
  color: var(--green);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

/* Prism token colors — light theme */
.token.comment, .token.prolog, .token.doctype, .token.cdata {
  color: #94a3b8;
  font-style: italic;
}
.token.keyword, .token.tag, .token.attr-name, .token.selector {
  color: var(--violet);
  font-weight: 600;
}
.token.string, .token.attr-value, .token.template-string {
  color: var(--green);
}
.token.number, .token.unit {
  color: var(--amber);
}
.token.function {
  color: var(--blue);
}
.token.operator, .token.entity {
  color: var(--pink);
}
.token.punctuation, .token.interpolation-punctuation {
  color: #94a3b8;
}
.token.class-name, .token.builtin, .token.type-annotation {
  color: var(--teal);
  font-weight: 500;
}
.token.boolean, .token.constant {
  color: var(--violet);
}
.token.property, .token.symbol {
  color: #1d4ed8;
}
.token.parameter {
  color: #b45309;
}
.token.regex { color: var(--pink); }
.token.namespace { opacity: 0.7; }
.token.important, .token.bold { font-weight: bold; }
.token.italic { font-style: italic; }
.token.inserted { color: var(--green); background: #f0fdf4; }
.token.deleted { color: var(--red); background: #fef2f2; }

/* ============================================================
   Task Lists / Checkboxes
   ============================================================ */
.content-article .contains-task-list {
  padding-left: 0;
}
.content-article .task-list-item {
  list-style: none;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  margin-left: 0;
}
.content-article .task-list-item:hover {
  background: var(--surface);
}
.content-article .task-list-item label {
  cursor: pointer;
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}
.content-article .task-list-item input[type="checkbox"],
.content-article .task-list-item-checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--blue);
  margin-top: 0.2em;
}
.content-article .task-list-item.is-checked {
  opacity: 0.6;
}
.content-article .task-list-item.is-checked label {
  text-decoration: line-through;
  color: var(--text-light);
}

/* ============================================================
   FAQ Accordion
   ============================================================ */
.faq-accordion {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: box-shadow 0.2s;
}
.faq-item:hover,
.faq-item.open {
  box-shadow: var(--shadow-sm);
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 1.375rem;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s;
}
.faq-question:hover { background: var(--surface); }
.faq-item.open .faq-question { background: var(--blue-light); color: var(--blue); }

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  color: var(--text-muted);
}
.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--blue);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 800px;
}
.faq-answer-inner {
  padding: 0 1.375rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.75;
}
.faq-answer-inner code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-2);
  color: var(--violet);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ============================================================
   Tables
   ============================================================ */
.content-article .table-wrapper,
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.75rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.content-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}
.content-article thead {
  background: var(--surface);
}
.content-article th {
  text-align: left;
  padding: 0.875rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.content-article td {
  padding: 0.875rem 1.25rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}
.content-article tr:last-child td { border-bottom: none; }
.content-article tbody tr:hover { background: var(--surface); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem var(--padding-x) 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
}
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}
.footer-brand-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #f1f5f9;
}
.footer-tagline {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #64748b;
}

.footer-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
@media (max-width: 640px) {
  .footer-sections { grid-template-columns: 1fr 1fr; }
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #f1f5f9;
  margin-bottom: 0.875rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col ul a {
  font-size: 0.875rem;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col ul a:hover { color: #93c5fd; }

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 1.25rem var(--padding-x);
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-bottom p {
  font-size: 0.8125rem;
  color: #475569;
  text-align: center;
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .logo-sub { display: none; }
  .content-article h1 { font-size: 1.75rem; }
  .content-article h2 { font-size: 1.25rem; margin-top: 2rem; }
  pre[class*="language-"] { font-size: 0.8125rem; padding: 1rem; }
  .hero { padding: 2.5rem var(--padding-x); }
  .sections-section { padding: 2.5rem var(--padding-x); }
  .about-section { padding: 2.5rem var(--padding-x); }
  .featured-section { padding: 2.5rem var(--padding-x); }
}

@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; }
  .hero-btn { justify-content: center; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Focus & Accessibility
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 1rem 2rem;
  background: var(--blue);
  color: white;
  font-weight: 600;
  z-index: 999;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { top: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */
@media print {
  .site-header, .site-footer, .breadcrumbs, .copy-btn { display: none !important; }
  .content-article { max-width: 100%; }
  pre[class*="language-"] { background: #f8fafc; color: #1e293b; border: 1px solid #e2e8f0; }
}

