/*
 * tokens.css: the one design scale for the public website and the athlete app (design package 6, stage 1, 5 Dec 2026;
 * the founder on the Apple design audit: "OK let's get going on this all in the most efficient way possible").
 *
 * Loaded FIRST among the site's stylesheets in the head of every public and app layout (partials/app-head, through
 * App\Support\PageAssets::tokensLink(), versioned by the file's mtime: no ?v lever to bump). Only custom properties,
 * all named --ds-*, and no selector rules. The older families (common.css's legacy names, --spx-* in app-explore.css,
 * --atp-* in athlete-page.css, --sp-* and --rp-* in race-plan.css, --sp-btn-fill in touch.css) read these, each with
 * the token's own value as its fallback, so a page that misses this file still draws the same colours.
 * tests/Unit/Design/DesignTokensTest.php holds the contrast pairs and the pointing.
 *
 * Root font-size stays the browser's 16px, so 1rem = 16px and nothing moves when a size becomes rem.
 */

:root {
    /* ---- Grey and ink ramp: near-black ink to the page ground, a faint teal cast throughout.
       Ratios: WCAG contrast on white / on --ds-ground. Text uses the first four steps only. */
    --ds-ink: #0B0F0F;          /* 19.3:1 / 17.8:1  headings and body text */
    --ds-ink-2: #2F3636;        /* 12.3:1 / 11.4:1  secondary text, icons */
    --ds-grey-600: #5B6565;     /*  6.0:1 /  5.5:1  muted text, captions, labels */
    --ds-grey-500: #687171;     /*  5.0:1 /  4.6:1  the lightest grey text may use (the legacy --medium-gray) */
    --ds-grey-400: #97A0A0;     /*  2.7:1           NOT text: disabled, decoration, placeholder icons */
    --ds-grey-300: #C9CFCF;     /*  1.6:1           strong borders, control outlines */
    --ds-line: #E3E7E7;         /*  1.3:1           hairlines, card borders */
    --ds-ground: #F4F6F6;       /*  1.1:1           the page ground behind cards */
    --ds-surface: #FFFFFF;      /*                  cards, sheets, bars */
    --ds-dark: #040505;         /* the near-black surfaces (guest wall, dark bars, theme-color); white on it 20.4:1 */

    /* ---- Teal ramp */
    --ds-teal: #00A99D;         /* accents, selected states, icons. 2.9:1 on white: never text on white, never under
                                   white text; text ON it is --ds-ink (6.6:1) */
    --ds-teal-fill: #007C74;    /* filled buttons under white text (5.1:1), teal text links on white (5.1:1) */
    --ds-teal-press: #00655F;   /* a filled button's hover and press; teal text on the soft tint (6.2:1) */
    --ds-teal-deepest: #004D48; /* the increased-contrast ring and hover (9.7:1) */
    --ds-teal-soft: #E3F5F3;    /* tinted grounds: chips, selected rows, a ghost button's hover */
    --ds-teal-on-dark: #00A99D; /* teal on --ds-dark: the bright teal itself reads there (7.0:1); no second hue */

    /* ---- Semantic */
    --ds-danger: #B42318;       /* 6.6:1 on white */
    --ds-danger-soft: #FDECEC;
    --ds-warning: #9A4A07;      /* 6.3:1 on white */
    --ds-warning-soft: #FFF1E2;
    --ds-success: #1A7F37;      /* 5.1:1 on white */
    --ds-success-soft: #E7F5EC;
    /* fixed brand exceptions: their owners' colours, never re-tinted */
    --ds-brand-strava: #FC4C02;
    --ds-brand-whatsapp: #25D366;

    /* ---- Radii: tags, controls, cards, large surfaces, pills */
    --ds-radius-xs: 6px;
    --ds-radius-s: 10px;
    --ds-radius-m: 14px;
    --ds-radius-l: 20px;
    --ds-radius-pill: 999px;

    /* ---- Shadows: three depths. 1 = a card at rest, 2 = raised (menus, popovers), 3 = floating (dialogs) */
    --ds-shadow-1: 0 1px 2px rgba(11, 15, 15, .06), 0 1px 3px rgba(11, 15, 15, .05);
    --ds-shadow-2: 0 4px 16px rgba(11, 15, 15, .08);
    --ds-shadow-3: 0 16px 44px rgba(11, 15, 15, .2);

    /* ---- Spacing: a 4px scale */
    --ds-space-1: 4px;
    --ds-space-2: 8px;
    --ds-space-3: 12px;
    --ds-space-4: 16px;
    --ds-space-5: 20px;
    --ds-space-6: 24px;
    --ds-space-8: 32px;
    --ds-space-10: 40px;
    --ds-space-12: 48px;
    --ds-space-16: 64px;

    /* ---- Motion (the sheets' durations and curves are design package 4's, in sp-sheet.css) */
    --ds-dur-press: 100ms;
    --ds-dur-menu: 150ms;
    --ds-dur-state: 200ms;      /* colour, background and border changes */
    --ds-ease-out: ease-out;
    --ds-ease-in-out: cubic-bezier(.4, 0, .2, 1);

    /* ---- Type: the families in use today (the fonts decision is the founder's; nothing here changes them) */
    --ds-font-display: 'Borna', 'Inter', system-ui, -apple-system, sans-serif;
    --ds-font-text: 'Inter', system-ui, -apple-system, sans-serif;

    /* ---- Type scale: each style is a set (size, weight, line-height, tracking), used together.
       Larger sizes are tracked tighter and set closer; body text is untracked at 1.45-1.5. */
    --ds-caption-size: .75rem;      /* 12px */
    --ds-caption-weight: 500;
    --ds-caption-leading: 1.35;
    --ds-caption-tracking: .005em;

    --ds-footnote-size: .8125rem;   /* 13px */
    --ds-footnote-weight: 400;
    --ds-footnote-leading: 1.4;
    --ds-footnote-tracking: 0;

    --ds-eyebrow-size: .6875rem;    /* 11px, uppercase: the one tracking for every eyebrow label */
    --ds-eyebrow-weight: 700;
    --ds-eyebrow-leading: 1.2;
    --ds-eyebrow-tracking: .08em;

    --ds-body-sm-size: .875rem;     /* 14px */
    --ds-body-sm-weight: 400;
    --ds-body-sm-leading: 1.45;
    --ds-body-sm-tracking: 0;

    --ds-body-size: 1rem;           /* 16px */
    --ds-body-weight: 400;
    --ds-body-leading: 1.5;
    --ds-body-tracking: 0;

    --ds-callout-size: 1.125rem;    /* 18px: lead text, the first line under a title */
    --ds-callout-weight: 500;
    --ds-callout-leading: 1.4;
    --ds-callout-tracking: -.005em;

    --ds-title3-size: 1.25rem;      /* 20px */
    --ds-title3-weight: 600;
    --ds-title3-leading: 1.25;
    --ds-title3-tracking: -.005em;

    --ds-title2-size: 1.5rem;       /* 24px */
    --ds-title2-weight: 700;
    --ds-title2-leading: 1.2;
    --ds-title2-tracking: -.01em;

    --ds-title1-size: 1.75rem;      /* 28px */
    --ds-title1-weight: 700;
    --ds-title1-leading: 1.15;
    --ds-title1-tracking: -.015em;

    --ds-display-size: 2.5rem;      /* 40px */
    --ds-display-weight: 700;
    --ds-display-leading: 1.05;
    --ds-display-tracking: -.02em;
}
