/* ContextOS Website - Main Stylesheet
   Design: Data-First Clarity (aligned with OrderHUBx family)
   Typography: Lexend (headings) + Work Sans (body) + JetBrains Mono (data)
   ============================================================ */

/* ============================================
   1. CSS VARIABLES & DESIGN SYSTEM
   ============================================ */

/* fonts.googleapis @import removed; loaded via <link> in HTML head */
:root {
  /* Colors — ContextOS Brand */
  --color-navy: #0A1628;
  --color-navy-light: #1A2B45;
  --color-teal: #0D9488;
  --color-teal-dark: #0B7A70;
  --color-teal-light: #14B8A6;
  --color-emerald: #10B981;
  --color-emerald-dark: #059669;
  --color-amber: #F59E0B;

  --color-bg: #F8FAFC;
  --color-white: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-light: #6B7280;
  --color-text-muted: #9CA3AF;
  --color-border: #E5E7EB;
  --color-border-strong: #D1D5DB;

  /* Semantic */
  --color-positive: #10B981;
  --color-warning: #F59E0B;
  --color-negative: #EF4444;

  /* Typography */
  --font-heading: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Courier New', monospace;

  /* Font sizes */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;

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

  /* Container */
  --container-max: 1200px;

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

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Legacy aliases for inline styles in existing HTML */
  --color-primary: var(--color-teal);
  --color-primary-light: var(--color-teal-light);
  --color-secondary: var(--color-teal);
  --color-accent: var(--color-emerald);
  --color-text-primary: var(--color-text);
  --color-text-secondary: var(--color-text-light);
  --color-error: var(--color-negative);
  --font-family: var(--font-body);
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
}

/* ============================================
   2. RESET & BASE STYLES
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: var(--color-teal);
  color: var(--color-white);
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */

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

h1 { font-size: clamp(2.5rem, 5vw, var(--font-size-5xl)); }
h2 { font-size: clamp(2rem, 4vw, var(--font-size-4xl)); }
h3 { font-size: clamp(1.5rem, 3vw, var(--font-size-3xl)); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-light);
  line-height: 1.7;
}

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

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

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

/* Monospace numbers / data */
.mono {
  font-family: var(--font-mono);
}

sup {
  font-size: 0.6em;
  vertical-align: super;
  line-height: 0;
}

/* ============================================
   4. LAYOUT & CONTAINERS
   ============================================ */

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

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 896px;
}

.container-lg {
  max-width: 1200px;
}

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

section.section-light {
  background-color: var(--color-white);
}

section.section-dark {
  background-color: var(--color-navy);
  color: var(--color-white);
}

section.section-dark h1,
section.section-dark h2,
section.section-dark h3,
section.section-dark h4,
section.section-dark h5,
section.section-dark h6 {
  color: var(--color-white);
}

section.section-dark p {
  color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   5. HEADER & NAVIGATION
   ============================================ */

header {
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

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

nav {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  margin-left: var(--space-lg);
}

nav a {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
  transition: color var(--transition-fast);
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
}

nav a:hover {
  color: var(--color-teal);
}

nav a.active {
  color: var(--color-teal);
  border-bottom-color: var(--color-teal);
}

.nav-buttons {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background-color: var(--color-navy);
  border-radius: 1px;
  transition: all var(--transition-base);
}

/* ============================================
   6. BUTTONS & LINKS
   ============================================ */

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

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

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

.btn-secondary {
  background-color: transparent;
  color: var(--color-teal);
  border-color: var(--color-teal);
}

.btn-secondary:hover {
  background-color: var(--color-teal);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

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

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

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-lg);
}

.link-text {
  color: var(--color-teal);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(13, 148, 136, 0.3);
  transition: all var(--transition-fast);
}

.link-text:hover {
  text-decoration-color: var(--color-teal);
}

/* ============================================
   7. HERO SECTION
   ============================================ */

.hero {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: var(--color-white);
  padding: var(--space-3xl) 0;
  position: relative;
  overflow: hidden;
}

/* Subtle grid texture */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(13, 148, 136, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 148, 136, 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.4;
  pointer-events: none;
}

/* Accent glow */
.hero::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: var(--color-white);
  margin-bottom: var(--space-md);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  max-width: 800px;
  animation: slideInUp 0.8s ease;
}

.hero .subheadline {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-lg);
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  animation: slideInUp 0.8s ease 0.15s both;
}

.hero .support-text {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xl);
  color: rgba(255, 255, 255, 0.75);
  max-width: 600px;
  animation: slideInUp 0.8s ease 0.3s both;
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  animation: slideInUp 0.8s ease 0.45s both;
}

.hero-cta .btn-secondary {
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-cta .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--color-white);
  color: var(--color-white);
}

