///
//  Copyright (c) 2022 GrowStocks
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in all
//  copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//  SOFTWARE.
///

@use '../tools';
@use 'sass:map';

$_color-tokens: (
  'gs-white': (
    '200': #ffffff,
    '300': #e7e7e7,
    '400': #c4c4c4,
    '600': #b2b2b2,
    '800': #a1a1a1,
  ),
  'gs-black': (
    '200': #252525,
    '300': #202020,
    '400': #151515,
    '600': #101010,
    '800': #000000,
  ),
  'gs-grey': (
    '200': #a1a1a1,
    '300': #919191,
    '400': #717171,
    '600': #545454,
    '800': #323232,
  ),
  'gs-red': (
    '200': #ff8d8d,
    '300': #ec4f4f,
    '400': #c41b1b,
    '600': #8d0c0c,
    '800': #5b0000,
  ),
  'gs-orange': (
    '200': #ffa040,
    '300': #fd8835,
    '400': #ff6a00,
    '600': #c4570c,
    '800': #903a00,
  ),
  'gs-yellow': (
    '200': #ffc46a,
    '300': #fdaa31,
    '400': #ff9900,
    '600': #c97900,
    '800': #935800,
  ),
  'gs-lime': (
    '200': #a9d37d,
    '300': #87cb44,
    '400': #63a822,
    '600': #468310,
    '800': #26480a,
  ),
  'gs-green': (
    '200': #7ed38e,
    '300': #45ab5b,
    '400': #228836,
    '600': #1c7a2f,
    '800': #0c3b16,
  ),
  'gs-aqua': (
    '200': #98ebef,
    '300': #6dd0d3,
    '400': #31a9ad,
    '600': #1b767a,
    '800': #0c3133,
  ),
  'gs-blue': (
    '200': #98a8c4,
    '300': #8396b9,
    '400': #496c9b,
    '600': #12305e,
    '800': #030e23,
  ),
  'gs-purple': (
    '200': #c0a2ee,
    '300': #a173e0,
    '400': #6c30bd,
    '600': #3b1570,
    '800': #1b0838,
  ),
  'gs-pink': (
    '200': #f5a7e8,
    '300': #da7ac6,
    '400': #c727af,
    '600': #8f107a,
    '800': #49063f,
  ),
);

$_struct-tokens: (
  'spacing': (
    'none': 0,
    'xs': tools.to-rem(4px),
    'sm': tools.to-rem(8px),
    'md': tools.to-rem(16px),
    'lg': tools.to-rem(24px),
    'xl': tools.to-rem(32px),
    '2xl': tools.to-rem(48px),
    '3xl': tools.to-rem(64px),
    '4xl': tools.to-rem(80px),
    '5xl': tools.to-rem(96px),
    '6xl': tools.to-rem(112px),
    'auto': auto
  ),
  'el-spacing': (
    'none': 0,
    'xs': 0.1rem,
    'sm': 0.3rem,
    'md': 0.7rem,
    'lg': 1.2rem,
    'xl': 2.3rem,
    '2xl': 3.4rem,
    '3xl': 4.5rem,
    '4xl': 6.1rem,
    '5xl': 8.2rem,
    '6xl': 12.3rem,
    'auto': auto
  ),
  'radius': (
    'none': 0,
    'xs': 0.1rem,
    'sm': 0.3rem,
    'md': 0.5rem,
    'lg': 0.7rem,
    'xl': 1.2rem,
    '2xl': 2.3rem,
    '3xl': 3.4rem,
    '4xl': 4.5rem,
    '5xl': 6.1rem,
    '6xl': 8.2rem,
    'pill': 5000px,
    'circle': 50%,
  ),
  'dimension': (
    'none': 0,
    'xs': tools.to-rem(277px),
    'sm': tools.to-rem(320px),
    'md': tools.to-rem(640px),
    'lg': tools.to-rem(890px),
    'xl': tools.to-rem(1077px),
    'sprite': tools.to-rem(32px),
    'full': 100%,
  ),
  'breakpoint': (
    'none': 0,
    'xs': 277px,
    'sm': 320px,
    'md': 640px,
    'lg': 890px,
    'xl': 1077px,
    'sprite': 32px,
  ),
  'border': (
    'none': 0,
    'xs': 1px,
    'sm': 3px,
    'md': 5px,
    'lg': 7px,
    'xl': 11px,
  ),
  'shadow': (
    'none': 0 0 0 rgba(0 0 0 / 0),
    'xs': 0 0.1rem 0.3rem var(--gs-shadow-color),
    'sm': 0 0.3rem 0.5rem var(--gs-shadow-color),
    'md': 0 0.7rem 1.2rem var(--gs-shadow-color),
    'lg': 0 1.2rem 1.5rem var(--gs-shadow-color),
    'xl': 0 1.7rem 2.1rem var(--gs-shadow-color),
    '2xl': 0 2.3rem 3.5rem var(--gs-shadow-color),
    '3xl': 0 3.5rem 4.7rem var(--gs-shadow-color),
    '4xl': 0 4.7rem 5.2rem var(--gs-shadow-color),
    '5xl': 0 5.2rem 6.5rem var(--gs-shadow-color),
    '6xl': 0 6.7rem 7.3rem var(--gs-shadow-color),
  ),
);

$_abstracted-struct-tokens: (
  'padding': map.get($_struct-tokens, 'el-spacing'),
  'margin': map.get($_struct-tokens, 'spacing'),
  'width': map.get($_struct-tokens, 'dimension'),
  'height': map.get($_struct-tokens, 'dimension'),
  'gap': map.get($_struct-tokens, 'spacing'),
);

$_typography-tokens: (
  'family': (
    'mono': ('Jetbrains Mono', monospace),
    'sans-serif': ('Inter', sans-serif),
    'serif': ('Lora', serif),
  ),
  'size': (
    'xs': clamp(#{tools.to-rem(10px)}, 2vw, #{tools.to-rem(12px)}),
    'sm': clamp(#{tools.to-rem(14px)}, 4vw, #{tools.to-rem(16px)}),
    'md': clamp(#{tools.to-rem(17px)}, 5vw, #{tools.to-rem(21px)}),
    'lg': clamp(#{tools.to-rem(19px)}, 6vw, #{tools.to-rem(25px)}),
    'xl': clamp(#{tools.to-rem(24px)}, 8vw, #{tools.to-rem(30px)}),
    '2xl': clamp(#{tools.to-rem(26px)}, 8vw, #{tools.to-rem(36px)}),
    '3xl': clamp(#{tools.to-rem(32px)}, 10vw, #{tools.to-rem(42px)}),
    '4xl': clamp(#{tools.to-rem(39px)}, 10vw, #{tools.to-rem(49px)}),
    '5xl': clamp(#{tools.to-rem(47px)}, 12vw, #{tools.to-rem(57px)}),
    '6xl': clamp(#{tools.to-rem(56px)}, 14vw, #{tools.to-rem(66px)}),
  ),
  'weight': (
    'light': 200,
    'normal': 400,
    'bold': 700,
    'black': 900,
  ),
  'line-height': (
    'broad': 2,
    'normal': 1.5,
    'condensed': 1.25,
  ),
);

$gs-tokens: map.deep-merge(
  $_color-tokens, map.deep-merge(
    $_typography-tokens, map.deep-merge($_struct-tokens, $_abstracted-struct-tokens)
  )
);