/* Design tokens of the interface. Every colour, size, radius, shadow and curve a component uses is
   named here; components.css and pages.css never write a raw hex value or pixel shadow.
   A customer installation sets four values: --accent and --accent-fill, light and dark. */

@font-face {
  font-family: 'Inter IOS';
  src: url("../vendor/fonts/inter-latin-opsz-normal.4b73e2ff3024.woff2") format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Geist Mono IOS';
  src: url("../vendor/fonts/geist-mono-latin-wght-normal.a15f9d568fb0.woff2") format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* a hairline is half a point only where a point is two device pixels (Retina); on a 1x display
     a .5px border or spread is partly dropped by WebKit, so it is a full pixel there */
  --hairline: 1px;
  /* icon sizes by role: s inline in text and small controls, m in buttons, menus and fields, b the
     round icon button, l the back link, the palette and an outcome title, xl an empty state */
  --icon-s: 14px; --icon-m: 16px; --icon-b: 18px; --icon-l: 20px; --icon-xl: 28px;
  /* ---------------------------------------------------------------- type */
  --font: 'Inter IOS', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; /* password fields: the system face shows the dots well */
  --mono: 'Geist Mono IOS', ui-monospace, 'SF Mono', Menlo, monospace; /* SQL and codes only */
  --t-hero: 44px;      /* the question page title */
  --t-large: 34px;     /* the large title of every other page */
  --t-title: 21px;     /* section titles */
  --t-head: 16px;      /* headline: card and widget titles */
  --t-read: 19px;      /* the answer's reading */
  --t-body: 15px;
  --t-control: 14px;   /* buttons, menus, table cells */
  --t-sub: 13px;       /* subhead, labels, metadata */
  --t-foot: 12.5px;    /* footnotes, axis */
  --w-regular: 400; --w-medium: 500; --w-semibold: 600; --w-bold: 700;

  /* ---------------------------------------------------------------- radii by role */
  --r-xs: 7px;    /* kbd, segment, small chips */
  --r-sm: 10px;   /* rows, fields, nav items, search */
  --r-md: 14px;   /* menus, code, preview surfaces */
  --r-lg: 22px;   /* sheets, dialogs, lifted dashboard tiles */
  --r-xl: 28px;   /* the question field */
  --r-pill: 999px;/* buttons, capsules, toasts */

  /* ---------------------------------------------------------------- space: a 4-point grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --sidebar-w: 252px;
  --page-x: 56px;
  --toolbar-h: 56px;
  --control-h: 34px;
  --field-h: 40px;

  /* ---------------------------------------------------------------- motion
     core.js overwrites these four with the sampled springs (linear()); these are the
     fallbacks for engines without linear(). Durations are the measured settle times. */
  --spring-smooth: cubic-bezier(.25, .8, .25, 1); --spring-smooth-d: 500ms;
  --spring-snappy: cubic-bezier(.3, 1.25, .4, 1); --spring-snappy-d: 420ms;
  --spring-bouncy: cubic-bezier(.3, 1.45, .4, 1); --spring-bouncy-d: 600ms;
  --spring-gentle: cubic-bezier(.22, .9, .2, 1); --spring-gentle-d: 700ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --fade: 200ms;  /* colour and opacity changes that answer hover */
}