/* ============================================
   8. FEATURE CARDS
   ============================================ */

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

.feature-card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  text-align: left;
  border-top: 4px solid var(--color-teal);
  box-shadow: var(--shadow-md);
}

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

.feature-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-teal), var(--color-teal-dark));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  font-size: var(--font-size-xl);
}

.feature-card h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.feature-card p {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
}

/* ============================================
   9. CONTENT SECTIONS
   ============================================ */

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.content-grid.reverse {
  direction: rtl;
}

.content-grid.reverse > * {
  direction: ltr;
}

.content-text h2 {
  margin-bottom: var(--space-md);
}

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

.content-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.content-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   10. USE CASE GRID
   ============================================ */

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

.use-case-item {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border-left: 4px solid var(--color-teal);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.use-case-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.use-case-item h3 {
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-xl);
}

/* ============================================
   11. FOOTER
   ============================================ */

footer {
  background-color: #1E293B;
  color: rgba(255, 255, 255, 0.95);
  padding: var(--space-3xl) 0 var(--space-lg);
  margin-top: 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

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

.footer-section a {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.75rem;
  font-size: var(--font-size-sm);
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--color-teal-light);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-sm);
}

.social-links {
  display: flex;
  gap: var(--space-sm);
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.social-links a:hover {
  background-color: var(--color-teal);
  color: var(--color-white);
}

/* ============================================
   12. FORMS
   ============================================ */

.form-group {
  margin-bottom: var(--space-md);
}

label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 600;
  color: var(--color-navy);
  font-size: var(--font-size-sm);
}

input,
textarea,
select {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-white);
  transition: all var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============================================
   13. TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

table th {
  background: var(--color-navy);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: var(--space-md);
  text-align: left;
}

table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

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

table td strong {
  color: var(--color-navy);
}

/* ============================================
   14. UTILITIES
   ============================================ */

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

.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); }

.py-sm { padding: var(--space-sm) 0; }
.py-md { padding: var(--space-md) 0; }
.py-lg { padding: var(--space-lg) 0; }
.py-xl { padding: var(--space-xl) 0; }

.max-width-sm {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.max-width-md {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   15. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }

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

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

  .hamburger {
    display: flex;
  }

  nav {
    display: none;
  }

  nav.active {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-lg);
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
  }

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

  .content-grid.reverse {
    direction: ltr;
  }

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

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  :root {
    --font-size-5xl: 2rem;
    --font-size-4xl: 1.75rem;
    --font-size-3xl: 1.5rem;
    --space-2xl: 2rem;
    --space-xl: 1.5rem;
  }

  h1 { font-size: var(--font-size-3xl); }

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

  .use-cases-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   16. SCROLL ANIMATIONS
   ============================================ */

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

.feature-card,
.use-case-item,
.content-grid {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-card.animated,
.use-case-item.animated,
.content-grid.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animations */
.feature-card:nth-child(2) { transition-delay: 80ms; }
.feature-card:nth-child(3) { transition-delay: 160ms; }
.feature-card:nth-child(4) { transition-delay: 240ms; }
.feature-card:nth-child(5) { transition-delay: 320ms; }
.feature-card:nth-child(6) { transition-delay: 400ms; }

.use-case-item:nth-child(2) { transition-delay: 60ms; }
.use-case-item:nth-child(3) { transition-delay: 120ms; }
.use-case-item:nth-child(4) { transition-delay: 180ms; }
.use-case-item:nth-child(5) { transition-delay: 240ms; }
.use-case-item:nth-child(6) { transition-delay: 300ms; }

/* ============================================
   17. SCROLL TO TOP BUTTON
   ============================================ */

#scrollTopBtn {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background-color: var(--color-navy);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.125rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  z-index: 50;
}

#scrollTopBtn:hover {
  background-color: var(--color-teal);
  transform: translateY(-2px);
}

/* ============================================
   18. ACTIVE NAV LINK
   ============================================ */

nav a.active {
  color: var(--color-teal);
  font-weight: 700;
  border-bottom-color: var(--color-teal);
}

/* ============================================
   19. SPECIAL COMPONENTS
   ============================================ */

/* Stats row for hero */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.hero-stat {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(13, 148, 136, 0.25);
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-teal-light);
  display: block;
}

.hero-stat-label {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.75);
}

/* Callout / blockquote */
blockquote,
.callout {
  border-left: 4px solid var(--color-teal);
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-white);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-sm);
  margin: var(--space-xl) 0;
}

blockquote p,
.callout p {
  color: var(--color-text);
  font-size: var(--font-size-lg);
}

/* Pipeline steps (How It Works page) */
.pipeline-steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  margin-top: var(--space-xl);
}

.pipeline-step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 2;
}

