/* ============================================
   soniqo.audio — Documentation Styles
   ============================================ */

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

/* --- Theme Variables ---
 * Tokens mirror the Next.js marketing surface (usecase/app/globals.css)
 * so the two surfaces share the same warm/orange-tinted palette. Anything
 * customised for the docs (sidebar background, code block) is derived from
 * those base tokens. */
:root {
  /* Light theme (default) — warm near-white, deep warm charcoal */
  --bg-primary: hsl(32 50% 99%);
  --bg-secondary: hsl(30 30% 96%);
  /* Sidebar shares the body plane (one consistent surface, like marketing). */
  --bg-sidebar: hsl(32 50% 99%);
  --bg-code: hsl(30 20% 94%);
  --bg-code-block: hsl(24 10% 12%);
  --bg-card: #ffffff;
  --bg-card-hover: hsl(30 30% 96%);
  --border: hsl(28 18% 90%);
  --border-light: hsl(28 18% 94%);
  --text-primary: hsl(24 12% 14%);
  --text-secondary: hsl(24 6% 40%);
  --text-muted: hsl(24 6% 55%);
  --text-code: #c44a07;
  --text-inverse: #ffffff;
  --accent: #e8610c;
  --accent-hover: #d35500;
  --accent-subtle: rgba(232, 97, 12, 0.08);
  --accent-border: rgba(232, 97, 12, 0.25);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  /* Radius + header height aligned with marketing (12px / 56px). */
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-width: 260px;
  --header-height: 56px;
}

