/* Hueston Brand Design System - Exact Match */

/* Brand Tokens (CSS Variables) */
:root {
  /* Core brand */
  --brand-primary: #DE492F;       /* confirmed in live SVG */
  --brand-600: #c74228;           /* hover */
  --brand-700: #a53721;           /* active/pressed */

  /* Neutrals (clean, high-contrast UI) */
  --text-900: #0f1115;
  --text-700: #2a2f36;
  --text-500: #6b7280;            /* muted/help text */
  --bg-0: #ffffff;                /* page */
  --bg-50: #f7f7f8;               /* sections/cards alt */
  --bg-100: #f2f3f5;              /* subtle stripes/rows */
  --border-200: #e7e8ea;
  --border-300: #d3d6db;

  /* Interaction */
  --focus-ring: color-mix(in srgb, var(--brand-primary) 40%, transparent);
  --link: var(--brand-primary);
  --link-hover: var(--brand-600);

  /* Layout rhythm */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 6px 20px rgba(0,0,0,.08);
  --container: 1200px;            /* comfortable, matches their feel */
  --gutter: 24px;

  /* Additional shadow for larger elements */
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
}

/* Typography */
@font-face {
  font-family: 'Inter';
  font-display: swap;
  src: local('Inter'); /* team may import via Google Fonts/Adobe */
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text-900);
  background: var(--bg-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { 
  letter-spacing: -0.01em; 
  font-weight: 800; 
  color: var(--text-900);
  line-height: 1.2;
}

h4, h5, h6 { 
  letter-spacing: -0.005em; 
  font-weight: 700; 
  color: var(--text-900);
}

p, li { 
  color: var(--text-700);
  margin-bottom: 1rem;
}

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

small, .muted { 
  color: var(--text-500); 
}

/* Links & emphasis */
a { 
  color: var(--link); 
  text-decoration: none; 
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

a:hover { 
  color: var(--link-hover); 
}

mark { 
  background: color-mix(in srgb, var(--brand-primary) 15%, white); 
}

/* Focus (keyboard & a11y) */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: calc(var(--radius) - 4px);
}

/* Layout helpers */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(48px, 8vw, 96px);
  background: var(--bg-0);
}

.section.alt { 
  background: var(--bg-50); 
}

/* Components */
/* Primary CTA */
.button-primary {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: .5rem; 
  padding: .75rem 1rem;
  border-radius: var(--radius);
  background: var(--brand-primary);
  color: #fff; 
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: background .2s ease, transform .05s ease, box-shadow .2s ease;
  cursor: pointer;
  border: none;
  font-size: inherit;
  font-family: inherit;
}

.button-primary:hover { 
  background: var(--brand-600);
  color: #fff;
}

.button-primary:active { 
  background: var(--brand-700); 
  transform: translateY(1px); 
}

.button-large {
  padding: 1rem 1.75rem;
  font-size: 1rem;
}

/* Secondary / outline */
.button-outline {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: .5rem; 
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-300);
  color: var(--text-900); 
  background: transparent;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
  cursor: pointer;
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
}

.button-outline:hover { 
  border-color: var(--brand-primary); 
  color: var(--brand-primary); 
}

.button-outline:active { 
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent); 
}

/* Card */
.card {
  background: var(--bg-0);
  border: 1px solid var(--border-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* Input */
.input {
  width: 100%;
  border: 1px solid var(--border-200);
  border-radius: var(--radius-sm);
  padding: .625rem .75rem;
  background: var(--bg-0); 
  color: var(--text-900);
  transition: border-color .2s ease, box-shadow .2s ease;
  font-size: 0.95rem;
  font-family: inherit;
}

.input:focus { 
  outline: none; 
  box-shadow: 0 0 0 4px var(--focus-ring); 
  border-color: var(--brand-600); 
}

/* Badges (used around testimonials/labels on their site) */
.badge {
  display: inline-flex; 
  align-items: center; 
  gap: .35rem;
  padding: .25rem .5rem; 
  border-radius: 999px;
  background: var(--bg-100); 
  color: var(--text-700);
  border: 1px solid var(--border-200);
  font-size: 0.875rem;
  font-weight: 500;
}

.badge--brand { 
  background: color-mix(in srgb, var(--brand-primary) 10%, white); 
  color: var(--brand-700); 
  border-color: color-mix(in srgb, var(--brand-primary) 25%, white); 
}

/* Tables (for plan/features blocks) */
.table {
  width: 100%; 
  border-collapse: separate; 
  border-spacing: 0;
  border: 1px solid var(--border-200); 
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
}

.table th, .table td { 
  padding: .875rem 1rem; 
  border-bottom: 1px solid var(--border-200); 
}

.table thead th { 
  background: var(--bg-50); 
  text-align: left; 
  color: var(--text-900); 
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table tbody tr {
  transition: background 0.2s ease;
}

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

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

.table td {
  font-size: 0.95rem;
  color: var(--text-700);
}

/* Lists (feature lists w/ checkmarks etc.) */
.list {
  display: grid;
  gap: .5rem;
  color: var(--text-700);
}

/* Link buttons commonly used as CTAs */
.link-cta {
  display: inline-flex; 
  align-items: center; 
  gap: .4rem; 
  font-weight: 700;
  color: var(--brand-primary);
}

.link-cta:hover { 
  color: var(--brand-600); 
}

/* Hero specific - follows brand guide headline treatment */
.hero h1 { 
  font-size: clamp(2.25rem, 6vw, 3.5rem); 
  line-height: 1.1; 
}

/* Page-specific styles building on brand guidelines */

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

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Logo as link */
a.logo {
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a.logo:hover {
  opacity: 0.85;
}

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

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-900);
}

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

.nav-links a:not(.button-primary) {
  color: var(--text-700);
  font-weight: 500;
}

.nav-links a:not(.button-primary):hover {
  color: var(--brand-primary);
}

/* Dropdown Navigation */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  color: var(--text-700);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

.dropdown-trigger:hover {
  color: var(--brand-primary);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-0);
  border: 1px solid var(--border-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
  min-width: 180px;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-700);
  font-weight: 400;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease;
}

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

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-banner {
  position: relative;
  min-height: 600px;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
  display: flex;
  align-items: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.5) 0%, rgba(59, 130, 246, 0.2) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 0;
  color: white;
}