.pipeline-step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-teal);
  color: var(--color-white);
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-sm);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.pipeline-connector {
  flex: 0 0 auto;
  width: 60px;
  height: 3px;
  background: var(--color-teal);
  margin-top: 24px;
  z-index: 1;
}

/* Intelligence ladder (Human+AI page) */
.ladder-level {
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  transition: all var(--transition-base);
}

.ladder-level:hover {
  transform: translateX(4px);
}

.ladder-level h4 {
  margin-bottom: var(--space-xs);
}

.ladder-level p {
  margin-bottom: 0;
}

/* CTA Section (darker background) */
.cta-section {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: var(--color-white);
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(13, 148, 136, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 148, 136, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.3;
  pointer-events: none;
}

.cta-section .container {
  position: relative;
  z-index: 1;
}

.cta-section h2 {
  color: var(--color-white);
}

.cta-section p {
  color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   20. STORY TABS (Home Page 3-Tab Section)
   ============================================ */

/* Tab Navigation */
.story-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: var(--space-2xl);
}

.story-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: var(--space-lg) var(--space-md);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-base);
  margin-bottom: -2px;
  font-family: var(--font-body);
}

.story-tab:hover {
  background-color: var(--color-bg);
}

.story-tab.active {
  border-bottom-color: var(--color-teal);
  background-color: var(--color-white);
}

.story-tab-number {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-teal);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.05em;
}

.story-tab-title {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 4px;
}

.story-tab.active .story-tab-title {
  color: var(--color-teal-dark);
}

.story-tab-subtitle {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Tab Panels */
.story-panels {
  position: relative;
  min-height: 500px;
}

.story-panel {
  display: none;
  animation: panelFadeIn 0.35s ease;
}

.story-panel.active {
  display: block;
}

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

/* Panel Header */
.panel-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.panel-header h2 {
  margin-bottom: var(--space-md);
}

.panel-header p {
  margin-left: auto;
  margin-right: auto;
}

/* Panel Columns */
.panel-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.panel-column h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
  color: var(--color-navy);
}

/* Signal List (Tab 1) */
.signal-list {
  list-style: none;
  padding: 0;
}

.signal-list li {
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--color-teal);
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-lg);
  color: var(--color-text);
  background: var(--color-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.signal-list li em {
  color: var(--color-teal-dark);
  font-weight: 600;
  font-style: normal;
}

/* Flow Diagram (Tab 1) */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: var(--space-lg) 0 var(--space-md);
}

.flow-step {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  min-width: 160px;
  text-align: center;
}

.flow-step-problem {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--color-negative);
  color: var(--color-negative);
  font-weight: 700;
}

.flow-arrow {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  line-height: 1.2;
  padding: 2px 0;
}

.flow-caption {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
  margin-bottom: 0;
}

/* Panel Callout */
.panel-callout {
  background: var(--color-bg);
  border-left: 4px solid var(--color-teal);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: var(--space-lg) var(--space-xl);
  margin-top: var(--space-2xl);
}

.panel-callout p {
  margin-bottom: 0;
  font-size: var(--font-size-lg);
  color: var(--color-text);
  line-height: 1.7;
}

/* Model Flow (Tab 2) */
.model-flow {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  overflow-x: auto;
}

.model-step {
  flex: 1;
  min-width: 180px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
}

.model-step-enriched {
  border-color: var(--color-teal);
}

.model-step-signal {
  border-color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.04);
}

.model-step-label {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.model-step-content {
  font-size: var(--font-size-base);
  color: var(--color-text);
}

.model-step-content code {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background: var(--color-bg);
  word-break: break-all;
  text-align: left;
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-navy);
}

.model-step-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.context-tag {
  display: inline-block;
  font-size: var(--font-size-xs);
  padding: 3px 10px;
  background: rgba(13, 148, 136, 0.08);
  color: var(--color-teal-dark);
  border-radius: 100px;
  font-weight: 500;
}

.model-arrow {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-teal);
  font-size: 1.5rem;
  min-width: 60px;
}

.model-arrow span {
  font-size: var(--font-size-xs);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.model-arrow::before {
  content: '\2192';
  font-size: 1.5rem;
}

/* Routing List (Tab 2) */
.routing-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.route-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.route-icon {
  font-size: var(--font-size-lg);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

/* Intelligence Levels (Tab 2) */
.intelligence-levels {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin: var(--space-md) 0;
}

.intel-level {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.intel-auto {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--color-emerald);
}

.intel-assist {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--color-amber);
}

.intel-escalate {
  background: rgba(239, 68, 68, 0.06);
  border-left: 3px solid var(--color-negative);
}

.intel-label {
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--color-navy);
}

.intel-desc {
  color: var(--color-text-light);
}

