/* ==========================================================================
   PRECINCT -- Static Site Stylesheet
   https://precinct.dev
   Open-source security reference architecture for agentic AI systems
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   0. RESET & BASE
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   1. CUSTOM PROPERTIES -- DESIGN TOKENS
   -------------------------------------------------------------------------- */

:root {
  /* -- Typography --------------------------------------------------------- */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Source Code Pro", "Cascadia Code",
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-heading: "Space Grotesk", var(--font-body);

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */

  --leading-tight: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;

  /* -- Spacing ------------------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* -- Radii -------------------------------------------------------------- */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* -- Shadows ------------------------------------------------------------ */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* -- Layout ------------------------------------------------------------- */
  --header-height: 4rem;
  --sidebar-width: 16rem;
  --container-max: 80rem;   /* 1280px */
  --content-max: 52rem;     /* 832px */

  /* -- Transitions -------------------------------------------------------- */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* -- Z-index layers ----------------------------------------------------- */
  --z-sidebar: 40;
  --z-header: 50;
  --z-overlay: 60;
  --z-modal: 70;
  --z-toast: 80;
}

/* --------------------------------------------------------------------------
   2. THEME VARIABLES -- DARK (default)
   -------------------------------------------------------------------------- */

:root,
[data-theme="dark"] {
  /* -- Surface colors ----------------------------------------------------- */
  --color-bg-primary: #0a0e17;
  --color-bg-secondary: #111827;
  --color-bg-tertiary: #1e293b;
  --color-bg-elevated: #1e293b;
  --color-bg-hover: #243044;
  --color-bg-code: #0d1321;
  --color-bg-code-inline: rgba(59, 130, 246, 0.1);

  /* -- Border colors ------------------------------------------------------ */
  --color-border: #1e293b;
  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-border-strong: #334155;

  /* -- Text colors -------------------------------------------------------- */
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-tertiary: #64748b;
  --color-text-inverse: #0a0e17;
  --color-text-link: #60a5fa;
  --color-text-link-hover: #93bbfd;

  /* -- Accent colors ------------------------------------------------------ */
  --color-accent: #3b82f6;
  --color-accent-light: #60a5fa;
  --color-accent-dark: #2563eb;
  --color-accent-bg: rgba(59, 130, 246, 0.1);

  /* -- Semantic colors ---------------------------------------------------- */
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;
  --color-info-bg: rgba(59, 130, 246, 0.1);

  /* -- Syntax highlighting ------------------------------------------------ */
  --syntax-keyword: #fbbf24;
  --syntax-string: #34d399;
  --syntax-number: #f59e0b;
  --syntax-comment: #64748b;
  --syntax-function: #60a5fa;
  --syntax-variable: #f1f5f9;
  --syntax-operator: #94a3b8;
  --syntax-type: #38bdf8;
  --syntax-constant: #fb923c;

  /* -- Secondary accent (cyan) --------------------------------------------- */
  --color-accent-cyan: #22d3ee;
  --color-accent-cyan-dim: #06b6d4;
  --color-accent-violet: #facc15;

  /* -- Gradients ---------------------------------------------------------- */
  --gradient-hero: linear-gradient(135deg, #0a0e17 0%, #111827 50%, #0f172a 100%);
  --gradient-card: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
  --gradient-accent: linear-gradient(135deg, #3b82f6, #60a5fa);
  --gradient-text: linear-gradient(135deg, #60a5fa, #22d3ee, #facc15);

  /* -- Scrollbar ---------------------------------------------------------- */
  --scrollbar-track: #111827;
  --scrollbar-thumb: #334155;
  --scrollbar-thumb-hover: #475569;
}

/* --------------------------------------------------------------------------
   3. THEME VARIABLES -- LIGHT
   -------------------------------------------------------------------------- */

[data-theme="light"] {
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-bg-elevated: #ffffff;
  --color-bg-hover: #e2e8f0;
  --color-bg-code: #f1f5f9;
  --color-bg-code-inline: rgba(59, 130, 246, 0.08);

  --color-border: #e2e8f0;
  --color-border-subtle: rgba(0, 0, 0, 0.06);
  --color-border-strong: #cbd5e1;

  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #94a3b8;
  --color-text-inverse: #f1f5f9;
  --color-text-link: #2563eb;
  --color-text-link-hover: #1d4ed8;

  --color-accent: #2563eb;
  --color-accent-light: #3b82f6;
  --color-accent-dark: #1d4ed8;
  --color-accent-bg: rgba(37, 99, 235, 0.06);

  --color-success: #059669;
  --color-success-bg: rgba(5, 150, 105, 0.06);
  --color-warning: #d97706;
  --color-warning-bg: rgba(217, 119, 6, 0.06);
  --color-error: #dc2626;
  --color-error-bg: rgba(220, 38, 38, 0.06);
  --color-info: #2563eb;
  --color-info-bg: rgba(37, 99, 235, 0.06);

  --syntax-keyword: #7c3aed;
  --syntax-string: #059669;
  --syntax-number: #d97706;
  --syntax-comment: #94a3b8;
  --syntax-function: #2563eb;
  --syntax-variable: #0f172a;
  --syntax-operator: #475569;
  --syntax-type: #0284c7;
  --syntax-constant: #ea580c;

  --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 1) 100%);
  --gradient-accent: linear-gradient(135deg, #2563eb, #3b82f6);
  --gradient-text: linear-gradient(135deg, #2563eb, #0891b2, #ca8a04);

  --color-accent-cyan: #0891b2;
  --color-accent-cyan-dim: #0e7490;
  --color-accent-violet: #ca8a04;

  --scrollbar-track: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-thumb-hover: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.03);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.06), 0 4px 6px -4px rgb(0 0 0 / 0.06);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.06), 0 8px 10px -6px rgb(0 0 0 / 0.06);
}

