/*
 * Bodylet AI: design tokens
 *
 * Every value used by the components in ../css and by the landing page comes
 * from here; nothing else should hard-code a color, a size or a duration.
 * Prefix: --bl-.
 *
 * The values below are the dark scheme, the default. light.css, next to this
 * file, gives the same color and elevation tokens their light values; a page
 * that wants a light scheme links it (see the comment at its top).
 *
 * Windows, terminals, code blocks and the live session window (demo/session,
 * .bl-sd) take the scheme of the page: dark here, light where light.css is
 * in force, with a white body and a syntax palette drawn for white.
 *
 * The remote screen inside a window (.bl-screen, and .bl-sd__screen in the
 * session) is the picture of a machine's own display: it keeps the dark
 * scheme in every scheme, so that its tag, its pointers and its veil stay
 * drawn for that picture. That is why the first block also applies to it;
 * on a dark page it changes nothing.
 */

/* ── Scheme: color ──────────────────────────────────────────────────────── */

:root,
.bl-screen,
.bl-sd__screen {
  color-scheme: dark;

  /* ── Neutrals: near-black with a green tint ───────────────────────────── */
  --bl-black: #040605;
  --bl-bg: #070a08;            /* page */
  --bl-bg-raised: #0a0e0b;     /* large bands that sit above the page */
  --bl-surface-1: #0d120e;     /* cards, panels */
  --bl-surface-2: #121813;     /* controls, table headers, inset areas */
  --bl-surface-3: #19211a;     /* hover, selected rows */
  --bl-surface-4: #222c23;     /* pressed, strongest neutral fill */

  /* Hairlines are translucent so they hold on any surface. */
  --bl-border: rgba(216, 236, 206, 0.09);
  --bl-border-strong: rgba(216, 236, 206, 0.16);
  --bl-border-focus: rgba(198, 248, 122, 0.55);
  /* The edge of a field, a checkbox or a switch. */
  --bl-border-input: var(--bl-border-strong);
  --bl-border-input-hover: rgba(216, 236, 206, 0.26);

  /* Text. Contrast on --bl-bg: 17.9, 10.6, 6.6 (all AA or better). */
  --bl-text: #f1f5ee;
  --bl-text-2: #b6c0b5;        /* body copy, secondary */
  --bl-text-3: #8c988c;        /* captions, labels, placeholders */
  --bl-text-faint: #5d695e;    /* decoration and disabled only, never content */
  --bl-text-on-accent: #0b1206;

  /* ── Accent: lime ─────────────────────────────────────────────────────── */
  --bl-lime-50: #f5fee6;
  --bl-lime-100: #e6fdc0;      /* highlights, top face of the mark */
  --bl-lime-200: #d7fb9f;
  --bl-lime-300: #c6f87a;      /* THE accent: fills, mark, links on dark */
  --bl-lime-400: #b0f04f;      /* glow core, hover on accent fills */
  --bl-lime-500: #8fd43a;      /* shaded face of the mark */
  --bl-lime-600: #6fae22;
  --bl-lime-700: #4f7d1b;
  --bl-lime-800: #33511a;
  --bl-lime-900: #1f3013;
  --bl-lime-950: #131d0d;

  /* The accent as text, icon, line and focus ring. */
  --bl-accent: var(--bl-lime-300);
  --bl-accent-hover: var(--bl-lime-200);
  --bl-accent-hot: var(--bl-lime-400);
  /* The accent as a solid surface under --bl-text-on-accent: the primary
     button, a selected filter, a ticked box. On dark it is the accent itself. */
  --bl-accent-fill: var(--bl-lime-300);
  --bl-accent-fill-hover: var(--bl-lime-200);
  --bl-accent-fill-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(60, 100, 10, 0.25);

  /* Accent used as a surface on dark: never the solid color, always a wash. */
  --bl-accent-wash-1: rgba(198, 248, 122, 0.06);
  --bl-accent-wash-2: rgba(198, 248, 122, 0.11);
  --bl-accent-wash-3: rgba(198, 248, 122, 0.18);
  --bl-accent-line: rgba(198, 248, 122, 0.28);
  --bl-accent-line-strong: rgba(198, 248, 122, 0.5);

  /* ── Semantic ─────────────────────────────────────────────────────────── */
  --bl-ok: var(--bl-lime-300);
  --bl-warn: #f6c453;
  --bl-warn-wash: rgba(246, 196, 83, 0.12);
  --bl-warn-line: rgba(246, 196, 83, 0.32);
  --bl-danger: #ff7a6b;
  --bl-danger-strong: #f0503f;
  --bl-danger-strong-hover: var(--bl-danger);
  --bl-danger-wash: rgba(255, 122, 107, 0.12);
  --bl-danger-line: rgba(255, 122, 107, 0.34);
  /* Who is acting. The agent is lime; the human is a cool blue. */
  --bl-agent: var(--bl-lime-300);
  --bl-human: #9ccbff;
  --bl-human-wash: rgba(156, 203, 255, 0.12);
  --bl-human-line: rgba(156, 203, 255, 0.34);

  /* The three dots of a window title bar. Chrome only: never a status. */
  --bl-chrome-close: #f0645a;
  --bl-chrome-minimize: #f2bc4e;
  --bl-chrome-zoom: #5fc866;

  /* The frame and title bar of a window, and the body of a terminal or a
     code block inside it. */
  --bl-window-bg: var(--bl-surface-1);
  --bl-code-bg: var(--bl-black);

  /* Syntax, for terminals and code blocks. */
  --bl-syn-prompt: var(--bl-lime-300);  /* prompt, success line, caret */
  --bl-syn-cmd: var(--bl-lime-200);     /* the command a person typed */
  --bl-syn-arg: var(--bl-lime-200);     /* a quoted argument in a terminal */
  --bl-syn-key: #c6f87a;
  --bl-syn-string: #f1f5ee;
  --bl-syn-number: #9ccbff;
  --bl-syn-name: #c4a7ff;       /* keys of a document (YAML, JSON) */
  --bl-syn-comment: #7c887c;
  --bl-syn-punct: #8c988c;
  --bl-syn-flag: #f6c453;

  /* ── Focus ring, field and veil ─────────────────────────────────────── */
  --bl-ring: 0 0 0 2px var(--bl-bg), 0 0 0 4px var(--bl-accent);
  /* The inner shadow of a field, and the veil behind a modal dialog. */
  --bl-inset: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  --bl-scrim: color-mix(in srgb, var(--bl-black) 72%, transparent);
}

