// Modern CSS reset by Josh Comeau
// (see https://www.joshwcomeau.com/css/custom-css-reset/)
//
// Note: that this reset is completely generic and agnostic to
// our own Sourcegraph related style reset, all web app related
// element styling you can find in global.scss file.

// We use root as a guard scope element to avoid polluting global styles
// scopes in the app where uikit components are used.

@layer {
    .root {
        /* 1. Use a more-intuitive box-sizing model */
        *,
        *::before,
        *::after {
            box-sizing: border-box;
        }

        /* 2. Remove default margin */
        * {
            margin: 0;
        }

        /* 3. Enable keyword animations */
        @media (prefers-reduced-motion: no-preference) {
            html {
                interpolate-size: allow-keywords;
            }
        }

        /* 4. Improve text rendering */
        body {
            -webkit-font-smoothing: antialiased;
        }

        /* 5. Improve media defaults */
        img,
        picture,
        video,
        canvas {
            display: block;
            max-width: 100%;
        }

        /* 6. Avoid text overflows */
        p,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            overflow-wrap: break-word;
        }

        /* 6. Improve line wrapping */
        p {
            text-wrap: pretty;
        }

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            text-wrap: balance;
        }
    }
}
