@import url("/byteion-core.css");

/**
 * Byteion Docs — theme entry
 *
 * Pulls the full @byteion/core theme stack so docs pages render with the
 * exact same primitives + semantic aliases + brand themes as production
 * consumers. Imported BEFORE Tailwind CDN in every page.
 *
 * Order matters:
 *   1. tokens.css        — primitive HSL palette (auto-generated)
 *   2. variables.css     — semantic aliases (light + dark + reduced-motion)
 *   3. themes/*.css      — optional brand themes via [data-theme="..."]
 */

@import url("/byteion-core/theme/generated/tokens.css");
@import url("/byteion-core/theme/variables.css");
@import url("/byteion-core/theme/themes/acme.css");
@import url("/byteion-core/theme/themes/midnight.css");

/* Smooth in-page anchors and native theme backgrounds to prevent flash */
html {
  scroll-behavior: smooth;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}
body {
  transition: opacity 0.15s ease-in-out;
}
body.preload {
  opacity: 0 !important;
}

/* Selection color matches brand */
*::selection { background: hsl(var(--primary) / 0.25); color: inherit; }

/* Marketing background utility used by the homepage hero */
.bg-grid-pattern {
  background-image:
    linear-gradient(to right, hsl(var(--foreground) / 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(var(--foreground) / 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Prose typography that themes correctly */
.prose:not(.not-prose *) {
  line-height: 1.75;
  font-size: 1rem;
}
.prose h1:not(.not-prose *),
.prose-themed h1 {
  color: hsl(var(--foreground));
  font-size: 2.25rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.2;
  scroll-margin-top: 6rem;
}
.prose h2:not(.not-prose *),
.prose-themed h2 {
  color: hsl(var(--foreground));
  font-size: 1.75rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  scroll-margin-top: 6rem;
  border-bottom: 1px solid hsl(var(--border) / 0.4);
  padding-bottom: 0.5rem;
}
.prose h3:not(.not-prose *),
.prose-themed h3 {
  color: hsl(var(--foreground));
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  scroll-margin-top: 6rem;
}
.prose h4:not(.not-prose *),
.prose-themed h4 {
  color: hsl(var(--foreground));
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.prose p:not(.not-prose *),
.prose-themed p {
  color: hsl(var(--muted-foreground));
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  line-height: 1.75;
}
.prose strong:not(.not-prose *),
.prose-themed strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}
.prose a:not(.not-prose *),
.prose-themed a {
  color: hsl(var(--primary));
  text-decoration: none;
}
.prose a:not(.not-prose *):hover,
.prose-themed a:hover {
  text-decoration: underline;
}
.prose .not-prose a.bg-primary,
.prose-themed .not-prose a.bg-primary {
  color: hsl(var(--primary-foreground)) !important;
  text-decoration: none !important;
}
.prose .not-prose a.bg-primary:hover,
.prose-themed .not-prose a.bg-primary:hover {
  text-decoration: none !important;
}
.prose ul:not(.not-prose *),
.prose-themed ul {
  list-style-type: disc;
  padding-left: 1.625rem;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}
.prose ol:not(.not-prose *),
.prose-themed ol {
  list-style-type: decimal;
  padding-left: 1.625rem;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}
.prose li:not(.not-prose *),
.prose-themed li {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.625;
}
.prose li p:not(.not-prose *) {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}
.prose code:not(.not-prose *):not(pre code),
.prose-themed code:not(pre code) {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}
.prose pre:not(.not-prose *),
.prose-themed pre[class*="language-"] {
  border-radius: 0.5rem;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.875rem;
  margin: 1.5rem 0;
}
.prose blockquote:not(.not-prose *) {
  border-left: 4px solid hsl(var(--primary));
  padding-left: 1.25rem;
  font-style: italic;
  margin: 1.5rem 0;
  color: hsl(var(--muted-foreground));
}
.prose table:not(.not-prose *) {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}
.prose th:not(.not-prose *) {
  border-bottom: 2px solid hsl(var(--border));
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.prose td:not(.not-prose *) {
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  padding: 0.75rem 1rem;
  color: hsl(var(--muted-foreground));
}