.hero h1 {
  color: white;
  margin: 1rem 0 1.5rem;
  max-width: 800px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

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

.hero-stats {
  display: flex;
  gap: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: white;
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Badges in hero */
.badges-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.hero .badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.hero .badge--brand {
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-700);
  border-color: white;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--text-500);
  max-width: 600px;
  margin: 1rem auto 0;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-600));
  color: white;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}

/* About Content */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

.about-content p {
  font-size: 1.125rem;
  line-height: 1.8;
}

/* Performance & Privacy Badges Section */
.badges-section {
  padding: 2rem 0;
  background: white;
  border-bottom: 1px solid var(--border-200);
}

.performance-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  transition: transform 0.2s ease;
}

.badge-item:hover {
  transform: translateY(-2px);
}

.badge-item svg {
  width: 32px;
  height: 32px;
  color: var(--brand-primary);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.badge-item:hover svg {
  color: var(--brand-600);
}

.badge-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.badge-value {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-900);
  line-height: 1;
}

.badge-label {
  font-size: 0.75rem;
  color: var(--text-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: 500;
}

/* Mobile responsive badges */
@media (max-width: 768px) {
  .performance-badges {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .badge-item {
    flex-direction: column;
    text-align: center;
  }
  
  .badge-item svg {
    width: 28px;
    height: 28px;
  }
  
  .badge-value {
    font-size: 1rem;
  }
}

/* Compact About Section */
.compact-section {
  padding-block: clamp(24px, 4vw, 40px) !important;
}

.about-section-wide {
  max-width: 100%;
}

.about-header-row {
  text-align: center;
  margin-bottom: 1.5rem;
}

.about-header-row h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  margin: 0 0 0.5rem 0;
}

.about-subtitle {
  color: var(--text-500);
  font-size: 1rem;
  margin: 0;
  font-style: italic;
}

.about-main {
  max-width: 1200px;
  margin: 0 auto;
}

.about-intro {
  font-size: 1.125rem;
  color: var(--text-900);
  font-weight: 500;
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.about-lead {
  font-size: 1rem;
  color: var(--text-700);
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
}

.llmo-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.benefit-item h3 {
  font-size: 1rem;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.benefit-item p {
  font-size: 0.875rem;
  color: var(--text-700);
  line-height: 1.5;
  margin: 0;
}

/* Mobile layout for about section */
@media (max-width: 768px) {
  .about-header-row h2 {
    font-size: 1.35rem;
  }

  .about-intro {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .about-lead {
    font-size: 0.95rem;
  }

  .llmo-benefits {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
  }
  
  .benefit-item h3 {
    font-size: 0.95rem;
  }

  .benefit-item p {
    font-size: 0.825rem;
  }
}

/* Table Controls */
.table-controls {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-500);
}

.search-box input {
  padding-left: 3rem;
  width: 100%;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-200);
  background: var(--bg-0);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-700);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(222, 73, 47, 0.05);
}

.filter-btn.active {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

/* Table wrapper */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Bot table specific */
.bot-table td:nth-child(1) {
  font-weight: 600;
  color: var(--text-900);
}

.bot-table td:nth-child(2) {
  color: var(--brand-primary);
  font-weight: 500;
}

.bot-table td:nth-child(4) {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text-500);
  word-break: break-all;
}

.bot-table td:nth-child(5) {
  text-align: center;
}

.bot-respect-yes {
  color: #10b981;
  font-weight: 600;
}

.bot-respect-no {
  color: #ef4444;
  font-weight: 600;
}

.bot-respect-mixed {
  color: #f59e0b;
  font-weight: 600;
}

.table-footer {
  text-align: center;
  padding: 1rem 0;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--bg-50) 0%, rgba(222, 73, 47, 0.05) 100%);
}