/* Architecture Flow (Tab 3) */
.architecture-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-xl) var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  flex-wrap: nowrap;
}

.arch-step {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  line-height: 1.3;
  min-width: 80px;
}

.arch-step-core {
  background: var(--color-teal);
  color: var(--color-white);
  border-color: var(--color-teal-dark);
  font-weight: 700;
}

.arch-connector {
  width: 32px;
  height: 2px;
  background: var(--color-teal);
  flex-shrink: 0;
  position: relative;
}

.arch-connector::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -3px;
  width: 0;
  height: 0;
  border-left: 6px solid var(--color-teal);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

/* Surfaces Grid (Tab 3) */
.surfaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.surface-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border-top: 3px solid var(--color-teal);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

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

.surface-card h4 {
  margin-bottom: var(--space-xs);
}

.surface-card p {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-sm);
}

.surface-card-wide {
  grid-column: 1 / -1;
  text-align: center;
  border-top-color: var(--color-navy);
}

.surface-examples {
  list-style: none;
  padding: 0;
}

.surface-examples li {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  padding: 4px 0;
  border-bottom: 1px solid var(--color-border);
}

.surface-examples li:last-child {
  border-bottom: none;
}

/* Story Tabs Responsive */
@media (max-width: 768px) {
  .story-tabs {
    flex-direction: column;
    border-bottom: none;
    gap: var(--space-xs);
  }

  .story-tab {
    border-bottom: none;
    border-left: 3px solid transparent;
    margin-bottom: 0;
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
  }

  .story-tab.active {
    border-left-color: var(--color-teal);
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
  }

  .story-tab-subtitle {
    display: none;
  }

  .panel-columns {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .model-flow {
    flex-direction: column;
    align-items: stretch;
  }

  .model-arrow {
    min-width: auto;
    transform: rotate(90deg);
    padding: var(--space-xs) 0;
  }

  .model-step {
    min-width: auto;
  }

  .architecture-flow {
    flex-direction: column;
    gap: 0;
  }

  .arch-connector {
    width: 2px;
    height: 24px;
  }

  .arch-connector::after {
    right: auto;
    bottom: -1px;
    top: auto;
    left: -3px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid var(--color-teal);
    border-bottom: none;
  }

  .story-panels {
    min-height: auto;
  }

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

  .surface-card-wide {
    grid-column: auto;
  }
}

/* ============================================
   21. PRODUCT FAMILY (Products Page)
   ============================================ */

.product-family {
  margin-bottom: var(--space-xl);
}

.product-family-header {
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-bg);
  border-left: 4px solid var(--color-teal);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin-bottom: var(--space-xl);
}

.product-family-header h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-xs);
}

.product-family-header p {
  margin-bottom: 0;
}

.mt-2xl {
  margin-top: var(--space-2xl);
}

/* ============================================
   22. BEFORE/AFTER COMPARISON SLIDER
   ============================================ */

.compare-slider {
  max-width: 700px;
  margin: 0 auto;
}

.compare-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.compare-label {
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
}

.compare-label-before {
  background: var(--color-bg);
  color: var(--color-text-light);
}

.compare-label-after {
  background: rgba(13, 148, 136, 0.08);
  color: var(--color-teal-dark);
}

.compare-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.compare-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.compare-before {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}

.compare-before .compare-img {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: 100%;
  max-width: none;
}

.compare-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.compare-handle-line {
  flex: 1;
  width: 3px;
  background: var(--color-teal);
  opacity: 0.8;
}

.compare-handle-circle {
  width: 44px;
  height: 44px;
  background: var(--color-white);
  border: 3px solid var(--color-teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--color-teal);
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .compare-slider {
    max-width: 100%;
  }

  .compare-handle-circle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

/* ============================================
   23. PRINT STYLES
   ============================================ */

@media print {
  header,
  footer,
  .btn,
  #scrollTopBtn {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .hero {
    background: #f0f0f0;
    color: black;
  }
}

/* ===== Simulation modal (lightbox) ===== */
.sim-modal { position: fixed; inset: 0; z-index: 9999; }
.sim-modal[hidden] { display: none; }
.sim-modal-overlay { position: absolute; inset: 0; background: rgba(10,22,40,.78); backdrop-filter: blur(4px); }
.sim-modal-frame { position: absolute; inset: 24px; background: #F8FAFC; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); display: flex; flex-direction: column; }
.sim-modal-frame iframe { flex: 1; width: 100%; border: 0; background: #F8FAFC; }
.sim-modal-close { position: absolute; top: 12px; right: 14px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); color: #0A1628; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); font-family: system-ui; }
.sim-modal-close:hover { background: #fff; transform: scale(1.05); }
@media (max-width: 768px) { .sim-modal-frame { inset: 0; border-radius: 0; } }