/* ── Elevation ──────────────────────────────────────────────────────────
   On the root only, so that everything on a page, a window included, casts
   that page's shadow. */

:root {
  /* On a dark theme elevation is mostly a lighter surface plus a top highlight. */
  --bl-highlight: inset 0 1px 0 rgba(236, 255, 220, 0.06);
  --bl-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --bl-shadow-2: 0 8px 24px -8px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
  --bl-shadow-3: 0 32px 80px -24px rgba(0, 0, 0, 0.85), 0 12px 28px -12px rgba(0, 0, 0, 0.6);

  /* Glows: accent light, used sparingly and never on text. */
  --bl-glow-sm: 0 0 0 1px rgba(198, 248, 122, 0.22), 0 0 18px -2px rgba(176, 240, 79, 0.28);
  --bl-glow-md: 0 0 0 1px rgba(198, 248, 122, 0.3), 0 0 44px -6px rgba(176, 240, 79, 0.4);
  --bl-glow-lg: 0 0 0 1px rgba(198, 248, 122, 0.3), 0 0 120px -10px rgba(176, 240, 79, 0.45);
}

/* ── Type, space, shape, motion: the same in every scheme ──────────────── */

:root {
  /* ── Type ─────────────────────────────────────────────────────────────── */
  --bl-font-sans: "Manrope", "Manrope Fallback", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bl-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  --bl-text-2xs: 0.6875rem;    /* 11: table headers, badges */
  --bl-text-xs: 0.75rem;       /* 12: captions, mono labels */
  --bl-text-sm: 0.8125rem;     /* 13: dense UI */
  --bl-text-md: 0.875rem;      /* 14: UI default */
  --bl-text-base: 1rem;        /* 16: reading */
  --bl-text-lg: 1.125rem;      /* 18: lead */
  --bl-text-xl: 1.3125rem;     /* 21 */
  --bl-text-2xl: 1.625rem;     /* 26 */
  --bl-text-3xl: 2.125rem;     /* 34 */
  --bl-text-4xl: 2.75rem;      /* 44 */
  --bl-text-5xl: 3.5rem;       /* 56 */
  --bl-text-6xl: 4.5rem;       /* 72 */
  /* Fluid sizes for marketing headings. */
  --bl-text-display: clamp(2.5rem, 1.35rem + 4.9vw, 4.75rem);
  --bl-text-title: clamp(1.875rem, 1.3rem + 2.4vw, 3rem);

  --bl-weight-regular: 400;
  --bl-weight-medium: 500;
  --bl-weight-semibold: 600;
  --bl-weight-bold: 700;

  --bl-leading-tight: 1.04;
  --bl-leading-snug: 1.2;
  --bl-leading-ui: 1.4;
  --bl-leading-body: 1.6;

  --bl-tracking-display: -0.035em;
  --bl-tracking-title: -0.025em;
  --bl-tracking-ui: -0.005em;
  --bl-tracking-label: 0.14em;   /* uppercase mono labels */

  /* ── Space (4 px grid) ────────────────────────────────────────────────── */
  --bl-space-1: 0.25rem;
  --bl-space-2: 0.5rem;
  --bl-space-3: 0.75rem;
  --bl-space-4: 1rem;
  --bl-space-5: 1.25rem;
  --bl-space-6: 1.5rem;
  --bl-space-8: 2rem;
  --bl-space-10: 2.5rem;
  --bl-space-12: 3rem;
  --bl-space-16: 4rem;
  --bl-space-20: 5rem;
  --bl-space-24: 6rem;
  --bl-space-32: 8rem;

  --bl-container: 75rem;         /* 1200 */
  --bl-gutter: clamp(1.25rem, 4vw, 2.5rem);
  --bl-section: clamp(4.5rem, 9vw, 8.5rem);

  /* ── Radii ────────────────────────────────────────────────────────────── */
  --bl-radius-xs: 4px;
  --bl-radius-sm: 6px;
  --bl-radius-md: 10px;
  --bl-radius-lg: 14px;
  --bl-radius-xl: 20px;
  --bl-radius-2xl: 28px;
  --bl-radius-pill: 999px;

  /* ── Motion ───────────────────────────────────────────────────────────── */
  --bl-dur-1: 120ms;             /* hover, press */
  --bl-dur-2: 200ms;             /* small state changes */
  --bl-dur-3: 360ms;             /* panels, tabs */
  --bl-dur-4: 700ms;             /* reveals */
  --bl-dur-5: 1200ms;            /* hero entrances */
  --bl-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --bl-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --bl-ease-in: cubic-bezier(0.5, 0, 0.9, 0.4);
  --bl-ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);

  /* ── Layers ───────────────────────────────────────────────────────────── */
  --bl-z-base: 0;
  --bl-z-raised: 10;
  --bl-z-sticky: 100;
  --bl-z-overlay: 200;
  --bl-z-toast: 300;
}
