/*
 * SteuerWork design tokens.
 *
 * This is the only file that may contain raw colour values. Components use
 * the --sw-* properties exclusively. Theme selection:
 *   no data-theme on <html>  -> follows the operating system
 *   data-theme="light"       -> light
 *   data-theme="dark"        -> dark
 * Print always uses the light values: the dark rules apply to screens only.
 *
 * tests/design_tokens.rs checks the contrast of every pair that components
 * combine, in both themes, and that both dark rules stay identical.
 */

@font-face {
  font-family: "Cabin";
  src: url("../fonts/cabin/Cabin-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cabin";
  src: url("../fonts/cabin/Cabin-Italic-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Typography. Cabin is packaged locally; the fallbacks only cover missing
     glyphs or a broken asset. Never uppercase UI text. */
  --sw-font-sans: "Cabin", system-ui, sans-serif;
  --sw-font-mono: ui-monospace, monospace;
  --sw-font-weight-regular: 400;
  --sw-font-weight-medium: 500;
  --sw-font-weight-semibold: 600;
  --sw-font-weight-bold: 700;
  --sw-font-size-display: 2.25rem;
  --sw-line-height-display: 1.2;
  --sw-font-size-title: 1.75rem;
  --sw-line-height-title: 1.25;
  --sw-font-size-subsection: 1.375rem;
  --sw-line-height-subsection: 1.3;
  --sw-font-size-heading-small: 1.125rem;
  --sw-line-height-heading-small: 1.35;
  --sw-font-size-body: 1rem;
  --sw-line-height-body: 1.55;
  --sw-font-size-compact: 0.875rem;
  --sw-line-height-compact: 1.45;
  --sw-font-size-meta: 0.75rem;
  --sw-line-height-meta: 1.5;
  --sw-reading-width: 70ch;

  /* Spacing scale, named after its pixel value at the default font size. */
  --sw-space-4: 0.25rem;
  --sw-space-8: 0.5rem;
  --sw-space-12: 0.75rem;
  --sw-space-16: 1rem;
  --sw-space-20: 1.25rem;
  --sw-space-24: 1.5rem;
  --sw-space-32: 2rem;
  --sw-space-40: 2.5rem;
  --sw-space-48: 3rem;
  --sw-space-64: 4rem;

  /* Shape, layout and interaction. */
  --sw-radius-small: 6px;
  --sw-radius-control: 12px;
  --sw-radius-card: 16px;
  --sw-radius-hero: 24px;
  --sw-radius-pill: 999px;
  --sw-target-min: 2.75rem;
  --sw-focus-ring-width: 3px;
  --sw-focus-ring-offset: 3px;
  --sw-icon-size: 1.25rem;
  --sw-icon-size-large: 1.5rem;
  --sw-logo-size: 2rem;
  --sw-icon-stroke: 1.75;
  --sw-nav-width: 15rem;
  --sw-content-max: 80rem;

  /* Motion. Set to zero below when reduced motion is requested. */
  --sw-duration-fast: 120ms;
  --sw-duration-base: 200ms;
  --sw-easing: cubic-bezier(0.2, 0, 0, 1);

  /* Light theme colours. */
  --sw-canvas: #F5F7FF;
  --sw-surface: #FFFFFF;
  --sw-surface-raised: #FFFFFF;
  --sw-surface-muted: #EAF0FA;
  --sw-text: #17213A;
  --sw-text-muted: #4C5872;
  --sw-border: #D8E0EE;
  --sw-control-border: #75839B;
  --sw-primary: #5736D5;
  --sw-primary-hover: #4226B5;
  --sw-on-primary: #FFFFFF;
  --sw-primary-soft: #EDE8FF;
  --sw-on-primary-soft: #4226B5;
  --sw-link: #4C2AC2;
  --sw-focus: #5637D8;
  --sw-success: #12634C;
  --sw-success-bg: #DDF8EC;
  --sw-warning: #744600;
  --sw-warning-bg: #FFF1C2;
  --sw-danger: #A52745;
  --sw-danger-bg: #FFE5EA;
  --sw-danger-action: #A52745;
  --sw-danger-action-hover: #841F37;
  --sw-on-danger-action: #FFFFFF;
  --sw-info: #14568C;
  --sw-info-bg: #E0F1FF;

  /* Expressive accents, identical in both themes. Never a status signal.
     Text on an accent always uses --sw-on-accent. */
  --sw-accent-violet: #A78BFA;
  --sw-accent-aqua: #52E3D0;
  --sw-accent-lime: #C9F45B;
  --sw-accent-peach: #FF9B80;
  --sw-accent-sun: #FFD75D;
  --sw-on-accent: #17213A;

  /* Chart series. Adjacent series differ mainly in hue (luminance contrast
     between neighbours is only about 1.1 to 1.5), so charts must never rely on
     colour alone: separate segments with surface-coloured gaps, label series
     directly and always offer the equivalent table. */
  --sw-chart-1: #5736D5;
  --sw-chart-2: #157F71;
  --sw-chart-3: #826B24;
  --sw-chart-4: #AD2804;
  --sw-chart-5: #536A17;

  --sw-shadow-card: 0 1px 2px rgb(23 33 58 / 0.06), 0 4px 12px rgb(23 33 58 / 0.06);
  --sw-shadow-raised: 0 8px 24px rgb(23 33 58 / 0.14);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --sw-duration-fast: 0ms;
    --sw-duration-base: 0ms;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* Dark theme, following the operating system. Keep identical to the rule
   below; tests/design_tokens.rs enforces this. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --sw-canvas: #111827;
    --sw-surface: #1B2437;
    --sw-surface-raised: #253149;
    --sw-surface-muted: #202C42;
    --sw-text: #F3F5FF;
    --sw-text-muted: #B8C5DC;
    --sw-border: #394862;
    --sw-control-border: #8494B1;
    --sw-primary: #B9A7FF;
    --sw-primary-hover: #D0C4FF;
    --sw-on-primary: #201249;
    --sw-primary-soft: #382B65;
    --sw-on-primary-soft: #D8CCFF;
    --sw-link: #C7B7FF;
    --sw-focus: #D2C5FF;
    --sw-success: #83E8BB;
    --sw-success-bg: #173C35;
    --sw-warning: #FFDB7B;
    --sw-warning-bg: #493710;
    --sw-danger: #FF9FB5;
    --sw-danger-bg: #48263A;
    --sw-danger-action: #FF9FB5;
    --sw-danger-action-hover: #FFC2D0;
    --sw-on-danger-action: #351929;
    --sw-info: #9BD6FF;
    --sw-info-bg: #203D5B;
    --sw-chart-1: #B9A7FF;
    --sw-chart-2: #52E3D0;
    --sw-chart-3: #FFD75D;
    --sw-chart-4: #FBA58D;
    --sw-chart-5: #9CD40E;
    --sw-shadow-card: 0 1px 2px rgb(0 0 0 / 0.40), 0 4px 12px rgb(0 0 0 / 0.30);
    --sw-shadow-raised: 0 8px 24px rgb(0 0 0 / 0.50);
  }
}

/* Dark theme, chosen explicitly. Keep identical to the rule above. */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --sw-canvas: #111827;
    --sw-surface: #1B2437;
    --sw-surface-raised: #253149;
    --sw-surface-muted: #202C42;
    --sw-text: #F3F5FF;
    --sw-text-muted: #B8C5DC;
    --sw-border: #394862;
    --sw-control-border: #8494B1;
    --sw-primary: #B9A7FF;
    --sw-primary-hover: #D0C4FF;
    --sw-on-primary: #201249;
    --sw-primary-soft: #382B65;
    --sw-on-primary-soft: #D8CCFF;
    --sw-link: #C7B7FF;
    --sw-focus: #D2C5FF;
    --sw-success: #83E8BB;
    --sw-success-bg: #173C35;
    --sw-warning: #FFDB7B;
    --sw-warning-bg: #493710;
    --sw-danger: #FF9FB5;
    --sw-danger-bg: #48263A;
    --sw-danger-action: #FF9FB5;
    --sw-danger-action-hover: #FFC2D0;
    --sw-on-danger-action: #351929;
    --sw-info: #9BD6FF;
    --sw-info-bg: #203D5B;
    --sw-chart-1: #B9A7FF;
    --sw-chart-2: #52E3D0;
    --sw-chart-3: #FFD75D;
    --sw-chart-4: #FBA58D;
    --sw-chart-5: #9CD40E;
    --sw-shadow-card: 0 1px 2px rgb(0 0 0 / 0.40), 0 4px 12px rgb(0 0 0 / 0.30);
    --sw-shadow-raised: 0 8px 24px rgb(0 0 0 / 0.50);
  }
}

@media print {
  :root {
    color-scheme: light;
  }
}
