/*
 * Theme: neutral (opt-in, not imported by css/domestic.css)
 *
 * The achromatic look that was the default before ivory: white page and
 * near-black text (chroma 0), a near-black primary and accent, so links
 * read as underlined text and checks, switches and selection are
 * near-black (near-white in dark), as in shadcn/ui's neutral theme
 * (https://ui.shadcn.com/docs/theming). Sans titles, no page pattern,
 * cards on the page color and a raised frame around the content panel.
 *
 * Apply with data-theme="neutral" on :root or on any element, after
 * linking this file. It sets semantic --dui-* tokens only, with light and
 * dark values; forced colors keep the base behavior. Muted text and the
 * hairline keep following --dui-contrast.
 *
 * Specs
 *   https://developer.mozilla.org/en-US/docs/Web/CSS/--*
 *   https://www.w3.org/TR/css-color-4/#ok-lab
 *   https://www.w3.org/TR/css-color-5/#relative-colors
 *   https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html
 */
@layer reset, tokens, base, layout, components, utilities;

@layer tokens {
  /* Also on knob scopes inside the theme: semantic.css re-derives some of these tokens there and would otherwise drop the theme's values. */
  [data-theme="neutral"],
  [data-theme="neutral"] :where([data-motion], [data-density], [data-contrast]) {
    --dui-color-surface: light-dark(oklch(100% 0 0deg), oklch(14.5% 0 0deg));
    --dui-color-surface-raised: light-dark(oklch(98.5% 0 0deg), oklch(20.5% 0 0deg));
    --dui-color-surface-sunken: light-dark(oklch(97% 0 0deg), oklch(22% 0 0deg));
    --dui-color-surface-hover: light-dark(oklch(96% 0 0deg), oklch(26.9% 0 0deg));
    --dui-color-surface-active: light-dark(oklch(93.5% 0 0deg), oklch(31% 0 0deg));
    --dui-color-surface-frame: var(--dui-color-surface-raised);
    --dui-color-text: light-dark(oklch(14.5% 0 0deg), oklch(98.5% 0 0deg));
    --dui-color-text-muted: color-mix(in oklab, var(--dui-color-text) clamp(0%, (var(--dui-contrast) - 1) * 100%, 100%), light-dark(oklch(50.5% 0 0deg), oklch(70.8% 0 0deg)));
    --dui-color-border: light-dark(oklch(14.5% 0 0deg / calc(11% * var(--dui-contrast))), oklch(98.5% 0 0deg / calc(10% * var(--dui-contrast))));
    --dui-color-border-control: light-dark(oklch(60% 0 0deg), oklch(58% 0 0deg));
    --dui-color-border-control-hover: light-dark(oklch(55.6% 0 0deg), oklch(65% 0 0deg));
    --dui-color-border-button: light-dark(oklch(92.2% 0 0deg), oklch(37.1% 0 0deg));
    --dui-color-shadow: light-dark(oklch(0% 0 0deg / 10%), oklch(0% 0 0deg / 46%));
    --dui-color-accent: var(--dui-color-text);
    --dui-color-primary: var(--dui-color-text);
    --dui-color-primary-contrast: light-dark(oklch(100% 0 0deg), oklch(14.5% 0 0deg));
    --dui-color-code-punctuation: light-dark(oklch(37% 0 0deg), oklch(83.5% 0 0deg));
    --dui-elevation-raised-surface: var(--dui-elevation-1-surface);
    --dui-elevation-panel-surface: var(--dui-color-surface);
    --dui-font-display: var(--dui-font-heading);
    --dui-font-weight-display: var(--dui-font-weight-heading);
    --dui-pattern-image: none;
  }
}
