/* tokens.css: Ximus design tokens. Primitives, then semantic layers. */

:root {
  color-scheme: light;

  /* ---------- PRIMITIVE: colour. Three brand hue families: navy (and navy-tinted greys), green, blue. Red is a status colour for form errors only. ---------- */
  --c-white:    #ffffff;
  --c-gray-50:  #f4f6fa;
  --c-gray-100: #eef2f8;
  --c-gray-200: #d5dce8;
  --c-gray-300: #b9c4d6;
  --c-gray-500: #6b7a90;
  --c-ink-900:  #0f1b2d;
  --c-ink-700:  #3a4a60;
  --c-ink-500:  #586882;
  --c-navy-950: #06142a;
  --c-navy-900: #0b1b33;
  --c-navy-800: #11284a;
  --c-navy-700: #183560;
  --c-navy-600: #28436b;
  --c-navy-500: #3a5a8a;
  --c-navy-300: #9fb2cf;
  --c-navy-200: #c9d5e8;
  --c-green-50:  #e8f7ee;
  --c-green-200: #9fd9b6;
  --c-green-300: #6ff59c;
  --c-green-400: #3ef07a;
  --c-green-600: #0f7a3e;
  --c-green-700: #0b6532;
  --c-blue-50:  #e9f0fc;
  --c-blue-200: #b5d1ff;
  --c-blue-300: #8ab8ff;
  --c-blue-600: #1a5fcf;
  --c-blue-700: #1449a3;
  --c-red-50:   #fef3f2;     /* status colour: form errors only, not a brand hue */
  --c-red-300:  #ffb4ab;
  --c-red-700:  #b42318;
  --c-navy-rgb:  11, 27, 51;     /* for shadows */
  --c-white-rgb: 255, 255, 255;
  --c-green-rgb: 62, 240, 122;
  --c-blue-rgb:  138, 184, 255;

  /* ---------- PRIMITIVE: size (rem; 1rem = 16px) ---------- */
  --size-1:  0.25rem;   /*  4px */
  --size-2:  0.5rem;    /*  8px */
  --size-3:  0.75rem;   /* 12px */
  --size-4:  1rem;      /* 16px */
  --size-5:  1.5rem;    /* 24px */
  --size-6:  2rem;      /* 32px */
  --size-7:  3rem;      /* 48px */
  --size-8:  4rem;      /* 64px */
  --size-9:  6rem;      /* 96px */

  /* ---------- PRIMITIVE: radius, border, font, motion ---------- */
  --r-md: 0.5rem;
  --r-lg: 0.75rem;
  --r-pill: 999px;
  --bw: 1px;
  --bw-focus: 3px;
  --font-inter: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --logo-size: 3.5rem;
  --fw-400: 400; --fw-500: 500; --fw-600: 600; --fw-700: 700;
  --dur-100: 150ms;
  --dur-200: 250ms;
  --ease-std: ease;

  /* ---------- SEMANTIC (not colour): type, space, layout, shadow ---------- */
  --font-heading: var(--font-inter);
  --font-body:    var(--font-inter);
  --fs-display: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);   /* h1: 36px to 56px */
  --fs-h2:      clamp(1.625rem, 1.25rem + 1.6vw, 2.5rem); /* 26px to 40px */
  --fs-h3:      clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);  /* 17px to 20px */
  --fs-lead:    clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);  /* 17px to 20px */
  --fs-body:    1rem;
  --fs-small:   0.875rem;
  --lh-display: 1.12;
  --lh-heading: 1.2;
  --lh-snug:    1.35;
  --lh-body:    1.65;
  --ls-heading: -0.01em;
  --ls-label:   0.04em;

  --gap-xs: var(--size-2);
  --gap-sm: var(--size-3);
  --gap-md: var(--size-4);
  --gap-lg: var(--size-5);
  --gap-xl: var(--size-6);
  --gap-2xl: var(--size-7);
  --section-y: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --gutter:    clamp(1rem, 0.5rem + 2vw, 2rem);
  --container-max: 73.75rem;        /* 1180px */
  --measure:   40rem;               /* 640px max line length */
  --measure-faq: 50rem;             /* 800px */
  --header-h:  4.5rem;              /* 72px */
  --scroll-pad: 5.5rem;             /* 88px: header height + air */
  --tap-sm: 2.5rem;                 /* 40px */
  --tap-md: 3rem;                   /* 48px */
  --tap-lg: 3.5rem;                 /* 56px */
  --field-h: 3.25rem;               /* 52px */
  --icon-sm: 1.25rem;
  --icon-md: 1.5rem;
  --icon-tile: 3rem;
  --z-header: 100; --z-skip: 200;
  --pad-cta: clamp(var(--size-5), 0.5rem + 4vw, var(--size-8));
  --menu-max-h: calc(100vh - var(--header-h));     /* open mobile menu scrolls inside this height */

  --shadow-card:  0 1px 2px rgba(var(--c-navy-rgb), 0.06), 0 6px 18px rgba(var(--c-navy-rgb), 0.06);
  --shadow-hover: 0 2px 4px rgba(var(--c-navy-rgb), 0.08), 0 12px 28px rgba(var(--c-navy-rgb), 0.12);
  --shadow-frame: 0 16px 40px rgba(var(--c-navy-rgb), 0.28);
  --shadow-menu:  0 12px 28px rgba(var(--c-navy-rgb), 0.18);

  /* Icons as tokens. The chevron colour must follow --text-faint light (#586882 = %23586882). */
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23586882' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  /* Mask image for list ticks: colour ignored, the element's background-color shows. */
  --icon-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

