/* Menakuru Command Centre - design tokens.
   Tier 1 = base values. Tier 2 = named roles (what components use).
   Raw px and hex live ONLY in this file. */

:root {
  color-scheme: light dark;

  /* ===== TIER 1: base values ===== */
  /* colour scales */
  --white: #ffffff;
  --grey-50: #f3f4f7;
  --grey-100: #e7e9ef;
  --grey-300: #bcc2d0;
  --grey-600: #566073;
  --ink-900: #111a2e;
  --ink-700: #26314f;
  --gold-500: #f7b500;
  --gold-400: #ffc933;
  --green-700: #14693a;
  --green-100: #dcf1e4;
  --red-700: #b3261e;
  --red-100: #fbe3e0;
  --amber-800: #7a4f00;
  --amber-100: #fdf0cc;
  --night-950: #0b1020;
  --night-900: #141b2f;
  --night-800: #1c2540;
  --night-700: #26314f;
  --night-line: #2c3757;
  --night-line-strong: #4a5678;
  --mist-100: #edf0f7;
  --mist-400: #a9b2c7;
  --green-300: #6fd49b;
  --green-900: #12301f;
  --red-300: #ff9a91;
  --red-900: #3b1815;
  --amber-300: #f2c15a;
  --amber-900: #35290a;

  /* spacing scale: 4 / 8 / 12 / 16 / 24 / 32 */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;

  /* corners: 8 / 12 / 16 / 24 / full */
  --radius-8: 8px;
  --radius-12: 12px;
  --radius-16: 16px;
  --radius-24: 24px;
  --radius-full: 999px;

  /* type: 12 / 14 / 16 / 20 / 24 / 32 */
  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
  --weight-regular: 400;
  --weight-medium: 600;
  --weight-heavy: 700;
  --lh-text: 1.6;
  --lh-tight: 1.3;
  --font-family: "Figtree", "Noto Sans Telugu", system-ui, sans-serif;

  /* motion: transform and opacity only, 150-250 ms */
  --ms-fast: 150ms;
  --ms-base: 200ms;
  --ms-slow: 250ms;
  --ms-spin: 800ms;
  --ms-toast: 4000ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --press-scale: 0.97;

  /* sizes (controls, icons, panels) */
  --target-min: 44px;
  --h-phone: 44px;
  --h-desktop: 36px;
  --h-chip: 34px;
  --tab-h-phone: 48px;
  --tab-h-desktop: 40px;
  --icon-size: 20px;
  --icon-size-lg: 32px;
  --icon-stroke: 2px;
  --spinner-size: 16px;
  --spinner-stroke: 2px;
  --bar-h: 8px;
  --edge-w: 4px;
  --connector-h: 2px;
  --dot-size: 12px;
  --step-w: 96px;
  --panel-w: 480px;
  --content-max: 1200px;
  --menu-min-w: 200px;
  --search-w: 320px;
  --hairline: 1px;
  --focus-w: 2px;
  --focus-off: 2px;

  /* ===== TIER 2: roles (light) ===== */
  --surface-page: var(--grey-50);
  --surface-card: var(--white);
  --surface-sheet: var(--white);
  --surface-raised: var(--white);
  --surface-sunken: var(--grey-100);
  --line: var(--grey-100);
  --line-strong: var(--grey-300);
  --text-strong: var(--ink-900);
  --text-muted: var(--grey-600);
  --accent: var(--gold-500);
  --accent-hover: var(--gold-400);
  --on-accent: var(--ink-900);
  --key-ink: var(--ink-900);
  --key-ink-hover: var(--ink-700);
  --on-key-ink: var(--white);
  --key-white: var(--white);
  --focus: var(--ink-900);
  --done-fg: var(--green-700);
  --done-bg: var(--green-100);
  --alert-fg: var(--red-700);
  --alert-bg: var(--red-100);
  --soon-fg: var(--amber-800);
  --soon-bg: var(--amber-100);
  --toast-bg: var(--ink-900);
  --toast-fg: var(--white);
  --scrim: rgba(17, 26, 46, 0.5);
  --shadow-card: 0 2px 12px rgba(17, 26, 46, 0.08);
  --shadow-raised: 0 8px 32px rgba(17, 26, 46, 0.2);

  /* spacing roles */
  --gap-group: var(--space-4);
  --gap-items: var(--space-8);
  --gap-fields: var(--space-16);
  --gap-sections: var(--space-24);
  --card-pad: var(--space-16);
  --tile-pad: var(--space-12);
  --page-margin: var(--space-16);

  /* control roles (phone and small tablet) */
  --btn-h: var(--h-phone);
  --btn-fs: var(--fs-16);
  --tab-h: var(--tab-h-phone);
  --bar-space: calc(var(--btn-h) + var(--space-12) * 2 + var(--space-16) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1024px) {
  :root {
    --page-margin: var(--space-24);
    --btn-h: var(--h-desktop);
    --btn-fs: var(--fs-14);
    --tab-h: var(--tab-h-desktop);
    --bar-space: var(--space-32);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    /* surfaces get lighter the higher they sit */
    --surface-page: var(--night-950);
    --surface-card: var(--night-900);
    --surface-sheet: var(--night-800);
    --surface-raised: var(--night-700);
    --surface-sunken: var(--night-950);
    --line: var(--night-line);
    --line-strong: var(--night-line-strong);
    --text-strong: var(--mist-100);
    --text-muted: var(--mist-400);
    --key-ink: var(--mist-100);
    --key-ink-hover: var(--white);
    --on-key-ink: var(--ink-900);
    --key-white: var(--night-700);
    --focus: var(--mist-100);
    --done-fg: var(--green-300);
    --done-bg: var(--green-900);
    --alert-fg: var(--red-300);
    --alert-bg: var(--red-900);
    --soon-fg: var(--amber-300);
    --soon-bg: var(--amber-900);
    --toast-bg: var(--mist-100);
    --toast-fg: var(--ink-900);
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-raised: 0 8px 32px rgba(0, 0, 0, 0.6);
  }
}
