/* ============================================================
   CSS CUSTOM PROPERTIES
============================================================ */
:root {
  --accent:         #3ECFCF;
  --accent-dark:    #1FA8A8;
  --accent-light:   #6FDFDF;
  --bg-primary:     #0D0F12;
  --bg-elevated:    #13171C;
  --bg-border:      #1E252E;
  --text-primary:   #F0F4F8;
  --text-secondary: #8896A7;
  --text-muted:     #4A5568;
  --success:        #34D399;
  --warning:        #FBBF24;
  --error:          #F87171;

  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --container-max: 1160px;
  --container-narrow: 760px;
  --section-gap: 120px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition-base: 160ms ease;
}

/* ============================================================
   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 {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* ============================================================
   TYPOGRAPHY UTILITIES
============================================================ */
.section-headline {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.15;
}

.section-subheadline {
  font-size: 18px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 56px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ============================================================
   LAYOUT
============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

/* ============================================================
   NAV
============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    backdrop-filter var(--transition-base);
}

.nav.scrolled {
  background: rgba(13, 15, 18, 0.96);
  border-bottom-color: var(--bg-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  flex-shrink: 0;
  line-height: 1;
}

.wordmark--small {
  font-size: 15px;
}

.wordmark-k {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-base);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-install-badge {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: 999px;
  padding: 5px 14px;
}

.nav-install-badge code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ============================================================
   HERO
============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 120px;
  padding-bottom: 100px;
  padding-left: 24px;
  padding-right: 24px;
  overflow: hidden;
}

.hero-bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 55% at 50% 38%, rgba(62, 207, 207, 0.04) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.hero-headline {
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.06;
}

.hero-highlight {
  color: var(--accent);
  font-style: italic;
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

/* Underline draw animation */
.hero-highlight::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  animation: underline-draw 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

@keyframes underline-draw {
  to { transform: scaleX(1); }
}

.hero-subheadline {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

/* Badges */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

/* Hero install block */
.install-block {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 13px 14px 13px 20px;
  width: 100%;
  max-width: 380px;
  gap: 12px;
}

.install-code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  background: none;
  border: none;
  padding: 0;
}

.install-code code {
  font-family: inherit;
  font-size: inherit;
}

/* Install block copy btn — override absolute positioning */
.install-block .copy-btn {
  position: static;
  flex-shrink: 0;
}

.hero-gh-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  transition: color var(--transition-base);
}

.hero-gh-link:hover {
  color: var(--accent-light);
}

/* ============================================================
   CODE BLOCKS — shared
============================================================ */
.code-block-wrap {
  position: relative;
  width: 100%;
}

.code-block {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  background: #0A0C0F;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 20px 52px 20px 22px;
  overflow-x: auto;
  tab-size: 2;
  -moz-tab-size: 2;
}

.code-block code {
  font-family: inherit;
  font-size: inherit;
}

/* Syntax token colors */
.t-cmd     { color: var(--accent); }
.t-str     { color: var(--success); }
.t-flag    { color: var(--warning); }
.t-comment { color: var(--text-muted); font-style: italic; }

/* Copy button — universal, absolute by default */
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition:
    background var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base);
  flex-shrink: 0;
}

.copy-btn:hover {
  background: rgba(62, 207, 207, 0.1);
  border-color: rgba(62, 207, 207, 0.4);
  color: var(--accent);
}

.copy-btn.copied {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--success);
}

/* Icon toggle */
.copy-btn .icon-check { display: none; }

.copy-btn.copied .icon-copy { display: none; }
.copy-btn.copied .icon-check { display: block; }

/* ============================================================
   PROBLEM / SOLUTION
============================================================ */
.problem-section {
  border-top: 1px solid var(--bg-border);
}