/* ---------- SEMANTIC COLOUR, light (default) ---------- */
:root, .surface-light {
  --bg:             var(--c-white);
  --bg-alt:         var(--c-gray-50);
  --surface:        var(--c-white);
  --surface-2:      var(--c-gray-100);
  --border:         var(--c-gray-200);    /* decorative hairlines only */
  --border-strong:  var(--c-gray-300);    /* decorative: card hover, frame edge */
  --border-control: var(--c-gray-500);    /* form controls, outline buttons: 3:1 needed */
  --text:           var(--c-ink-900);
  --text-dim:       var(--c-ink-700);
  --text-faint:     var(--c-ink-500);
  --accent:         var(--c-green-600);   /* button fill */
  --accent-hover:   var(--c-green-700);
  --accent-text:    var(--c-green-600);   /* green used as text or icon */
  --on-accent:      var(--c-white);       /* text on the fill */
  --accent-soft:    var(--c-green-50);
  --accent-border:  var(--c-green-200);
  --link:           var(--c-blue-600);
  --link-hover:     var(--c-blue-700);
  --info-bg:        var(--c-blue-50);
  --info-text:      var(--c-blue-700);
  --info-border:    var(--c-blue-300);
  --focus-ring:     var(--c-blue-600);
  --error:          var(--c-red-700);     /* form errors only */
  --error-bg:       var(--c-red-50);
  --hover-tint:     rgba(var(--c-navy-rgb), 0.06);
  --header-bg:      var(--c-white);
}

/* ---------- SEMANTIC COLOUR, navy bands (hero, NexusOne, contact, footer) ---------- */
.band-navy, .site-footer {
  --bg:             var(--c-navy-900);
  --bg-alt:         var(--c-navy-950);
  --surface:        var(--c-navy-800);
  --surface-2:      var(--c-navy-700);
  --border:         var(--c-navy-600);
  --border-strong:  var(--c-navy-500);
  --border-control: var(--c-navy-300);
  --text:           var(--c-white);
  --text-dim:       var(--c-navy-200);
  --text-faint:     var(--c-navy-300);
  --accent:         var(--c-green-400);
  --accent-hover:   var(--c-green-300);
  --accent-text:    var(--c-green-400);
  --on-accent:      var(--c-navy-950);
  --accent-soft:    rgba(var(--c-green-rgb), 0.14);
  --accent-border:  rgba(var(--c-green-rgb), 0.40);
  --link:           var(--c-blue-300);
  --link-hover:     var(--c-blue-200);
  --info-bg:        rgba(var(--c-blue-rgb), 0.14);
  --info-text:      var(--c-blue-300);
  --info-border:    rgba(var(--c-blue-rgb), 0.40);
  --focus-ring:     var(--c-blue-300);
  --error:          var(--c-red-300);     /* safe default: the form card is always .surface-light */
  --error-bg:       var(--c-navy-700);
  --hover-tint:     rgba(var(--c-white-rgb), 0.08);
}
.site-footer { --bg: var(--c-navy-950); }

@supports (height: 100dvh) {
  :root { --menu-max-h: calc(100dvh - var(--header-h)); }
}

/* ---------------------------------------------------------------
   Breakpoints (media queries cannot read custom properties):
     max-width: 1040px  header links collapse to the menu button
     max-width:  900px  two-column layouts stack, grids reflow
     max-width:  640px  one column, full-width buttons

   Text-on-surface pairs in use (ratios are in design-system.md 1.2):
     light scope: --text, --text-dim, --text-faint, --accent-text, --link on --bg, --bg-alt, --surface-2
                  --on-accent on --accent and --accent-hover; --info-text on --info-bg; --error on --error-bg
     navy scope:  --text, --text-dim, --text-faint, --accent-text, --link on --bg, --surface, --surface-2
                  --on-accent on --accent and --accent-hover
   --------------------------------------------------------------- */
