/* The fonts, palette, type scale and colors of the site (copied from
   stackgres.io), on the design system's tokens */

/* Fonts: Inter, Exo 2 and Roboto Mono come with the design system
   (og-design.html) */

/* Palette */
:root {
    --white: #ffffff;
    --mediumBlue: #383753;
    --darkBlue: #0B031C;
    --blue: #369AFF;
    --lBlue: #1CE8FF;
    --yellow: #F2A90C;
    --lYellow: #FFFC66;
    --green: #2EBE97;
    --lGreen: #39E640;
    --orange: #DE560D;
    --lOrange: #FF9E17;
    --magenta: #D836FF;
}

/* Type scale: every font size of the site is one of these, about 1.27x
   apart; weight and color set the rest of the hierarchy */
:root {
    --fontDisplay: clamp(3rem, .5rem + 5vw, 6rem);
    --fontH1: clamp(2.5rem, 1.6rem + 1.8vw, 3.25rem);
    --fontH2: clamp(2rem, 1.2rem + 1.4vw, 2.5rem);
    --fontH3: 1.75rem;
    --fontLead: 1.375rem;
    --fontBase: .9375rem;
    --fontSmall: .875rem;
    /* Roboto Mono runs wide: a step under the text */
    --fontCode: .9375rem;

    /* The families: Exo 2 for the headings, the menu and the buttons, Inter
       for the text, Roboto Mono for the code */
    --weightBody: 450;
    --fontHeading: 'Exo 2', sans-serif;
    --fontBody: 'Inter', system-ui, sans-serif;
    --fontMono: 'Roboto Mono', ui-monospace, monospace;
}

/* Themes: dark, by default, and light, which the data-theme attribute of
   the html element selects (see the theme.html partial). The colors come
   from the design system, whose --og-* tokens follow the same attribute;
   the rest are the site's own */
:root {
    --themeBg: hsl(var(--og-page));
    --themeText: hsl(var(--og-fg));
    --themeMuted: hsl(var(--og-fg-muted));
    --themeBorder: hsl(var(--og-border));
    --themeSurface: hsl(var(--og-surface-sunken));
    --themeField: hsl(var(--og-field));
    --themeFieldStrong: hsl(var(--og-field));
    --themeHover: hsl(var(--og-hover));
    --themeDivider: hsl(var(--og-border));
    --themeAccent: hsl(var(--og-primary));
    --themeAccentLight: hsl(var(--og-link-hover));
    --themeHeader: hsl(var(--og-nav) / 95%);
    --themeCard: linear-gradient(hsl(var(--og-surface)), hsl(var(--og-surface)));
    --themeCardOpacity: 1;
    --themeCardBorder: hsl(var(--og-border));
    --themePanel: rgba(255, 255, 255, .2);
    --themeOverlayOpacity: .2;
    color-scheme: dark;

    /* Code: the design system's palettes, GitHub's in both themes */
    --codeBg: hsl(var(--og-code-bg));
    --codeBorder: hsl(var(--og-code-border));
    --codeText: hsl(var(--og-code-fg));
    --codeComment: hsl(var(--og-code-comment));
    --codeKeyword: hsl(var(--og-code-keyword));
    --codeString: hsl(var(--og-code-string));
    --codeConstant: hsl(var(--og-code-constant));
    --codeFunction: hsl(var(--og-code-function));
    --codeVariable: hsl(var(--og-code-variable));
    --codeTag: hsl(var(--og-code-tag));
    --codeHighlight: hsl(var(--og-code-highlight));
}

:root[data-theme="light"] {
    --themePanel: rgba(11, 3, 28, .06);
    --themeOverlayOpacity: .06;
    color-scheme: light;
}

/* Colors of text, surfaces and accents */
body {
    --textColor: var(--themeText);
    --bgColor: var(--themeBg);
    --borderColor: var(--themeBorder);
    --activeBg: var(--themeSurface);
    --inputBg: var(--themeFieldStrong);
    --baseColor: var(--themeAccent);
    --baseLightColor: var(--themeAccentLight);
    /* The accent as text (links, labels, highlighted words): the design
       system's link colour, which stays readable where the fill may not */
    --accentText: hsl(var(--og-link));
    /* The site's gradients, now flat: the accent ones are the design system's
       primary color, kept as images so they still work as backgrounds, border
       images and clipped text; the glows are gone. --onAccent is the text and
       icon color on top of the accent */
    --onAccent: hsl(var(--og-primary-fg));
    --accentFill: linear-gradient(hsl(var(--og-primary)), hsl(var(--og-primary)));
    --textGradient: linear-gradient(var(--accentText), var(--accentText));
    --baseGradient: var(--accentFill);
    --invertedGradient: var(--accentFill);
    --verticalGradient: var(--accentFill);
    --horizontalGradient: var(--accentFill);
    --orangeGradient: none;
    --invertedOrangeGradient: none;
    --greenGradient: none;
    --invertedGreenGradient: none;
    --blueGradient: none;
    --invertedBlueGradient: none;
    --whiteGradient: var(--themeCard);
}
