/* Braid design tokens. Canonical source of values for the marketing site and the app.
   Layer 1: brand and palette. Layer 2: roles (what components read). Layer 3: scale. */

:root {
  /* Brand: sampled from brand/braid-logo-source.png */
  --brand: #0062e4;
  --brand-hover: #0054c2;
  --brand-active: #00459f;
  --brand-tint: #e8f1fd;
  --on-brand: #ffffff;
  --mark: #0062e4;

  /* Surfaces */
  --bg: #ffffff;
  --surface: #f6f9fe;
  --sunken: #eef3fb;
  --halo: var(--bg);

  /* Text */
  --ink: #0b1b33;
  --muted: #475871;
  --link: #0062e4;

  /* Lines */
  --line: #d6dfed;
  --line-strong: #aebbd1;

  /* Strands: the three threads of the braid motif. Navy for people, blue for agents, slate for knowledge. */
  --people: #0b1b33;
  --agent: #0062e4;
  --knowledge: #9db4d6;
  --on-people: #ffffff;
  --on-agent: #ffffff;
  --on-knowledge: #0b1b33;
  --knowledge-ink: #566d94;

  /* Roles */
  --btn-bg: var(--brand);
  --btn-fg: var(--on-brand);
  --btn-bg-hover: var(--brand-hover);
  --focus: #0062e4;
  --code-bg: #0b1b33;
  --code-fg: #e6eefb;
  --highlight: rgba(255, 207, 51, 0.5);
  --inverse-bg: #0b1b33;
  --inverse-fg: #ffffff;

  /* Type families */
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale (fluid, 360px to 1440px) */
  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1.0625rem, 1.03rem + 0.15vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.18rem + 0.35vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.4rem + 1vw, 2.2rem);
  --step-3: clamp(2.1rem, 1.6rem + 2.5vw, 3.4rem);
  --step-4: clamp(2.7rem, 1.8rem + 4.5vw, 5.2rem);
  --step-hero: clamp(3rem, 1.2rem + 9vw, 8rem);

  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: clamp(3rem, 7vw, 5rem);
  --space-6: clamp(4rem, 10vw, 8rem);

  /* Layout and shape */
  --gutter: clamp(16px, 4vw, 40px);
  --page: 1180px;
  --measure: 62ch;
  --radius: 10px;
  --radius-lg: 14px;

  /* Motion */
  --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
  --duration-fast: 120ms;
  --duration-weave: 1600ms;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #5b9dff;
    --brand-hover: #7bb0ff;
    --brand-active: #9bc2ff;
    --brand-tint: #11243f;
    --on-brand: #04122b;
    --mark: #5b9dff;

    --bg: #0a1322;
    --surface: #101c30;
    --sunken: #0c182a;

    --ink: #e9f0fb;
    --muted: #9fb0c8;
    --link: #6aa6ff;

    --line: #223452;
    --line-strong: #37507a;

    --people: #e9f0fb;
    --agent: #5b9dff;
    --knowledge: #4a6794;
    --on-people: #0a1322;
    --on-agent: #04122b;
    --on-knowledge: #ffffff;
    --knowledge-ink: #9db4d6;

    --focus: #6aa6ff;
    --code-bg: #060e1b;
    --code-fg: #dbe6f7;
    --highlight: rgba(240, 194, 74, 0.35);
    --inverse-bg: #101c30;
    --inverse-fg: #e9f0fb;
  }
}
