/* what-if colour tokens: the one source for the landing page and the docs theme.
   `make docs/render` stages this file into the docs theme with theme/tokens.wiki.css, so the two
   cannot drift. Neutrals are the shared warm stone (light) and zinc (dark) of the agync family;
   cerulean is the product accent and marks interaction only: links, focus, selection and the one
   primary action. Status colours always travel with a word. */

:root {
  color-scheme: light;
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --sunken: #F5F5F4;
  --line: #E7E5E4;
  --line-strong: #D6D3D1;
  --text: #1C1917;
  --text-2: #44403C;
  --text-3: #57534E;
  --text-4: #716A65;
  --accent: #0F5FA8;
  --accent-text: #0B4F8C;
  --accent-soft: rgba(15, 95, 168, 0.08);
  --on-accent: #FFFFFF;
  --ok: #15803D;
  --warn: #A16207;
  --crit: #B91C1C;
  --code-bg: #1C1917;
  --code-fg: #F5F5F4;
  --code-accent: #93C5F2;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111114;
    --surface: #16161A;
    --sunken: #0D0D0F;
    --line: #2A2A2F;
    --line-strong: #3A3A40;
    --text: #F4F4F5;
    --text-2: #E4E4E7;
    --text-3: #A1A1AA;
    --text-4: #8E8E96;
    --accent: #6CB0EC;
    --accent-text: #93C5F2;
    --accent-soft: rgba(108, 176, 236, 0.12);
    --on-accent: #0D0D0F;
    --ok: #4ADE80;
    --warn: #FFD800;
    --crit: #F87171;
    --code-bg: #0D0D0F;
    --code-fg: #E4E4E7;
    --code-accent: #93C5F2;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111114;
  --surface: #16161A;
  --sunken: #0D0D0F;
  --line: #2A2A2F;
  --line-strong: #3A3A40;
  --text: #F4F4F5;
  --text-2: #E4E4E7;
  --text-3: #A1A1AA;
  --text-4: #8E8E96;
  --accent: #6CB0EC;
  --accent-text: #93C5F2;
  --accent-soft: rgba(108, 176, 236, 0.12);
  --on-accent: #0D0D0F;
  --ok: #4ADE80;
  --warn: #FFD800;
  --crit: #F87171;
  --code-bg: #0D0D0F;
  --code-fg: #E4E4E7;
  --code-accent: #93C5F2;
}
/* what-if over the okf-wiki docs renderer. `make docs/render` writes the theme's tokens.css as
   ../assets/css/tokens.css (the palette) followed by this file, which maps that palette onto the
   renderer's names and sets the faces, scale and square geometry. Edit colours in the palette,
   never here. Corners are 2px on controls and 4px on panels; elevation is tone plus a hairline. */