/* ---------------------------------------------------------------- light */
:root, :root[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff;              /* the sheet */
  --bg-side: #f4f5f7;         /* sidebar plane */
  --bg-group: #f4f5f7;        /* code, preview, quiet surfaces */
  --bg-elev: #ffffff;         /* menus, dialogs, field */
  --material: rgba(255, 255, 255, .86);
  --material-side: rgba(244, 245, 247, .8);
  --label: #1b1c1f;
  --label-2: #5f6168;         /* 6.2:1 on --bg, 5.8:1 on --bg-side */
  --label-3: #8a8c93;         /* icons and disabled text only: under 4.5:1 */
  --placeholder: #6e7077;
  --fill: rgba(116, 118, 128, .12);
  --fill-soft: rgba(116, 118, 128, .075);
  --fill-press: rgba(116, 118, 128, .2);
  --fill-strong: rgba(116, 118, 128, .28);
  --sep: rgba(60, 62, 70, .12);
  --sep-strong: rgba(60, 62, 70, .2);
  --scrim: rgba(20, 21, 26, .18);
  --positive: #1a7f45;
  --negative: #c2352b;
  --caution: #9a5b00;
  --mark-muted: #d5d7dc;
  --mark-muted-line: #b3b5bc;
  --on-accent: var(--cb-brand-on, #ffffff);
  --shadow-field: 0 0 0 var(--hairline) rgba(0, 0, 0, .07), 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px -6px rgba(0, 0, 0, .07);
  --shadow-pop: 0 0 0 var(--hairline) rgba(0, 0, 0, .09), 0 2px 6px rgba(0, 0, 0, .05), 0 14px 40px -6px rgba(0, 0, 0, .14);
  --shadow-lift: 0 0 0 var(--hairline) rgba(0, 0, 0, .06), 0 2px 6px rgba(0, 0, 0, .04), 0 18px 40px -12px rgba(0, 0, 0, .14);
  --shadow-drag: 0 0 0 var(--hairline) rgba(0, 0, 0, .08), 0 30px 60px -12px rgba(0, 0, 0, .25);
  --shadow-thumb: 0 0 0 var(--hairline) rgba(0, 0, 0, .06), 0 2px 5px rgba(0, 0, 0, .1);
  --thumb: #ffffff;
  --white: #ffffff;
  --black: #000000;
  --on-accent-2: color-mix(in srgb, var(--on-accent) 85%, transparent);
  --shadow-knob: 0 1px 3px rgba(0, 0, 0, .2), 0 0 0 var(--hairline) rgba(0, 0, 0, .04);
}

/* ---------------------------------------------------------------- dark */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #161618;
  --bg-side: #1d1e21;
  --bg-group: #202124;
  --bg-elev: #28292d;
  --material: rgba(22, 22, 24, .84);
  --material-side: rgba(34, 35, 39, .78);
  --label: #f4f4f6;
  --label-2: #a3a5ac;         /* 7.3:1 on --bg */
  --label-3: #75777e;
  --placeholder: #8c8e95;
  --fill: rgba(120, 122, 132, .24);
  --fill-soft: rgba(120, 122, 132, .14);
  --fill-press: rgba(120, 122, 132, .34);
  --fill-strong: rgba(120, 122, 132, .4);
  --sep: rgba(255, 255, 255, .09);
  --sep-strong: rgba(255, 255, 255, .16);
  --scrim: rgba(0, 0, 0, .48);
  --positive: #52cf85;
  --negative: #ff6f64;
  --caution: #f2b252;
  --mark-muted: #43454a;
  --mark-muted-line: #5d5f66;
  --shadow-field: 0 0 0 var(--hairline) rgba(255, 255, 255, .1), 0 10px 30px -6px rgba(0, 0, 0, .5);
  --shadow-pop: 0 0 0 var(--hairline) rgba(255, 255, 255, .12), 0 16px 48px -6px rgba(0, 0, 0, .6);
  --shadow-lift: 0 0 0 var(--hairline) rgba(255, 255, 255, .09), 0 18px 40px -12px rgba(0, 0, 0, .6);
  --shadow-drag: 0 0 0 var(--hairline) rgba(255, 255, 255, .14), 0 30px 60px -12px rgba(0, 0, 0, .7);
  --shadow-thumb: none;
  --thumb: #5a5b61;
  --white: #ffffff;
  --black: #000000;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #161618;
    --bg-side: #1d1e21;
    --bg-group: #202124;
    --bg-elev: #28292d;
    --material: rgba(22, 22, 24, .84);
    --material-side: rgba(34, 35, 39, .78);
    --label: #f4f4f6;
    --label-2: #a3a5ac;         /* 7.3:1 on --bg */
    --label-3: #75777e;
    --placeholder: #8c8e95;
    --fill: rgba(120, 122, 132, .24);
    --fill-soft: rgba(120, 122, 132, .14);
    --fill-press: rgba(120, 122, 132, .34);
    --fill-strong: rgba(120, 122, 132, .4);
    --sep: rgba(255, 255, 255, .09);
    --sep-strong: rgba(255, 255, 255, .16);
    --scrim: rgba(0, 0, 0, .48);
    --positive: #52cf85;
    --negative: #ff6f64;
    --caution: #f2b252;
    --mark-muted: #43454a;
    --mark-muted-line: #5d5f66;
    --shadow-field: 0 0 0 var(--hairline) rgba(255, 255, 255, .1), 0 10px 30px -6px rgba(0, 0, 0, .5);
    --shadow-pop: 0 0 0 var(--hairline) rgba(255, 255, 255, .12), 0 16px 48px -6px rgba(0, 0, 0, .6);
    --shadow-lift: 0 0 0 var(--hairline) rgba(255, 255, 255, .09), 0 18px 40px -12px rgba(0, 0, 0, .6);
    --shadow-drag: 0 0 0 var(--hairline) rgba(255, 255, 255, .14), 0 30px 60px -12px rgba(0, 0, 0, .7);
    --shadow-thumb: none;
    --thumb: #5a5b61;
  
    --white: #ffffff;
    --black: #000000;
  }
}

/* ---------------------------------------------------------------- the customer's colour
   The only accent. --accent is for text and marks (AA on --bg), --accent-fill for surfaces that
   carry --on-accent, the text colour the brand derives. The installation's brand sheet (`/brand/sheet/`) writes the --cb-brand-* values
   and these two read them; without a sheet the defaults below stand. Until the old catalogue is
   retired the brand sheet is derived against the old surfaces, so the contrast of the accent on
   the new ones is the sheet's, not guaranteed here. */
:root, :root[data-theme='light'] { --accent: var(--cb-brand-ink, #2152c4); --accent-fill: var(--cb-brand-action, #2152c4); }
:root[data-theme='dark'] { --accent: var(--cb-brand-ink, #82a8ff); --accent-fill: var(--cb-brand-action, #2e5fd0); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --accent: var(--cb-brand-ink, #82a8ff); --accent-fill: var(--cb-brand-action, #2e5fd0); }
}
:root {
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);   /* selection, receive pulse */
  --accent-soft-2: color-mix(in srgb, var(--accent) 30%, var(--bg));   /* ranked bars after the first */
  --accent-2: color-mix(in srgb, var(--accent) 58%, var(--bg));        /* the third series of a chart, a share's third part */
  --focus: color-mix(in srgb, var(--accent) 70%, transparent);        /* focus ring */
}

@media (min-resolution: 2dppx) {
  :root { --hairline: .5px; }
}
