/* ============================================================================
   tokens.css - Design tokens for WxPrediction Forecast Contest v2
   ============================================================================
   These CSS custom properties are the single source of truth for every visual
   decision. Change a value here and it propagates across the entire site.
   Never hardcode a color, font size, or spacing value in any other file -
   always reference a token.
*/

:root {
    /* === Colors: brand & UI ===
       The palette is tightly scoped: one primary (deep blue), one accent
       (warm gold for highlights/awards), and a neutral gray scale.
    */
    --color-brand-50:     #EBF1F9;
    --color-brand-100:    #C5D4EB;
    --color-brand-200:    #94B0DA;
    --color-brand-500:    #2E5AAC;   /* primary brand blue */
    --color-brand-600:    #1F4488;
    --color-brand-700:    #163569;
    --color-brand-900:    #0A1B3D;   /* darkest, used in nav */

    --color-accent-50:    #FBF3DF;
    --color-accent-200:   #F0D483;
    --color-accent-500:   #C99213;   /* warm gold for first place, badges */
    --color-accent-700:   #8B5F03;

    --color-success-50:   #E5F5EB;
    --color-success-500:  #1E8A4D;
    --color-success-700:  #14633A;

    --color-danger-50:    #FBE8E8;
    --color-danger-500:   #BC2C2C;
    --color-danger-700:   #861E1E;

    --color-info-50:      #E5F0FA;
    --color-info-500:     #1F70C2;

    /* Neutral grays - keep in sync, do not introduce other gray values */
    --color-gray-0:       #FFFFFF;
    --color-gray-50:      #F8F9FB;   /* page background */
    --color-gray-100:     #F0F2F6;   /* card/section backgrounds */
    --color-gray-200:     #E2E5EB;   /* dividers, borders */
    --color-gray-300:     #C8CCD4;
    --color-gray-500:     #6B7280;   /* secondary text */
    --color-gray-700:     #374151;
    --color-gray-900:     #111827;   /* primary text */

    /* === Semantic aliases ===
       Pages and components reference these instead of raw color tokens.
       This means we can re-skin the site by changing the alias mappings
       without touching any component code.
    */
    --bg-page:            var(--color-gray-50);
    --bg-surface:         var(--color-gray-0);
    --bg-muted:           var(--color-gray-100);
    --bg-nav:             var(--color-brand-900);

    --text-primary:       var(--color-gray-900);
    --text-secondary:     var(--color-gray-500);
    --text-muted:         var(--color-gray-300);
    --text-on-dark:       var(--color-gray-0);
    --text-link:          var(--color-brand-500);
    --text-link-hover:    var(--color-brand-700);

    --border-default:     var(--color-gray-200);
    --border-strong:      var(--color-gray-300);
    --border-focus:       var(--color-brand-500);

    /* === Typography ===
       System font stacks - no web fonts. Pages render instantly, no FOUT,
       no privacy issues, looks native on every platform.
    */
    --font-sans:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                          "Helvetica Neue", Arial, sans-serif;
    --font-mono:          ui-monospace, "SF Mono", Menlo, Consolas,
                          "Liberation Mono", monospace;

    --text-xs:            0.75rem;    /* 12px - captions, table labels */
    --text-sm:            0.875rem;   /* 14px - body small, secondary info */
    --text-base:          1rem;       /* 16px - default body */
    --text-lg:            1.125rem;   /* 18px - emphasised body */
    --text-xl:            1.25rem;    /* 20px - section headings */
    --text-2xl:           1.5rem;     /* 24px - page titles */
    --text-3xl:           1.875rem;   /* 30px - homepage hero */

    --leading-tight:      1.25;
    --leading-normal:     1.5;
    --leading-relaxed:    1.7;

    /* Two weights, deliberately. More weights = more design noise. */
    --weight-normal:      400;
    --weight-medium:      500;

    /* === Spacing scale ===
       Multiples of 4px. Use these instead of arbitrary px values so vertical
       rhythm stays consistent across the site.
    */
    --space-1:            0.25rem;    /* 4px */
    --space-2:            0.5rem;     /* 8px */
    --space-3:            0.75rem;    /* 12px */
    --space-4:            1rem;       /* 16px */
    --space-5:            1.25rem;    /* 20px */
    --space-6:            1.5rem;     /* 24px */
    --space-8:            2rem;       /* 32px */
    --space-10:           2.5rem;     /* 40px */
    --space-12:           3rem;       /* 48px */
    --space-16:           4rem;       /* 64px */

    /* === Layout ===
       Maximum content width keeps line lengths readable on wide monitors.
    */
    --content-max:        1100px;
    --content-narrow:     720px;

    /* === Borders & corners === */
    --radius-sm:          4px;
    --radius-md:          8px;
    --radius-lg:          12px;
    --radius-pill:        999px;

    --border-thin:        1px;

    /* === Elevation (shadows) ===
       Used sparingly. Cards stay flat by default; shadows are reserved for
       things that genuinely float above the page (dropdowns, modals).
    */
    --shadow-sm:          0 1px 2px rgba(17, 24, 39, 0.05);
    --shadow-md:          0 4px 12px rgba(17, 24, 39, 0.08);
    --shadow-focus:       0 0 0 3px rgba(46, 90, 172, 0.25);

    /* === Motion ===
       Subtle. No bouncy animations. */
    --duration-fast:      150ms;
    --duration-medium:    250ms;
    --easing:             cubic-bezier(0.4, 0, 0.2, 1);
}
