/*
 * The Insignal look for the docs sites. docmd's stylesheet reads its own
 * variables; this file points them at the design system's tokens
 * (--ins-*, generated into tokens.css from design/theme/default.json), so a
 * token change reaches the docs on the next build. Only tokens here, no raw
 * colours, as in the app.
 */

:root,
:root[data-theme="dark"] {
  --bg-color: var(--ins-background);
  --text-color: var(--ins-foreground);
  --text-heading: var(--ins-foreground);
  --text-muted: var(--ins-muted-foreground);
  --link-color: var(--ins-primary);
  --link-color-hover: color-mix(in oklch, var(--ins-primary) 85%, var(--ins-foreground));
  --accent-color: var(--ins-primary);
  --primary-color: var(--ins-primary);
  --border-color: var(--ins-border);
  --border-color-hover: var(--ins-input);
  --border-color-codeblock: var(--ins-border);
  --header-bg: color-mix(in oklch, var(--ins-background) 85%, transparent);
  --header-border: var(--ins-border);
  --sidebar-bg: var(--ins-sidebar);
  --sidebar-text: var(--ins-sidebar-foreground);
  --sidebar-link-active-bg: var(--ins-sidebar-accent);
  --sidebar-link-active-text: var(--ins-sidebar-accent-foreground);
  --sidebar-group-bg: transparent;
  --code-bg: var(--ins-muted);
  --code-text: var(--ins-foreground);
  --scrollbar-thumb: var(--ins-border);
  --scrollbar-thumb-hover: var(--ins-muted-foreground);
  --image-border-color: var(--ins-border);
  --glow-color: color-mix(in oklch, var(--ins-ring) 12%, transparent);
  --glow-color-strong: color-mix(in oklch, var(--ins-ring) 22%, transparent);
  --halo-soft: 0 0 0 4px color-mix(in oklch, var(--ins-ring) 15%, transparent);
  --docmd-tooltip-bg: var(--ins-popover);
  --docmd-tooltip-color: var(--ins-popover-foreground);
  --docmd-tooltip-border: var(--ins-border);

  --font-family-sans: var(--ins-font-sans);
  --font-family-mono: var(--ins-font-mono);
  --font-size-base: 15px;
  --radius-sm: calc(var(--ins-radius) - 4px);
  --radius-md: calc(var(--ins-radius) - 2px);
  --radius-lg: calc(var(--ins-radius) + 4px);
  --radius-xl: calc(var(--ins-radius) + 8px);
}

body {
  font-family: var(--ins-font-sans);
  letter-spacing: var(--ins-letter-spacing);
  font-feature-settings: "cv01", "cv05";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-weight: 590;
  letter-spacing: -0.018em;
}

h1 {
  letter-spacing: -0.028em;
}

code,
kbd,
pre {
  font-family: var(--ins-font-mono);
  font-variant-ligatures: none;
}

/* The sidebar's active page: a raised chip, as in the app's nav. */
.sidebar-nav a.active {
  font-weight: 510;
  box-shadow: 0 1px 2px 0 color-mix(in oklch, var(--ins-shadow-color) calc(var(--ins-shadow-opacity) * 100%), transparent);
}

:focus-visible {
  outline: 2px solid var(--ins-ring);
  outline-offset: 2px;
}

/* Callouts in the status colours. Each says what it is in words too. */
.callout-info {
  --callout-color: var(--ins-info);
}

.callout-warning {
  --callout-color: var(--ins-warning);
}

.callout-success,
.callout-tip {
  --callout-color: var(--ins-success);
}

.callout-danger {
  --callout-color: var(--ins-destructive);
}