/* --------------------------------------------------------------------------
   4. GLOBAL BASE STYLES
   -------------------------------------------------------------------------- */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  transition: color var(--transition-slow), background-color var(--transition-slow);
}

/* -- Scrollbar ------------------------------------------------------------ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* -- Selection ------------------------------------------------------------ */

::selection {
  background-color: rgba(59, 130, 246, 0.3);
  color: var(--color-text-primary);
}

/* --------------------------------------------------------------------------
   5. TYPOGRAPHY
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--text-3xl);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-2xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--text-xl);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--text-lg);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

/* Anchors on headings */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  color: inherit;
  text-decoration: none;
}

h1 a:hover, h2 a:hover, h3 a:hover,
h4 a:hover, h5 a:hover, h6 a:hover {
  color: var(--color-accent-light);
}

.content p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

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

.content a {
  color: var(--color-text-link);
  text-decoration: underline;
  text-decoration-color: rgba(96, 165, 250, 0.3);
  text-underline-offset: 2px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.content a:hover {
  color: var(--color-text-link-hover);
  text-decoration-color: currentColor;
}

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

.content em {
  font-style: italic;
}

.content ul,
.content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.content ul {
  list-style-type: disc;
}

.content ol {
  list-style-type: decimal;
}

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

.content li::marker {
  color: var(--color-accent);
}

.content ul ul,
.content ol ol,
.content ul ol,
.content ol ul {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

.content blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 3px solid var(--color-accent-violet);
  background-color: rgba(250, 204, 21, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-secondary);
}

.content blockquote p {
  margin-bottom: 0;
}

.content hr {
  margin: var(--space-8) 0;
  border: none;
  height: 1px;
  background-color: var(--color-border);
}

/* -- Lead / intro paragraphs ---------------------------------------------- */

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* -- Small / caption text ------------------------------------------------- */

small,
.text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-mono {
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   6. CODE BLOCKS
   -------------------------------------------------------------------------- */

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* Inline code */
:not(pre) > code {
  padding: 0.125em 0.375em;
  background-color: var(--color-bg-code-inline);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-accent-light);
  font-size: 0.85em;
  white-space: nowrap;
}

/* Code blocks */
pre {
  position: relative;
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background-color: var(--color-bg-code);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  line-height: 1.7;
  tab-size: 4;
}

pre code {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  color: #4ade80;
  font-size: var(--text-sm);
  white-space: pre;
}

[data-theme="light"] pre code {
  color: #16a34a;
}

/* Language label on code blocks */
pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  right: 0;
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-bg-tertiary);
  border-bottom-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-lg);
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* Copy button on code blocks */
.code-copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-tertiary);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast), background-color var(--transition-fast),
    color var(--transition-fast);
}

pre:hover .code-copy-btn {
  opacity: 1;
}

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

.code-copy-btn.copied {
  color: var(--color-success);
}

/* When there is a language label, shift copy button down */
pre[data-lang] .code-copy-btn {
  top: var(--space-8);
}

/* -- Syntax token classes ------------------------------------------------- */

.token-keyword  { color: var(--syntax-keyword); }
.token-string   { color: var(--syntax-string); }
.token-number   { color: var(--syntax-number); }
.token-comment  { color: var(--syntax-comment); font-style: italic; }
.token-function { color: var(--syntax-function); }
.token-variable { color: var(--syntax-variable); }
.token-operator { color: var(--syntax-operator); }
.token-type     { color: var(--syntax-type); }
.token-constant { color: var(--syntax-constant); }

/* --------------------------------------------------------------------------
   7. LAYOUT -- CONTAINER & PAGE STRUCTURE
   -------------------------------------------------------------------------- */

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

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

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

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-content {
  flex: 1;
  padding-top: var(--header-height);
}

/* Two-column layout: sidebar + main */
.layout-with-sidebar {
  display: flex;
  gap: var(--space-8);
}

.layout-main {
  flex: 1;
  min-width: 0;  /* prevent flex blowout */
  max-width: var(--content-max);
  padding: var(--space-8) 0;
}