:root {
  /* Surfaces and ink */
  --color-bg: var(--bg);
  --color-surface: var(--bg);
  --color-bg-elevated: var(--surface);
  --color-surface-sunken: var(--sunken);
  --color-surface-sunken-deep: var(--sunken);
  --color-text: var(--text);
  --color-heading: var(--text);
  --color-text-muted: var(--text-3);
  --color-text-faint: var(--text-4);
  --color-line: var(--line);
  --color-line-strong: var(--line-strong);
  --color-line-control: var(--text-4);
  --color-scrim: rgba(12, 10, 9, 0.44);

  /* Accent: interaction only */
  --color-accent: var(--accent);
  --color-accent-text: var(--accent-text);
  --color-accent-soft: var(--accent-soft);
  --color-accent-ring: var(--line-strong);
  --color-on-accent: var(--on-accent);
  --color-current-tint: var(--accent-soft);
  --focus-ring: var(--accent);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;

  /* Code, selection, highlight */
  --color-code-bg: var(--code-bg);
  --color-code-fg: var(--code-fg);
  --color-code-line: var(--line-strong);
  --color-inline-code-bg: var(--sunken);
  --color-inline-code-fg: var(--text);
  --color-selection-bg: var(--accent-soft);
  --color-selection-fg: var(--text);
  --color-mark: var(--accent-soft);
  --color-mark-ink: var(--text);

  /* Status: quiet tint, coloured word */
  --status-success-tint: var(--sunken);
  --status-success-line: var(--line);
  --status-success-text: var(--ok);
  --status-info-tint: var(--sunken);
  --status-info-line: var(--line);
  --status-info-text: var(--accent-text);
  --status-warn-tint: var(--sunken);
  --status-warn-line: var(--line);
  --status-warn-text: var(--warn);
  --status-danger-tint: var(--sunken);
  --status-danger-line: var(--line);
  --status-danger-text: var(--crit);
  --status-neutral-tint: var(--sunken);
  --status-neutral-line: var(--line);
  --status-neutral-text: var(--text-3);

  /* Diagrams: stone boxes, accent for the path that matters */
  --diagram-font: "IBM Plex Sans", system-ui, sans-serif;
  --diagram-ground: var(--bg);
  --diagram-surface: var(--sunken);
  --diagram-surface-alt: var(--surface);
  --diagram-ink: var(--text);
  --diagram-muted: var(--text-3);
  --diagram-line: var(--line-strong);
  --diagram-accent: var(--accent);
  --diagram-accent-soft: var(--accent-soft);
  --diagram-accent-ink: var(--accent-text);
  --diagram-accent-2: #93C5F2;
  --diagram-accent-3: #BFDBF7;
  --diagram-yellow: #F3C83D;
  --diagram-cyan: #67E8F9;
  --diagram-red: var(--crit);
  --diagram-amber: var(--warn);
  --diagram-green: #86EFAC;
  --diagram-blue: #93C5FD;
  --diagram-violet: #C4B5FD;
  --diagram-pink: #F9A8D4;

  /* Lightbox: always dark */
  --lb-bg: #0D0D0F;
  --lb-bar: #16161A;
  --lb-line: #2A2A2F;
  --lb-line-strong: #3A3A40;
  --lb-text: #F4F4F5;
  --lb-muted: #A1A1AA;
  --lb-faint: #8E8E96;
  --lb-accent: #6CB0EC;
  --lb-accent-line: #1E3A5F;
  --lb-hint: #8E8E96;

  /* Faces and scale */
  --font-display: "IBM Plex Sans", system-ui, sans-serif;
  --font-ui: "IBM Plex Sans", system-ui, sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 600;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-body: 1rem;
  --text-lg: 1.125rem;
  --text-h3: 1.25rem;
  --text-h2: 1.5rem;
  --text-h1: clamp(2.25rem, 1.5rem + 2.4vw, 3rem);
  --lh-tight: 1.12;
  --lh-snug: 1.25;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;
  --ls-display: -0.03em;
  --ls-tight: -0.02em;
  --ls-snug: -0.01em;
  --measure: 68ch;

  /* Space and square geometry */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --radius-xl: 4px;
  --radius-pill: 2px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* Quiet motion */
  --dur-fast: 120ms;
  --dur: 120ms;
  --dur-slow: 240ms;
  --ease: linear;
  --ease-strong: linear;

  --z-base: 0;
  --z-sticky: 10;
  --z-header: 30;
  --z-overlay: 40;
  --z-skip-link: 50;
  --z-lightbox: 60;
}

/* Sidebar section and folder links are at least 24px tall (WCAG 2.5.8). */
html .side-title-link,
html .side-subsum a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

/* The lockup matches the landing header: the mark in cerulean, the name lowercase in the mono face. */
html .brand { gap: 9px; }
html .brand-mark { border-radius: 0; }
html .wordmark {
  font: 600 17px/1 var(--font-code);
  letter-spacing: -0.03em;
  color: var(--color-heading);
}
html .brand-sub { font-family: var(--font-code); }
