/* ============================================================
   tokens.css — the brand skin for Open ONDC.
   Palette sampled from ondc.org: primary blue #1c75bc, deep
   navy #19486d, bright cyan #07a4e7, warm amber #e59500.
   The engine (site.css) consumes ONLY these custom properties —
   zero colour/font/radius literals live outside this file.
   Values are tuned to WCAG AA on their own surfaces.
   ============================================================ */

:root {
  /* ---- brand anchors (from ondc.org) ---- */
  --brand-navy: #19486d;        /* deep ONDC navy — hero, banners */
  --brand-navy-deep: #123049;   /* hero gradient floor */
  --brand-blue: #1c75bc;        /* ONDC primary blue */
  --brand-cyan: #07a4e7;        /* bright accent blue */
  --brand-amber: #e59500;       /* warm accent (used sparingly) */

  /* ---- typography ---- */
  --font-display: "Bricolage Grotesque", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- shape ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ---- elevation ---- */
  --shadow-1: 0 1px 2px rgb(16 24 40 / 0.06), 0 1px 3px rgb(16 24 40 / 0.10);
  --shadow-2: 0 4px 8px -2px rgb(16 24 40 / 0.10), 0 2px 4px -2px rgb(16 24 40 / 0.06);
  --shadow-3: 0 12px 24px -6px rgb(16 24 40 / 0.16), 0 4px 10px -4px rgb(16 24 40 / 0.08);

  /* ---- motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 180ms;
}

/* ============ LIGHT (default) ============ */
:root,
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #fbfdfe;
  --surface: #ffffff;
  --surface-alt: #f3f7fb;
  --surface-sunken: #eaf1f7;
  --border: #dde6ee;
  --border-strong: #c5d3e0;

  --text: #142333;
  --text-muted: #45566b;
  --text-faint: #5d6d84;          /* AA 4.5:1+ on light surfaces */

  --primary: #19486d;             /* ONDC navy — nav, headings, hero */
  --primary-contrast: #ffffff;
  --accent: #b45f06;              /* ONDC amber, darkened for AA on white */
  --accent-strong: #9c5205;
  --accent-contrast: #ffffff;
  --accent-tint: #fdefdd;
  --link: #1668b0;                /* ONDC blue link */
  --link-hover: #114f89;
  --success: #1f7a4d;
  --success-tint: #e5f4ec;
  --warning: #8f5e12;
  --warning-tint: #fdf3e1;
  --danger: #c0392b;

  --hero-bg: linear-gradient(135deg, #19486d 0%, #123049 58%, #0d2438 100%);
  --hero-text: #f2f7fd;
  --hero-muted: #b7c7dd;

  --sidebar-bg: #f5f9fc;
  --topbar-bg: rgb(251 253 254 / 0.92);
  --code-bg: #eef3f8;
  --kbd-bg: #ffffff;
  --scrim: rgb(9 22 38 / 0.55);

  /* category hues (repo categories, support badges) — AA on their tints */
  --cat-grant: #1c75bc;           --cat-grant-tint: #e7f1fa;   /* specs / protocol (blue) */
  --cat-equity: #6d4fc4;          --cat-equity-tint: #efecfb;  /* adaptors (violet) */
  --cat-loan: #0e7490;            --cat-loan-tint: #e2f2f7;    /* SDKs (teal) */
  --cat-incubation: #1f7a4d;      --cat-incubation-tint: #e5f4ec; /* reference apps (green) */
  --cat-market: #1668b0;          --cat-market-tint: #e7f0fa;  /* developer docs (blue) */
  --cat-mixed: #b45f06;           --cat-mixed-tint: #fdefdd;   /* testing / certify (amber) */
  --cat-other: #55647a;           --cat-other-tint: #eef2f6;   /* other / infra (slate) */

  /* stage hues (network journey: understand → build → test → go live) */
  --stage-ideation: #b7791f;
  --stage-prototype: #0e7490;
  --stage-early: #1c75bc;
  --stage-growth: #19486d;
  --stage-market: #1f7a4d;
}

/* ============ DARK ============ */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b1622;
  --surface: #10202f;
  --surface-alt: #16293b;
  --surface-sunken: #081420;
  --border: #21384f;
  --border-strong: #314c67;

  --text: #e7eef6;
  --text-muted: #a8b8cc;
  --text-faint: #85a3c0;          /* AA on raised dark surfaces */

  --primary: #7fb2e6;             /* lightened ONDC blue for dark */
  --primary-contrast: #0b1622;
  --accent: #f0a53a;             /* ONDC amber, lightened */
  --accent-strong: #ffb84f;
  --accent-contrast: #1a1103;
  --accent-tint: #33240d;
  --link: #6fa8e6;
  --link-hover: #98c2f0;
  --success: #48c17c;
  --success-tint: #10301f;
  --warning: #d9a13f;
  --warning-tint: #33270e;
  --danger: #e26d5f;

  --hero-bg: linear-gradient(135deg, #15304a 0%, #102338 60%, #0a1826 100%);
  --hero-text: #f2f7fd;
  --hero-muted: #a7bcd6;

  --sidebar-bg: #0d1c2b;
  --topbar-bg: rgb(11 22 34 / 0.92);
  --code-bg: #16293b;
  --kbd-bg: #16293b;
  --scrim: rgb(2 8 15 / 0.72);

  --cat-grant: #6fb0ea;           --cat-grant-tint: #12293f;
  --cat-equity: #a68cf0;          --cat-equity-tint: #241d40;
  --cat-loan: #43bcd6;            --cat-loan-tint: #0c2c36;
  --cat-incubation: #4cc27f;      --cat-incubation-tint: #103021;
  --cat-market: #7fb2e6;          --cat-market-tint: #14263c;
  --cat-mixed: #f0a53a;           --cat-mixed-tint: #33240d;
  --cat-other: #93a3b9;           --cat-other-tint: #1b2838;

  --stage-ideation: #d9a13f;
  --stage-prototype: #43bcd6;
  --stage-early: #6fb0ea;
  --stage-growth: #7fb2e6;
  --stage-market: #4cc27f;

  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 4px 8px -2px rgb(0 0 0 / 0.5);
  --shadow-3: 0 12px 24px -6px rgb(0 0 0 / 0.6);
}