/* --------------------------------------------------------------------------
   8. HEADER & NAVIGATION
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  background-color: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background-color var(--transition-slow);
}

[data-theme="light"] .site-header {
  background-color: rgba(255, 255, 255, 0.85);
}

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

@media (min-width: 640px) {
  .header-inner {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .header-inner {
    padding: 0 var(--space-8);
  }
}

/* -- Logo ----------------------------------------------------------------- */

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
}

.site-logo img {
  height: 1.75rem;
  width: auto;
}

.site-logo .logo-accent {
  color: var(--color-accent-light);
}

/* -- Desktop nav ---------------------------------------------------------- */

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

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

.nav-links a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

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

.nav-links a.active {
  color: var(--color-accent-light);
  background-color: var(--color-accent-bg);
}

/* -- Nav dropdowns -------------------------------------------------------- */

.nav-dropdown {
  position: relative;
  list-style: none;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: none;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.dropdown-toggle:hover {
  color: var(--color-text-primary);
  background-color: var(--color-bg-hover);
}

.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.15rem;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform var(--transition-fast);
}

.nav-dropdown.open .caret {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: var(--z-dropdown, 1000);
  min-width: 10rem;
  margin: 0.25rem 0 0;
  padding: var(--space-2) 0;
  list-style: none;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.nav-dropdown.open > .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

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

/* -- Header actions (theme toggle, github link, etc.) --------------------- */

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

/* -- Theme toggle --------------------------------------------------------- */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast),
    border-color var(--transition-fast);
}

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

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 1.125rem;
  height: 1.125rem;
}

/* Show/hide correct icon per theme */
[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}
[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* -- Mobile menu button --------------------------------------------------- */

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

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

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

.mobile-menu-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* -- Mobile menu panel ---------------------------------------------------- */

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-overlay);
  background-color: var(--color-bg-primary);
  padding: var(--space-4);
  overflow-y: auto;
}

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

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

.mobile-menu a {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

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

.mobile-menu a.active {
  color: var(--color-accent-light);
  background-color: var(--color-accent-bg);
}

/* --------------------------------------------------------------------------
   9. HERO SECTION
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: calc(var(--space-24) + var(--header-height)) 0 var(--space-24);
  background: var(--color-bg-primary);
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

/* Animated gradient mesh background */
.hero-mesh {
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(250, 204, 21, 0.06) 0%, transparent 50%);
  animation: meshDrift 25s ease-in-out infinite;
  pointer-events: none;
}

@keyframes meshDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.02); }
  66% { transform: translate(-20px, 25px) scale(0.98); }
}

[data-theme="light"] .hero-mesh {
  background:
    radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(14, 116, 144, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(124, 58, 237, 0.04) 0%, transparent 50%);
}

/* Grid pattern overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
  pointer-events: none;
}

[data-theme="light"] .hero::before {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 68rem;
  margin: 0 auto;
  animation: heroFadeIn 0.8s ease forwards;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  padding: var(--space-2) var(--space-5);
  background-color: rgba(250, 204, 21, 0.06);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-accent-violet);
  letter-spacing: var(--tracking-wide);
}

.hero-badge-pulse {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
  50% { opacity: 0.6; box-shadow: 0 0 16px rgba(16, 185, 129, 0.3); }
}

/* -- Hero headline -------------------------------------------------------- */

.hero-headline {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-8);
  line-height: 1.1;
}

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

/* -- Acronym bar ---------------------------------------------------------- */

.acronym-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  padding: var(--space-4) var(--space-6);
  background: rgba(250, 204, 21, 0.04);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: var(--radius-xl);
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.acronym-word {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

.acronym-word mark {
  background: none;
  color: var(--color-accent-light);
  font-weight: 700;
  font-size: var(--text-lg);
  line-height: 1;
}

.acronym-sep {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  font-weight: 400;
}

.acronym-small {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  align-self: center;
}

@media (min-width: 640px) {
  .acronym-word {
    font-size: var(--text-base);
  }

  .acronym-word mark {
    font-size: var(--text-xl);
  }

  .acronym-sep {
    font-size: var(--text-base);
  }

  .acronym-small {
    font-size: var(--text-sm);
  }
}

/* -- Hero subheadline ----------------------------------------------------- */

.hero-subheadline {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  text-align: left;
  max-width: 44rem;
  margin: 0 auto var(--space-8);
}

@media (min-width: 640px) {
  .hero-subheadline {
    font-size: var(--text-xl);
  }
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.hero-ctas .btn svg {
  display: inline-block;
}

.hero-sublink {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-12);
}

.hero-sublink a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.hero-sublink a:hover {
  color: var(--color-text-link-hover);
}

/* -- Hero stats ----------------------------------------------------------- */

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6);
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: var(--radius-xl);
  max-width: 60rem;
  margin: 0 auto;
}

[data-theme="light"] .hero-stats {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(202, 138, 4, 0.3);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  text-align: center;
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-heading);
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.stat-divider {
  display: none;
  width: 1px;
  height: 2.5rem;
  background: linear-gradient(180deg, transparent, var(--color-border-strong), transparent);
}

