/* LocalGPT - Dark theme design system */
:root {
  --bg: #121214;
  --bg-subtle: #18181b;
  --surface: #202024;
  --surface-hover: #27272a;
  --border: #2e2e33;
  --border-light: #3f3f46;
  --primary: #25c2a0;
  --primary-hover: #29d5b0;
  --primary-dim: rgba(37, 194, 160, 0.12);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sidebar-width: 270px;
  --toc-width: 230px;
  --header-height: 60px;
  color-scheme: dark;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img, video, iframe {
  max-width: 100%;
}

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(18, 18, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.header-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none !important;
}
.brand img {
  width: 30px;
  height: 30px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--text);
}

.nav-socials {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-social-link {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
}
.nav-social-link:hover {
  color: var(--text);
}
.nav-social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Main Layout */
main.main-content {
  flex: 1;
}

/* Hero Section */
.hero {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 50% 20%, rgba(37, 194, 160, 0.08), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 3.5rem;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }
  .hero-left {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

.hero-logos {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.hero-icon {
  width: 120px;
  height: 120px;
}
.hero-gear {
  max-width: 320px;
  height: auto;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.install-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 460px;
}

.install-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  gap: 0.75rem;
}

.install-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

.install-code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
}

.copy-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}
.copy-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none !important;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #000;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Feature Grid */
.section-features {
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--border);
}
.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.feature-card h3 {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 0.6rem;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Family Apps */
.section-apps {
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--border);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.2s ease;
}
.app-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37, 194, 160, 0.08);
}
.app-tagline {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.app-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.app-desc {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.app-cta {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
}

/* Templates Preview Grid */
.section-templates {
  padding: 4.5rem 0;
}
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.template-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.2s ease;
}
.template-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.template-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.4rem;
}
.template-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.template-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Docs Layout */
.docs-layout {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
}

.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem 3rem;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
}

.sidebar-category {
  margin-bottom: 1.5rem;
}
.sidebar-category-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.25rem;
}
.sidebar-list {
  list-style: none;
}
.sidebar-link {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none !important;
  transition: all 0.15s ease;
}
.sidebar-link:hover {
  color: var(--text);
  background: var(--surface);
}
.sidebar-link.active {
  color: var(--primary);
  background: var(--primary-dim);
  font-weight: 600;
}

.docs-main {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 5rem;
}

.docs-container {
  max-width: 820px;
}

.docs-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  padding: 2.5rem 1rem 3rem;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  font-size: 0.85rem;
}
@media (max-width: 1200px) {
  .docs-toc {
    display: none;
  }
}
@media (max-width: 840px) {
  .docs-sidebar {
    display: none;
  }
  .docs-main {
    padding: 2rem 1.5rem 4rem;
  }
}

.toc-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.toc-list {
  list-style: none;
}
.toc-list li {
  margin-bottom: 0.35rem;
}
.toc-list a {
  color: var(--text-muted);
  text-decoration: none;
}
.toc-list a:hover {
  color: var(--primary);
}

/* Markdown prose */
.prose h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}
.prose h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.prose h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.8rem 0 0.75rem;
}
.prose p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
}
.prose ul, .prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.prose li {
  margin-bottom: 0.4rem;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  color: var(--primary);
}
.prose pre {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border-radius: 8px;
  background: #19191d !important;
  border: 1px solid var(--border);
  overflow-x: auto;
}
.prose pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}
.prose blockquote {
  border-left: 4px solid var(--primary);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: 0 6px 6px 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.prose th, .prose td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  text-align: left;
}
.prose th {
  background: var(--surface);
  font-weight: 600;
}

/* Template Single Page */
.template-hero {
  padding: 4rem 0 3rem;
  text-align: center;
  background: radial-gradient(circle at 50% 10%, rgba(37, 194, 160, 0.1), transparent 70%);
  border-bottom: 1px solid var(--border);
}
.template-hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(120deg, var(--primary), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.template-hero-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 750px;
  margin: 0 auto 2rem;
}
.preview-box {
  max-width: 800px;
  aspect-ratio: 16/9;
  background: #09090b;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 2rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.1rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
.template-content {
  max-width: 800px;
  margin: 3.5rem auto;
  padding: 0 1.5rem;
}
.template-section {
  margin-bottom: 3.5rem;
}
.template-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.customization-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}
.customization-box ol {
  padding-left: 1.5rem;
}
.customization-box li {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}
.faq-item {
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}
.faq-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}
.faq-item p {
  color: var(--text-muted);
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  background: #0e0e10;
  padding: 3.5rem 0 2rem;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 0.5rem;
}
.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-col a:hover {
  color: var(--text);
}

.family-strip {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.85rem;
}
.family-label {
  color: var(--text-dim);
  font-weight: 600;
}
.family-strip a {
  color: var(--text-muted);
  text-decoration: none;
}
.family-strip a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* Search styles */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
  width: 200px;
  outline: none;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}
.search-input:focus {
  border-color: var(--primary);
  width: 260px;
  background: var(--bg-subtle);
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  display: none;
  z-index: 1000;
}
.search-results.open {
  display: block;
}
.search-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none !important;
}
.search-item:last-child {
  border-bottom: none;
}
.search-item:hover {
  background: var(--surface);
}
.search-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 0.2rem;
}
.search-item-snippet {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
