/* xonicbox design tokens v2.4
   Source: guide/BRAND.md v2.4 section 4.2 (v2.0 approved 2026-12-03, "approve all"; v2.1 grid approved 2026-12-03, "1 yes").
   Copy this file as it is; values change only in the guide and here together, never locally in a site.
   @font-face rules are not part of the tokens: see guide 4.3 rule 9 (font paths depend on the site). */

:root {
  color-scheme: light dark;

  /* brand colours: the same in both modes */
  --xb-blue:  #2B4BFF;
  --xb-night: #6F88FF;
  --xb-ink:   #111318;
  --xb-paper: #FFFFFF;
  --xb-linen: #F4F1EC;
  --xb-stone: #6B6660;

  /* roles, light (default) */
  --xb-bg:           #FFFFFF;  /* page ground: paper */
  --xb-panel:        #F4F1EC;  /* quiet panels, contact callout: linen */
  --xb-text:         #111318;  /* ink */
  --xb-muted:        #6B6660;  /* stone */
  --xb-hairline:     #E6E1D8;  /* decorative borders and rules */
  --xb-rule:         #111318;  /* the grid: frame, section and cell lines (v2.1) */
  --xb-field:        #8A847C;  /* input and control borders, 3:1 */
  --xb-accent:       #2B4BFF;  /* links, primary button, focus ring */
  --xb-accent-hover: #1F3BE0;
  --xb-on-accent:    #FFFFFF;  /* text on the primary button */
  --xb-ring:         0 0 0 2px var(--xb-bg), 0 0 0 4px var(--xb-accent);
  --xb-logo-ink:     #111318;  /* lockup flaps and word, inlined (v2.2) */
  --xb-logo-dot:     #2B4BFF;  /* lockup centre and period */
  --xb-weave-ground: #F4F1EC;  /* the weave: linen by day */
  --xb-weave-bar:    #2B4BFF;

  /* type (guide 4.3) */
  --xb-font-serif: "Instrument Serif", "xb Peso", "Instrument Serif Fallback", "Times New Roman", serif;
  --xb-font-sans:  "Instrument Sans", "xb Peso", "Instrument Sans Fallback", Arial, system-ui, sans-serif;
  --xb-step--1: 0.875rem;                                  /* 14 px: captions, labels, footer. The floor. */
  --xb-step-0:  1rem;                                      /* 16 px: body, buttons, nav, inputs */
  --xb-step-1:  1.125rem;                                  /* 18 px: lead; h3 and card titles (sans 600) */
  --xb-step-2:  clamp(1.5rem, 1.2rem + 1.2vw, 2rem);       /* 24-32 px: h2 (serif) */
  --xb-step-3:  clamp(2rem, 1.5rem + 2vw, 2.75rem);        /* 32-44 px: h1 on text pages (serif) */
  --xb-step-4:  clamp(2.5rem, 1.6rem + 3.6vw, 5rem);       /* 40-80 px: home hero, one per site (serif; v2.4) */
  --xb-lh-hero:  1.05;
  --xb-lh-head:  1.1;   /* h1, h2 */
  --xb-lh-snug:  1.3;   /* h3, card titles, buttons, nav */
  --xb-lh-small: 1.5;   /* 14 px text */
  --xb-lh-body:  1.6;   /* paragraphs, lists, lead */
  --xb-ls-serif: -0.01em; /* serif at step 2 and up; sans is never tracked */
  --xb-w-body:   400;
  --xb-w-ui:     500;   /* buttons, nav, labels */
  --xb-w-strong: 600;   /* h3, card titles, inline emphasis, totals */
  --xb-max-text: 33rem; /* body measure: about 72 characters of Instrument Sans at 16 px */
  --xb-max-lead: 36rem; /* lead measure: about 69 characters at 18 px */
  --xb-max-head: 16em;  /* hero and h1 wrap here: about 45 characters of Instrument Serif */

  /* spacing (4 px base), shape, layout */
  --xb-space-1: 0.25rem; --xb-space-2: 0.5rem; --xb-space-3: 0.75rem; --xb-space-4: 1rem;
  --xb-space-5: 1.5rem;  --xb-space-6: 2rem;   --xb-space-7: 3rem;    --xb-space-8: 4rem;
  --xb-radius-sm: 6px;     /* inputs */
  --xb-radius:    12px;    /* cards, panels, screenshot frames */
  --xb-bevel:    10px;      /* buttons: the cut on two opposite corners (v2.2; replaces the pill) */
  --xb-bevel-sm: 8px;       /* choice chips */
  --xb-ease: cubic-bezier(.2, .7, .2, 1); /* motion (4.5) */
  --xb-max: none;          /* v2.4: the frame is the full window width (was 1200 px). Text keeps its measures */
  --xb-pad: clamp(2rem, 1rem + 1.6vw, 3.5rem); /* v2.4: cell padding, 32-56 px */
  --xb-tap: 44px;          /* minimum tap target */
}

/* dark mode follows the OS unless the visitor picked a theme with the switch (v2.2) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --xb-bg:           #111318;  /* ink */
    --xb-panel:        #1A1D24;
    --xb-text:         #F4F1EC;  /* linen */
    --xb-muted:        #A9A49C;
    --xb-hairline:     #2A2E38;
    --xb-rule:         #77726B;
    --xb-field:        #77726B;
    --xb-accent:       #6F88FF;  /* night blue */
    --xb-accent-hover: #93A6FF;
    --xb-on-accent:    #111318;  /* ink text on the night-blue button */
    --xb-logo-ink:     #FFFFFF;
    --xb-logo-dot:     #6F88FF;
    --xb-weave-ground: #111318;
    --xb-weave-bar:    #6F88FF;
  }
}

/* v2.2: the site's switch sets data-theme on <html> */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --xb-bg:           #111318;  /* ink */
  --xb-panel:        #1A1D24;
  --xb-text:         #F4F1EC;  /* linen */
  --xb-muted:        #A9A49C;
  --xb-hairline:     #2A2E38;
  --xb-rule:         #77726B;
  --xb-field:        #77726B;
  --xb-accent:       #6F88FF;  /* night blue */
  --xb-accent-hover: #93A6FF;
  --xb-on-accent:    #111318;  /* ink text on the night-blue button */
  --xb-logo-ink:     #FFFFFF;
  --xb-logo-dot:     #6F88FF;
  --xb-weave-ground: #111318;
  --xb-weave-bar:    #6F88FF;
}
