/* ===========================================
   TerraPDF Website Styles
   Professional, clean, modern design
   =========================================== */

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

:root {
  /* Colors - TerraPDF brand palette */
  --primary: #043775;
  --primary-dark: #03204b;
  --primary-light: #23538d;
  --secondary: #2ec27e;
  --accent: #e5a50a;
  
  /* Neutrals */
  --text: #1f395e;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e5e7eb;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%);
  --gradient-card-hover: linear-gradient(145deg, #f8fafc 0%, #e8f4fd 100%);
  
  /* Code */
  --code-bg: #1e1e1e;
  --code-text: #d4d4d4;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
   /* Typography */
   --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
   --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  
  /* Transitions */
  --transition: 0.2s ease-in-out;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ===========================================
   Header & Navigation
   =========================================== */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: var(--space-lg);
}

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

 .logo-img {
   height: 40px;
   width: auto;
   display: block;
 }

 .logo-text {
   line-height: 1;
 }

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

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition);
  position: relative;
  padding: var(--space-xs) 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  gap: var(--space-sm);
}

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

/* ===========================================
   Buttons
   =========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

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

/* ===========================================
   Main Content
   =========================================== */

main {
  flex: 1;
  padding: var(--space-3xl) 0;
}

/* ===========================================
   Typography
   =========================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: var(--space-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* ===========================================
   Hero Section
   =========================================== */

.hero {
  text-align: center;
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, #f8fafc 0%, #e8f4fd 100%);
  border-radius: 12px;
  margin-bottom: var(--space-3xl);
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-md);
}

.hero .tagline {
  font-size: 1.35rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto var(--space-xl);
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-badges {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

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

.badge img {
  height: 24px;
}

/* ===========================================
   Features Section
   =========================================== */

.features-section {
  margin-bottom: var(--space-3xl);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border);
}

/* Larger header for Why TerraPDF section */
#why-terrapdf .section-header h2 {
  font-size: 2.75rem;
}

#why-terrapdf .section-header p {
  font-size: 1.15rem;
}

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

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.feature-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-lg);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card:hover {
  border-color: var(--primary-light);
  background: var(--gradient-card-hover);
}

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

.feature-card h3,
.feature-card h4 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: var(--primary-dark);
  position: relative;
  z-index: 1;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  position: relative;
  z-index: 1;
}

.feature-card code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--primary-dark);
}

/* Smaller cards for inline grids */
.features-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.features-grid .feature-card {
  padding: var(--space-md);
  border-radius: 8px;
}

.features-grid .feature-card h3,
.features-grid .feature-card h4 {
  font-size: 0.95rem;
  margin-bottom: var(--space-xs);
}

.features-grid .feature-card p {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Two-column layout for specific grids */
.features-grid--two-col {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.features-grid--two-col .feature-card {
  padding: var(--space-xl);
  border-radius: 16px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.features-grid--two-col .feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.features-grid--two-col .feature-card:hover {
  border-color: var(--primary);
  background: var(--gradient-card-hover);
}

.features-grid--two-col .feature-card:hover::before {
  opacity: 1;
}

.features-grid--two-col .feature-card h3,
.features-grid--two-col .feature-card h4 {
  font-size: 1.35rem;
  margin-bottom: var(--space-md);
  color: var(--primary-dark);
}

.features-grid--two-col .feature-card p {
  font-size: 1rem;
  line-height: 1.7;
}

.features-grid--two-col .feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
}

/* Vertical stack layout for docs page */
.features-vertical {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.features-vertical .feature-card {
  padding: var(--space-lg);
  border-radius: 12px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.features-vertical .feature-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
  background: var(--gradient-card-hover);
}

.features-vertical .feature-card h3,
.features-vertical .feature-card h4 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: var(--primary-dark);
}

.features-vertical .feature-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Responsive: single column on mobile */
@media (max-width: 768px) {
  .features-grid--two-col {
    grid-template-columns: 1fr;
  }
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.feature-card code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--primary-dark);
}

/* ===========================================
   Code Blocks
   =========================================== */

pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: var(--space-lg);
  border-radius: 8px;
  overflow-x: auto;
  margin: var(--space-lg) 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

pre code {
  font-family: var(--font-mono);
}

code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.05);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* ===========================================
   Content Sections
   =========================================== */

 .content-section {
   margin-bottom: var(--space-3xl);
 }

 .back-to-docs {
   display: inline-flex;
   align-items: center;
   gap: 0.25rem;
   color: var(--text-muted);
   font-size: 0.875rem;
   text-decoration: none;
   margin-bottom: var(--space-lg);
   transition: color var(--transition);
 }

 .back-to-docs:hover {
   color: var(--primary);
 }

 .content-section h2 {
   margin-bottom: var(--space-lg);
   padding-bottom: var(--space-sm);
   border-bottom: 2px solid var(--border);
 }

