/* CTS Design System v0: tokens.
   The single source of truth for colour, type, space, shape, depth and motion on every CTS product.
   Plain CSS custom properties, no build step. Copy or sync this file; never edit a copy (see README.md).
   Names are category-first (--cts-<category>-<name>) so tokens.json can be generated from this file:
     node tools/tokens-json.mjs          writes tokens/tokens.json
     node tools/tokens-json.mjs --check  fails if tokens.json is out of date
   Dark is the signature theme. There is no light theme in v0 (see PRINCIPLES.md). */

:root {
  color-scheme: dark;

  /* ---- Matte finish: the five tunables (medium shown). Every dark surface, sheen and shadow reads from these; the site ladder in cts-site.css is built from them.
     subtle: --matte-black #0b0a09, surface #151413, grain .025, sheen .045, shadow .3   strong: --matte-black #141210, surface #201e1c, grain .06, sheen .012, shadow .17 ---- */
  --matte-black: #060606;
  --matte-surface: #292826;
  --matte-grain: .085;
  --matte-sheen: .14;
  --matte-shadow: .72;
  /* Steel: Destroyer-Grey-style flat mid-grey, tuned warm to share the graphite family (#8a8884, from memory, tune by eye). A hard industrial layer on the black base, never a card or page surface: cream text fails AA on it. Use with near-black text (--matte-steel-ink) on faces, or as rails, borders and line art. Set each --matte-steel-use-* back to its old value to turn the layer off. */
  --matte-steel: #8a8884;
  --matte-steel-edge: #a9a6a1;
  --matte-steel-deep: #66635f;
  --matte-steel-ink: #0a0a0b;
  --matte-steel-use-face: linear-gradient(180deg, #a09d98 0%, #85827d 100%);
  /* Flat matte steel: a soft top-light sheen over the face gradient. No line patterns of any kind (the old brushed stripes are gone). */
  --matte-steel-brushed: linear-gradient(180deg, rgba(255, 244, 223, 0.12) 0%, rgba(255, 244, 223, 0) 42%);
  --matte-steel-rail-bar: linear-gradient(90deg, var(--matte-steel-deep) 0%, var(--matte-steel) 18%, var(--matte-steel-edge) 50%, var(--matte-steel) 82%, var(--matte-steel-deep) 100%);
  /* One grey family: every grey on the page is the black base mixed toward the steel, never a one-off hex. */
  --cts-cta-gap: clamp(1.25rem, 1rem + 1.1vw, 1.75rem); /* breathing room around action rows: 20px on phones to 28px on desktop */
  --matte-g1: color-mix(in srgb, var(--matte-black), var(--matte-steel) 10%);
  --matte-g2: color-mix(in srgb, var(--matte-black), var(--matte-steel) 17%);
  --matte-g3: color-mix(in srgb, var(--matte-black), var(--matte-steel) 23%);
  --matte-g4: color-mix(in srgb, var(--matte-black), var(--matte-steel) 29%);
  --matte-g5: color-mix(in srgb, var(--matte-black), var(--matte-steel) 33%);
  --matte-g6: color-mix(in srgb, var(--matte-black), var(--matte-steel) 41%);
  --matte-g7: color-mix(in srgb, var(--matte-black), var(--matte-steel) 55%);
  /* Decorative edges (card and panel borders, column and row dividers, page rails): soft, dark, about 1.5 to 2:1 on the card. Text and interactive borders keep their own stronger tokens. */
  --matte-edge: color-mix(in srgb, var(--matte-g7) 80%, transparent);
  --matte-edge-soft: color-mix(in srgb, var(--matte-g6) 90%, transparent);
  --matte-edge-top: color-mix(in srgb, var(--matte-steel) 26%, transparent);
  --matte-hairline-v: linear-gradient(180deg, transparent 0%, var(--matte-edge) 22%, var(--matte-edge) 78%, transparent 100%);
  --matte-hairline-h: linear-gradient(90deg, transparent 0%, var(--matte-edge) 22%, var(--matte-edge) 78%, transparent 100%);
  /* Buttons: ONE family for every action on the site. Primary = brushed steel face with near-black text; secondary = dark graphite fill, soft steel border, cream text. Gold stays for text, marks, icons and the promo banner. */
  --matte-btn-face: var(--matte-steel-brushed), linear-gradient(180deg, #a09d98 0%, #85827d 100%);
  --matte-btn-face-hover: var(--matte-steel-brushed), linear-gradient(180deg, #b4b1ab 0%, #98958f 100%);
  --matte-btn-ink: var(--matte-steel-ink);
  --matte-btn-edge: var(--matte-steel-edge);
  --matte-btn-shadow: inset 0 1px 0 rgba(255, 244, 223, 0.42), inset 0 -1px 0 rgba(0, 0, 0, 0.28), var(--cts-shadow-1);
  --matte-btn2-fill: var(--matte-g2);
  --matte-btn2-fill-hover: var(--matte-g3);
  --matte-btn2-edge: color-mix(in srgb, var(--matte-steel-edge) 62%, transparent);
  --matte-steel-use-face-ink: var(--matte-steel-ink);
  --matte-steel-use-rail: var(--matte-edge-soft);
  --matte-steel-use-rail-strong: var(--matte-edge);
  --matte-steel-use-control: var(--matte-steel-edge);
  --matte-steel-use-line-art: color-mix(in srgb, var(--matte-steel) 42%, transparent);
  --matte-surface-hi: color-mix(in srgb, var(--matte-surface), #fff calc(var(--matte-sheen) * 60%));

  /* ---- Colour: brand. These four values are the CTS identity and do not change. ---- */
  --cts-color-gold: #f2bf65;
  --cts-color-red: #b83723;
  --cts-color-cream: #fff4df;
  --cts-color-black: #000000;
  /* Brand tints. Gold-bright is the existing hover gold. Red-bright is the only red that is safe for small text on dark. */
  --cts-color-gold-bright: #ffdc99;
  --cts-color-gold-deep: #c9973f;
  --cts-color-red-bright: #ff8f78;

  /* ---- Colour: graphite ramp. Neutral grays, darkest to lightest. Surfaces are built from gradients between neighbours. ---- */
  --cts-color-graphite-950: #0b0a08;
  --cts-color-graphite-900: #100f0d;
  --cts-color-graphite-850: #151412;
  --cts-color-graphite-800: #1a1917;
  --cts-color-graphite-750: #211f1d;
  --cts-color-graphite-700: #282624;
  --cts-color-graphite-600: #343230;
  --cts-color-graphite-500: #4a4846;
  --cts-color-graphite-400: #6e6c6a;
  --cts-color-graphite-300: #989695;
  --cts-color-graphite-200: #c6c4c2;
  --cts-color-graphite-100: #e8e6e4;

  /* ---- Colour: roles. Components use these, not the raw ramp. ---- */
  --cts-color-bg: var(--cts-color-graphite-950);
  --cts-color-bg-raised: var(--cts-color-graphite-900);
  --cts-color-bg-sunken: var(--cts-color-black);
  --cts-color-surface: var(--cts-color-graphite-850);
  --cts-color-surface-raised: var(--cts-color-graphite-750);
  --cts-color-surface-well: rgba(0, 0, 0, 0.32);
  --cts-color-text: var(--cts-color-cream);
  --cts-color-text-secondary: #b9b6af;
  --cts-color-text-tertiary: #aaa7a2;
  --cts-color-text-on-gold: #15110a;
  --cts-color-line: rgba(255, 255, 255, 0.08);
  --cts-color-line-strong: rgba(255, 255, 255, 0.16);
  --cts-color-accent: var(--cts-color-gold);
  --cts-color-accent-soft: rgba(242, 191, 101, 0.12);
  --cts-color-accent-line: rgba(242, 191, 101, 0.38);
  --cts-color-focus: var(--cts-color-gold);
  --cts-color-danger: var(--cts-color-red-bright);
  --cts-color-danger-soft: rgba(184, 55, 35, 0.16);

  /* ---- Gradients: the "gradient grays". Light always comes from above. ---- */
  --cts-gradient-surface: linear-gradient(180deg, var(--matte-surface-hi) 0%, var(--cts-color-surface) 100%);
  --cts-gradient-surface-raised: linear-gradient(180deg, color-mix(in srgb, var(--cts-color-surface-raised), #fff calc(var(--matte-sheen) * 60%)) 0%, var(--cts-color-surface-raised) 100%);
  --cts-gradient-band: linear-gradient(180deg, var(--cts-color-bg-raised) 0%, var(--cts-color-bg) 100%);
  --cts-gradient-gold: linear-gradient(180deg, #ffe4ad 0%, #f2bf65 55%, #dea94f 100%);
  --cts-gradient-gold-hover: linear-gradient(180deg, #ffecc4 0%, #f7cb7c 55%, #e6b45d 100%);
  --cts-gradient-text-gold: linear-gradient(180deg, #ffdf9f 0%, #f2bf65 60%, #d9a349 100%);
  --cts-gradient-text-graphite: linear-gradient(180deg, #f1eee7 0%, #8d8b87 100%);
  --cts-gradient-keyline: linear-gradient(90deg, #b83723 0%, #f2bf65 45%, rgba(242, 191, 101, 0) 100%);
  --cts-gradient-hairline: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0) 100%);

  /* ---- Type: system fonts only. No webfont is ever downloaded. ---- */
  --cts-font-family-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --cts-font-family-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --cts-font-family-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --cts-font-size-display: clamp(2.75rem, 1rem + 6vw, 6rem);
  --cts-font-size-headline: clamp(2.125rem, 1.2rem + 3.6vw, 4rem);
  --cts-font-size-title-1: clamp(1.625rem, 1.2rem + 1.4vw, 2.25rem);
  --cts-font-size-title-2: clamp(1.3125rem, 1.15rem + 0.6vw, 1.5rem);
  --cts-font-size-body-lg: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  --cts-font-size-body: 1.0625rem;
  --cts-font-size-small: 0.9375rem;
  --cts-font-size-caption: 0.8125rem;
  --cts-font-size-eyebrow: 0.8125rem;

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

  --cts-line-height-display: 1.03;
  --cts-line-height-headline: 1.07;
  --cts-line-height-title: 1.16;
  --cts-line-height-snug: 1.4;
  --cts-line-height-body: 1.6;

  --cts-letter-spacing-display: -0.045em;
  --cts-letter-spacing-headline: -0.035em;
  --cts-letter-spacing-title: -0.022em;
  --cts-letter-spacing-body: -0.006em;
  --cts-letter-spacing-eyebrow: 0.14em;

  /* ---- Space: a 4 px base. Use the steps; do not invent in-between values. ---- */
  --cts-space-1: 0.25rem;
  --cts-space-2: 0.5rem;
  --cts-space-3: 0.75rem;
  --cts-space-4: 1rem;
  --cts-space-5: 1.5rem;
  --cts-space-6: 2rem;
  --cts-space-7: 3rem;
  --cts-space-8: 4rem;
  --cts-space-9: 6rem;
  --cts-space-10: 8rem;

  /* ---- Layout ---- */
  --cts-layout-wrap: 75rem;
  --cts-layout-wrap-narrow: 54rem;
  --cts-layout-gutter: clamp(1.25rem, 5vw, 4rem);
  --cts-layout-section: clamp(4.5rem, 3rem + 7vw, 9.5rem);
  --cts-layout-measure: 38rem;
  --cts-layout-header: 4rem;

  /* ---- Shape ---- */
  --cts-radius-xs: 6px;
  --cts-radius-sm: 10px;
  --cts-radius-md: 14px;
  --cts-radius-lg: 20px;
  --cts-radius-xl: 28px;
  --cts-radius-2xl: 36px;
  --cts-radius-pill: 999px;

  /* ---- Size: touch and control minimums (WCAG 2.2 target size) ---- */
  --cts-size-target: 2.75rem;
  --cts-size-control: 3.25rem;

  /* ---- Elevation: three steps plus the sheen every raised surface carries on its top edge. ---- */
  --cts-shadow-sheen: inset 0 1px 0 rgba(255, 244, 223, var(--matte-sheen));
  --cts-shadow-1: 0 2px 6px rgba(0, 0, 0, calc(var(--matte-shadow) * .6)), 0 10px 28px rgba(0, 0, 0, calc(var(--matte-shadow) * .8));
  --cts-shadow-2: 0 2px 8px rgba(0, 0, 0, calc(var(--matte-shadow) * .5)), 0 24px 64px rgba(0, 0, 0, var(--matte-shadow));
  --cts-shadow-3: 0 3px 10px rgba(0, 0, 0, calc(var(--matte-shadow) * .5)), 0 48px 130px rgba(0, 0, 0, calc(var(--matte-shadow) * 1.4));
  --cts-shadow-gold: 0 10px 30px rgba(242, 191, 101, 0.2);

  /* ---- Materials: glass for anything that floats over content (header, menus, sheets). ---- */
  --cts-material-glass: color-mix(in srgb, var(--cts-color-bg) 74%, transparent);
  --cts-material-glass-raised: color-mix(in srgb, var(--cts-color-surface) 70%, transparent);
  --cts-material-glass-sheet: color-mix(in srgb, var(--cts-color-surface) 94%, transparent);
  --cts-material-glass-solid: var(--cts-color-bg-raised);
  --cts-material-blur: saturate(180%) blur(20px);
  --cts-material-border: rgba(255, 244, 223, 0.08);

  /* ---- Focus ---- */
  --cts-focus-width: 3px;
  --cts-focus-offset: 3px;

  /* ---- Motion: four durations, three curves. Every animation says something; none loops for decoration. ---- */
  --cts-motion-duration-press: 120ms;
  --cts-motion-duration-hover: 240ms;
  --cts-motion-duration-enter: 520ms;
  --cts-motion-duration-stage: 900ms;
  --cts-motion-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --cts-motion-ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
  --cts-motion-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* ---- Layers ---- */
  --cts-layer-header: 40;
  --cts-layer-overlay: 60;
}

/* Reduced motion: transitions become instant. Components also switch their keyframe animations off (components.css). */
@media (prefers-reduced-motion: reduce) {
  :root {
    --cts-motion-duration-press: 0s;
    --cts-motion-duration-hover: 0s;
    --cts-motion-duration-enter: 0s;
    --cts-motion-duration-stage: 0s;
  }
}

/* Matte grain: one fixed fine-noise layer (inline SVG, no image file), under the header, never catches the pointer. */
body::after { content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: var(--matte-grain); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .96 0 0 0 0 .88 0 0 0 1.6 -.3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media print { body::after { display: none; } }
