/*
  Purpose:      The single source of visual design tokens for every screen.
  Reason:       §30 forbids literal colours and pixel values inside screen files;
                every visual value is a token defined here. §15 sets the contrast
                and touch-target floors, and DESIGN_SYSTEM.md raises them for
                sunlight and gloved hands.
  Dependencies: None. Loaded before any component stylesheet.
  Input:        Colour scheme preference (light / dark).
  Output:       CSS custom properties.
  Risks:        Adding a raw hex value in a component silently forks the palette
                and breaks dark mode for that component only — the hardest kind of
                visual bug to notice.

  Amaç:         Her ekranın kullandığı görsel tasarım belirteçlerinin tek kaynağı.
  Gerekçe:      §30 ekran dosyasında sabit renk ve piksel değerini yasaklar; her
                görsel değer burada tanımlı bir belirteçtir. §15 kontrast ve
                dokunma hedefi tabanını koyar; DESIGN_SYSTEM.md güneş ve eldiven
                için o tabanı yükseltir.
  Bağımlılıklar: Yok. Bileşen stillerinden önce yüklenir.
  Girdi:        Renk şeması tercihi (aydınlık / karanlık).
  Çıktı:        CSS özel özellikleri.
  Riskler:      Bileşende ham hex değeri kullanmak paleti sessizce çatallar ve
                karanlık temayı yalnızca o bileşende bozar — fark edilmesi en zor
                görsel hata türü.
*/

:root {
  /* --- Renk: aydınlık tema --- */
  --color-primary: #2f6f3e;          /* yaprak yeşili */
  --color-primary-strong: #21522d;
  --color-primary-contrast: #ffffff;

  --color-surface: #fbfaf7;          /* kireç beyazı, saf beyaz değil (parlama) */
  --color-surface-raised: #ffffff;
  --color-border: #d6d2c8;

  --color-text: #17201a;             /* zemine karşı ~14:1 */
  --color-text-muted: #4a5350;       /* ~7:1 — güneş altı taban */

  /* Anlam taşıyan renkler — kişiselleştirmeye KAPALI (§30) */
  --color-compliant: #1f6b3a;
  --color-warning: #8a5a00;
  --color-non-compliant: #a3261d;
  --color-unknown: #5a6360;          /* dördüncü durum: bilinmiyor ≠ uyumlu */

  --color-compliant-bg: #e6f2e9;
  --color-warning-bg: #fdf1dc;
  --color-non-compliant-bg: #fbe9e7;
  --color-unknown-bg: #eceeed;

  /* --- Boşluk (4px katları) --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  /* --- Yarıçap --- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* --- Tipografi (sistem yazı tipi: çevrimdışı çalışır, her yazı sistemi) --- */
  --font-family-base: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-family-numeric: ui-monospace, "SF Mono", "Cascadia Mono", monospace;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.75rem;
  --font-size-display: 2.5rem;       /* güvenli hasat tarihi — ekranın kahramanı */
  --line-height-base: 1.5;

  /* --- Dokunma hedefi: §15 tabanı 44px; tarla için 56px --- */
  --touch-target-min: 56px;

  /* --- Hareket --- */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --easing-standard: cubic-bezier(0.2, 0, 0, 1);

  --shadow-raised: 0 1px 2px rgba(23, 32, 26, 0.08),
                   0 2px 8px rgba(23, 32, 26, 0.06);
}

/* --- Karanlık tema: şafak ve akşam tarlada çalışma saatidir --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #6cc27f;
    --color-primary-strong: #8ad39a;
    --color-primary-contrast: #0d1410;

    --color-surface: #10150f;
    --color-surface-raised: #1a211a;
    --color-border: #333b33;

    --color-text: #eef2ec;
    --color-text-muted: #b3bcb4;

    --color-compliant: #6cc27f;
    --color-warning: #e0a83c;
    --color-non-compliant: #ef7b6e;
    --color-unknown: #9aa39d;

    --color-compliant-bg: #16301d;
    --color-warning-bg: #33270e;
    --color-non-compliant-bg: #3a1a17;
    --color-unknown-bg: #232823;

    --shadow-raised: 0 1px 2px rgba(0, 0, 0, 0.4),
                     0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  --color-primary: #6cc27f;
  --color-primary-strong: #8ad39a;
  --color-primary-contrast: #0d1410;
  --color-surface: #10150f;
  --color-surface-raised: #1a211a;
  --color-border: #333b33;
  --color-text: #eef2ec;
  --color-text-muted: #b3bcb4;
  --color-compliant: #6cc27f;
  --color-warning: #e0a83c;
  --color-non-compliant: #ef7b6e;
  --color-unknown: #9aa39d;
  --color-compliant-bg: #16301d;
  --color-warning-bg: #33270e;
  --color-non-compliant-bg: #3a1a17;
  --color-unknown-bg: #232823;
}

/* §15 / §30: işletim sisteminin "hareketi azalt" ayarına uyulur */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 1ms;
    --duration-base: 1ms;
  }
}