@media (min-width: 640px) {
  .stat-divider {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   10. BUTTONS
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Primary */
.btn-primary {
  background: var(--gradient-accent);
  color: #ffffff;
  border-color: transparent;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

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

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

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--color-accent-light);
  border-color: var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent-bg);
}

/* Sizes */
.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* --------------------------------------------------------------------------
   11. CARDS
   -------------------------------------------------------------------------- */

.card {
  background: var(--gradient-card);
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    transform var(--transition-base);
}

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

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--space-4);
  background-color: var(--color-accent-bg);
  border-radius: var(--radius-lg);
  color: var(--color-accent-light);
}

.card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.card h3 {
  font-size: var(--text-lg);
  margin-top: 0;
  margin-bottom: var(--space-2);
}

.card p {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  margin-bottom: 0;
}

/* -- Card grids ----------------------------------------------------------- */

.card-grid {
  display: grid;
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

/* 2-column grid */
.card-grid-2 {
  grid-template-columns: 1fr;
}

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

/* 3-column grid */
.card-grid-3 {
  grid-template-columns: 1fr;
}

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

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

/* 4-column grid */
.card-grid-4 {
  grid-template-columns: 1fr;
}

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

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

/* --------------------------------------------------------------------------
   12. TABLES
   -------------------------------------------------------------------------- */

.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: var(--space-6) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead {
  background-color: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

tbody td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: top;
}

/* Zebra striping */
tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.015);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: var(--color-bg-hover);
}

.extension-slot-row td {
  background-color: var(--color-bg-secondary);
  border-top: 1px dashed var(--color-border);
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.85em;
  font-style: italic;
  opacity: 0.85;
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}

.extension-slot-row:hover td {
  background-color: var(--color-bg-secondary);
}

/* Table search/filter input */
.table-filter {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-3);
}

.table-filter input {
  width: 100%;
  max-width: 20rem;
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  transition: border-color var(--transition-fast);
}

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

.table-filter input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-bg);
}

/* --------------------------------------------------------------------------
   13. SIDEBAR NAVIGATION
   -------------------------------------------------------------------------- */

.sidebar {
  display: none;
  flex-shrink: 0;
  width: var(--sidebar-width);
  padding: var(--space-8) 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-sidebar) - 1);
  background-color: rgba(0, 0, 0, 0.5);
}

.sidebar-overlay.open {
  display: block;
}

@media (min-width: 1024px) {
  .sidebar-overlay {
    display: none !important;
  }
}

/* Mobile sidebar toggle button */
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
}

.sidebar-toggle:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-primary);
}

@media (min-width: 1024px) {
  .sidebar-toggle {
    display: none;
  }
}

.sidebar-toggle svg {
  width: 1rem;
  height: 1rem;
}

/* Mobile sidebar */
.sidebar-mobile {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  z-index: var(--z-sidebar);
  width: var(--sidebar-width);
  background-color: var(--color-bg-primary);
  border-right: 1px solid var(--color-border);
  padding: var(--space-4);
  overflow-y: auto;
}

.sidebar-mobile.open {
  display: block;
}

@media (min-width: 1024px) {
  .sidebar-mobile {
    display: none !important;
  }
}

/* -- Sidebar nav links ---------------------------------------------------- */

.sidebar-nav-group {
  margin-bottom: var(--space-6);
}

.sidebar-nav-title {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-tertiary);
}

.sidebar-nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

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

.sidebar-nav a.active {
  color: var(--color-accent-light);
  background-color: var(--color-accent-bg);
  font-weight: 500;
}

/* Nested sidebar items */
.sidebar-nav .sidebar-subnav {
  padding-left: var(--space-4);
}