.cta-card {
  padding: 4rem 3rem;
  text-align: center;
  background: white;
}

.cta-card h2 {
  margin-bottom: 1.5rem;
}

.cta-card p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.cta-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* FAQ Section */
.faq-content {
  margin-top: 3rem;
}

.faq-category {
  margin-bottom: 3rem;
}

.faq-category:last-child {
  margin-bottom: 0;
}

.faq-category h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-900);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-200);
}

.faq-grid {
  display: grid;
  gap: 2rem;
}

.faq-item {
  background: var(--bg-0);
  border: 1px solid var(--border-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
}

.faq-item h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-900);
  margin-bottom: 0.75rem;
}

.faq-item p {
  font-size: 0.95rem;
  color: var(--text-700);
  line-height: 1.6;
  margin: 0;
}

.faq-item p + p {
  margin-top: 0.75rem;
}

.faq-item .code-block {
  background: var(--text-900);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  overflow-x: auto;
}

.faq-item .code-block code {
  color: #fff;
  background: none;
  padding: 0;
}

@media (max-width: 768px) {
  .faq-category h3 {
    font-size: 1.25rem;
  }
  
  .faq-item h4 {
    font-size: 1rem;
  }
  
  .faq-item {
    padding: 1.25rem;
  }
}

/* Footer */
.footer {
  background: var(--text-900);
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.footer-version {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

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

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.footer-links a:hover {
  color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .nav-dropdown {
    display: none;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .table-controls {
    flex-direction: column;
  }
  
  .search-box {
    max-width: 100%;
  }
  
  .filter-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .cta-card {
    padding: 2.5rem 1.5rem;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
  }
}

/* Sticky Navigation Improvements */

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-600));
  width: 0%;
  z-index: 9999;
  transition: width 0.3s ease;
}

/* Sticky Table of Contents */
.sticky-toc {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-0);
  border: 1px solid var(--border-200);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-md);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  max-width: 200px;
}

.sticky-toc.visible {
  opacity: 1;
  visibility: visible;
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-900);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-200);
}

.toc-header svg {
  color: var(--brand-primary);
  flex-shrink: 0;
}

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

.toc-list li {
  margin-bottom: 0.5rem;
}

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

.toc-list a {
  color: var(--text-700);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: block;
  padding: 0.25rem 0;
}

.toc-list a:hover {
  color: var(--brand-primary);
  padding-left: 0.5rem;
}

.toc-list a.active {
  color: var(--brand-primary);
  font-weight: 600;
  position: relative;
  padding-left: 0.5rem;
}

.toc-list a.active::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.5rem;
  background: var(--brand-primary);
  border-radius: 2px;
}

/* TOC Sub-navigation */
.toc-sub {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0 1rem;
}

.toc-sub li {
  margin-bottom: 0.25rem;
}

.toc-sub a {
  font-size: 0.8rem;
  color: var(--text-500);
  padding: 0.15rem 0;
}

.toc-sub a:hover {
  color: var(--brand-primary);
  padding-left: 0.25rem;
}

.toc-sub a.active {
  color: var(--brand-primary);
  font-weight: 500;
  padding-left: 0.25rem;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 95;
}

.back-to-top:hover {
  background: var(--brand-600);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.back-to-top:active {
  background: var(--brand-700);
  transform: translateY(0);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hide TOC on medium screens */
@media (max-width: 1200px) {
  .sticky-toc {
    display: none;
  }
}

/* Adjust back to top on mobile */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* Developer API Section */
#developers {
  background: var(--bg-50);
}

.dev-content {
  margin-top: 2rem;
}

.dev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.api-card {
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.api-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-900);
}

.code-block {
  position: relative;
  background: var(--text-900);
  color: #fff;
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
}

.code-block code, 
.code-block pre {
  color: #fff;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  font-family: 'Courier New', monospace;
}

.code-block pre {
  white-space: pre;
  word-wrap: normal;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  font-family: inherit;
}

.copy-btn:hover {
  background: var(--brand-600);
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn.copied {
  background: #10b981;
}

.api-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-500);
}

.api-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.api-feature {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.api-feature svg {
  width: 24px;
  height: 24px;
  color: var(--brand-primary);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.api-feature h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text-900);
}

.api-feature p {
  font-size: 0.875rem;
  color: var(--text-500);
  margin: 0;
}

.api-usage {
  padding: 2rem;
  margin-top: 2rem;
}

.api-usage h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-900);
}

/* Mobile responsive developer section */
@media (max-width: 768px) {
  .dev-grid {
    grid-template-columns: 1fr;
  }
  
  .api-features-grid {
    grid-template-columns: 1fr;
  }
  
  .code-block {
    font-size: 0.75rem;
  }
  
  .copy-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}