.content-section h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.content-section ul,
.content-section ol {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.content-section li {
  margin-bottom: var(--space-sm);
}

.content-section table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
}

.content-section th,
.content-section td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.content-section th {
  background: var(--bg-alt);
  font-weight: 600;
}

.content-section tr:hover {
  background: var(--bg-alt);
}

/* ===========================================
   Feature List
   =========================================== */

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
  list-style: none;
  margin: var(--space-lg) 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-alt);
  border-radius: 6px;
}

.feature-list li::before {
  content: '✓';
  color: var(--secondary);
  font-weight: bold;
  font-size: 1.1rem;
}

/* ===========================================
   Install Box
   =========================================== */

.install-box {
  background: var(--code-bg);
  color: white;
  padding: var(--space-lg);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-align: center;
  margin: var(--space-xl) 0;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}

.install-box:focus {
  border-color: var(--primary-light);
  outline: none;
}

.install-box .command {
  color: var(--accent);
  font-weight: 600;
}

/* ===========================================
   Callout / Note Boxes
   =========================================== */

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

.callout-info {
  background: #e3f2fd;
  border-color: var(--primary);
  color: #0d47a1;
}

.callout-warning {
  background: #fff3e0;
  border-color: var(--accent);
  color: #e65100;
}

.callout-success {
  background: #e8f5e9;
  border-color: var(--secondary);
  color: #1b5e20;
}

/* ===========================================
   Footer
   =========================================== */

 .site-footer {
   background: #040d1b;
   color: #d1d5db;
   padding: var(--space-2xl) 0 0;
   margin-top: auto;
 }

 .footer-logo {
   display: flex;
   align-items: center;
   gap: var(--space-sm);
   margin-bottom: var(--space-md);
 }

 .footer-logo-img {
   height: 32px;
   width: auto;
   display: block;
 }

 .footer-logo h4 {
   margin-bottom: 0;
   color: white;
   font-size: 1rem;
 }

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid #374151;
}

.footer-section h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.footer-section p {
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: var(--space-sm);
}

.footer-section a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}

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

.footer-bottom {
  padding: var(--space-lg) 0;
  text-align: center;
  font-size: 0.85rem;
  color: #9ca3af;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom a {
  color: #9ca3af;
}

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

p.footer-signature {
  margin-top: var(--space-xs);
  font-size: 0.8rem;
}

.footer-signature a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-signature a:hover {
  color: var(--accent);
}

/* ===========================================
   Documentation Specific
   =========================================== */

.docs-sidebar {
  display: none;
}

.docs-content {
  max-width: 900px;
  margin: 0 auto;
}

.doc-item {
  display: block;
  padding: var(--space-md);
  border-radius: 6px;
  margin-bottom: var(--space-sm);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
}

.doc-item:hover {
  background: var(--bg-alt);
}

.doc-item h3 {
  margin: 0;
  font-size: 1rem;
}

.doc-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: var(--space-xs) 0 0;
}

/* ===========================================
   API Reference Tables
   =========================================== */

.api-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
}

.api-table th,
.api-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.api-table th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text);
}

.api-table code {
  background: var(--code-bg);
  color: #9cdcfe;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.85em;
}

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

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

  .nav-cta {
    display: none;
  }

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

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

  .hero .tagline {
    font-size: 1.1rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

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

  .features-showcase {
    gap: var(--space-2xl);
  }

  .feature-item {
    padding: var(--space-md);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .cta-section {
    padding: var(--space-lg) 0;
    border-radius: 8px;
  }

  .cta-content h2 {
    font-size: 1.5rem;
  }

  .cta-content p {
    font-size: 0.9rem;
  }

  .cta-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
  }

  .cta-section .btn {
    width: 100%;
    text-align: center;
  }

  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  .error-code {
    font-size: 6rem;
  }

  .error-page h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .section-header h2 {
    font-size: 1.75rem;
  }
}

