/* ==========================================================================
   Askling product tokens.

   THE ONLY FILE WITH COLOUR LITERALS (enforced by scripts/lint-colours.mjs
   and the ESLint colour rule). Every component reads these custom
   properties; nothing else may write a hex, rgb, hsl or oklch value.

   Source of truth for the look: the Askling website (v3), BRAND.md section 6
   and assets/site.css. The values below are the website's role tokens, with
   the type scale and spacing tightened for a dense app (15 px body, 44 px
   tile numbers instead of 54 px marketing numbers).

   Light only for now. Tokens are named by ROLE, never by hue, so a dark set
   can be added later as one more block:
     :root[data-theme="dark"] { --surface-page: ...; ... }
   Components must never branch on the theme themselves.
   ========================================================================== */

:root,
:root[data-theme="light"] {
  color-scheme: light;

  /* ---- surfaces ---------------------------------------------------------- */
  --surface-page: #EEF0F4;          /* app canvas behind tiles */
  --surface-card: #FFFFFF;          /* sidebar, panels, popups, table rows */
  --surface-well: #F6F7FA;          /* popup footer, quiet wells */
  --surface-sunken: #E4E7EE;        /* skeletons, neutral badges, tracks */
  --surface-hover: #F1F3F7;         /* row and nav hover on light grounds */
  --surface-scrim: rgba(10, 16, 36, 0.58); /* the dim behind popups */
  --surface-frost: rgba(255, 255, 255, 0.55); /* the light veil over a frosted, locked ICP tile (brief I5) */
  --surface-page-dot: rgba(18, 28, 61, 0.10); /* the website canvas dot, on the page ground */

  /* the header band: the website's navy band */
  --band-surface: #121C3D;
  --band-raised: #1C2852;
  --band-raised-2: #26346A;
  --band-chip: var(--band-raised-2); /* an icon chip on a navy strip */
  --band-marker: #B4BCD3;           /* the thin marker on the band's left edge */
  --band-track: rgba(255, 255, 255, 0.18); /* the empty bar on the run card's navy block */
  --text-on-band-problem: #FF9A9A;  /* the soft red big line on navy: the last run did not finish (run card) */

  /* ---- text -------------------------------------------------------------- */
  --text-primary: #121C3D;
  --text-strong: #2A3557;
  --text-secondary: #4A556E;
  --text-on-band: #F2F4FA;
  --text-on-band-secondary: #B4BCD3;
  --text-on-solid: #FFFFFF;         /* on red bands, navy tags and chips */
  --sheen: rgb(255 255 255 / 0.22); /* the slow light across a busy primary button (Run now was clicked) */
  --sheen-stripe: rgb(255 255 255 / 0.35); /* the moving stripes on a working bar (setup window, brief O2) */
  --logo-hubspot: #FF7A59; /* HubSpot's own orange, only behind its mark on Connect HubSpot (brief O2) */
  --logo-hubspot-ink: #FFFFFF;

  /* ---- lines ------------------------------------------------------------- */
  --line-subtle: rgba(18, 28, 61, 0.12);
  --line-strong: rgba(18, 28, 61, 0.26);
  --line-on-band: rgba(255, 255, 255, 0.14);
  --line-on-band-strong: rgba(255, 255, 255, 0.38);
  --spot-ring: var(--line-subtle);  /* the soft ring around the button Askling help points at (Show me where) */

  /* ---- brand: deep navy. Name tags, chips, primary button, brand strip ---- */
  --brand-solid: #121C3D;
  --brand-face: #1C2852;            /* face of the navy primary button */
  --brand-hover: #26346A;
  --brand-strip: #121C3D;
  --brand-fold: #070C1F;

  /* ---- yes: the one accent, in one role. Approve, success, Active. ------- */
  --yes-solid: #2ED38F;
  --yes-hover: #24C483;
  --yes-strip: #1EAF74;
  --yes-fold: #127A50;
  --yes-bright: #49DEA0;            /* the green Run now on navy, under the pointer */
  --yes-tint: #E4F9F0;
  --text-on-yes: #0B1530;
  --text-yes: #0A7A50;              /* yes as text on light grounds */

  /* ---- notify: the red count badge (owner 2026-11-09). Always this red, white bold number. ---- */
  --notify-badge: #D92D20;
  --text-on-notify: #FFFFFF;

  /* ---- priority: strip, fold (shade), number, tint, ink ------------------ */
  /* strip = right edge colour; fold = the darker band between face and strip;
     text = the big tile number (>= 3:1 on white, measured >= 5:1);
     tint + ink = small pills (ink on tint >= 4.5:1). */
  /* Saffron and garnet (owner 2026-10-21, CL-P1): replaces the old yellow and red; all text passes WCAG AA. */
  --prio-high-strip: #C0263A;
  --prio-high-fold: #86182A;
  --prio-high-text: #B0213A;
  --prio-high-tint: #FBE4E7;
  --prio-high-ink: #8A1A2C;

  --prio-medium-strip: #F39200;
  --prio-medium-fold: #B06300;
  --prio-medium-text: #985400;
  --prio-medium-tint: #FEECD6;
  --prio-medium-ink: #7A4300;

  --prio-low-strip: #A4ADBD;
  --prio-low-fold: #7D8799;
  --prio-low-text: #5A6478;
  --prio-low-tint: #EBEDF0;
  --prio-low-ink: #4A556E;

  /* a clean company in the squares of Data quality: the sunken surface, so only the work stands out */
  --waffle-clean: var(--surface-sunken);

  /* ---- state ------------------------------------------------------------- */
  --state-ok: #1F9D63;              /* status dot: running, connected */
  --state-off: #8A93A8;             /* status dot and switch track: off */
  --state-ok-halo: rgba(31, 157, 99, 0.28);
  --state-off-halo: rgba(138, 147, 168, 0.28);

  /* red band: kill switch paused, connection revoked */
  --band-problem-surface: #86182A;
  --band-problem-text: #FFFFFF;
  --band-warning-surface: #FEECD6;
  --band-warning-text: #7A4300;

  /* ---- tile parts -------------------------------------------------------- */
  --tile-face: #FFFFFF;
  --tag-surface: #121C3D;
  --tag-text: #FFFFFF;
  --chip-surface: #121C3D;
  --chip-text: #FFFFFF;
  --pill-surface: #F1F3F7;
  --knob: #FFFFFF;

  /* ---- the deck: ghost tiles for empty states and the connect page only -- */
  --deck-face: #FFFFFF;
  --deck-line: rgba(18, 28, 61, 0.09);
  --deck-strip: color-mix(in srgb, #121C3D 48%, #FFFFFF);
  --deck-fold: color-mix(in srgb, #070C1F 48%, #FFFFFF);
  --deck-strip-back: color-mix(in srgb, #121C3D 24%, #FFFFFF);
  --deck-fold-back: color-mix(in srgb, #070C1F 24%, #FFFFFF);
  --deck-chip: color-mix(in srgb, #121C3D 70%, #FFFFFF);

  /* ---- sign in marks (brief A3): the providers' own logo colours, used ONLY inside their marks on the
     Sign in with Google and Sign in with Microsoft buttons. Named by brand, not by role, because they are
     someone else's fixed logo and never a role of the Askling palette. -------------------------------- */
  --mark-google-blue: #4285F4;
  --mark-google-green: #34A853;
  --mark-google-yellow: #FBBC05;
  --mark-google-red: #EA4335;
  --mark-microsoft-red: #F25022;
  --mark-microsoft-green: #7FBA00;
  --mark-microsoft-blue: #00A4EF;
  --mark-microsoft-yellow: #FFB900;

  /* ---- focus ------------------------------------------------------------- */
  --focus-ring: #121C3D;            /* 2 px, on light grounds */
  --focus-ring-on-band: #F2F4FA;    /* 2 px white ring on the navy band */
  --focus-flash: #121C3D;           /* the landed highlight on a tile */

  /* ---- elevation: no shadow at rest (pack 07, rule 3) -------------------- */
  --shadow-hover: 0 1px 2px rgba(18, 28, 61, 0.06), 0 10px 22px -16px rgba(18, 28, 61, 0.42);
  --shadow-float: 0 2px 4px rgba(18, 28, 61, 0.08), 0 18px 36px -18px rgba(18, 28, 61, 0.50);
  --shadow-popup: 0 30px 80px -20px rgba(3, 6, 15, 0.55);
}

/* ==========================================================================
   Non colour tokens: type, shape, spacing, layout, layers, motion.
   Theme independent. A dark set never needs to touch these.
   ========================================================================== */

:root {
  /* type. Anybody (display: titles, figures, tags, buttons) against Geist
     (body). The --font-*-src variables are set by next/font/local on <html>;
     the plain family names are the fallback when they are not. */
  --font-display: var(--font-anybody-src, "Anybody"), var(--font-geist-src, "Geist"), ui-sans-serif, sans-serif;
  --font-body: var(--font-geist-src, "Geist"), ui-sans-serif, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;

  --text-xs: 0.75rem;      /* 12 px: count badges */
  --text-sm: 0.8125rem;    /* 13 px: tags, pills, eyebrows, table heads */
  --text-md: 0.875rem;     /* 14 px: dense rows, status line */
  --text-body: 0.9375rem;  /* 15 px: body */
  --text-lg: 1.0625rem;    /* 17 px: unit next to a big number, lead lines */
  --text-title: 1.5rem;    /* 24 px: page one level deeper, popup title */
  --text-number: 2.75rem;  /* 44 px: the tile's focal number */
  --text-hero: 3.5rem;     /* 56 px: the popup hero number */
  --leading-body: 1.5;
  --leading-tight: 1.15;
  --weight-body: 400;
  --weight-strong: 600;
  --weight-tag: 650;
  --weight-display: 800;
  --stretch-display: 104%;
  --stretch-number: 112%;
  --stretch-tag: 94%;

  /* radius: each one has a job (BRAND.md 6) */
  --radius-tile: 12px;     /* tiles and buttons */
  --radius-tag: 9px;       /* name tags, nav items, category buttons */
  --radius-input: 10px;
  --radius-chip: 8px;      /* icon chips on strips */
  --radius-popup: 20px;
  --radius-pill: 999px;    /* status, badges and the money pill only */

  /* the strip */
  --strip-w: 56px;
  --fold-w: 8px;
  --btn-strip: 40px;
  --btn-fold: 4px;

  /* spacing: 4 px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* layout */
  --sidebar-w: 240px;
  --content-max: 1200px;
  --content-pad: 24px;
  --grid-gap: 16px;
  --tile-h: 160px;         /* room for a two line title above the number line (card headings, 2026-11-10) */
  --tile-h-quiet: 132px;
  --popup-max: 760px;
  /* the width rule (owner 2026-11-10: "a rule for every card's width"): a popup without a table is --popup-max, a popup with a table is
     --popup-max-wide (Popup `wide`), a phone is full width */
  --popup-max-wide: 936px;
  --logbook-w: 560px;
  --control-h: 40px;
  --control-h-sm: 32px;
  --touch-min: 44px;

  /* layers (pack 07, declared once, tested): popup > flyout > top bar > content */
  --z-content: 0;
  --z-raised: 10;          /* the logbook button: still page content (0 to 10) */
  --z-popover: 20;         /* the field picker's popover: above tiles, scrolls under the top bar */
  --z-topbar: 30;
  --z-flyout: 40;
  --z-sheet: 45;           /* the field picker's phone sheet: over the bar and flyouts, below dialogs */
  --z-popup: 50;

  /* motion: two registers, from the website.
     Productive: 120 / 200 ms. Popup: 200 in, 150 out. */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-popup-in: 240ms;
  --dur-height: 220ms;       /* a popup's height glides when its content grows or shrinks */
  --dur-reduced-fade: 100ms; /* reduced motion: opacity only */
  --dur-popup-out: 150ms;
  --dur-leave: 180ms;
  --dur-flash: 900ms;
  --dur-reveal: 560ms;
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-glide: cubic-bezier(0.4, 0, 0.2, 1); /* a height change: gentle start and end, so no frame moves it far */
  --ease-exit: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-ui: cubic-bezier(0.2, 0, 0, 1);
}

@media (max-width: 639px) {
  :root {
    --strip-w: 44px;
    --grid-gap: 12px;
    --content-pad: 16px;
    --text-number: 2.5rem;
  }
}
