/*
 * Design tokens: every colour, font, size and timing the UI uses. They mirror the Knowei
 * design system's tokens (names and values) and docs/PROJECT.md §7; components refer to
 * these custom properties, never to raw values. Guide: docs/guides/frontend.md.
 */

/* Cascade layer order for all stylesheets: a later layer wins, whatever the selector. */
@layer tokens, reset, base, layout, components;

@layer tokens {
  :root {
    color-scheme: light;

    /* Palette: neutrals and red exactly from the client's design pack, accents from the Canva */
    --white: #FFFFFF;
    --cream: #FDF7EF;  /* the pack's grey-on-cream colourway */
    --color-90: #53585F;  /* dark fills: slider thumb, invite, plus, digit tiles, focus ring, hand notes */
    --color-70: #938F8F;  /* the pack's grey: text, active tab, countdown panel, thumb */
    --color-60: #AEAAA3;  /* the line, upcoming tabs, kickers, the XI mark */
    --color-50: #D7D2CA;  /* header and bottom bands, scroll track, fields */
    --color-30: #F3EDE5;  /* popup grounds, video cards, hover grounds */
    --color-10: #FAF7F3;  /* card surfaces: BESCHRIJVING, network canvas, chips (knowei.nl) */

    /* Accents: the four card decks and the keyword-table columns */
    --accent-blue:  #9D9FB8;
    --accent-tan:   #C7B28E;
    --accent-green: #A1C7AC;
    --accent-coral: #CD9B8C;  /* also the colour of causes */
    --accent-clay:  #CFA78F;  /* the Canva's selected cause cards, dashboard heads */

    /* Pastel tints: keyword-table columns, highlights, topic nodes */
    --accent-blue-tint:  #E4E4EB;
    --accent-coral-tint: #F1E4E0;
    --accent-tan-tint:   #EEE6DA;
    --accent-green-tint: #E1EFE5;

    /* Signal: the pack's red for amount and chosen */
    --signal-red: #FF5962;
    --scrim: rgba(0, 0, 0, 0.5);

    /* Roles: components use these, so a role can change in one place */
    --text: var(--color-70);
    --text-muted: var(--color-60);
    --text-on-dark: var(--white);
    --ground: var(--cream);
    --band: var(--color-50);
    --panel: var(--white);
    --surface: var(--color-10);
    --field: var(--color-50);
    --rule: var(--color-60);
    --focus-ring: var(--color-90);
    --cause: var(--accent-coral);
    --topic: var(--accent-coral-tint);
    --chosen: var(--signal-red);
    --deck-brown: var(--accent-tan);
    --deck-blue: var(--accent-blue);
    --deck-green: var(--accent-green);
    --deck-pink: var(--accent-coral);

    /* Type: system Helvetica stack, no webfont except the footer's watsof credit and Knowei Hand (hand notes); one shorthand per text style */
    --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Knowei Hand lacks ; ( ) — % & / and some accents: those characters fall back to Helvetica one by one */
    --font-hand: 'Knowei Hand', var(--font-sans);
    --type-nav: 700 16px/20px var(--font-sans);
    --tracking-nav: 0.02em;
    --type-tab-subtitle: 400 15px/22px var(--font-sans);
    --type-section-title: 700 16px/20px var(--font-sans);
    --tracking-section-title: 0.04em;
    --type-prompt: 400 16px/24px var(--font-sans);
    --type-question: 700 16px/20px var(--font-sans);
    --type-countdown: 700 44px/52px var(--font-sans);
    --type-match: 700 12px/16px var(--font-sans);
    --type-body: 400 15px/22px var(--font-sans);
    --type-body-sm: 400 13px/18px var(--font-sans);
    --type-hand-note: 400 16px/22px var(--font-hand);
    --type-label: 700 11px/14px var(--font-sans);
    --tracking-label: 0.06em;
    --type-popup-title: 700 24px/30px var(--font-sans);
    --type-button: 600 16px/24px var(--font-sans);

    /* Spacing (4px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;

    /* Radius: square by default; 6px for every rounded block, 2px to soften a corner */
    --radius-0: 0px;
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 12px;
    --radius-pill: 9999px;

    /* Strokes */
    --stroke-hairline: 1px;
    --stroke-rule: 2px;
    --stroke-frame: 4px;
    --stroke-popup: 8px;

    /* Sizes */
    --size-header-row: 64px;
    --size-header-band: 96px; /* the row and 32px under its hairline (2026-11-04) */
    --size-rail: 384px;
    --size-snake: 48px;
    --size-step: 40px;
    --size-thumb: 24px;
    --size-ring: 48px;
    --size-scrollbar: 36px;

    /* Shadows: flat, except these three */
    --shadow-popup: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 6px 16px rgba(0, 0, 0, 0.18);
    --shadow-tip: 0 2px 6px rgba(0, 0, 0, 0.12); /* the network's tooltip, the open tab */

    /* Desktop only (§4.1); designed at 1440px. Below this the page scrolls sideways. */
    --page-min-width: 1240px;

    /* Motion: every transition and animation takes its timing from here, for one rhythm. */
    --kn-dur-fast: 150ms;    /* hover and press feedback */
    --kn-dur: 200ms;         /* colour and state changes */
    --kn-dur-slow: 300ms;    /* new output fading in, the tab block dropping open */
    --kn-dur-slower: 500ms;  /* large moves, such as scrolling to a tab */
    --kn-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    /* Not from the design system: the step between items of a list that fades in one by one,
       `animation-delay: calc(min(var(--i, 0), 3) * var(--kn-stagger))`. 0 with reduced motion. */
    --kn-stagger: calc(var(--kn-dur-fast) * 0.4);
  }

  /* Reduced motion: timings collapse, so every animation built on them ends at once. */
  @media (prefers-reduced-motion: reduce) {
    :root {
      --kn-dur-fast: 0ms;
      --kn-dur: 0ms;
      --kn-dur-slow: 0ms;
      --kn-dur-slower: 0ms;
    }
  }
}