/* ===========================================
    Utilities
    =========================================== */

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

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

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Syntax highlighting overrides */
.hljs-keyword { color: #c586c0; }
.hljs-string { color: #ce9178; }
.hljs-number { color: #b5cea8; }
.hljs-comment { color: #6a9955; }
.hljs-function { color: #dcdcaa; }
.hljs-class { color: #4ec9b0; }

/* ===========================================
   Skip Link (Accessibility)
   =========================================== */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 9999;
  transition: top 0.3s;
  border-radius: 0 0 6px 0;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* ===========================================
   Keyboard Navigation Focus
   =========================================== */

body.keyboard-nav *:focus {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ===========================================
   Copy Buttons
   =========================================== */

pre {
  position: relative;
}

.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #d4d4d4;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.copy-code-btn.copied {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.install-box + .btn-small {
  margin-top: 0.5rem;
}

/* Table wrapper for horizontal scroll on small screens */
.table-wrapper {
  overflow-x: auto;
  margin: var(--space-lg) 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.table-wrapper .api-table {
  margin: 0;
  min-width: 400px;
}

.table-wrapper .api-table th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.table-wrapper .api-table td {
  white-space: nowrap;
}

/* ===========================================
    Features Categorized Overview
    =========================================== */

.features-categorized {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

@media (max-width: 768px) {
  .features-categorized {
    grid-template-columns: 1fr;
  }
}

.category-group {
  background: var(--bg);
  border-radius: 12px;
  padding: var(--space-lg);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.category-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.category-group:hover {
  border-color: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.category-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border);
}

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

.category-features li {
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
  line-height: 1.6;
  position: relative;
  padding-left: 1.2em;
}

.category-features li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
  font-size: 1.1em;
  line-height: 1;
  top: 0.1em;
}

.category-features li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.category-features li a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.category-features strong {
  color: var(--text);
  font-weight: 600;
}

.category-features code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  color: var(--primary-dark);
}

/* ===========================================
    Scroll to Top Button
    =========================================== */

.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ===========================================
   Error Page (404)
   =========================================== */

.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.error-code {
  font-size: 10rem;
  font-weight: 900;
  color: var(--primary);
  opacity: 0.15;
  margin-bottom: 0;
  line-height: 1;
}

.error-page h1 {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.error-page p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  color: var(--text-muted);
}

.error-page ul {
  list-style: none;
  padding: 0;
}

.error-page ul li {
  margin-bottom: var(--space-sm);
}

.error-page ul li a {
  color: var(--primary);
  text-decoration: underline;
}

.error-page ul li a:hover {
  color: var(--primary-dark);
}

/* ===========================================
   External Links (optional indicator)
   =========================================== */

a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.7;
  vertical-align: super;
}

/* ===========================================
  Features Showcase (Homepage)
  =========================================== */

.features-showcase {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
  margin-top: var(--space-2xl);
}

.feature-category {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.category-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--primary);
  max-width: fit-content;
}

.category-label::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
}

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

.feature-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-item:hover {
  border-color: var(--primary-light);
  background: var(--gradient-card-hover);
}

.feature-item:hover::before {
  opacity: 1;
}

.feature-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ===========================================
   CTA Section (Homepage)
   =========================================== */

.cta-section {
  background: var(--primary);
  color: white;
  padding: var(--space-xl) 0;
  margin: var(--space-2xl) 0;
}

.cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
}

.cta-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: white;
}

.cta-content p {
  font-size: 1rem;
  max-width: 500px;
  opacity: 0.9;
  margin: 0;
}

.cta-buttons {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

.cta-section .btn {
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
}

.cta-section .btn-primary {
  background: white;
  color: var(--primary);
}

.cta-section .btn-primary:hover {
  background: var(--bg-alt);
}

.cta-section .btn-outline {
  color: white;
  border-color: rgba(255,255,255,0.5);
}

.cta-section .btn-outline:hover {
  background: rgba(255,255,255,0.1);
}

/* ===========================================
   Additional Utilities
   =========================================== */

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 4px;
}

/* Better mobile spacing */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  .error-code {
    font-size: 6rem;
  }

  .error-page h1 {
    font-size: 2rem;
  }
}