.sidebar-nav .sidebar-subnav a {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.sidebar-nav .sidebar-subnav a:hover {
  color: var(--color-text-secondary);
}

.sidebar-nav .sidebar-subnav a.active {
  color: var(--color-accent-light);
}

/* --------------------------------------------------------------------------
   14. BADGES & TAGS
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem var(--space-2);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-default {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.badge-accent {
  background-color: rgba(250, 204, 21, 0.06);
  color: var(--color-accent-violet);
  border: 1px solid rgba(250, 204, 21, 0.25);
}

.badge-success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-error {
  background-color: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

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

/* --------------------------------------------------------------------------
   15. CALLOUTS / ADMONITIONS
   -------------------------------------------------------------------------- */

.callout {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.callout-title svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.callout p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

.callout-info {
  background-color: rgba(250, 204, 21, 0.06);
  border-color: var(--color-accent-violet);
}

.callout-info .callout-title {
  color: var(--color-info);
}

.callout-success {
  background-color: var(--color-success-bg);
  border-color: var(--color-success);
}

.callout-success .callout-title {
  color: var(--color-success);
}

.callout-warning {
  background-color: var(--color-warning-bg);
  border-color: var(--color-warning);
}

.callout-warning .callout-title {
  color: var(--color-warning);
}

.callout-error {
  background-color: var(--color-error-bg);
  border-color: var(--color-error);
}

.callout-error .callout-title {
  color: var(--color-error);
}

/* -- Callout box (centered featured content) -------------------------------- */

.callout-box {
  max-width: 48rem;
  margin: 0 auto var(--space-8);
  padding: var(--space-6);
  background-color: var(--color-bg-elevated);
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: var(--radius-xl);
  text-align: left;
}

[data-theme="light"] .callout-box {
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   16. MERMAID DIAGRAMS
   -------------------------------------------------------------------------- */

.mermaid-wrapper {
  margin: var(--space-6) 0;
  padding: var(--space-6);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.mermaid-wrapper .mermaid {
  display: flex;
  justify-content: center;
}

.mermaid-wrapper .mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Mermaid theme overrides for dark mode */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node polygon {
  fill: var(--color-bg-tertiary);
  stroke: var(--color-border-strong);
}

.mermaid .nodeLabel {
  color: var(--color-text-primary);
}

.mermaid .edgeLabel {
  color: var(--color-text-secondary);
  background-color: var(--color-bg-secondary);
}

.mermaid .edgePath .path {
  stroke: var(--color-text-tertiary);
}

/* Mermaid light mode overrides */
[data-theme="light"] .mermaid .node rect,
[data-theme="light"] .mermaid .node circle,
[data-theme="light"] .mermaid .node polygon {
  fill: #e2e8f0;
  stroke: #94a3b8;
}

[data-theme="light"] .mermaid .nodeLabel {
  color: #0f172a;
}

[data-theme="light"] .mermaid .edgeLabel {
  color: #475569;
  background-color: #f8fafc;
}

[data-theme="light"] .mermaid .edgePath .path {
  stroke: #94a3b8;
}

/* Wide mermaid diagram wrapper */
.mermaid-wrapper-wide {
  margin: var(--space-6) 0;
  padding: var(--space-6);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  min-height: 30rem;
}

.mermaid-wrapper-wide .mermaid {
  display: flex;
  justify-content: center;
}

.mermaid-wrapper-wide .mermaid svg {
  max-width: 100%;
  height: auto;
  min-width: 50rem;
}

/* Mermaid live editor link */
.mermaid-live-link {
  display: block;
  text-align: center;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.mermaid-live-link a {
  color: var(--color-text-tertiary);
  text-decoration: underline;
  text-decoration-color: rgba(100, 116, 139, 0.4);
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.mermaid-live-link a:hover {
  color: var(--color-text-link);
}

/* --------------------------------------------------------------------------
   17. FOOTER
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: var(--space-16);
  padding: var(--space-12) 0 var(--space-8);
  background-color: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
}

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

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

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

.footer-brand {
  max-width: 20rem;
}

.footer-brand .site-logo {
  margin-bottom: var(--space-4);
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: var(--leading-relaxed);
}

.footer-column h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-top: 0;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.footer-column ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-column a {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
}

.footer-column a:hover {
  color: var(--color-text-link);
}

/* -- Sponsor logos -------------------------------------------------------- */

.footer-sponsors {
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border-subtle);
  margin-bottom: var(--space-8);
}

.footer-sponsors h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-tertiary);
  margin-top: 0;
  margin-bottom: var(--space-4);
  text-align: center;
}

.sponsor-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
}

.sponsor-logos img {
  height: 2rem;
  width: auto;
  opacity: 0.5;
  filter: grayscale(100%);
  transition: opacity var(--transition-base), filter var(--transition-base);
}

.sponsor-logos img:hover {
  opacity: 0.8;
  filter: grayscale(0%);
}

/* -- Footer bottom bar ---------------------------------------------------- */

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-bottom a {
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
}

.footer-bottom a:hover {
  color: var(--color-text-link);
}

/* --------------------------------------------------------------------------
   18. SECTIONS
   -------------------------------------------------------------------------- */

.section {
  padding: var(--space-16) 0;
}

.section-sm {
  padding: var(--space-8) 0;
}

.section-lg {
  padding: var(--space-24) 0;
}

.section-header {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto var(--space-12);
}

.section-header h2 {
  margin-top: 0;
}

.section-header p {
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
}

/* Alternating section backgrounds */
.section-alt {
  background-color: var(--color-bg-secondary);
}

/* --------------------------------------------------------------------------
   19. UTILITY CLASSES
   -------------------------------------------------------------------------- */

/* -- Display -------------------------------------------------------------- */

.hidden { display: none; }
.block  { display: block; }
.flex   { display: flex; }
.grid   { display: grid; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }

/* -- Flex utilities ------------------------------------------------------- */

.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* -- Text alignment ------------------------------------------------------- */

.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* -- Text color ----------------------------------------------------------- */

.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary  { color: var(--color-text-tertiary); }
.text-accent    { color: var(--color-accent-light); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-error     { color: var(--color-error); }

/* -- Font weight ---------------------------------------------------------- */

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* -- Margin --------------------------------------------------------------- */

.mt-0  { margin-top: 0; }
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }

/* -- Padding -------------------------------------------------------------- */

.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }

/* -- Width ---------------------------------------------------------------- */

.w-full { width: 100%; }
.max-w-content { max-width: var(--content-max); }
.max-w-container { max-width: var(--container-max); }

/* -- Border --------------------------------------------------------------- */

.border     { border: 1px solid var(--color-border); }
.border-t   { border-top: 1px solid var(--color-border); }
.border-b   { border-bottom: 1px solid var(--color-border); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

/* -- Visibility ----------------------------------------------------------- */

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

/* -- Overflow ------------------------------------------------------------- */

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* -- Transitions ---------------------------------------------------------- */

.transition-all {
  transition: all var(--transition-base);
}

/* -- Opacity -------------------------------------------------------------- */

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* --------------------------------------------------------------------------
   20. RESPONSIVE UTILITIES
   -------------------------------------------------------------------------- */

/* Hide on small screens, show from md up */
.md\:block {
  display: none;
}

@media (min-width: 768px) {
  .md\:block {
    display: block;
  }

  .md\:hidden {
    display: none;
  }

  .md\:flex {
    display: flex;
  }
}

@media (min-width: 1024px) {
  .lg\:block {
    display: block;
  }

  .lg\:hidden {
    display: none;
  }

  .lg\:flex {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   21. ANIMATIONS
   -------------------------------------------------------------------------- */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate-fade-in {
  animation: fadeIn var(--transition-slow) ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.3s ease forwards;
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 75ms; }
.stagger-children > *:nth-child(3) { animation-delay: 150ms; }
.stagger-children > *:nth-child(4) { animation-delay: 225ms; }
.stagger-children > *:nth-child(5) { animation-delay: 300ms; }
.stagger-children > *:nth-child(6) { animation-delay: 375ms; }
.stagger-children > *:nth-child(7) { animation-delay: 450ms; }
.stagger-children > *:nth-child(8) { animation-delay: 525ms; }

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

/* --------------------------------------------------------------------------
   22. NAV / HEADER CLASS ALIASES
   These bridge the HTML class names to the design system.
   -------------------------------------------------------------------------- */

/* nav-container is the HTML equivalent of header-inner */
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 640px) {
  .nav-container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .nav-container {
    padding: 0 var(--space-8);
  }
}

/* Logo in nav */
.nav-brand {
  flex-shrink: 0;
}

.logo-link {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
  line-height: 1.2;
}

.logo-text {
  font-size: var(--text-lg);
  color: var(--color-text-primary);
}

.logo-tagline {
  display: none;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-tertiary);
}

@media (min-width: 640px) {
  .logo-tagline {
    display: inline;
  }
}

/* Nav actions (github link + theme toggle) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-github {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

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

.nav-github svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Mobile hamburger toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.375rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text-secondary);
  border-radius: 1px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Animate hamburger to X when active */
.nav-toggle.active .nav-toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

.nav-toggle.active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .nav-toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

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

/* Mobile nav overlay when .mobile-open is toggled */
@media (max-width: 767px) {
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-overlay);
    background-color: var(--color-bg-primary);
    padding: var(--space-4);
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
  }

  .nav-links.mobile-open a,
  .nav-links.mobile-open .dropdown-toggle {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-lg);
    border-radius: var(--radius-md);
  }

  .nav-links.mobile-open .nav-dropdown {
    width: 100%;
  }

  .nav-links.mobile-open .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: var(--space-4);
    background: transparent;
  }

  .nav-links.mobile-open .nav-dropdown.open > .dropdown-menu {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   23. HOMEPAGE-SPECIFIC SECTIONS
   -------------------------------------------------------------------------- */

/* -- Section titles ------------------------------------------------------- */

.section-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: 0;
  margin-bottom: var(--space-4);
  text-align: center;
  letter-spacing: var(--tracking-tight);
}

