/*
 * Veronto Design Tokens — Variant B: "Slate"
 * ------------------------------------------
 * Direction: muted slate-blue primary (Linear-ish calm), neutral grays,
 * 2px radius, Inter Variable + IBM Plex Mono, flat surfaces, hairline
 * borders, minimal shadows. Graphite dark mode.
 *
 * Fonts lokal gehostet (DSGVO-Konformitaet fuer Kanzlei-Software) —
 * keine Google-Fonts-CDN, keine externen Requests beim Seitenaufruf.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-variable.woff2") format("woff2-variations"),
       url("/static/fonts/inter-variable.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/plex-mono-regular.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/plex-mono-medium.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  /* ============================================================
   * PRIMITIVES
   * ============================================================ */

  --space-0: 0;
  --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;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono",
               Menlo, Consolas, "Liberation Mono", monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  --text-3xl:  clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);
  --text-4xl:  clamp(2.25rem, 1.75rem + 2.5vw, 3rem);

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  --tracking-tight: -0.015em;
  --tracking-normal: -0.005em;

  --radius: 0.125rem;
  --radius-sm: 0.125rem;
  --radius-md: 0.125rem;
  --radius-lg: 0.25rem;
  --radius-xl: 0.375rem;
  --radius-full: 9999px;

  --motion-duration-short: 120ms;
  --motion-duration-medium: 240ms;
  --motion-duration-long: 400ms;
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);

  --shadow-sm: 0 1px 0 0 rgb(15 23 42 / 0.04);
  --shadow:    0 1px 2px 0 rgb(15 23 42 / 0.05);
  --shadow-md: 0 2px 6px -1px rgb(15 23 42 / 0.08), 0 1px 2px -1px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 8px 16px -4px rgb(15 23 42 / 0.10), 0 2px 4px -2px rgb(15 23 42 / 0.05);
  --shadow-xl: 0 16px 32px -8px rgb(15 23 42 / 0.14), 0 4px 8px -4px rgb(15 23 42 / 0.06);

  /* ============================================================
   * SEMANTIC — Light mode
   * ============================================================ */

  --background:           oklch(1 0 0);
  --foreground:           oklch(0.18 0.005 260);
  --card:                 oklch(1 0 0);
  --card-foreground:      oklch(0.18 0.005 260);
  --popover:              oklch(1 0 0);
  --popover-foreground:   oklch(0.18 0.005 260);

  /* Primary — Muted slate blue. Linear-ish. Reads calm on white. */
  --primary:              oklch(0.48 0.08 250);
  --primary-foreground:   oklch(0.985 0.002 260);

  --secondary:            oklch(0.97 0.003 260);
  --secondary-foreground: oklch(0.22 0.006 260);

  --muted:                oklch(0.965 0.003 260);
  --muted-foreground:     oklch(0.48 0.008 260);

  --accent:               oklch(0.955 0.004 260);
  --accent-foreground:    oklch(0.22 0.006 260);

  --destructive:             oklch(0.50 0.18 25);
  --destructive-foreground:  oklch(0.985 0.002 260);

  --success:              oklch(0.48 0.10 155);
  --success-foreground:   oklch(0.985 0.002 260);
  --warning:              oklch(0.62 0.13 65);
  --warning-foreground:   oklch(0.18 0.005 260);
  --info:                 oklch(0.50 0.10 235);
  --info-foreground:      oklch(0.985 0.002 260);

  --border:               oklch(0.91 0.004 260);
  --input:                oklch(0.89 0.004 260);
  --ring:                 oklch(0.48 0.08 250);

  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --focus-ring-color: var(--ring);

  --container-max: 1200px;
  --container-max-narrow: 900px;
  --header-height: 56px;
}

/* ============================================================
 * DARK MODE — Graphite
 * ============================================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --background:           oklch(0.17 0.005 260);
    --foreground:           oklch(0.965 0.003 260);
    --card:                 oklch(0.20 0.005 260);
    --card-foreground:      oklch(0.965 0.003 260);
    --popover:              oklch(0.22 0.005 260);
    --popover-foreground:   oklch(0.965 0.003 260);

    --primary:              oklch(0.74 0.10 250);
    --primary-foreground:   oklch(0.15 0.005 260);

    --secondary:            oklch(0.24 0.006 260);
    --secondary-foreground: oklch(0.95 0.003 260);

    --muted:                oklch(0.22 0.005 260);
    --muted-foreground:     oklch(0.68 0.008 260);

    --accent:               oklch(0.25 0.006 260);
    --accent-foreground:    oklch(0.95 0.003 260);

    --destructive:             oklch(0.65 0.20 25);
    --destructive-foreground:  oklch(0.15 0.005 260);

    --success:              oklch(0.70 0.14 155);
    --success-foreground:   oklch(0.15 0.005 260);
    --warning:              oklch(0.76 0.14 65);
    --warning-foreground:   oklch(0.15 0.005 260);
    --info:                 oklch(0.72 0.12 235);
    --info-foreground:      oklch(0.15 0.005 260);

    --border:               oklch(1 0 0 / 0.09);
    --input:                oklch(1 0 0 / 0.12);
    --ring:                 oklch(0.74 0.10 250);

    --shadow-sm: 0 1px 0 0 rgb(0 0 0 / 0.20);
    --shadow:    0 1px 2px 0 rgb(0 0 0 / 0.30);
    --shadow-md: 0 2px 6px -1px rgb(0 0 0 / 0.35), 0 1px 2px -1px rgb(0 0 0 / 0.25);
    --shadow-lg: 0 8px 16px -4px rgb(0 0 0 / 0.45), 0 2px 4px -2px rgb(0 0 0 / 0.30);
    --shadow-xl: 0 16px 32px -8px rgb(0 0 0 / 0.55), 0 4px 8px -4px rgb(0 0 0 / 0.35);
  }
}