[data-theme="dark"] {
  --bg-primary: hsl(24 10% 7%);
  --bg-secondary: hsl(24 8% 11%);
  /* Sidebar shares the body plane (matches the marketing surface where
   * the page is one consistent background); divider on the right is the
   * only thing separating it from the content area. */
  --bg-sidebar: hsl(24 10% 7%);
  --bg-code: hsl(24 8% 14%);
  --bg-code-block: hsl(24 10% 5%);
  --bg-card: hsl(24 10% 9%);
  --bg-card-hover: hsl(24 8% 14%);
  --border: hsl(24 8% 18%);
  --border-light: hsl(24 8% 14%);
  --text-primary: hsl(30 25% 96%);
  --text-secondary: hsl(28 12% 75%);
  --text-muted: hsl(28 8% 55%);
  --text-code: #f5a35c;
  --text-inverse: hsl(24 12% 10%);
  --accent: #f08030;
  --accent-hover: #f59050;
  --accent-subtle: rgba(240, 128, 48, 0.1);
  --accent-border: rgba(240, 128, 48, 0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

/* --- Typography --- */
body {
  /* Mirror marketing's Tailwind font stack so glyph widths match. */
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui,
    'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'rlig' 1, 'calt' 1, 'ss01' 1;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.7rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.3rem; margin-top: 2rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--accent-hover); }

code {
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--bg-code);
  color: var(--text-code);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--bg-code-block);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  position: relative;
}

pre code {
  background: none;
  color: #abb2bf;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Layout ---
 * Header mirrors the marketing surface: translucent bg with backdrop-blur,
 * 56px height, subtle bottom border. Inner content is clamped to the same
 * 1360px container width as the marketing `.container`, so the logo /
 * nav / icons sit at the same horizontal positions on both surfaces. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: color-mix(in srgb, var(--bg-primary) 80%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Marketing `.container` (measured via Playwright at viewport 1440):
   * max-width: 1360px · margin: 0 auto (40px on each side) · padding:
   * 1rem (16px). So content actually starts at 56px on a 1440 viewport.
   * Replicate by clamping padding to the centring offset plus 1rem. */
  padding-left: max(1rem, calc((100vw - 1360px) / 2 + 1rem));
  padding-right: max(1rem, calc((100vw - 1360px) / 2 + 1rem));
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (background: color-mix(in srgb, white 50%, transparent)) {
  .site-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
  }
}

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

.header-logo {
  /* 28×28 to match marketing's h-7 w-7 = 1.75rem */
  height: 28px;
  width: 28px;
  border-radius: 6px;
}

.header-title {
  /* Match marketing logo span: text-base font-semibold tracking-tight */
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.header-title span {
  color: var(--text-muted);
  font-weight: 400;
}

/* New 3-column header layout (injected by scripts/docs-header-3col.mjs):
 *   .header-left   logo + mobile hamburger
 *   .header-nav    nav links + bullet divider  (centered between sides)
 *   .header-icons  GitHub · lang-switcher · theme-toggle  (right edge)
 * Matches the Next.js marketing surface byte-for-byte. */
.site-header { gap: 1rem; }
.header-nav,
.header-right /* legacy fallback, kept for any unmigrated page */ {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.header-icons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
/* Icon-button treatment to mirror the marketing chrome:
 *   p-2 (0.5rem padding) · rounded-md (0.375rem) · borderless ·
 *   text-foreground/70 at rest, full text-foreground on hover. */
.header-icons a,
.header-icons .lang-toggle,
.header-icons .theme-toggle {
  background: none !important;
  border: none !important;
  height: auto;
  width: auto;
  padding: 0.5rem !important;
  border-radius: 0.375rem !important;
  color: color-mix(in srgb, var(--text-primary) 70%, transparent) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.header-icons a:hover,
.header-icons .lang-toggle:hover,
.header-icons .theme-toggle:hover {
  color: var(--text-primary) !important;
  background-color: color-mix(in srgb, var(--accent) 8%, transparent) !important;
}
/* Match the marketing icon sizes precisely:
 *   GitHub : h-5 w-5 (20px)
 *   Globe  : h-4 w-4 (16px)   ← inside the lang-toggle
 *   Sun/Moon: h-5 w-5 (20px)  ← inside the theme-toggle */
.header-icons svg {
  width: 20px;
  height: 20px;
}
.header-icons .lang-toggle svg {
  width: 16px;
  height: 16px;
}
.header-icons .lang-toggle {
  height: auto !important;
  gap: 0.25rem !important;
  font-weight: 600 !important;
}
.header-icons .theme-toggle {
  height: auto !important;
  width: auto !important;
}
.header-icons .lang-toggle-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
/* The lang-switcher is a wrapper, not the button — strip its layout so it
 * doesn't introduce extra padding/borders around the actual button. */
.header-icons .lang-switcher {
  display: flex;
  align-items: center;
}

.header-link {
  color: color-mix(in srgb, var(--text-primary) 85%, transparent);
  font-size: 0.95rem;
  font-weight: 400;
  transition: color 0.15s;
}
.header-link:hover { color: var(--accent); }

/* "Get started" is the first link after the bullet divider in our nav.
 * Marketing renders it with `font-medium` (500) to flag it as the
 * primary entry point — mirror that here. */
.header-nav .header-divider + .header-link {
  font-weight: 500;
  color: var(--text-primary);
}
/* The GitHub icon-link inherits .header-link but should look like an icon
 * button (not a text link) — keep colour neutral, no underline shift. */
.header-right a[href^="https://github.com/soniqo"] {
  color: color-mix(in srgb, var(--text-primary) 70%, transparent);
  padding: 0.5rem;
  border-radius: 0.5rem;
}
.header-right a[href^="https://github.com/soniqo"]:hover {
  color: var(--text-primary);
  background-color: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Header platform groups */
.header-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.header-right a.header-group-label,
.header-right a.header-group-label:hover,
.header-right a.header-group-label:visited {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
}
.header-group-label::after {
  content: ":";
  margin-left: 0.1rem;
}

.header-divider {
  /* Inherit font-size from .header-nav (0.95rem) and rely on flex gap
   * for spacing — exactly how marketing's bullet divider is rendered. */
  color: color-mix(in srgb, var(--text-muted) 40%, transparent);
}
.header-group .header-link {
  font-size: 0.8rem;
}
.header-group + .header-group {
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}

/* Language switcher */
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
}
.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 36px;
  padding: 0 0.55rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.lang-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.lang-toggle svg {
  width: 16px;
  height: 16px;
}
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 0.35rem;
  margin: 0;
  z-index: 200;
}
.lang-menu[hidden] {
  display: none;
}
.lang-menu li {
  list-style: none;
}
.lang-menu a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.1s;
}
.lang-menu a:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}
.lang-menu a[aria-current="true"] {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-subtle);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.theme-toggle svg { width: 20px; height: 20px; }
/* Default (light): show moon, hide sun. Dark theme rule MUST come after
 * the :root rule because both have equal specificity (1,0,0) — source
 * order is what flips them. */
:root .icon-sun { display: none; }
:root .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.menu-toggle svg { width: 18px; height: 18px; }

/* --- Sidebar — transparent so the warm aurora + spotlight backdrop
 * (`.docs-ambient`, fixed at z-index -1) bleeds through the same way it
 * does behind the main content. Soft right-edge divider only. */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: transparent;
  border-right: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  overflow-y: auto;
  padding: 1.5rem 0;
  z-index: 50;
  transition: transform 0.25s ease;
}

/* Sidebar styled to match shadcn `Sidebar` primitive + a magicui touch
 * (subtle accent dot on the active row). Pill-shaped hover & active
 * states, tighter typography, consistent vertical rhythm. */
.sidebar-section {
  padding: 0 0.75rem;
  margin-bottom: 1.25rem;
}

.sidebar-heading {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  padding: 0 0.5rem;
}
.sidebar-subheading {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.9rem;
  margin-bottom: 0.25rem;
  padding: 0 0.5rem;
  opacity: 0.8;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav a {
  position: relative;
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  color: color-mix(in srgb, var(--text-primary) 75%, transparent);
  font-size: 0.92rem;
  font-weight: 400;
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.sidebar-nav a:hover {
  background-color: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text-primary);
}

.sidebar-nav a.active {
  background-color: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-weight: 600;
}
/* magicui touch: a small accent dot at the left edge of the active row
 * — softer than the previous 2px border, lighter visual weight. */
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: -0.15rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.content-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* --- Landing Page --- */
.landing {
  margin-left: 0;
}

/* Hero */
.hero-compact {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 2rem 0;
}

.hero-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.hero-row h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

.hero-row .btn {
  flex-shrink: 0;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.hero-install {
  position: relative;
  flex: 1;
  min-width: 0;
}

.hero-install pre {
  margin-bottom: 0;
  padding: 0.5rem 2.2rem 0.5rem 0.85rem;
}

.hero-install code {
  font-size: 0.95rem;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  line-height: 1.2;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--text-inverse);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Discord brand blurple — distinguishes from the orange primary CTAs. */
.btn-discord {
  background: #5865F2;
  color: #ffffff;
  border: 1px solid #5865F2;
}
.btn-discord:hover {
  background: #4752c4;
  border-color: #4752c4;
  color: #ffffff;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.copy-btn:hover { color: #abb2bf; }
.copy-btn svg { width: 16px; height: 16px; }

/* Two-column body: features (left) + sidebar (right) */
.home-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

.home-main {
  min-width: 0;
}

/* Grid sections with labels */
.grid-section {
  margin-bottom: 1.25rem;
}

.grid-section:last-child {
  margin-bottom: 0;
}

.grid-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.15rem;
}

/* Feature grid — compact 2-col */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  transition: all 0.15s;
  text-decoration: none;
  display: block;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* Category left-border colors */
.feature-card.cat-stt { border-left-color: #3b82f6; }
.feature-card.cat-stt:hover { border-left-color: #3b82f6; }
.feature-card.cat-tts { border-left-color: #8b5cf6; }
.feature-card.cat-tts:hover { border-left-color: #8b5cf6; }
.feature-card.cat-s2s { border-left-color: var(--accent); }
.feature-card.cat-s2s:hover { border-left-color: var(--accent); }
.feature-card.cat-llm { border-left-color: #10b981; }
.feature-card.cat-llm:hover { border-left-color: #10b981; }
.feature-card.cat-analysis { border-left-color: #10b981; }
.feature-card.cat-analysis:hover { border-left-color: #10b981; }
.feature-card.cat-android { border-left-color: #34a853; }
.feature-card.cat-android:hover { border-left-color: #34a853; }

.feature-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.5;
}

.feature-card .tag {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--accent-subtle);
  color: var(--accent);
  margin-top: 0.4rem;
  margin-right: 0.25rem;
}

/* Platform tabs */
.platform-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.platform-tabs button {
  background: none;
  border: none;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.platform-tabs button:hover {
  color: var(--text);
}
.platform-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Sidebar blocks */
.home-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
}

.sidebar-block-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sidebar-block-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar-block-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
}
.sidebar-block-link:hover { color: var(--accent-hover); }

.sidebar-block-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Blog list (sidebar) */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.blog-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.1s;
}

.blog-item:hover {
  background: var(--accent-subtle);
}

.blog-item-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.blog-item:hover .blog-item-title {
  color: var(--accent);
}

.blog-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Performance list (sidebar) */
.perf-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.perf-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.perf-row-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 3.5rem;
}

.perf-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.perf-row-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.perf-row-detail {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- Landing sections (Privacy, Architecture, Roadmap) --- */
.landing-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.landing-container {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.landing-section h2 {
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.section-lead {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.section-lead code {
  font-size: 0.8em;
}

.section-lead a {
  font-weight: 500;
}

/* Architecture grid */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.arch-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.arch-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.arch-list li {
  font-size: 0.8rem;
  color: var(--text-primary);
  padding: 0.2rem 0;
}

.arch-list li.arch-soon {
  color: var(--text-muted);
}

.arch-list li.arch-soon::after {
  content: " (soon)";
  font-size: 0.65rem;
  font-style: italic;
}

.arch-tag {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  background: var(--accent-subtle);
  color: var(--accent);
  vertical-align: middle;
}

/* Roadmap */
.roadmap-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.roadmap-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.roadmap-version {
  font-weight: 500;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
}

.roadmap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.roadmap-list li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.45;
}

.roadmap-done::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: 700;
  font-size: 0.75rem;
}

.roadmap-wip::before {
  content: "\25CB";
  position: absolute;
  left: 0.1rem;
  color: var(--accent);
  font-size: 0.7rem;
}

.roadmap-list code {
  font-size: 0.75em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

th, td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
}

/* --- Callouts --- */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-subtle);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5rem;
}

.callout p { margin-bottom: 0; color: var(--text-primary); }

.callout-title {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

/* --- Copy button on code blocks --- */
.code-block {
  position: relative;
}

.code-block .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    margin-left: 0;
  }

  .content-container {
    padding: 1.5rem 1rem 3rem;
  }

  .hero-compact {
    padding: 1.25rem 1rem 0;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .hero-right {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-dropdown,
  .header-link:not(:first-child):not(:last-child) {
    display: none;
  }

  .lang-toggle {
    padding: 0 0.4rem;
    font-size: 0.7rem;
  }

  .home-body {
    grid-template-columns: 1fr;
    padding: 1rem 1rem 2rem;
  }

  .home-sidebar {
    position: static;
  }

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

  .landing-section {
    padding: 0 1rem;
  }

  .arch-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .roadmap-cols {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-install pre {
    overflow-x: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * shadcn-aligned polish layer
 *
 * Lives at the end of the file so it overrides earlier rules without
 * touching the original markup. Pulls visual primitives from the Next.js
 * marketing surface (usecase/app/globals.css + components/ui/*) into the
 * static-HTML docs: focus-visible rings, smoother transitions, consistent
 * card/button shapes, sidebar-nav pill hovers, refined code blocks.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Selection — warm primary tint, matches marketing ::selection */
::selection {
  background-color: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--text-primary);
}

/* Universal focus-visible — keyboard users get a clear, on-brand ring.
 * Mouse users see no ring (browser default :focus is suppressed). */
*:focus { outline: none; }
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.btn:focus-visible,
.header-link:focus-visible,
.sidebar-nav a:focus-visible,
.feature-card:focus-visible,
.copy-btn:focus-visible,
.theme-toggle:focus-visible,
.menu-toggle:focus-visible,
.lang-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Smoother global transitions on interactive elements — 150ms cubic-bezier
 * matches shadcn's `transition-colors` default. */
.btn,
.header-link,
.feature-card,
.sidebar-nav a,
.callout,
.copy-btn,
.lang-menu a,
.theme-toggle,
.menu-toggle {
  transition: background-color 0.15s ease-out, color 0.15s ease-out,
    border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}

/* Sidebar nav — pill hover treatment matching shadcn `bg-accent/40`. */
.sidebar-nav a {
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  margin: 0 -0.3rem;
}
.sidebar-nav a:hover {
  background-color: var(--accent-subtle);
  color: var(--text-primary);
}
.sidebar-nav a.active {
  background-color: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

/* Buttons — match the shadcn primary primitive: subtle hover, focus ring
 * already handled above. */
.btn-primary {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.btn-primary:hover {
  background: var(--accent);
  opacity: 0.92;
  color: var(--text-inverse);
}
.btn-secondary {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

/* Feature cards — softer border, consistent shadow on hover, matches the
 * marketing `<UseCaseCard />` aesthetic. */
.feature-card {
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-left-width: 3px;
}
.feature-card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: var(--shadow-md);
}

/* Callout — refined left-bar shape, shadcn-style padding, larger radius. */
.callout {
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
}

/* Code blocks — subtle border, shadcn-`bg-muted` aesthetic in light mode,
 * keeps the existing dark code surface in dark mode. */
pre {
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.code-block .copy-btn {
  opacity: 0.6;
}
.code-block:hover .copy-btn {
  opacity: 1;
}

/* Tables — shadcn `<table>` primitive wrapped in a card. Without an
 * available wrapper element, we get the rounded card look via
 * `border-collapse: separate` + `overflow: hidden` + radius on the
 * table itself. The thead lights up with a muted bg so it reads as a
 * header strip; rows get subtle dividers. */
table {
  width: 100%;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table th,
table td {
  padding: 0.7rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-light);
}
table thead th {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
table tbody tr:last-child td,
table tbody tr:last-child th {
  border-bottom: none;
}
table tbody tr:hover td {
  background-color: color-mix(in srgb, var(--accent) 4%, transparent);
}
/* Code inside cells should stay inline — never become a block. */
table code {
  font-size: 0.875em;
  white-space: nowrap;
}

/* Inline link affordance — underline-on-hover, never visited-purple. */
.content-container p a,
.callout a {
  border-radius: 2px;
}
.content-container p a:hover,
.callout a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tag chip — matches shadcn `Badge` variant="muted". */
.feature-card .tag,
.arch-tag {
  font-size: 0.6rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

/* Footer — match marketing's subtle bg + top border. */
.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-secondary) 60%, transparent);
}

/* Header eyebrow labels (Apple:, Android:) — soften so the line reads as
 * a single group, not three competing sections. */
.header-right a.header-group-label,
.header-right a.header-group-label:hover,
.header-right a.header-group-label:visited {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.7;
}
.header-right a.header-group-label:hover {
  opacity: 1;
  color: var(--text-primary);
}

/* ─── Ambient backdrop (spotlight + aurora) ─────────────────────────────
 * Mirrors the marketing surface's hero ambient layers. Lives behind the
 * page chrome at z-index 0 with pointer-events:none. The actual content
 * sits above thanks to z-index:1 on .main-content and .site-header. */
.docs-ambient {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  pointer-events: none;
  /* -1 puts the layer behind document flow content (which has z-index
   * auto); z-index 0 would sit ABOVE static content and hide it. */
  z-index: -1;
  overflow: hidden;
}
.docs-ambient .hero-spotlight {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 50%),
    radial-gradient(circle at 75% 30%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 45%);
}
.docs-ambient .hero-aurora {
  position: absolute;
  inset: 0;
}
.docs-ambient .hero-aurora::before,
.docs-ambient .hero-aurora::after {
  content: '';
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 720px;
  max-height: 720px;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.35;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--accent) 55%, transparent),
    transparent 60%
  );
}
.docs-ambient .hero-aurora::before {
  top: -20%;
  left: -10%;
  animation: docs-aurora-drift-a 22s ease-in-out infinite;
}
.docs-ambient .hero-aurora::after {
  top: 10%;
  right: -15%;
  opacity: 0.25;
  animation: docs-aurora-drift-b 28s ease-in-out infinite;
}
[data-theme="dark"] .docs-ambient .hero-aurora::before,
[data-theme="dark"] .docs-ambient .hero-aurora::after {
  opacity: 0.18;
}
@keyframes docs-aurora-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(12%, 8%, 0) scale(1.15); }
}
@keyframes docs-aurora-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.1); }
  50%      { transform: translate3d(-10%, -6%, 0) scale(0.95); }
}
@media (prefers-reduced-motion: reduce) {
  .docs-ambient .hero-aurora::before,
  .docs-ambient .hero-aurora::after { animation: none; }
}
/* Make sure header + content stack above the ambient. The sidebar keeps
 * its own `position: fixed` from earlier in the file; we only bump its
 * stacking, not its positioning. */
.site-header { z-index: 100; }
.sidebar { z-index: 50; }
.main-content { position: relative; z-index: 1; }

/* Reduced-motion: kill transitions globally. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ─── RTL support (Arabic) ───────────────────────────────────────────────
 * Only the directional layout primitives need explicit overrides — the
 * rest of the design is already symmetric. Code blocks, CLI commands,
 * model names, file paths, and numerals stay LTR even on RTL pages
 * because their content is English and reads left-to-right.            */

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border);
}

[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

@media (max-width: 900px) {
  [dir="rtl"] .main-content { margin-right: 0; }
}

[dir="rtl"] .sidebar-nav a.active::before {
  left: auto;
  right: -0.15rem;
}

/* Keep code blocks, CLI commands, and inline code anchored LTR. */
[dir="rtl"] code,
[dir="rtl"] pre,
[dir="rtl"] .code-block,
[dir="rtl"] kbd,
[dir="rtl"] samp {
  direction: ltr;
  text-align: left;
  unicode-bidi: bidi-override;
}

/* Tabular data with English headers stays LTR. */
[dir="rtl"] table {
  direction: ltr;
}
[dir="rtl"] table caption,
[dir="rtl"] table th[scope="row"] {
  direction: rtl;
  text-align: right;
}