@media (min-width: 640px) {
  .section-title {
    font-size: var(--text-4xl);
  }
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 40rem;
  margin: 0 auto var(--space-8);
}

.section-intro {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  max-width: 48rem;
  margin-bottom: var(--space-8);
}

.section-intro p {
  margin-bottom: var(--space-4);
}

/* -- Dramatic callout box ------------------------------------------------- */

.callout-box-dramatic {
  text-align: center;
}

.callout-stat {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
}

.callout-box-dramatic p:last-child {
  text-align: left;
}

/* -- Comparison table (problem section) ----------------------------------- */

.comparison-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.comparison-table thead {
  background-color: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.comparison-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-primary);
}

.comparison-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: top;
}

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

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

/* -- Three Choices -------------------------------------------------------- */

.choices-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  margin-top: var(--space-8);
}

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

.choice-card {
  position: relative;
  padding: var(--space-6);
  background: var(--gradient-card);
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: var(--radius-xl);
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    transform var(--transition-base);
}

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

.choice-card-featured {
  border-color: var(--color-accent-violet);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.06) 0%, var(--color-bg-elevated) 100%);
}

.choice-card-featured:hover {
  border-color: var(--color-accent-violet);
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.15);
}

.choice-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: var(--space-4);
  background-color: var(--color-accent-bg);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent-light);
}