.problem-section .section-headline {
  margin-bottom: 52px;
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.problem-col {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.problem-col.with {
  border-color: rgba(62, 207, 207, 0.18);
  background: rgba(62, 207, 207, 0.015);
}

.col-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
  display: block;
}

.col-label--error  { color: var(--error); }
.col-label--accent { color: var(--accent); }

.problem-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.problem-list li {
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.problem-col.with .problem-list li {
  color: var(--text-primary);
}

.item-marker {
  flex-shrink: 0;
  font-weight: 700;
  line-height: 1.65;
  font-size: 15px;
}

.item-marker--error  { color: var(--error); }
.item-marker--accent { color: var(--accent); }

.problem-list code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(62, 207, 207, 0.08);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.problem-note {
  text-align: center;
  font-size: 18px;
  color: var(--text-secondary);
  margin-top: 52px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

/* ============================================================
   HOW IT WORKS
============================================================ */
.how-section {
  border-top: 1px solid var(--bg-border);
}

.how-section .section-headline {
  margin-bottom: 52px;
}

.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-card {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

.step-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-right {
  min-width: 0;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  line-height: 1;
  user-select: none;
}

.step-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.step-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.step-desc code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(62, 207, 207, 0.08);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ============================================================
   FEATURES
============================================================ */
.features-section {
  border-top: 1px solid var(--bg-border);
}

.features-section .section-headline {
  margin-bottom: 52px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--bg-border);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.feature-card {
  background: var(--bg-elevated);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background var(--transition-base);
}

.feature-card:hover {
  background: #171D24;
}

.feature-icon {
  color: var(--accent);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.feature-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.feature-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================
   KNOWLEDGE MODEL
============================================================ */
.knowledge-section {
  border-top: 1px solid var(--bg-border);
}

.knowledge-section .section-headline {
  margin-bottom: 12px;
}

/* Desktop table */
.knowledge-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.knowledge-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.knowledge-table thead tr {
  border-bottom: 1px solid var(--bg-border);
}

.knowledge-table th {
  text-align: left;
  padding: 13px 22px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.knowledge-table tbody tr {
  border-bottom: 1px solid var(--bg-border);
  transition: background var(--transition-base);
}

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

.knowledge-table tbody tr:hover {
  background: rgba(62, 207, 207, 0.025);
}

.knowledge-table td {
  padding: 13px 22px;
  color: var(--text-secondary);
  line-height: 1.45;
  vertical-align: middle;
}

.knowledge-table td:nth-child(2) {
  color: var(--text-primary);
  font-size: 14px;
}

/* Type badge */
.type-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(62, 207, 207, 0.09);
  border: 1px solid rgba(62, 207, 207, 0.18);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  white-space: nowrap;
  line-height: 1.6;
}

/* Scope code */
.scope-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
}

/* Confidence score */
.conf {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.conf--perfect { color: var(--success); }
.conf--high    { color: var(--accent); }
.conf--low     { color: var(--warning); }

/* Mobile card list — hidden by default */
.knowledge-cards {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.k-card {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.k-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.k-card-title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
}

.k-card-scope {
  font-size: 12px;
}

/* ============================================================
   SOURCE ROUTING SECTION
============================================================ */
.routing-section {
  border-top: 1px solid var(--bg-border);
}

/* Connectors grid */
.connectors-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.connector-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-width: 200px;
  transition: border-color var(--transition-base);
}

.connector-card--live {
  border-color: rgba(62, 207, 207, 0.15);
}

.connector-card--live:hover {
  border-color: rgba(62, 207, 207, 0.35);
}

.connector-card--soon {
  opacity: 0.5;
}

.connector-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 15px;
}

.connector-mark--notion {
  background: #fff;
  color: #191919;
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
}

.connector-mark--mcp {
  background: rgba(62, 207, 207, 0.1);
  color: var(--accent);
  border: 1px solid rgba(62, 207, 207, 0.2);
}

.connector-mark--soon {
  background: var(--bg-border);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.connector-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.connector-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.connector-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.connector-badge--live {
  color: var(--success);
}

.connector-badge--soon {
  color: var(--text-muted);
}

/* Routing flow */
.routing-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.routing-flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  min-width: 160px;
  text-align: center;
}

.routing-flow-node--center {
  border-color: rgba(62, 207, 207, 0.25);
  background: rgba(62, 207, 207, 0.04);
}

.routing-flow-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.routing-flow-icon--accent {
  background: rgba(62, 207, 207, 0.12);
  border: 1px solid rgba(62, 207, 207, 0.25);
  color: var(--accent);
}

.routing-flow-k {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}

.routing-flow-label {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 120px;
}

.routing-flow-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Schema details toggle */
.routing-details {
  margin-bottom: 0;
}

.routing-details-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding: 10px 0;
  user-select: none;
  transition: color var(--transition-base);
  margin-bottom: 0;
}

.routing-details-summary::-webkit-details-marker {
  display: none;
}

.routing-details-summary:hover {
  color: var(--text-secondary);
}

details[open] .routing-details-chevron {
  transform: rotate(180deg);
}

.routing-details-chevron {
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.routing-details-body {
  padding-top: 32px;
}

/* Shared call block (inside toggle) */
.routing-call-wrap {
  max-width: 680px;
  margin: 0 auto 0;
}

.routing-call-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.routing-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  gap: 0;
}

.routing-connector-line {
  width: 1px;
  height: 28px;
  background: var(--bg-border);
}

.routing-connector-fork {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.routing-fork-sep {
  color: var(--text-muted);
}

.routing-fork-label--local {
  color: var(--success);
}

.routing-fork-label--route {
  color: var(--accent);
}

.routing-responses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.routing-response {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.routing-response--local {
  border-top: 3px solid var(--success);
}

.routing-response--route {
  border-top: 3px solid var(--accent);
}

.routing-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--bg-border);
}

.routing-mode-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.routing-mode-badge--local {
  color: var(--success);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.routing-mode-badge--route {
  color: var(--accent);
  background: rgba(62, 207, 207, 0.09);
  border: 1px solid rgba(62, 207, 207, 0.18);
}

.routing-response-source {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.routing-response .code-block {
  border: none;
  border-radius: 0;
  background: transparent;
}

.routing-callouts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--bg-border);
}

.routing-callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.routing-callout-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 5px;
}

.routing-callout-dot--success {
  background: var(--success);
}

.routing-callout-dot--accent {
  background: var(--accent);
}

.routing-connect {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 48px;
}

.routing-connect-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.routing-connect .code-block-wrap {
  max-width: 380px;
  width: 100%;
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(62, 207, 207, 0.08);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.feature-desc code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(62, 207, 207, 0.08);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ============================================================
   PROMPT EXAMPLES
============================================================ */
.prompts-section {
  border-top: 1px solid var(--bg-border);
}

.prompt-bubbles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
}

.prompt-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  text-align: left;
  transition: box-shadow var(--transition-base);
}

.prompt-bubble:hover {
  box-shadow: 0 4px 24px rgba(62, 207, 207, 0.08);
}

.prompt-bubble-tag {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.prompt-bubble-text {
  font-size: 15px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
}

/* ============================================================
   CLIENT TABS (step 02 + anywhere reused)
============================================================ */
.client-tabs-group {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--bg-border);
}

.client-tabs {
  display: flex;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--bg-border);
}

