/**
 * Shared shell for /docs/* static pages — aligned with docs.html / landing brand tokens.
 *
 * Brand colors: --docs-primary uses the design-system primary (#5851b8),
 * NOT indigo (#6366f1) which is explicitly forbidden in CLAUDE.md.
 * Gradient mirrors --brand-gradient (rose → purple) from tokens.css.
 */
:root {
  --docs-bg: #fafafa;
  --docs-surface: #ffffff;
  --docs-text: #18181b;
  --docs-text-secondary: #52525b;
  --docs-text-muted: #a1a1aa;
  --docs-border: #e4e4e7;
  /* Primary: matches --primary-color from design tokens (bright mode) */
  --docs-primary: #5851b8;
  --docs-primary-hover: #4a43a0;
  /* Accent: brand rose */
  --docs-accent: #d4537e;
  /* Gradient: mirrors --brand-gradient (purple → rose) */
  --docs-gradient: linear-gradient(135deg, #5851b8 0%, #8b5cf6 50%, #d4537e 100%);
  --docs-radius: 12px;
  --docs-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --docs-header-h: 64px;
  /* Aliases used by HTML inline styles */
  --docs-muted: #a1a1aa;
  --docs-code-bg: #0b1020;
}

body.docs-shell.dark {
  --docs-bg: #0f172a;
  --docs-surface: #1e293b;
  --docs-text: #f1f5f9;
  --docs-text-secondary: #94a3b8;
  --docs-text-muted: #64748b;
  --docs-border: #334155;
  --docs-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --docs-muted: #64748b;
}

* {
  box-sizing: border-box;
}

body.docs-shell {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--docs-text);
  background: var(--docs-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle page background (matches marketing glow) */
body.docs-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(88, 81, 184, 0.12), transparent 55%);
  z-index: 0;
}

body.docs-shell.dark::before {
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(88, 81, 184, 0.18), transparent 55%);
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--docs-header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--docs-border);
  background: color-mix(in srgb, var(--docs-surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.docs-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.docs-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.docs-brand-text {
  font-family: Sora, sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  background: var(--docs-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.docs-brand-sub {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--docs-text-secondary);
  -webkit-text-fill-color: var(--docs-text-secondary);
  margin-left: 2px;
}

.docs-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.docs-nav a {
  color: var(--docs-text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.docs-nav a:hover {
  color: var(--docs-primary);
}

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

.docs-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.docs-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--docs-text-secondary);
  background: transparent;
  border: 1px solid var(--docs-border);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.docs-btn-ghost:hover {
  border-color: var(--docs-primary);
  color: var(--docs-primary);
}

.docs-btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--docs-gradient);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(88, 81, 184, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.docs-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(88, 81, 184, 0.45);
}

main.docs-main {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  width: 100%;
}

.docs-hero-title {
  font-family: Sora, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.2;
}

.docs-lead {
  font-size: 1.0625rem;
  color: var(--docs-text-secondary);
  max-width: 640px;
  margin: 0 0 32px;
}

.docs-card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.docs-card {
  display: block;
  padding: 24px;
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--docs-shadow);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.docs-card:hover {
  border-color: var(--docs-primary);
  transform: translateY(-2px);
}

.docs-card h2 {
  font-family: Sora, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--docs-text);
}

.docs-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--docs-text-secondary);
}

.docs-section-title {
  font-family: Sora, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 36px 0 16px;
}

.docs-hint {
  padding: 16px 20px;
  border-radius: var(--docs-radius);
  border-left: 4px solid var(--docs-primary);
  background: color-mix(in srgb, var(--docs-primary) 8%, var(--docs-surface));
  color: var(--docs-text-secondary);
  font-size: 0.9375rem;
  margin-top: 24px;
}

body.docs-shell.dark .docs-hint {
  background: color-mix(in srgb, var(--docs-primary) 15%, var(--docs-surface));
}

.docs-code-block {
  margin: 16px 0;
  padding: 18px 20px;
  border-radius: var(--docs-radius);
  background: #0b1020;
  color: #e5e7eb;
  overflow-x: auto;
  border: 1px solid var(--docs-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
}

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

.docs-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid var(--docs-border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--docs-text-muted);
}

.docs-footer a {
  color: var(--docs-text-secondary);
  text-decoration: none;
  margin: 0 12px;
}

.docs-footer a:hover {
  color: var(--docs-primary);
}

.docs-back-row {
  margin-bottom: 24px;
}

.docs-back-row a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--docs-primary);
  text-decoration: none;
}

.docs-back-row a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .docs-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .docs-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid var(--docs-border);
  }
}

/* Theme toggle SVG icon visibility */
#docsThemeToggle .icon-moon { display: none; }
body.dark #docsThemeToggle { color: var(--text-color, #fff); }
body.dark #docsThemeToggle .icon-sun { display: none; }
body.dark #docsThemeToggle .icon-moon { display: block; }

/* ── Semantic color utilities ─────────────────────────────────────────── */
/* Avoids hardcoded hex colors in HTML for boolean table indicators       */
.docs-color-success { color: #22c55e; }
.docs-color-danger  { color: #ef4444; }

/* Step number circle for multi-step install guides */
.docs-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--docs-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
}

/* Featured workflow highlight box — uses brand token colours */
.docs-highlight-box {
  background: color-mix(in srgb, var(--docs-primary) 8%, var(--docs-surface));
  border: 1px solid color-mix(in srgb, var(--docs-primary) 30%, transparent);
  border-radius: var(--docs-radius);
  padding: 20px 24px;
  margin-bottom: 2rem;
}

body.docs-shell.dark .docs-highlight-box {
  background: color-mix(in srgb, var(--docs-primary) 15%, var(--docs-surface));
}

/* AI install prompt box (dark bg, amber accent) */
.docs-ai-prompt {
  position: relative;
  background: #0f172a;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--docs-radius);
  padding: 20px 24px;
  margin-bottom: 2rem;
}

.docs-ai-prompt-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-ai-prompt pre {
  white-space: pre-wrap;
  word-break: break-word;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.8;
  margin: 0;
  font-family: inherit;
}

/* Tables — replaces most inline table styles */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  overflow-x: auto;
}

.docs-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--docs-text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--docs-border);
}

.docs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--docs-border);
}

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