.choice-heading {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.choice-description {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

/* -- Innovations grid ----------------------------------------------------- */

.innovations-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  margin-top: var(--space-8);
}

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

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

.innovation-card {
  padding: var(--space-6);
  background: var(--gradient-card);
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: var(--radius-xl);
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    transform var(--transition-base);
}

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

.innovation-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-4);
  background-color: var(--color-accent-bg);
  border-radius: var(--radius-lg);
  color: var(--color-accent-light);
}

.innovation-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
}

.innovation-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

/* -- Stack (tech) grid ---------------------------------------------------- */

.stack-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  margin-top: var(--space-8);
}

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

.stack-card {
  padding: var(--space-6);
  background: var(--gradient-card);
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: var(--radius-xl);
  border-top: 2px solid var(--color-accent-violet);
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    transform var(--transition-base);
}

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

.stack-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.stack-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.card-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent-light);
  transition: color var(--transition-fast);
}

.card-link:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

/* -- Pipeline visualization ----------------------------------------------- */

.pipeline {
  max-width: 48rem;
  margin: var(--space-8) auto 0;
  position: relative;
}

.pipeline::before {
  content: "";
  position: absolute;
  left: 1.25rem;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 2px;
  background: linear-gradient(180deg,
    var(--color-accent) 0%,
    var(--color-accent-cyan-dim) 50%,
    var(--color-accent-violet) 100%
  );
  opacity: 0.3;
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  position: relative;
}

.pipeline-number {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background-color: var(--color-bg-tertiary);
  border: 2px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-secondary);
  position: relative;
  z-index: 1;
  transition: all var(--transition-base);
}

.pipeline-step:hover .pipeline-number {
  border-color: var(--color-accent-violet);
  color: var(--color-accent-violet);
  background-color: rgba(250, 204, 21, 0.1);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.2);
}

.pipeline-step-final .pipeline-number {
  border-color: var(--color-accent-cyan-dim);
  color: var(--color-accent-cyan);
  background-color: rgba(6, 182, 212, 0.1);
}

.pipeline-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) 0;
}

.pipeline-content strong {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-primary);
}

.pipeline-content span {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.middleware-note {
  margin-top: var(--space-8);
  padding: var(--space-5) var(--space-6);
  background: rgba(250, 204, 21, 0.04);
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.middleware-note strong {
  color: var(--color-text-primary);
}

/* Legacy middleware table (used on inner pages) */
.middleware-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-top: var(--space-8);
}

.middleware-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.middleware-table thead {
  background-color: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.middleware-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-primary);
}

.middleware-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: top;
}

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

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

.step-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-accent-light);
  text-align: center;
  width: 3rem;
}

/* -- Compliance grid ------------------------------------------------------ */

.compliance-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, 1fr);
  margin-top: var(--space-8);
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

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

.compliance-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-4);
  background-color: var(--color-bg-elevated);
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.compliance-badge:hover {
  border-color: var(--color-accent-violet);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.12);
}

.compliance-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-primary);
}

.compliance-scope {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.compliance-cta {
  text-align: center;
  margin-top: var(--space-8);
}

/* -- Deployment grid ------------------------------------------------------ */

.deployment-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  margin-top: var(--space-8);
}

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

.deployment-card {
  padding: var(--space-6);
  background: var(--gradient-card);
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-radius: var(--radius-xl);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.deployment-card:hover {
  border-color: var(--color-accent-violet);
  box-shadow: var(--shadow-lg);
}

.deployment-card h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
}

.deployment-use-case {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent-light);
  margin-bottom: var(--space-3);
}

.deployment-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

/* -- Sponsors grid -------------------------------------------------------- */

.sponsors-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.sponsor-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-8);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.sponsor-logo:hover {
  border-color: var(--color-accent-violet);
  box-shadow: var(--shadow-md);
}

.sponsor-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.sponsor-img-hextropian {
  height: 72px;
  border-radius: var(--radius-md);
}

.sponsor-logo-hextropian {
  background-color: #000;
}

[data-theme="light"] .sponsor-img-cibertrend {
  filter: none;
}

.sponsor-name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* -- Footer overrides for index.html naming ------------------------------- */

.footer-content {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-8);
}

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

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

.footer-logo {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.footer-description {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: var(--leading-relaxed);
}

.footer-links h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-top: 0;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
}

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

.footer-license,
.footer-copyright {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-2);
}

.footer-license a,
.footer-copyright a {
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
}

.footer-license a:hover,
.footer-copyright a:hover {
  color: var(--color-text-link);
}

/* -- Alternating section backgrounds (homepage) --------------------------- */

.section-problem {
  background-color: var(--color-bg-secondary);
}

.section-innovations {
  background-color: var(--color-bg-secondary);
}

.section-middleware {
  background-color: var(--color-bg-secondary);
}

.section-sponsors {
  background-color: var(--color-bg-secondary);
}

/* -- Code blocks on homepage ---------------------------------------------- */

.code-block {
  margin: var(--space-4) 0;
}

.code-block pre {
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-bg-code);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: #4ade80;
}

