/* ==========================================================================
   DMW-Performance — CSS Custom Properties (Design Tokens)
   ==========================================================================
   Defines the entire design system: colors, typography, spacing, layout,
   radii, shadows, transitions, and z-index.
   Light mode is the default; dark mode is applied automatically via
   prefers-color-scheme, and can be forced via [data-theme="dark"|"light"].
   ========================================================================== */

:root {
  /* ----- Brand Colors ----- */
  --color-primary: #E8B400;
  --color-primary-dark: #C49800;
  --color-primary-text: #1A1A1A; /* text ON primary button */
  /* Gold als SCHRIFT auf hellem Grund. #E8B400 auf Weiss ergibt 1,9:1 und ist
     damit weit unter den 4,5:1, die lesbarer Text braucht — die kleinen
     goldenen Grossbuchstaben-Labels waren praktisch nicht zu entziffern.
     Dieser Ton liegt bei 5,7:1 auf Weiss und bleibt trotzdem im Goldbereich.
     Nur fuer Schrift verwenden; Flaechen, Rahmen und Symbole behalten
     --color-primary. Im Dunkelmodus wird daraus wieder das helle Gold, weil
     Gold auf Schwarz von Haus aus gut lesbar ist. */
  --color-gold-ink: #806200;
  --color-accent: #1A1A2E;
  --color-accent-light: #16213E;

  /* ----- Light Mode Neutrals (default) ----- */
  --color-bg: #F8F8F8;
  --color-bg-elevated: #FFFFFF;
  --color-bg-subtle: #EFEFEF;
  --color-surface: #FFFFFF;
  --color-border: #DEDEDE;
  --color-text: #1A1A1A;
  --color-text-muted: #555555;
  --color-text-inverse: #FFFFFF;

  /* ----- Semantic Colors -----
     Desaturated so status messages sit beside the gold/navy brand without
     screaming. Still WCAG-AA legible on both the light and dark surfaces. */
  --color-success: #2F8F4E;
  --color-error: #C0392B;
  --color-info: #3D7A8C;
  --color-warning: #D99A1C;

  /* ----- Fremdmarken-Farben -----
     WhatsApps eigenes Gruen. Von der Marke vorgegeben und deshalb in beiden
     Modi identisch: Besucher erkennen den Knopf genau an dieser Farbe. */
  --color-whatsapp: #25D366;
  --color-whatsapp-dark: #1DA851; /* hover / focus */

  /* ----- Typography ----- */
  --font-heading: 'Rajdhani', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  /* Utility face for record/data rows — system stack, no extra webfont. */
  --font-mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, 'Liberation Mono', monospace;

  /* Type scale — readable floor (12/14/16px) with a 1.25 ratio above base */
  --text-xs: 0.75rem;    /* 12px — smallest, still legible */
  --text-sm: 0.875rem;   /* 14px — secondary text, footer, labels */
  --text-base: 1rem;     /* 16px — body */
  --text-lg: 1.25rem;    /* 20px */
  --text-xl: 1.563rem;
  --text-2xl: 1.953rem;
  --text-3xl: 2.441rem;
  --text-4xl: 3.052rem;

  /* Line heights */
  --leading-tight: 1.2;
  --leading-snug: 1.4;
  --leading-normal: 1.6;
  --leading-relaxed: 1.7;

  /* Font weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ----- Spacing (8pt grid) ----- */
  --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-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ----- Layout ----- */
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-wide: 1440px;
  --header-height: 72px;
  --footer-height: auto;

  /* ----- Border Radius ----- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* ----- Shadows -----
     Tinted with the brand navy (#1A1A2E ≈ rgb(26,26,46)) instead of pure
     black — colored shadows read as more premium and "lit" than flat grey. */
  --shadow-xs: 0 1px 2px rgba(26, 26, 46, 0.06);
  --shadow-sm: 0 2px 6px rgba(26, 26, 46, 0.10);
  --shadow-md: 0 6px 20px rgba(26, 26, 46, 0.14);
  --shadow-lg: 0 12px 36px rgba(26, 26, 46, 0.18);
  --shadow-xl: 0 20px 56px rgba(26, 26, 46, 0.24);

  /* ----- Texture -----
     Tileable fractal-noise grain as an inline SVG data-URI (no extra request).
     Breaks the digital flatness of plain light sections. Very low opacity so
     it reads as paper/film grain, never as visible dots. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");

  /* ----- Transitions ----- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-slower: 600ms ease;

  /* ----- Z-Index Scale ----- */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 50;
  --z-header: 100;
  --z-overlay: 150;
  --z-modal: 200;
  --z-toast: 300;
  --z-tooltip: 400;
  --z-max: 9999;
}

/* ==========================================================================
   Dark Mode — Automatic (via OS preference)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #F0C030;
    --color-primary-dark: #D8A820;
    --color-gold-ink: #F0C030;
    --color-bg: #0D0D0D;
    --color-bg-elevated: #1A1A1A;
    --color-bg-subtle: #222222;
    --color-surface: #1E1E1E;
    --color-border: #333333;
    --color-text: #E8E8E8;
    --color-text-muted: #A0A0A0;
    --color-text-inverse: #1A1A1A;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.40);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.50);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.60);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.70);
  }
}

/* ==========================================================================
   Dark Mode — Manual Override
   ========================================================================== */
[data-theme="dark"] {
  --color-primary: #F0C030;
  --color-primary-dark: #D8A820;
  --color-gold-ink: #F0C030;
  --color-bg: #0D0D0D;
  --color-bg-elevated: #1A1A1A;
  --color-bg-subtle: #222222;
  --color-surface: #1E1E1E;
  --color-border: #333333;
  --color-text: #E8E8E8;
  --color-text-muted: #A0A0A0;
  --color-text-inverse: #1A1A1A;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.50);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.60);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.70);
}

/* ==========================================================================
   Light Mode — Manual Override
   (Forces light values even when OS prefers dark)
   ========================================================================== */
[data-theme="light"] {
  --color-primary: #E8B400;
  --color-primary-dark: #C49800;
  --color-bg: #F8F8F8;
  --color-bg-elevated: #FFFFFF;
  --color-bg-subtle: #EFEFEF;
  --color-surface: #FFFFFF;
  --color-border: #DEDEDE;
  --color-text: #1A1A1A;
  --color-text-muted: #555555;
  --color-text-inverse: #FFFFFF;
  --shadow-xs: 0 1px 2px rgba(26, 26, 46, 0.06);
  --shadow-sm: 0 2px 6px rgba(26, 26, 46, 0.10);
  --shadow-md: 0 6px 20px rgba(26, 26, 46, 0.14);
  --shadow-lg: 0 12px 36px rgba(26, 26, 46, 0.18);
  --shadow-xl: 0 20px 56px rgba(26, 26, 46, 0.24);
}
