/*
 * AnkaPilot design tokens — the single source of colour, type, spacing, radius, shadow and motion.
 * Components use only the semantic names below, never raw colours.
 * Light theme: "İsviçre Açık" (docs/tasarim-onerileri/03). Dark theme: "Komuta Paneli" (05).
 * Brand: navy, wing gradient royal → teal → green, phoenix + compass mark.
 * Every text/background pair is checked for ≥ 4.5:1 by tests/tokens.test.mjs.
 * The dark block appears twice (system preference and explicit choice) and the test keeps both identical.
 */
:root {
  color-scheme: light;

  /* Brand primitives (theme independent) */
  --brand-navy: #0a2347;
  --brand-deep-navy: #071f3f;
  --brand-royal: #2a6ad8;
  --brand-teal: #069d9f;
  --brand-cyan: #03d9d0;
  --brand-green: #05dc85;
  --wing: linear-gradient(120deg, #2a6ad8 0%, #069d9f 52%, #05dc85 100%);

  /* Surfaces */
  --surface-page: #f4f7fa;
  --surface-card: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #eaf0f5;
  --surface-nav: #0a2347;
  --scrim: rgb(10 35 71 / 0.42);

  /* Text */
  --text: #0a2347;
  --text-muted: #5d6f84;
  --text-on-accent: #ffffff;
  --text-on-nav: #eef6fc;
  --text-on-nav-muted: #a8bfd2;

  /* Lines */
  --border: #d6dee8;
  --border-strong: #0a2347;

  /* Accent and status. "*-soft" are fills behind text of the matching colour. */
  --accent: #087f83;
  --accent-hover: #066568;
  --accent-soft: #e0f3f2;
  --accent-text: #066568;
  --royal: #1f5fc4;
  --positive: #167342;
  --positive-soft: #e3f3ea;
  --negative: #b3261e;
  --negative-soft: #fde7e5;
  --warning: #9a6200;
  --warning-soft: #fff1dc;
  --focus: #1f5fc4;

  /* Type */
  --font-display: "Montserrat", system-ui, sans-serif;
  --font-body: "Inter Variable", "Inter", system-ui, sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --leading: 1.5;
  --leading-tight: 1.15;

  /* Spacing (multiples of 4px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  /* Radius: soft on phones ("Mobil Yumuşak"), tighter on wide screens ("Komuta Paneli") */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-sheet: 24px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-1: 0 1px 2px rgb(10 35 71 / 0.06), 0 1px 1px rgb(10 35 71 / 0.04);
  --shadow-2: 0 12px 32px rgb(10 35 71 / 0.14), 0 2px 6px rgb(10 35 71 / 0.06);

  /* Motion */
  --dur-in: 200ms;
  --dur-out: 140ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.32, 1.25, 0.5, 1);

  /* Layout */
  --touch: 44px;
  --nav-height: 64px;
  --sidebar-width: 248px;
  --rail-width: 76px;
  --content-max: 1280px;
}

@media (min-width: 1024px) {
  :root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --surface-page: #0b1622;
    --surface-card: #111f2e;
    --surface-raised: #172a3d;
    --surface-sunken: #08111b;
    --surface-nav: #08111b;
    --scrim: rgb(2 8 15 / 0.6);
    --text: #eef6fc;
    --text-muted: #a8bfd2;
    --text-on-accent: #0b1622;
    --text-on-nav: #eef6fc;
    --text-on-nav-muted: #a8bfd2;
    --border: #22364b;
    --border-strong: #a8bfd2;
    --accent: #03d9d0;
    --accent-hover: #2ee6de;
    --accent-soft: #0d3438;
    --accent-text: #03d9d0;
    --royal: #6f9cf0;
    --positive: #2fbf7f;
    --positive-soft: #0f2e22;
    --negative: #f2766b;
    --negative-soft: #3a1714;
    --warning: #f0a43a;
    --warning-soft: #3a2709;
    --focus: #03d9d0;
    --shadow-1: 0 0 0 1px rgb(255 255 255 / 0.06);
    --shadow-2: 0 16px 40px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.08);
  }
}

:root[data-theme='dark'] {
    color-scheme: dark;
    --surface-page: #0b1622;
    --surface-card: #111f2e;
    --surface-raised: #172a3d;
    --surface-sunken: #08111b;
    --surface-nav: #08111b;
    --scrim: rgb(2 8 15 / 0.6);
    --text: #eef6fc;
    --text-muted: #a8bfd2;
    --text-on-accent: #0b1622;
    --text-on-nav: #eef6fc;
    --text-on-nav-muted: #a8bfd2;
    --border: #22364b;
    --border-strong: #a8bfd2;
    --accent: #03d9d0;
    --accent-hover: #2ee6de;
    --accent-soft: #0d3438;
    --accent-text: #03d9d0;
    --royal: #6f9cf0;
    --positive: #2fbf7f;
    --positive-soft: #0f2e22;
    --negative: #f2766b;
    --negative-soft: #3a1714;
    --warning: #f0a43a;
    --warning-soft: #3a2709;
    --focus: #03d9d0;
    --shadow-1: 0 0 0 1px rgb(255 255 255 / 0.06);
    --shadow-2: 0 16px 40px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.08);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-in: 0ms;
    --dur-out: 0ms;
  }
}
