/*
 * netson.cloud design tokens.
 *
 * The single token set for the website, and later for the netson-apis
 * reporting layer and locksmith-web (spec §8b). Custom properties only:
 * no element or class selectors live here. Documented in docs/design-tokens.md.
 */

:root {
    color-scheme: light dark;

    /* Colour: brand */
    --color-ink: #272727;
    --color-accent: #C81A2B;
    --color-bg: #ffffff;

    /* Colour: text */
    --color-ink-soft: #5c5c5c;
    --color-ink-faint: #707070;
    --color-on-ink: #ffffff;

    /* Colour: surfaces and lines */
    --color-surface: #f5f5f3;
    --color-panel: #272727;
    --color-on-panel: #ffffff;
    --color-on-panel-soft: #c4c4c0;
    --color-line: #e4e4e0;
    --color-line-strong: #8a8a86;
    --color-logo-tile: #f5f5f3;

    /* Colour: section bands and icons */
    --color-band: #f6f5f1;
    --color-band-accent: #fcf5f4;
    --color-icon-tile: #f9e6e7;
    --color-icon: #C81A2B;

    /* Colour: accent roles */
    --color-accent-text: #C81A2B;
    --color-on-accent: #ffffff;
    --color-focus: #C81A2B;

    /*
     * Colour: status (reports, the platform error page, locksmith-web).
     * Each state has a foreground (text, dots, icons) and a tint (pill or
     * row ground); the foreground is AA (4.5:1) on its tint, on --color-bg,
     * --color-surface and --color-band. Error is NOT the brand accent.
     */
    --color-status-pass: #1d7a4a;
    --color-status-pass-tint: #e4f3ea;
    --color-status-warn: #8f5a00;
    --color-status-warn-tint: #fbefd9;
    --color-status-error: #b02a1e;
    --color-status-error-tint: #fbe9e6;
    --color-status-notice: #2e6593;
    --color-status-notice-tint: #e6eef6;
    --color-status-unknown: #666663;
    --color-status-unknown-tint: #efefec;

    /* Typography */
    --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /*
     * Type scale: modular, ratio 1.25 at 80rem and wider, from a 18px base;
     * on narrow screens it eases to ratio 1.2 from a 16px base (320px viewport).
     */
    --step--1: clamp(0.8333rem, 0.8111rem + 0.1111vw, 0.9rem);
    --step-0: clamp(1rem, 0.9583rem + 0.2083vw, 1.125rem);
    --step-1: clamp(1.2rem, 1.1312rem + 0.3438vw, 1.4063rem);
    --step-2: clamp(1.44rem, 1.3341rem + 0.5297vw, 1.7578rem);
    --step-3: clamp(1.728rem, 1.5716rem + 0.7821vw, 2.1973rem);
    --step-4: clamp(2.0736rem, 1.8493rem + 1.1216vw, 2.7466rem);
    --step-5: clamp(2.4883rem, 2.1734rem + 1.5748vw, 3.4332rem);

    --leading-tight: 1.1;
    --leading-snug: 1.3;
    --leading-body: 1.6;
    --tracking-tight: -0.02em;
    --tracking-caps: 0.08em;
    --measure: 68ch;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2.5rem;
    --space-7: 4rem;
    --space-8: 6rem;

    /* Layout */
    --content-max: 72rem;
    --grid-columns: 12;
    --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);

    /* Shape and lines */
    --radius: 6px;
    --hairline: 1px;
    --rule: 2px;
    --focus-ring: 2px;

    /* Motion: colour and opacity only, never longer than this */
    --duration: 120ms;
    --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-ink: #ededeb;
        --color-accent: #f0525d;
        --color-bg: #191918;

        --color-ink-soft: #b3b3ae;
        --color-ink-faint: #8c8c87;
        --color-on-ink: #191918;

        --color-surface: #222221;
        --color-panel: #222221;
        --color-on-panel: #ededeb;
        --color-on-panel-soft: #b3b3ae;
        --color-line: #31312f;
        --color-line-strong: #6b6b67;
        --color-logo-tile: #dcdcd7;

        --color-band: #201f1e;
        --color-band-accent: #241b1b;
        --color-icon-tile: #3a2326;
        --color-icon: #f0525d;

        --color-accent-text: #f0525d;
        --color-on-accent: #191918;
        --color-focus: #f0525d;

        --color-status-pass: #5cc794;
        --color-status-pass-tint: #1a2c22;
        --color-status-warn: #e3a64f;
        --color-status-warn-tint: #2f2616;
        --color-status-error: #f47a62;
        --color-status-error-tint: #3a201b;
        --color-status-notice: #83b0dc;
        --color-status-notice-tint: #1c2733;
        --color-status-unknown: #a3a39e;
        --color-status-unknown-tint: #2a2a28;
    }
}