[data-theme="light"] .code-block code {
  color: #16a34a;
}

/* --------------------------------------------------------------------------
   24. LIGHT MODE ENHANCEMENTS
   Light mode needs stronger visual cues since it lacks the dark background contrast.
   -------------------------------------------------------------------------- */

[data-theme="light"] .choice-card,
[data-theme="light"] .innovation-card,
[data-theme="light"] .stack-card,
[data-theme="light"] .deployment-card {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .choice-card:hover,
[data-theme="light"] .innovation-card:hover,
[data-theme="light"] .stack-card:hover,
[data-theme="light"] .deployment-card:hover {
  box-shadow: var(--shadow-xl);
}

[data-theme="light"] .hero-stats {
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .compliance-badge {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .compliance-badge:hover {
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .sponsor-logo {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .dropdown-menu {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .section-problem,
[data-theme="light"] .section-innovations,
[data-theme="light"] .section-middleware,
[data-theme="light"] .section-sponsors {
  background-color: var(--color-bg-tertiary);
}

[data-theme="light"] .middleware-table-wrapper,
[data-theme="light"] .comparison-table-wrapper {
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   26. SCROLL REVEAL SYSTEM
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-0 { transition-delay: 0ms; }
.reveal-delay-1 { transition-delay: 120ms; }
.reveal-delay-2 { transition-delay: 240ms; }
.reveal-delay-3 { transition-delay: 360ms; }
.reveal-delay-4 { transition-delay: 480ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   27. ENHANCED CARD EFFECTS
   -------------------------------------------------------------------------- */

/* Gradient border on hover for innovation cards */
.innovation-card:hover {
  border-color: transparent;
  background:
    linear-gradient(var(--color-bg-secondary), var(--color-bg-secondary)) padding-box,
    linear-gradient(135deg, var(--color-accent), var(--color-accent-cyan-dim), var(--color-accent-violet)) border-box;
  box-shadow:
    var(--shadow-lg),
    0 0 20px rgba(250, 204, 21, 0.08);
}

/* Featured choice card glow */
.choice-card-featured {
  border-color: transparent;
  background:
    linear-gradient(var(--color-bg-elevated), var(--color-bg-elevated)) padding-box,
    linear-gradient(135deg, var(--color-accent), var(--color-accent-cyan-dim)) border-box;
  border: 1px solid transparent;
}

.choice-card-featured:hover {
  box-shadow:
    0 0 30px rgba(250, 204, 21, 0.12),
    0 0 60px rgba(250, 204, 21, 0.06);
}

/* Stack cards -- accent top border accent */
.stack-card {
  border-top: 2px solid var(--color-accent-violet);
}

/* Compliance badges subtle glow on hover */
.compliance-badge:hover {
  border-color: var(--color-accent-violet);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.12);
}

/* --------------------------------------------------------------------------
   28. HOMEPAGE SECTION ENHANCEMENTS
   -------------------------------------------------------------------------- */

/* Increased section padding for more breathing room */
.section {
  padding: var(--space-20) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-24) 0;
  }
}

/* Section titles with heading font */
.section-title {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

/* Section backgrounds with subtle gradients instead of flat colors */
.section-problem {
  background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
}

.section-innovations {
  background: linear-gradient(180deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 50%, var(--color-bg-primary) 100%);
}

.section-middleware {
  background-color: var(--color-bg-secondary);
}

.section-sponsors {
  background-color: var(--color-bg-secondary);
}

[data-theme="light"] .section-problem {
  background: linear-gradient(180deg, var(--color-bg-tertiary) 0%, var(--color-bg-primary) 100%);
}

[data-theme="light"] .section-innovations {
  background: linear-gradient(180deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 50%, var(--color-bg-primary) 100%);
}

[data-theme="light"] .section-middleware {
  background-color: var(--color-bg-tertiary);
}

[data-theme="light"] .section-sponsors {
  background-color: var(--color-bg-tertiary);
}

/* Footer citation */
.footer-citation {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border-subtle);
}

.footer-citation a {
  color: var(--color-text-tertiary);
  text-decoration: underline;
  text-decoration-color: rgba(100, 116, 139, 0.3);
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.footer-citation a:hover {
  color: var(--color-text-link);
}

/* --------------------------------------------------------------------------
   25. PRINT STYLES
   -------------------------------------------------------------------------- */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .site-header,
  .site-footer,
  .sidebar,
  .sidebar-toggle,
  .sidebar-mobile,
  .sidebar-overlay,
  .mobile-menu,
  .mobile-menu-btn,
  .theme-toggle,
  .code-copy-btn,
  .hero::before,
  .hero::after {
    display: none !important;
  }

  .page-content {
    padding-top: 0;
  }

  .hero {
    padding: 1rem 0;
  }

  a {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
  }

  /* Do not print href for internal links */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  pre code {
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  table {
    border-collapse: collapse;
  }

  table, th, td {
    border: 1px solid #ccc;
  }

  thead {
    display: table-header-group;
  }

  tr {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  h2, h3, h4 {
    page-break-after: avoid;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}
