@layer reset, tokens, utilities, components, overrides;

@layer reset {

    * {

        &,
        &::before,
        &::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;

            @media (prefers-reduced-motion:reduce) {
                animation-duration: .01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: .01ms !important;
                scroll-behavior: auto !important;
            }
        }
    }

    html {
        -webkit-text-size-adjust: 100%;
        tab-size: 4;
        font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01", "tnum";
        font-variation-settings: normal;
        color-scheme: dark;

        @media (prefers-reduced-motion:no-preference) {
            scroll-behavior: smooth;
        }
    }

    body {
        min-height: 100dvh;
        line-height: 1.6;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        background-color: var(--color-graphite-950, #0a0c10);
        color: var(--color-pure-white, #f8fafc);
        font-family: var(--font-sans);
        font-weight: var(--font-weight-regular, 400);
        overflow-x: hidden
    }

    html::-webkit-scrollbar,
    body::-webkit-scrollbar,
    *::-webkit-scrollbar {
        width: 5px;
        height: 5px
    }

    html::-webkit-scrollbar-track,
    body::-webkit-scrollbar-track,
    *::-webkit-scrollbar-track {
        background: color-mix(in oklch, var(--color-graphite-950, #0a0c10) 88%, black)
    }

    html::-webkit-scrollbar-thumb,
    body::-webkit-scrollbar-thumb,
    *::-webkit-scrollbar-thumb {
        background: var(--color-electric-blue, #38bdf8);
        border-radius: 0
    }

    html::-webkit-scrollbar-thumb:hover,
    body::-webkit-scrollbar-thumb:hover,
    *::-webkit-scrollbar-thumb:hover {
        background: color-mix(in oklch, var(--color-electric-blue, #38bdf8) 82%, white)
    }

    html::-webkit-scrollbar-button,
    body::-webkit-scrollbar-button,
    *::-webkit-scrollbar-button,
    *::-webkit-scrollbar-button:single-button,
    *::-webkit-scrollbar-button:vertical:decrement,
    *::-webkit-scrollbar-button:vertical:increment,
    *::-webkit-scrollbar-button:horizontal:decrement,
    *::-webkit-scrollbar-button:horizontal:increment,
    *::-webkit-scrollbar-button:vertical:start:decrement,
    *::-webkit-scrollbar-button:vertical:end:increment,
    *::-webkit-scrollbar-button:vertical:start:increment,
    *::-webkit-scrollbar-button:vertical:end:decrement,
    *::-webkit-scrollbar-button:horizontal:start:decrement,
    *::-webkit-scrollbar-button:horizontal:end:increment,
    *::-webkit-scrollbar-button:horizontal:start:increment,
    *::-webkit-scrollbar-button:horizontal:end:decrement {
        display: none !important;
        background: transparent !important;
        height: 0 !important;
        width: 0 !important;
        -webkit-appearance: none !important
    }

    html::-webkit-scrollbar-corner,
    body::-webkit-scrollbar-corner,
    *::-webkit-scrollbar-corner {
        background: transparent
    }

    img,
    picture,
    video,
    canvas,
    svg {
        display: block;
        max-width: 100%;
        height: auto
    }

    input,
    button,
    textarea,
    select {
        font: inherit;
        color: inherit;
        background: oklch(0% 0 none / 0);
        border: none
    }

    button {
        cursor: pointer;
        background: none
    }

    a {
        color: inherit;
        text-decoration: none
    }

    ul,
    ol {
        list-style: none
    }

    table {
        border-collapse: collapse;
        width: 100%
    }

    :focus-visible {
        outline: 2px solid var(--color-electric-blue, #38bdf8);
        outline-offset: 3px;

        :focus:not(&) {
            outline: none;
        }
    }
}

@layer overrides {
    @media (pointer:coarse) {

        .c-btn,
        .c-nav__link,
        .c-nav__mobile-link,
        .c-footer__link,
        .c-choice {
            min-block-size: 44px
        }
    }

    @media (hover:none) {

        :is(.c-btn--primary, .c-btn--secondary, .c-btn--ghost):hover{
            box-shadow: none
        }
    }

    @media (prefers-reduced-transparency:reduce) {

        .c-nav,
        .c-nav__backdrop,
        .c-journey__drawer {
            backdrop-filter: none;
            -webkit-backdrop-filter: none
        }
    }

    @media (forced-colors:active) {
        .c-skip-link:focus-visible {
            background: Highlight;
            color: HighlightText;
            outline: 2px solid CanvasText
        }

        .c-btn,
        .c-input,
        .c-select,
        .c-textarea,
        .c-choice,
        .c-fieldset,
        .c-nav__link--active::after {
            forced-color-adjust: none;
            border: 1px solid ButtonText
        }

        .c-choice:has(input:checked),
        .c-choice input[type='checkbox']:checked {
            background: Highlight;
            color: HighlightText;
            border-color: Highlight
        }

        * {
            scrollbar-width: auto;
            scrollbar-color: auto
        }

        .c-btn--primary {
            background: Highlight;
            color: HighlightText;
            border-color: Highlight
        }
    }

    @media print {

        .c-skip-link,
        .c-nav,
        .c-nav__backdrop,
        .c-nav__mobile-drawer,
        .c-datum-field,
        .c-ecosystem-controls,
        canvas {
            display: none !important
        }

        body {
            background: oklch(100% 0 none);
            color: #111
        }

        a[href]::after {
            content: " (" attr(href) ")";
            font-size: .8em
        }
    }
}