.client-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-base), border-color var(--transition-base);
  margin-bottom: -1px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.client-tab:hover {
  color: var(--text-secondary);
}

.client-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panels {
  background: var(--bg-primary);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* Remove double borders when code-block-wrap is inside a tab */
.tab-panel .code-block-wrap {
  margin: 0;
}

.tab-panel .code-block {
  border: none;
  border-radius: 0;
  background: transparent;
}

.tab-panel .copy-btn {
  top: 12px;
  right: 12px;
}

/* ============================================================
   TEAM SECTION — activity feed
============================================================ */
.team-section {
  border-top: 1px solid var(--bg-border);
}

.team-section .section-subheadline {
  max-width: 660px;
}

.activity-feed {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
}

.activity-entry {
  display: grid;
  grid-template-columns: 28px 150px 52px auto 1fr auto 64px;
  align-items: center;
  gap: 12px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--bg-border);
  transition: background var(--transition-base);
}

.activity-entry:last-child {
  border-bottom: none;
}

.activity-entry:hover {
  background: rgba(255, 255, 255, 0.015);
}

.activity-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.activity-avatar--a { background: rgba(62, 207, 207, 0.18);  color: var(--accent); }
.activity-avatar--b { background: rgba(155, 89, 182, 0.18);  color: #b47ee8; }
.activity-avatar--c { background: rgba(251, 191, 36, 0.15);  color: #FBBF24; }

.activity-agent {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-client {
  font-weight: 400;
  color: var(--text-muted);
}

.activity-verb {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.activity-verb--stored { color: var(--success); }
.activity-verb--read   { color: var(--text-muted); }

.activity-title {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-scope {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.activity-time {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}

/* ============================================================
   FINAL CTA
============================================================ */
.cta-section {
  border-top: 1px solid var(--bg-border);
  text-align: center;
}

.cta-headline {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 16px;
}

.cta-subheadline {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.cta-install-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.cta-install-row .install-block {
  max-width: 480px;
  width: 100%;
}

.cta-then {
  font-size: 14px;
  color: var(--text-muted);
}

.cta-scroll-link {
  color: var(--accent);
  text-decoration: none;
}

.cta-scroll-link:hover {
  text-decoration: underline;
}

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

/* ============================================================
   FOOTER
============================================================ */
.footer {
  border-top: 1px solid var(--bg-border);
  padding: 48px 0;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 28px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition-base);
}

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

/* ============================================================
   RESPONSIVE — TABLET  (≤ 1024px)
============================================================ */
@media (max-width: 1024px) {
  :root {
    --section-gap: 88px;
  }

  /* Features drop from 3 to 2 columns */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Step cards collapse to single column */
  .step-card {
    grid-template-columns: 1fr;
    padding: 36px 28px;
  }

  /* Activity feed — hide scope column */
  .activity-scope {
    display: none;
  }

  .activity-entry {
    grid-template-columns: 28px 130px 52px auto 1fr 64px;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE  (≤ 768px)
============================================================ */
@media (max-width: 768px) {
  :root {
    --section-gap: 64px;
  }

  /* Nav */
  .nav-install-badge {
    display: none;
  }

  /* Hero */
  .hero {
    padding-top: 100px;
    padding-bottom: 72px;
  }

  .hero-subheadline {
    font-size: 17px;
  }

  .install-block {
    max-width: 100%;
  }

  /* Problem grid — stack */
  .problem-grid {
    grid-template-columns: 1fr;
  }

  /* Features — single column */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* Knowledge — hide table, show cards */
  .knowledge-table-wrap {
    display: none;
  }

  .knowledge-cards {
    display: flex;
  }

  /* Section subheadline */
  .section-subheadline {
    font-size: 16px;
    margin-bottom: 36px;
  }

  /* Code blocks */
  .code-block {
    font-size: 13px;
    padding: 16px 44px 16px 16px;
  }

  /* Prompt bubbles — single column */
  .prompt-bubbles {
    grid-template-columns: 1fr;
  }

  /* Activity feed — stack entries on mobile */
  .activity-entry {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 12px 16px;
  }

  .activity-agent { font-size: 12px; flex: 1 1 120px; }
  .activity-client { display: none; }
  .activity-verb { order: 2; }
  .activity-title { order: 3; flex-basis: 100%; padding-left: 32px; font-size: 12px; white-space: normal; }
  .activity-scope { display: none; }
  .activity-time { order: 2; margin-left: auto; }

  /* Source routing — stack to single column */
  .routing-responses {
    grid-template-columns: 1fr;
  }

  /* Connectors — stack */
  .connector-card {
    min-width: 0;
    width: 100%;
  }

  /* Routing flow — stack vertically */
  .routing-flow {
    flex-direction: column;
  }

  .routing-flow-node {
    width: 100%;
    flex-direction: row;
    text-align: left;
    padding: 14px 18px;
    min-width: 0;
  }

  .routing-flow-label {
    max-width: none;
  }

  .routing-flow-arrow {
    transform: rotate(90deg);
  }

  /* Client tabs — wrap on mobile */
  .client-tab {
    padding: 8px 12px;
    font-size: 11px;
  }

  /* CTA */
  .cta-install-row .install-block {
    max-width: 100%;
  }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE  (≤ 480px)
============================================================ */
@media (max-width: 480px) {
  .nav-right {
    gap: 12px;
  }

  .problem-col {
    padding: 22px 18px;
  }

  .feature-card {
    padding: 24px 20px;
  }

  .hero-badges {
    gap: 6px;
  }

  .badge {
    font-size: 11px;
    padding: 3px 10px;
  }

  .section-headline {
    font-size: clamp(22px, 6vw, 32px);
  }

  .problem-note {
    font-size: 16px;
  }
}

/* ============================================================
   FOCUS — ACCESSIBILITY
============================================================ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   SCROLLBAR — minimal styling
============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-border);
  border-radius: 4px;
}

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

/* ============================================================
   TEXT SELECTION
============================================================ */
::selection {
  background: rgba(62, 207, 207, 0.18);
  color: var(--text-primary);
}

/* ============================================================
   REDUCED MOTION
============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================================
   GSAP — prevent FOUC on animated hero elements
============================================================ */
.hero-headline,
.hero-subheadline,
.hero-badges,
.hero .install-block,
.hero-gh-link {
  will-change: transform, opacity;
}
